Repository navigation
Demonstrate the composed ui/auth/admin override path and document it (#217) - #226
Merged
Merged
Conversation
jimhoyd
force-pushed
the
claude/issue-217-compose-overrides
branch
from
September 20, 2026 04:21
ff09e01 to
4e681a7
Compare
…217) first: the wiring half is already done. #220 (d9d627f) made the ui scaffold register authCatalogue/authUiTemplates/adminUiTemplates and pass the kit into authExtension/adminExtension, so all three "observed source evidence" bullets in the issue are stale. It also retired the UI primitive fallback, which means the issue's "preserve standalone auth/admin without ui" requirement no longer describes a supported configuration: those combinations now refuse at scaffold time. Nothing here re-opens that decision. What was missing was the demonstration and the documentation. Generated-consumer regression (test/workspace-scaffold.integration.ts): runs `init site --with ui,auth,admin` against the built packages, writes ui/templates/auth/sign-in.html, ui/templates/admin/dashboard.html and ui/copy/en.json into the generated site, bootstraps an administrator through the generated operator module, creates a runtime from the extension array the generated host.mjs exports, and asserts both the template and the copy override appear on a rendered /account/login and a rendered /admin. Verified to fail — not just compile — by removing adminUiTemplates from the ui scaffold: the composition assertion fails and the render test fails at activation. It skips, with the reason printed, when the host SQLite is not the one auth's store requires. The same test now also pins ui-alone to `sources: [], extensions: []` with no peer import. A throwing onSignUp is covered in packages/auth/test/lifecycle-hooks.test.ts, so the documented "post-action hooks cannot undo anything, keep them non-throwing" rule is a tested property. docs/COMPOSING-A-SITE.md is the new root document, linked from docs/AI-AUTHORING.md's reading order, llms.txt and llms-full.txt. It separates declarative config, project functions used for lifecycle hooks, and the TypeScript a new extension needs; tabulates each supported --with combination and each refusal; and gives per-package hook input, verdict, timing and failure semantics read from the implementation (get_extensions exposes the schemas but not these). It also records a gap found while writing it and confirmed by running the CLI: `urlcode-ui` builds its kit without the auth and admin namespaces, so `list` omits auth/* and admin/*, `eject auth/sign-in` is refused, `copy --missing` skeletons cover kit ids only, and `doctor` reports a project override of an extension template with no `expected` view model, so its `behind` flag cannot detect a stale extension override. The runtime path is unaffected. Not established: no HTTP listener, TLS proxy, browser or deployed site was exercised, and no published npm tarball was compared against this checkout. packages/ui/README.md's claim that auth/admin have not adopted the kit is left to #200. Co-Authored-By: Claude Opus 5 <[email protected]>
#220 merged and retired the UI primitive fallback, but the decisions table still described the code as retaining "tested primitive rendering without it" and recommended keeping both pending a decision. Verified against main: packages/auth/src/auth.ts:71 now refuses activation without ui and says outright there is no shared-primitive fallback, so the row was wrong about the current code and contradicted the composition path this branch documents. Moved to the closed-questions list rather than deleted, so the resolution stays on the record. Co-Authored-By: Claude Opus 5 <[email protected]>
CI's `static` job runs typecheck after `npm ci` but without a workspace build,
so `@jimhoyd/urlcode-auth` and `@jimhoyd/urlcode-admin` have no type
declarations there and the two literal dynamic-import specifiers failed with
TS2307. It passed locally only because this worktree had the packages built.
The specifier is now computed, which TypeScript does not resolve. Verified the
mechanism rather than assuming it: a literal `import('@not/installed-anywhere')`
reports TS2307 under the same compiler settings and the computed form reports
nothing. Runtime resolution is unchanged and verify:workspaces still passes.
Co-Authored-By: Claude Opus 5 <[email protected]>
The new override test failed on Windows with EBUSY unlinking site/data/auth.sqlite-wal, then hung until the job was cancelled at ten minutes. Cause: node:test runs after-hooks in registration order, and the project() helper registers its own directory removal first. The auth store's closes are registered later in the test body, so the directory was removed while SQLite still held the WAL open. POSIX unlinks an open file without complaint, which is why this passed everywhere except Windows. This test now takes its own mkdtemp and registers the removal last, after the host and runtime closes. The first test in the file keeps project(): it opens no store, so the helper's ordering is fine there. Not established: I could not reproduce the EBUSY locally, having no Windows host. The ordering defect it reports is real and reproducible by inspection -- the removal genuinely ran first -- but only the Windows CI leg can confirm the fix. Co-Authored-By: Claude Opus 5 <[email protected]>
#229 gave `urlcode-ui` an `--extensions` option: it resolves the named packages from `--project` and loads the namespaces they ship, so `list`, `eject`, `preview`, `doctor` and `copy --missing` cover `auth/*` and `admin/*` as the host that registers them does. This page still described the gap as current, and its example commands omitted the flag, so a reader following them would reproduce the old behaviour and conclude the tooling was broken. The section now describes what the CLI does, including the `extensions` field in the `doctor` report and why admin-owned `adminUi.*` ids are deliberately absent from `copy --missing` (#227). Co-Authored-By: Claude Opus 5 <[email protected]>
jimhoyd
force-pushed
the
claude/issue-217-compose-overrides
branch
from
September 20, 2026 04:56
0d4bd2a to
f2c839d
Compare
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 #217.
What the issue claimed, re-checked against main
#217 was written from source inspection at d5a14cf. Every source-evidence bullet in it is now stale, because #220 (
d9d627f) landed in between:packages/ui/src/host/scaffold.tscreates ui withsources: []and no extension templatesauthCatalogue,authUiTemplatesandadminUiTemplatesfromnames.packages/auth/src/scaffold.tsemitsauthExtension({service, csrfKey, projectSha256})without uiauthExtension({service, csrfKey, projectSha256, ui}).packages/admin/src/scaffold.tsemitsadminExtension(...)without ui..., ui}).--with auth,--with auth,adminand--with auth,admin,uiall refuse at scaffold time. This PR does not re-open that; it pins the refusals and pins--with uialone to a self-contained host.So requirement 1 was already delivered. What was genuinely missing was requirement 3 (a demonstration, not wiring that compiles) and the documentation half.
The demonstration
test/workspace-scaffold.integration.tsgains a generated-consumer test that:urlcode init site --with ui,auth,adminagainst the built workspace packages;ui/templates/auth/sign-in.html,ui/templates/admin/dashboard.htmlandui/copy/en.jsoninto the generated site;operator-service.mjs;host.mjsexports — nothing reaches into the packages;/account/loginand a rendered/admin.It was verified to actually catch a regression: dropping
adminUiTemplatesfrom the ui scaffold makes the composition assertion fail and the render test fail at activation with the extension's own "built without the admin templates" error. It skips with a printed reason when the host SQLite is not the release auth's store requires.packages/auth/test/lifecycle-hooks.test.tsgains one test: a throwingonSignUpreplaces the success response while the account it ran after still exists, so the documented "post-action hooks cannot undo anything" rule is a tested property.The documentation
New root document
docs/COMPOSING-A-SITE.md, linked fromdocs/AI-AUTHORING.md's reading order,llms.txtandllms-full.txt. It:config, project functions named from that config for lifecycle hooks, and the TypeScript a new extension needs — as a decision table and then a section each;--withcombination and every refusal;get_extensionsdoes not expose (it gives the config/policy schemas only): activation fail-fast,sandbox: truerejected rather than silently run trusted, an explicitallow: trueveto contract with403and the hook's reason, a thrown pre-action hook degrading to a generic500, and post-action hooks running after the operation has committed;scripts/check-guidance-claims.tspasses over it (194 Markdown files, 26 closed key sets).It also records a gap found while writing it and confirmed by running the CLI:
urlcode-uibuilds its kit without the auth and admin namespaces the generated host registers, solistomitsauth/*andadmin/*,eject auth/sign-inis refused as unknown,copy --missingskeletons cover kit ids only, anddoctorlists a project override of an extension template with noexpectedview model — itsbehindflag therefore cannot tell you an extension override has gone stale. The runtime path is unaffected, which is exactly what the new test proves.Verified by running
npm run lint,npm run typecheck,npm run check,npm run build,npm test(531 pass, 1 pre-existing skip),npm run verify:workspaces(ui 197, auth, admin 63, workspace integration 2) — all green. Docs regenerated withnpm run docs:llms.Not established
No HTTP listener, TLS proxy, browser or deployed site was exercised; the render test runs in-process against the generated host. No published npm tarball was compared against this checkout.
Scope kept out
packages/ui/README.md's stale "auth/admin have not adopted the kit" sentence is left to #200. The UI primitive fallback is untouched — it was already removed by #220, anddocs/OPEN-DECISIONS.mdline 37 is now stale as a result, which belongs to that PR's follow-up rather than this one.🤖 Generated with Claude Code