Repository navigation
Description
Problem or use case
First implementation gate for #841. #837 proved a generic request-bound handoff but its remaining plan expands our own service implementations. Before doing that, prove a real upstream implementation reduces URLCode ownership while retaining declarative authoring and understandable review.
Maintainer decisions: no backward compatibility, old-format migration or API shims; keep the default one locally runnable app; evaluate embedded authentication first. This is a bounded proof, not approval to recreate every current auth/admin feature.
Proposed behavior and alternatives
Use Better Auth as the first embedded candidate, SQLite for persistence, and ordinary static/frontend tooling. Better Auth documents native Request/Response integration and both built-in Node SQLite and better-sqlite3. Select an exact published version and a driver supported by the project's Node matrix during implementation; use node:sqlite first if it passes, rather than adding a native addon unnecessarily.
Build a synthetic private-requests application:
- Two ordinary users and one reviewer; bootstrap test accounts with the upstream API/tooling.
- Sign-in, sign-out, verified current identity and session invalidation using upstream behavior.
- Owners create/list/read their own requests; one reviewer may approve a pending request. Another owner cannot read or alter it. A normal user cannot approve.
- A minimal frontend uses the upstream client API and standard assets; no custom credential/session code and no new URLCode template language.
- Explicit URLCode application routes and an explicitly owned upstream auth mount. Review shows the auth provider's subroutes when verified metadata is available; unknown exposure is marked honestly and cannot be described as fully inspected.
- The app's one custom business transition remains focused application code. Temporary direct parameterized SQL is acceptable for the proof; it must not grow a second CRUD/persistence framework and is replaced/aligned by [Request]: Evaluate conditional state transitions and result-aware idempotency beyond store CRUD #835 before the final release.
Integrate through an operator-installed adapter and #840's handoff where sufficient. Provider authentication reads credentials inside the trusted host; ordinary application handlers receive verified identity/selected services, not forwarded cookies or Authorization. Provider-specific operations may stay namespaced. Do not design a universal authentication interface or expose a raw registry/database merely to demonstrate genericity.
Acceptance evidence:
- Start the packed-consumer sample with a documented local command and no mandatory network service; npm installation/build may use the network. Auth and app data initialize in synthetic local SQLite databases. Auth owns its schema; application code does not write its tables.
- Exercise the browser/HTTP flow, foreign-owner denial, reviewer denial, malformed input, revoked session, provider initialization failure, and cancellation boundaries. Review must distinguish identity from application permissions.
- Native sign-in must work before credential stripping for guest code; it must not bypass origin/CSRF/cookie controls or broadly forward guest credentials. Unsupported target/sandbox combinations refuse before serving.
- Run through both CLI-only and connected local authoring-MCP workflows, using [Request]: Make installed authoring validation context executable and discoverable #834 for executable validation context. Human revision approval is supplied explicitly by the evaluator and is not automated by the agent.
- Commit a deletion manifest in the PR description: old subsystems that become unnecessary, new adapter/application code, upstream dependencies and exact enabled endpoint/plugin inventory. Report physical source lines and runtime dependencies separately. No migration or compatibility code is counted as required.
- Exercise one change to the app without rebuilding account/session internals. Report actual agent repairs and review facts; one successful run is not a productivity benchmark claim.
Decision: adopt the candidate, narrow requirements, or reject it with concrete blocker evidence. Do not extend the proof into weeks of bespoke auth emulation. Only if embedded integration fails a required property should a second candidate be evaluated; Keycloak is not the default/fallback deployment without revisiting the one-app decision.
Non-goals: full historical auth/admin parity, support impersonation/two-person workflows unless independently required for the new product, automatic external package publishing, distributed storage, billing, an identity server, remote MCP authentication, or a frontend framework inside core. Existing sandbox isolation remains unchanged.
Sources: https://better-auth.com/docs/installation ; https://better-auth.com/docs/adapters/sqlite ; https://better-auth.com/docs/plugins/open-api . The OpenAPI plugin is documented as early-stage; endpoint completeness must be verified against the pinned instance, not assumed.
Code areas: packages/core/src/extensions.ts, host.ts, trusted-functions.ts; a small provider adapter and isolated sample. Do not expand packages/auth merely to preserve its public API. Follow repository branch/PR, semantic-card/docs/fixture, verify and package-check requirements. No provider integration was deployed by the preceding audit.
Activity
jimhoyd commentedon Sep 28, 2026
Proof implemented in #848 (unmerged; the decision is yours).
proofs/private-requests: Better Auth 1.7.6 onnode:sqlite, a 92-line operator adapter using feat(core): generic request-bound capability handoff for extensions (epic #837 Stage B) #840's capability, five ordinary function routes, a static frontend using Better Auth's client.npm run test:proofpasses 11/11: startup, explicit policy approval, provider/target refusals,urlcode test(signed-instepsfixtures) andauditready, owner/foreign/reviewer denials, malformed input, concurrent approval, cancellation, sign-out, revocation and per-client throttling.disabledPathsmisses parametric routes (exact allowlist added); rate limiting is off outsideNODE_ENV=productionand shares one bucket without a client address (adapter supplies URLCode's admitted address and requires the limiter).run_validate/run_testcannot receive the operator policy ([Request]: Make installed authoring validation context executable and discoverable #834); static validate assumes first-party packages ([Request]: Support independent provider packages and standard inert artifacts #844); idempotency/audit of the transition ([Request]: Evaluate conditional state transitions and result-aware idempotency beyond store CRUD #835). Filed [Bug]: an empty, unparseable or missing --policy file answers "Operation failed" without naming it #847.packages/auth17,336 +packages/admin1,305 src lines plus the routeauth:short form and passkey RP-ID seams, not deleted in this PR.jimhoyd commentedon Sep 28, 2026
Maintainer clarification for #841/#843: Express and Fastify were examples, not the compatibility boundary or a framework shortlist. The direction is interoperability with established JavaScript/TypeScript frameworks and the broader npm ecosystem.
Keep package identities, discovery, artifacts and core integration contracts independent of framework brands. Prefer established interfaces/formats and upstream APIs; use focused host adapters when lifecycle or request-context semantics differ. Be explicit whether an integration embeds URLCode, mounts a provider, consumes a library, or exchanges artifacts. Generic does not mean claiming every framework's plugins are interchangeable.
The initial embedded-auth proof remains the first deliverable. Before settling its reusable contract, check for accidental coupling against a second materially different established framework/library integration and record concrete fit/gaps, using a bounded fixture where practical. Do not make implementing all frameworks a prerequisite, or grow a universal middleware layer speculatively.
#837 remains on hold; this broadens the ecosystem objective rather than restarting its old stages. The authoritative scope in #841 now records this clarification.
Prove embedded Better Auth in one local URLCode site (#843) (#848)
Pass the operator's reviewed policy to inspection commands and the au…
Run the authoring MCP server on the official MCP SDK (#846, stdio) (#850
feat(extensions): install independent extension packages by spec or t…
jimhoyd commentedon Sep 28, 2026
The bounded proof is now the basis of the supported extension (#854):
proofs/private-requestsuses@jimhoyd/urlcode-authdirectly and its adapter package is deleted;npm run test:proof12/12 locally.Replace auth and admin with a Better Auth extension (#841) (#854)
feat(store): membership gates and cross-owner reads; the #843 proof r…
jimhoyd commentedon Sep 29, 2026
The proof passed and was adopted:
npm run test:proofruns in CI (verify:workspaces). It covers owner privacy, the reviewer approval race (exactly one wins), non-reviewer 403, cross-origin refusal, revoked-session replay, throttling, sandbox refusal, audit readiness and the MCP runners.Remaining #841 acceptance items (a second independent provider, a second framework integration) are tracked on #841.