Skip to content

feat(portal,server): ship a portal icon and point the server-hosted path view at its governing route (#309, #315) - #317

Merged
mbeacom merged 1 commit into
mainfrom
feat/portal-favicon-and-path-hint
Oct 11, 2026
Merged

mbeacom merged 1 commit into
mainfrom
feat/portal-favicon-and-path-hint

Conversation

@mbeacom

@mbeacom mbeacom commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Closes #309. Closes #315.

What and why

  • portal: the page has no icon, so browsers request /favicon.ico and get a 404 #309, the favicon. The portal bundle ships page/icon.svg: a neutral document glyph with presentation attributes only, no style, no script, and no external references. index.html references it relatively, so it works at any base path (ADR-0054 clause 8).
    • The CSP is unchanged: img-src 'self' covers it, and there are no data: URIs.
    • The REST server serves it as image/svg+xml (operation getPortalIcon, under /portal/, so API_VERSION stays 1.0.0).
    • It's deliberately not a required file in the bundle check, because a missing icon costs a 404 and nothing else.
  • portal: when the REST server hosts the portal, point the path view at its governing route (ADR-0055 clause 9) #315, the path hint (ADR-0055 clause 9). portal-data.json gains pathLookup: { route } | null.
    • It's always present, defaults to null, and is additive, so version stays "1".
    • The pure builder accepts it only beside an absent path table and requires a page-relative route: no scheme, root, query, fragment, or interior ...
    • The REST server sets it to ../../api/v1/corpora/<key>/governing.
    • The page shows that route and an example ?path=src/index.ts as text, with no link and no fetch, so the renderer stays network-free and the CSP is untouched.
    • PATH_TEXT.absent is unchanged for Pages builds.

Checklist

  • DCO signed off.
  • Recorded decisions: ADR-0054 and ADR-0055 clause 9.
  • Schema changed: n/a.
  • packages/ci/dist/portal-action.js is regenerated under linux/amd64 Bun 1.4.2. It's the only dist change, with +34/−2 of intended diff.
  • Observed failing first (ADR-0016), each against a planted break:
    • the contract keys;
    • the builder rebuilding the hint, the absent-only guard, and page-relative routes;
    • the page with no route branch, the example as a link, and a fetch;
    • the icon with an absolute href, a looser CSP, and a <script> in the SVG;
    • the server dropping the hint, a route one ../ short (the test resolves it and expects 200), and an asset without a route.
  • Full bun test: 4542 pass. typecheck, lint, check:deps, check:stale-refs, check:changelog, adr lint, and emit:portal-vendor (no-op) pass.

Notes for reviewers

  • Gate label: this touches packages/ci/** and scripts/.
  • Browser: I haven't checked the icon or the hint in a real browser yet. Coverage is the fake DOM and HTTP tests.

…ath view at its governing route (#309, #315)

- #309: the portal bundle ships `page/icon.svg`, referenced relatively
  from index.html, so browsers stop requesting /favicon.ico and getting a
  404. The CSP is unchanged (img-src 'self'); the REST server serves it
  as image/svg+xml (operation getPortalIcon).
- #315: portal-data.json gains `pathLookup: { route } | null`, always
  present and additive (version stays "1"). The pure builder accepts it
  only beside an `absent` path table and requires a page-relative route.
  The REST server sets it to its own `governing` route, and the page
  shows that route and an example query as text, with no link and no
  fetch, so the renderer stays network-free (ADR-0054, ADR-0055 clause 9).

packages/ci/dist/portal-action.js rebuilt under linux/amd64 Bun 1.4.2.
Every new test was observed failing first (ADR-0016).

Signed-off-by: Mark Beacom <m@beacom.dev>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 00:14
@mbeacom mbeacom added the gate-change-acknowledged A maintainer has seen and accepted this PR's change to the CI gate surface (ADR-0035) label Oct 11, 2026
@github-actions

Copy link
Copy Markdown

Decisions governing this change

8 accepted decisions govern this change · 1 active proposal

  • 0016 — Require every check to be observed failing before it counts as coverage
    • via path: packages/*/test/**
  • 0030 — Keep extension surfaces that carry a dependency tree outside this repository
    • via path: packages/ci/**
  • 0035 — Execute the gates that certify a pull request from the default branch
    • via path: packages/ci/**
    • via path: scripts/**
  • 0040 — Keep derived surfaces in lockstep with three mechanisms matched to three classes of drift
    • via path: AGENTS.md
  • 0041 — Regenerate committed artifacts on Dependabot pull requests with default-branch scripts behind a maintainer label
    • via path: packages/ci/dist/**
  • 0054 — Publish a static decision portal for GitHub Pages, built outside the CLI from the SDK
    • via path: packages/portal/**
  • 0055 — Serve a read-only REST API over the SDK in the OCI image, and reach MCP clients through it
    • via path: packages/server/**
  • 0059 — Aggregate decision corpora across an organization's repositories as a pinned, read-only federation
    • via path: packages/portal/**
Active proposals touching this change (1)

These are not yet ratified and do not bind this change:

  • 0056 — Ship the Azure deployment surface as Terraform in a separate repository behind APIM Standard v2 with public_access (proposed)
    • via path: packages/server/**

Links point at 1105989, this run's GITHUB_SHA. Run adr explain <path> locally to see why a file is governed.

@mbeacom mbeacom self-assigned this Oct 11, 2026
@mbeacom mbeacom added the enhancement New feature or request label Oct 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The source, contract, server routing, generated artifact, documentation, and focused tests are consistently updated with no actionable defects found.

0 open findings

What changed in this PR

Adds a bundled portal favicon and exposes the server’s governing-route hint in the path view.

Changes:

  • Ships and serves a relative SVG favicon.
  • Adds the additive pathLookup portal-data field and text-only rendering.
  • Updates tests, documentation, and the generated Action bundle.

The adrkit MCP server was unavailable; linked ADR text was reviewed, but marker-aware decision compliance was not independently verified.

File Description
scripts/​check-portal-bundle.ts Documents the icon as optional.
packages/​server/​test/​portal.test.ts Tests icon serving and lookup route.
packages/​server/​test/​openapi.test.ts Pins the icon operation ID.
packages/​server/​src/​server.ts Supplies lookup hints and SVG content type.
packages/​server/​src/​routes.ts Adds the icon route.
packages/​server/​src/​openapi.ts Adds SVG media-type support.
packages/​portal/​test/​page-static.test.ts Validates icon safety and bundling.
packages/​portal/​test/​page-render.test.ts Tests text-only route rendering.
packages/​portal/​test/​page-fixture.ts Supports lookup hints in fixtures.
packages/​portal/​test/​generate-safety.test.ts Includes the icon in generated output.
packages/​portal/​test/​contract.test.ts Pins the additive contract field.
packages/​portal/​test/​build.test.ts Tests lookup validation and determinism.
packages/​portal/​test/​assets.test.ts Accounts for the new asset.
packages/​portal/​src/​page/​text-imports.d.ts Declares SVG text imports.
packages/​portal/​src/​page/​page.css Wraps long displayed routes.
packages/​portal/​src/​page/​index.html References the relative favicon.
packages/​portal/​src/​page/​icon.svg Adds the document-glyph icon.
packages/​portal/​src/​page/​assets.ts Embeds the icon in portal bundles.
packages/​portal/​src/​page/​app.mjs Renders the governing-route hint as text.
packages/​portal/​src/​data/​contract.ts Defines PortalPathLookup.
packages/​portal/​src/​data/​build.ts Validates and serializes lookup hints.
packages/​ci/​dist/​portal-action.js Regenerates the committed Action bundle.
CHANGELOG.md Documents both user-facing changes.
AGENTS.md Records the updated architectural constraints.

🧠 Review effort: Balanced

@mbeacom
mbeacom merged commit 6a06e02 into main Oct 11, 2026
29 of 30 checks passed
@mbeacom
mbeacom deleted the feat/portal-favicon-and-path-hint branch October 11, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gate-change-acknowledged A maintainer has seen and accepted this PR's change to the CI gate surface (ADR-0035)

Projects

None yet

2 participants