Repository navigation
feat(portal,server): ship a portal icon and point the server-hosted path view at its governing route (#309, #315) - #317
Merged
Conversation
…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>
Decisions governing this change8 accepted decisions govern this change · 1 active proposal
Active proposals touching this change (1)These are not yet ratified and do not bind this change:
Links point at |
There was a problem hiding this comment.
🟢 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
pathLookupportal-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #309. Closes #315.
What and why
page/icon.svg: a neutral document glyph with presentation attributes only, no style, no script, and no external references.index.htmlreferences it relatively, so it works at any base path (ADR-0054 clause 8).img-src 'self'covers it, and there are nodata:URIs.image/svg+xml(operationgetPortalIcon, under/portal/, soAPI_VERSIONstays 1.0.0).portal-data.jsongainspathLookup: { route } | null.null, and is additive, soversionstays"1".absentpath table and requires a page-relative route: no scheme, root, query, fragment, or interior...../../api/v1/corpora/<key>/governing.?path=src/index.tsas text, with no link and no fetch, so the renderer stays network-free and the CSP is untouched.PATH_TEXT.absentis unchanged for Pages builds.Checklist
packages/ci/dist/portal-action.jsis regenerated under linux/amd64 Bun 1.4.2. It's the only dist change, with +34/−2 of intended diff.<script>in the SVG;../short (the test resolves it and expects 200), and an asset without a route.bun test: 4542 pass.typecheck,lint,check:deps,check:stale-refs,check:changelog,adr lint, andemit:portal-vendor(no-op) pass.Notes for reviewers
packages/ci/**andscripts/.