Skip to content

[Request]: Adopt ecosystem-compatible extensions, artifacts and upstream implementations #841

Closed

Description

@jimhoyd

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: true isolation 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
Mail 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

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

  1. changed the title [-][Request]: Evaluate upstream engines behind extension contracts to reduce maintenance[/-] [+][Request]: Adopt ecosystem-compatible extensions, artifacts and upstream implementations[/+] on Sep 28, 2026
  2. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    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:

    Group Current Estimated retained/replacement URLCode code
    Core runtime, CLI, agent/review tooling 18,136 8,000–11,000
    Auth + admin 18,641 1,500–3,000
    UI + forms + form-records 3,527 1,000–2,000
    Store + audit 2,392 1,000–1,800
    Application MCP 1,058 200–400
    Mail + abuse 1,302 400–800
    Total 45,056 12,100–19,000

    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.

  3. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    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.

  4. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    Auth adoption step is up for review in #854: @jimhoyd/urlcode-auth is now a thin Better Auth adapter (one allowlisted mount, auth: true → verified user id as the request principal and the identity capability, operator-owned secret/database, urlcode-auth migrate|create-user). The old account system, packages/admin and 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.

  5. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    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.

    • Better Auth and SQLite can be tested/default starter selections without becoming requirements of URLCode core. Frontend/component choices belong to the application or optional starter. Provider-owned configuration, SDKs and advanced features stay available.
    • npm packaging, documented HTTP host boundaries, JSON Schema/OpenAPI and MCP are interoperability surfaces. Adopt a precise supported profile; standards do not make lifecycle, authorization or transaction semantics interchangeable.
    • An internal validator or MCP SDK need not have a user-selectable plugin slot merely for theoretical replaceability when its types/behavior do not leak into the public contract. Avoid rebuilding every dependency as a URLCode abstraction.

    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.

  6. jimhoyd commented on Sep 29, 2026

    @jimhoyd
    CollaboratorAuthor

    Status against the execution order:

    Done

    In progress

    • A second, independently owned auth provider as a conformance fixture, with no core edits.
    • Direct use of an ordinary npm library with no adapter metadata, plus hosting URLCode inside a second, materially different framework, with recorded fit and gaps.
    • A UI and forms retirement plan (order 4). It will be filed as its own issue.

    Not started

    • Order 5: deletion, release integration and final ownership measurement.
    • Mail, abuse and telemetry replacement (lower priority).

    Closed as obsolete: #829 and #830. The contracts they describe were deleted.

  7. jimhoyd commented on Sep 29, 2026

    @jimhoyd
    CollaboratorAuthor

    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.

  8. added a commit that references this issue on Sep 29, 2026
  9. jimhoyd commented on Sep 29, 2026

    @jimhoyd
    CollaboratorAuthor

    Closing: the program's execution order is delivered on main. The remaining follow-ups are tracked on their own issues.

    Order Work Outcome
    1 #843 embedded upstream proof Done: #848, then adopted in #854 (Better Auth) and #865 (the proof runs on store and auth with no application server code)
    2 #844 independent packages and inert artifacts Done and closed: #853, #856, #864, #878, #901, #906
    2 #845 schemas and OpenAPI Done and closed: #860, #870, #871, #880, #879, #894, #900, #907, #924
    2 #846 official MCP SDK Done: #850, #851, #852
    2–3 #834 executable validation context Done and closed: #849, #905, #920
    3 #835 SQLite transitions Done and closed: #858, #862, #865, #869, #876, #884, #885, #925. The rest is on #902
    4 Auth and admin retirement Done: #854, #855
    4 UI and forms retirement (#883) Done: #890, #892, #895, #896, #898. ui, forms, form-records, abuse and mail are deleted
    5 Deletion, release integration, measurement Done: #896, #899 trims; ownership measured in #898; agent-workflow trial in #909, with findings #910–#917 fixed in #918–#923

    Acceptance evidence

    Measured (docs/FRAMEWORK.md, "Ownership" and "Agent workflow trial")

    • Owned package source: 45,056 → about 24.5k lines (−46%). Packages: 11 → 5.
    • This is above the 12.1k–19k estimate, and core grew rather than shrank; the docs say so.
    • In the agent trial, three small apps needed no server-side code, and the approval workflow was YAML only.

    Still open elsewhere

    Passing CI is not an independent security review or deployment/soak evidence.

  10. jimhoyd commented on Sep 30, 2026

    @jimhoyd
    CollaboratorAuthor

    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:

    Package Audit baseline Current main
    Core 18,136 23,580
    Auth 17,336 490
    Store 1,502 4,189
    Audit 890 930
    MCP 1,058 595
    Remaining generated ui source included in original ui 4
    Other retired source included in baseline total 0
    Total 45,056 29,788

    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.

  11. jimhoyd commented on Sep 30, 2026

    @jimhoyd
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions