Repository navigation
Description
Problem or use case
URLCode should own declarative application intent, enforceable authority boundaries, agent authoring and human review. It should reuse mature implementations for commodity services and exchange standard artifacts. Adding wrappers around all our present services would entrench ownership we may not need.
This is the scoped outcome of the ecosystem audit against main a996f0d88394e83be9cca17f9793b10c50aabf1c. It supersedes earlier compatibility/migration proposals in this issue. It is an implementation plan, not evidence that replacements have already passed inside URLCode.
Maintainer decisions: the project has one user; no backward compatibility, old descriptor support, legacy API aliases or old-data migration are required. The default remains one locally runnable application. Evaluate embedded authentication first. A separate Keycloak service, Redis, hosted control plane or telemetry collector is not a prerequisite. Installation/build may use network access; normal local execution must not require a separate identity service. Existing credentials/customer data are not to be deleted by this planning work.
#837's unstarted expansion is on hold. Its merged identity/handoff work (#833/#840) can remain where useful. Do not implement its old stages C–H or first-party AuthExports/StoreExports expansion before the provider proof settles the contract. Holding an issue is not a claim that another agent/task was interrupted.
Proposed behavior and alternatives
Intended architecture
An ordinary Node application hosts URLCode's declarative routes and explicitly installed upstream providers. A small operator-owned adapter connects a provider to request-bound identity/services when necessary. Provider clients, schemas and assets retain standard formats. Core does not import extension implementations. YAML describes application behavior, not provider credentials or infrastructure.
Keep the differentiation: declarations, route/policy composition, capability admission and refusal, sandbox isolation, revision-pinned operator grants, useful review facts, and an executable agent-to-human workflow. Delete duplicate implementations when their replacements pass. Do not preserve APIs solely because they exist today, or replace them with an equally broad universal facade.
This is not a decision to become an intermediate framework between Express and Fastify. Nor is a transport rewrite the prerequisite. Native Fastify plugins need a Fastify instance and its lifecycle; Express middleware assumes its request/response chain. They are not automatically interchangeable with URLCode or each other. Prefer an upstream library's native Request/Response or documented host integration; use narrow adapters only for demonstrated needs. Select one hosting approach if the proof requires it, rather than promising every plugin ecosystem simultaneously.
Ecosystem compatibility is broader than Express/Fastify
Maintainer clarification: Express and Fastify were examples, not the boundary or a shortlist. Design for interoperability with established JavaScript/TypeScript frameworks and the npm ecosystem generally. Provider discovery, package installation, artifacts and core contracts must not depend on a particular framework brand or first-party namespace.
Prefer established interfaces and formats where their semantics fit: npm packaging and dependency resolution, standard HTTP Request/Response integration, JSON Schema/OpenAPI, and upstream-owned client/provider APIs. Where a framework has its own lifecycle, routing, request context or plugin model, use a focused documented host adapter rather than pretending those models are interchangeable. Compatibility may mean embedding URLCode, mounting a provider, consuming a library, or exchanging artifacts; state which direction and capabilities are actually supported.
The first proof may use one concrete host/provider, but distinguish provider-specific details from the reusable integration contract. Before declaring that contract settled, evaluate it against a second materially different established framework or library integration and record concrete fit/gaps; a bounded conformance fixture is sufficient where practical. This is a check against accidental coupling, not a prerequisite to implement adapters for every framework or to build a universal middleware/plugin abstraction. Unsupported lifecycle, authority or target semantics must be explicit. Select integrations based on demonstrated application needs and maintained upstream contracts, not on the earlier Express/Fastify examples.
Direct library use and optional adapters — acceptance requirement
Ordinary npm libraries must be usable directly from trusted application code through their native imports/APIs, subject to the supported runtime and existing authority boundaries. They must not require a URLCode-specific adapter, extension descriptor, catalog entry or wrapper merely to be used. Standard interfaces should work directly where their semantics match. Frontends may use their normal build and HTTP clients.
Require a focused adapter only when a library must participate in URLCode-specific behavior whose semantics need translation, such as verified identity for protected routes, lifecycle management or declared transactional capabilities. Reuse an existing integration when available. Framework-specific plugins run in their native host through a compatible hosting boundary; do not require one URLCode adapter per plugin or claim arbitrary plugins are interchangeable.
Better Auth, SQLite and frontend tooling are recommended/tested starter choices, not mandatory core dependencies or user stack requirements. Agents must inspect and respect the installed stack before introducing defaults. Internal implementation dependencies do not each need a public substitution mechanism where standards already define the external contract.
Acceptance evidence must include direct use of an ordinary npm library without URLCode adapter metadata and a second independently owned provider at the same relevant capability boundary without editing core or importing default-provider types into it. A second frontend using the same auth provider does not demonstrate auth replaceability. Keep provider-specific APIs available; do not build a universal facade around every upstream feature.
Review must distinguish declared/enforced behavior from opaque trusted application code. Direct use does not waive sandbox isolation, operator grants or capability checks, and unsupported guarantees must refuse explicitly. Provider replacement may require application/client changes and data migration; compatibility is not a zero-change swap promise.
Execution order and tracked deliverables
| Order | Work | Completion evidence |
|---|---|---|
| 1 | #843 embedded upstream vertical proof | Better Auth as first candidate, SQLite, ordinary frontend; two users and reviewer; owner-private records and one approve transition; real sign-in/out/revocation; packed-consumer local startup; CLI and authoring MCP review. Adopt, narrow or reject based on observed blockers. |
| 2 | #844 independent packages and inert artifacts | Non-first-party, independently versioned npm provider; locked installation and offline non-executing inspection; standard OpenAPI/JSON Schema documents; separate inspection, source staging and executable activation. |
| 2 | #845 schemas and OpenAPI | Explicit JSON Schema dialect/profile, mature validation, verified OpenAPI export and independent consumer; shared operation schemas with authority kept separate. |
| 2 | #846 official MCP SDK | Authoring stdio first, application HTTP second; real client tests and deletion of both handwritten protocol/transport paths. Stdio can proceed independently where it does not preempt proof decisions. |
| 2–3 | #834 executable validation context | Installed project/host/origin/revision commands work for the new provider sample and expose the actual approved revision. No automated human approval. Existing issue remains the owner. |
| 3 | #835 SQLite-backed application transitions | Engine transactions, owner/role enforcement, race-tested state transition and result-aware idempotency. App audit evidence participates in the app transaction where required. No invented atomic transaction across unrelated provider databases. |
| 4 | Auth/admin retirement, tracked here | After #843 passes, replace custom account/session internals and retire old admin flows. Every retained feature has a current requirement and upstream implementation or a small documented application-specific remainder. |
| 4 | UI/forms retirement, tracked here | Standard frontend assets/components and clients; stop owning a general template/component ecosystem. Keep only declarative metadata/composition that adds value. |
| 5 | Deletion and release integration, tracked here | Remove dead source/config/exports/dependencies/docs, align packed starter and generated guidance, rerun supported target and sandbox checks, measure final ownership and agent workflow. |
The proof needs only minimal package/metadata glue; completing a universal registry, an OpenAPI importer, or a whole new framework first is explicitly out of scope. Parallelizable slices are not authorization for a big-bang rewrite.
Retirement and reuse decisions
| Present ownership | Proposed destination | What URLCode still owns / decision gate |
|---|---|---|
packages/auth and account/session-heavy admin flows |
Embedded upstream auth; Better Auth evaluated first | Verified request identity, application permission policy, operator integration. Do not rebuild old auth in an adapter. Upstream owns its tables. Candidate adoption depends on #843, not its feature list. |
| Custom body/store/form schema vocabularies and validation | JSON Schema + mature validators; OpenAPI for HTTP; trusted Standard Schema integrations where useful | Bounded support profile, resource limits, review and authorization semantics. No silent downgrade or old-schema translator. |
| Both MCP protocol stacks | Official TypeScript SDK | Actual tools, explicit exposure, revision/authority controls and exact runnable context. No gateway or custom OAuth product. |
| File-store transactions and growing CRUD service | SQLite and selected existing driver/query tooling | Small declared application model and policy/transition composition. #835 owns the design. Avoid a new ORM or a second file transaction engine. |
| Private template language, UI kit, generic forms/admin scaffolding | Ordinary frontend build/assets; evaluate existing component/form tooling against the proof | Application presentation and optional declarative field metadata. React/shadcn or JSON Forms are candidates, not three mandatory dependencies. A maintained SSR engine is considered only if a concrete SSR requirement remains. |
| Managed first-party catalog restrictions | npm package identities, independent versions and lock/integrity; small static provider descriptor | Curated recommendations, operator activation and trustworthy review facts. No replacement package manager. |
| Private artifact envelope | Standard JSON Schema/OpenAPI/Markdown; existing source registries/Agent Skills where requested | Safe inspection provenance and explicit source staging. Executable source is not mislabeled inert. |
| Mail transports/templates | Existing upstream transports/template tooling | Minimal declaration/integration only if needed; no new deliverability platform. |
| Rate limiting/backoff/challenges | Mature limiter implementations where semantics and deployment fit | Policy and actor mapping; do not add Redis merely to replace small local code. |
| Audit | SQLite transaction/event evidence where suitable; standard export/telemetry when actually needed | Durable security/business evidence and redaction. OpenTelemetry alone does not replace an audit log or guarantee an outbox. |
Mail, abuse and telemetry replacement are lower priority than auth/schema/MCP. Track them here until a concrete retained requirement selects a library; do not add a dependency just to reduce a small file. Historical feature parity, support impersonation, two-person administration, provider marketplaces, all-framework adapters, remote MCP authentication, distributed databases and hosted identity are outside this first program unless independently justified.
What the first proof must settle
#843 is deliberately a useful small application, not a hello-world integration. Its PR must show:
- One local startup path after installation/build; upstream-auth initialization and synthetic data setup. Forward schema initialization/upstream migrations are normal operation, distinct from preserving old URLCode data.
- Successful and denied owner/reviewer operations, revoked sessions, malformed requests and provider startup failure. Identity does not imply application authorization.
- Credentials handled at the trusted host boundary without widening guest credential forwarding. Existing
sandbox: trueisolation and external grants remain intact. Unsupported provider/target combinations refuse before serving. - A review report that identifies installed versions/integrity, declared routes and provider mounts, verified versus unknown endpoint metadata, authority, targets and exact validation commands. Static prose is not trusted agent instruction; metadata cannot grant authority.
- Both CLI-only and connected local authoring-MCP workflows, followed by one application change. Record repairs and review gaps; do not infer productivity statistics from one run.
- A concrete deletion inventory and dependency/startup footprint. If a required property forces substantial bespoke auth emulation, stop expanding the adapter and revisit the candidate or requirement.
Node is the first integrated provider target. Do not silently claim Worker compatibility because a library compiles, or remove supported existing targets without a separate explicit decision. Preserve portability at the behavioral contract/refusal boundary; do not demand that every provider execute in QuickJS.
Size baseline and realistic target
Measured physical TypeScript source lines (including blank lines/comments; excluding tests, docs, tools and dependencies) at the audited commit:
| Package | Lines |
|---|---|
| Core | 18,136 |
| Auth | 17,336 |
| Admin | 1,305 |
| UI | 2,495 |
| Forms | 589 |
| Form-records | 443 |
| Store | 1,502 |
| Audit | 890 |
| MCP | 1,058 |
| 714 | |
| Abuse | 588 |
| Total | 45,056 |
Auth alone is 64.4% of extension source. Planning ranges for remaining owned runtime source: core 8–11k; auth/admin adapters 1.5–3k; UI/forms composition 1–2k; store/audit 1–1.8k; MCP 0.2–0.4k; mail/abuse 0.4–0.8k. Total 12.1–19k, approximately 58–73% less; about 15k is a useful target, not a commitment.
These ranges are not a measured deletion patch and do not imply smaller installed dependencies or lower security risk. Recalculate after the proof. Report framework/adapters, unique sample application code, generated code, tests/docs, installed dependencies, startup and required services separately. Do not move custom framework code into a sample merely to improve the number. Reject replacements that add hidden operational ownership or sacrifice enforceable behavior for source-line savings.
Existing work disposition
- [Re-scoped; legacy expansion on hold]: Ecosystem integration, discovery and AI authoring #837: on hold; merged generic foundations remain available. Rewrite its remaining scope only after the proof; do not resume the old roadmap automatically.
- [On hold]: StoreExports has no owner-scoped delete or replace, so adapters cannot delete through a contract path #829 and [On hold]: AuthExports has no sign-in/sign-out and auth denials cannot carry an app error envelope (fixed-contract adapters) #830: on hold as expansions of legacy store/auth exports. Their real owner-scoped mutation and authentication needs are exercised through [Request]: Evaluate conditional state transitions and result-aware idempotency beyond store CRUD #835/[Request]: Prove an embedded upstream auth provider in one local URLCode application #843. No parity facade is mandated.
- [Request]: Make installed authoring validation context executable and discoverable #834 and [Request]: Evaluate conditional state transitions and result-aware idempotency beyond store CRUD #835: remain active owners, with scope aligned as above rather than duplicate tickets.
- [Bug]: Authoring review recommends unsupported per-method route split for one path #842: independent authoring-review defect; can be fixed without waiting for replacement architecture.
- Unrelated security/sandbox fixes continue. This plan does not claim to pause other tasks or approve deleting live data.
Program completion
Complete only when selected upstream providers work in the packed starter, meaningful positive/negative integration tests pass, old replaced implementations are actually removed, authoritative docs/generated guidance describe the new contract, and agent-produced changes remain inspectable and subject to explicit human approval. Run repository-required verify/package/schema generation checks for applicable changes and focused semantic fixtures. No upstream package adoption or passing CI is an independent security assessment.
No implementation date or reduction guarantee is assigned before #843 yields evidence. Each child issue specifies its acceptance boundary; retire or re-scope disproved assumptions openly instead of growing compatibility layers.
Primary references: Better Auth installation, SQLite adapter, OpenAPI plugin, official MCP SDK, JSON Schema, OpenAPI, Standard Schema, shadcn registry format, Agent Skills. Exact versions, licenses/notices, target behavior and endpoint completeness must be checked at implementation time. No publishing or licensing change is authorized by this scope.
Activity
[-][Request]: Evaluate upstream engines behind extension contracts to reduce maintenance[/-][+][Request]: Adopt ecosystem-compatible extensions, artifacts and upstream implementations[/+]jimhoyd commentedon Sep 28, 2026
Maintainer clarification: there is only one user, and historical compatibility is not required. Retaining old APIs, YAML shapes, data formats, migration tools, or compatibility shims is not an acceptance gate for this redesign. This supersedes the historical compatibility/migration requirements in the initial audit proposal. Required behavior for the chosen new design and its authority/sandbox boundaries still need validation.
Sizing estimate from audited main a996f0d (physical TypeScript lines in packages/*/src, including comments/blank lines): 45,056 currently maintained runtime/extension lines. Clean-design planning ranges, including anticipated URLCode adapters, are:
This suggests roughly 58–73% reduction in owned source, with ~15,000 lines (~67% reduction) as a useful provisional target. These are architectural estimates, not measured replacement results or an implementation commitment. Core is the least certain bucket: a transport swap alone cannot remove the authoring/review machinery, and replacing a library can add wrapper code. Auth savings assume transferring actual account ownership rather than wrapping the current engine. UI/form savings assume adopting a smaller standard authoring surface; exact feature parity is not assumed.
The source estimate excludes tests/docs/scripts, installed third-party source, package bytes and external service operations. Many implementation-specific tests can disappear, but contract/integration tests remain. Reuse may grow dependency size or external operational requirements even as owned code shrinks. Prototype deletions and wrapper costs must replace these estimates before treating them as achieved savings.
jimhoyd commentedon Sep 28, 2026
Order step 1 (#843) has a proof PR: #848. Summary and recommendation are on #843; follow-up evidence was added to #834, #835, #844, #845 and #846, and #847 was filed. Nothing was deleted yet; the measured deletion inventory and dependency footprint are in the PR.
refactor(mcp): delete the pre-#590 tool aliases and the `target` depl…
feat(mcp): serve the application MCP server with the official SDK (#846…
jimhoyd commentedon Sep 28, 2026
Auth adoption step is up for review in #854:
@jimhoyd/urlcode-authis now a thin Better Auth adapter (one allowlisted mount,auth: true→ verified user id as the request principal and theidentitycapability, operator-owned secret/database,urlcode-auth migrate|create-user). The old account system,packages/adminand the recipes that only served them are deleted; the #843 proof runs on the first-party extension. Next: remove core's now-unused passkey RP-ID seam, then #844 (remaining), #845 and #835.Replace auth and admin with a Better Auth extension (#841) (#854)
jimhoyd commentedon Sep 28, 2026
Architecture review follow-up: the proposed destinations need a clearer distinction between recommended starter defaults, interoperability contracts, and internal implementation dependencies. This is a proposed refinement prompted by the maintainer's question about users choosing other libraries, not a claim that arbitrary libraries already work.
For a different library, define three honest support levels: (1) an existing tested integration works directly; (2) a small operator/application-owned adapter maps the required boundary and can be published independently; (3) trusted application code uses the native library, with review explicitly showing what URLCode cannot inspect or enforce. The third path does not waive operator grants or sandbox restrictions. A declared guarantee that cannot be enforced must refuse, not silently degrade.
Acceptance proposal for #843/#844: demonstrate a second independently owned provider at the same relevant capability boundary without editing core or importing default-provider types there. A different frontend consuming the same Better Auth server is not sufficient proof that auth is replaceable. Keep the shared identity/authority handoff minimal; do not standardize every library's accounts, plugins or session API. Likewise a storage provider must actually meet each requested atomicity/idempotency capability; do not emulate it with a fragile generic CRUD facade.
Agents should inspect and respect the project's installed stack before choosing a default. Review should identify the selected provider, native configuration/operations, tested capabilities and opaque behavior. Replacing a provider does not promise zero application/client changes or automatic data migration.
This clarifies how broad ecosystem compatibility should be evaluated alongside #841's existing second-integration check. It does not require implementing a universal adapter catalog before the first proof.
jimhoyd commentedon Sep 29, 2026
Status against the execution order:
Done
[Request]: Prove an embedded upstream auth provider in one local URLCode application #843 proof: closed. It passed and was adopted in Prove embedded Better Auth in one local URLCode site (#843) #848, Replace auth and admin with a Better Auth extension (#841) #854 and Store membership gates and cross-owner reads; the #843 proof runs on store (#863) #865.
[Request]: Replace both MCP protocol stacks with the official SDK #846 official MCP SDK: closed (Run the authoring MCP server on the official MCP SDK (#846, stdio) #850, Remove the deprecated authoring MCP tool aliases #851, Serve the application MCP server with the official MCP SDK (#846, HTTP) #852).
Auth and admin retirement: Replace auth and admin with a Better Auth extension (#841) #854 and Remove the unused shared passkey relying-party ID from core #855.
[Request]: Support independent provider packages and standard inert artifacts #844: all three operations are delivered:
Items 2, 4 and 6 of Artifact inspection follow-ups: $id bases, registry integrity, $ref in data, YAML anchors, catalog documents #857 need design decisions.
[Request]: Adopt standard schemas and OpenAPI for provider interoperability #845: mostly delivered: a bounded 2020-12 profile validated by Ajv (Validate request.body.schema as a bounded JSON Schema 2020-12 profile (#845) #860), per-method bodies (Key request.body by HTTP method (#845, #861) #870), diagnostics (Pointed body schema diagnostics for contradictory schemas and Ajv refusals (#861) #871), formats (Standard string formats in the body schema profile (#861) #880), and an OpenAPI 3.1 export with official-schema validation, a generated client and a contract run (Export an OpenAPI 3.1 description of the project's HTTP operations (#845) #879). Open: store and forms vocabularies (JSON Schema profile follow-ups: store/forms vocabularies, OpenAPI export, shared HTTP+MCP+form schema, formats, workerd CI #861 item 1) and one schema shared across HTTP, MCP and forms.
[Request]: Evaluate conditional state transitions and result-aware idempotency beyond store CRUD #835: the store runs on SQLite with one transaction per write (Persist store collections in SQLite, one transaction per write (#835) #858). Also delivered: result-aware retries, declarative transitions and host transactions (Store: result-aware retries, declarative transitions and host transactions (#835) #862), membership gates (Store membership gates and cross-owner reads; the #843 proof runs on store (#863) #865), operator tooling (Store backup CLI, and extension targets in descriptors so recipes stop over-claiming (#859) #869, Store: members CLI, audited membership, reassign memberships, enum filters; declared targets in validate/capabilities (#866, #867) #876) and screen controls (Transition controls on store screens (#863) #872, Store screens: If-Match on edits and deletes, stale-page message, browser coverage (#873) #877).
[Request]: Make installed authoring validation context executable and discoverable #834: partial (Pass the operator's reviewed policy to inspection commands and the authoring MCP server (#834) #849).
In progress
Not started
Closed as obsolete: #829 and #830. The contracts they describe were deleted.
test(proofs): ecosystem fixture for direct npm library use and a Hono…
Merge main into claude/second-auth-provider: keep both #841 integrati…
test(proofs): Auth.js as a second, independent auth provider behind t…
docs: measure #841 ownership, drop stale UI/admin/browser prose, poin…
jimhoyd commentedon Sep 29, 2026
The agent workflow trial (owner-requested order-5 measure) is in #909. An agent built three small apps from a packed install; none needed server-side code, and the approval workflow was YAML only. Correction rounds were 8, 3 and 0, spent on tooling friction, not on the declarations.
Findings are filed as #910, #911, #912, #913, #914, #915, #916 and #917.
docs(framework): record the #841 agent workflow trial (#909)
jimhoyd commentedon Sep 29, 2026
Closing: the program's execution order is delivered on main. The remaining follow-ups are tracked on their own issues.
Acceptance evidence
auth: truekeyed on the extension's name, now keys onprovidesPrincipalinstead (Key principal-provider behavior on providesPrincipal, not the extension name 'auth' #888/Key principal-provider behavior on providesPrincipal, not the name 'auth' (#888) #893).createEmbeddedHandler(Embedding URLCode in another host: export a Response adapter; server-only protections #889/Embed URLCode in another host: createEmbeddedHandler shares core's request/response rules (#889) #891).Measured (docs/FRAMEWORK.md, "Ownership" and "Agent workflow trial")
Still open elsewhere
jit_page_->allocations_.erase(addr) == 1CHECK, fixed upstream in V8 9b8ca54d5a nodejs/node#66366; the workaround is in Work around the Node 24 V8 wasm abort in sandbox workers (#708) #922.Passing CI is not an independent security review or deployment/soak evidence.
jimhoyd commentedon Sep 30, 2026
Current-main review at 282c803 (111 commits after the audited a996f0d baseline): the ecosystem requirements have real implementation evidence. I reran 56 focused embedding/principal/handoff/schema/artifact tests and 25 packed-consumer Hono/direct-npm/Auth.js tests; all passed. Core and addon builds passed. This was a focused architecture review on Node v26.10.0/macOS, not full verify, all-platform CI, browser/soak or an independent security assessment.
Two concrete follow-ups are now tracked:
Ownership remeasurement using the same physical packages//src/**/.ts line convention on the downloaded GitHub commit archive:
That is a 33.9% reduction, not the earlier historical snapshot's 45.6%. The old docs explicitly identify their measurement commit; this does not make that historical measurement incorrect. Core has grown 30.0% from baseline; store is 2.79 times its original source. The ecosystem substitutions succeeded, but the 58–73% slimming projection was not achieved, and subsequent declarative/domain/operational features have regrown ownership.
Recommendation for the next scope decision: review the store's ownership boundary before adding more domain vocabulary or resuming #837. SQLite owns persistence/transactions, but URLCode still owns membership, transition, interval, transfer, idempotency, query and operational semantics. Retain features based on demonstrated agent authoring/review value, and compare future additions with existing libraries/native application code. Avoid treating every application trial gap as automatically requiring another framework feature. Keep #837 on hold pending this decision; this review does not restart it or request a blanket store rewrite.
jimhoyd commentedon Sep 30, 2026
Follow-up fixes from the current-main interoperability review are implemented in separate PRs:
The changes merge cleanly together. They do not resume #837, add per-library adapters or change sandbox isolation. Dependency evidence does not attest node_modules bytes, enumerate arbitrary runtime loading, or clear Node's imported-helper cache; these limits are explicit. Core compressed package growth from #1043 is 3,818 bytes (+0.35%), measured against main
282c803b. Package budgets follow the repository's measured-plus-margin rule.Neither PR is merged. CI and human review remain visible on the PRs; local verification is not an independent security assessment.