Skip to content

[Request]: Make every extension respect project-owner choice of libraries and providers #1052

Closed

Description

@jimhoyd

Problem or use case

Maintainer direction: project-owner choice applies to every extension and integration, not only storage. Owners choose their libraries, providers and infrastructure. URLCode supplies declarative composition, enforceable request/authority boundaries and agent/human review tools; it must not make adopting the entire bundled stack a prerequisite.

This broadens the original storage-only scope of this issue. SQLite, PostgreSQL, Better Auth, Express and Fastify are examples, not a required provider shortlist. Follow-up to #841 and #1041. #837 remains on hold; this does not reactivate its legacy facade expansion.

Ordinary trusted Node application code already supports native npm imports. What still needs to be consistent across extensions is optional adoption, owner-supplied implementations, truthful capability reporting, and preservation of upstream APIs. Current bundled auth/store/audit persistence has SQLite-specific assumptions. These must be described as implementation properties, not universal URLCode requirements.

Proposed behavior and alternatives

Rule for every extension

  1. Owner chooses the implementation. Bundled integrations are optional tested defaults. Core and unrelated capabilities must not import or require them. Dependencies genuinely necessary for a selected feature must be explicit and scoped to that feature.
  2. Native libraries remain native. Direct use in trusted application code does not require an extension descriptor, catalog entry or per-library adapter. Preserve native configuration, clients, queries, plugin APIs and advanced features. An internal implementation dependency need not have a public replacement slot when it does not constrain the application contract.
  3. Integrate only at meaningful boundaries. A focused integration is needed when a provider participates in URLCode-specific identity, declarative operations, lifecycle, authority or review behavior. Prefer existing standard interfaces and the generic extension/request contracts. Do not build a universal lowest-common-denominator API or mirror every upstream feature.
  4. Describe behavior, not a preferred provider's internals. Providers declare only guarantees they actually enforce. Refuse requested features whose guarantees cannot be enforced. Identify opaque trusted application behavior without claiming URLCode inspects or controls it. Compatibility does not imply identical features or a zero-change swap.
  5. Keep operator choices outside route behavior. Credentials, connections, provider instances, service endpoints and resource setup belong in trusted operator configuration. Define who creates/closes shared resources and owns migrations/transactions. Do not imply cross-provider atomicity.
  6. Independent integrations are first-class. Independently named/versioned packages can provide integrations without core edits, first-party namespace requirements or release lockstep beyond a declared compatible contract.
  7. Respect existing projects. Agents inspect and use the installed stack before proposing defaults. Review shows selected implementations, declared operations, authority, lifecycle/target requirements and known coverage gaps without exposing secrets. Static artifact inspection must not execute provider code.
  8. Preserve enforcement boundaries. Owner choice does not waive operator approval, revision-pinned grants or sandbox isolation. Unsupported target/provider combinations refuse before serving. Trusted native imports remain trusted execution, not a promise to run arbitrary npm libraries in the sandbox.

Apply the rule across domains

Domain URLCode integration responsibility Owner/upstream responsibility
Identity/authentication Verified principal and route authorization handoff; truthful credential/capability metadata Auth library/service, accounts, sessions, login clients and enabled plugins
Storage Declared operation inputs/results and requested ownership/atomicity/retry guarantees Database/client/ORM/service, queries, data schemas, migrations, pools and backups
Audit Explicit event/evidence requirements, delivery guarantees and failure behavior where requested Chosen durable destination and native implementation; generic telemetry is not automatically durable audit
MCP/other protocols Explicit operations, authority and standard protocol boundary Upstream protocol tooling and native integrations; do not expose every provider operation automatically
UI/forms/presentation Optional declarative metadata and HTTP contracts Frontend framework, components, form libraries and build tooling
Mail, caching, abuse controls and other optional capabilities Only the declared behavior/guarantees URLCode needs to compose Owner-selected native implementations and infrastructure
Hosting Documented request/response, lifecycle and enforcement responsibilities Owner's framework/server/runtime and its operational controls

This table is a design policy, not a mandate to rebuild retired extensions or ship an adapter for every listed domain. Existing standard interfaces should work directly wherever their semantics fit.

Acceptance evidence

  • Audit each current extension and its authoring/scaffold guidance against these rules. Record provider-specific assumptions, which are legitimate defaults, and which incorrectly constrain the public contract. File focused follow-ups rather than silently expanding this issue into an all-provider rewrite.
  • Demonstrate an application using ordinary upstream libraries through native APIs without URLCode adapter metadata or unrelated bundled extensions.
  • Demonstrate substitution at materially different relevant capability boundaries using independently owned integrations without modifying core. Reuse the existing Auth.js and Hono proofs where applicable; they do not prove storage portability, revocation parity or every host's operational coverage.
  • For supported substitutions, show that declarative application intent stays stable where semantics match; identify native configuration/client changes and unsupported capabilities honestly. No universal parity facade or automatic data migration promise.
  • For stateful integrations, test concurrent operations, rollback, retries and audit evidence wherever advertised. Use explicit isolated test resources/setup/teardown; if isolation is unavailable, refuse rather than fall back to live data. For auth/protocol/hosting integrations, test their corresponding refusal, lifecycle and authority behavior.
  • Ensure installation, inspection, review and generated agent guidance respect independent package identities and the owner's selected stack. Provider-owned native APIs remain accessible; static inspection does not import executable code.
  • Document the distinction between native application library use, optional URLCode declarative integration and bundled convenience implementations. Declare supported/refused guarantees and target limits.

Storage-specific clarification retained from the original scope

SQLite remains an optional local convenience implementation. PostgreSQL is one possible contrasting proof, not a required backend or the product objective. Owners may retain any suitable client, ORM, database or storage service. Do not require the bundled store's schema, SQLite files, migration/backup commands or synchronous execution model just to integrate owner-selected storage. A database URL switch is not a claim of full declarative-store parity; behavioral guarantees need evidence.

Scope boundaries and related work

No universal ORM, authentication facade, provider marketplace, distributed transaction layer or exhaustive adapter catalog. Do not duplicate upstream tools merely to present a uniform API. No historical compatibility/migration shims are required by the maintainer. This issue authorizes scoping the consistent contract and focused implementations, not automatic provider replacement or weakening guarantees.

#1041 owns the wider reuse audit; #1047 addresses a concrete generic-auth/OpenAPI metadata gap. #1042/#1043 delivered native auth body-format support and bounded dependency-review evidence. #837 remains on hold until its remaining scope is explicitly reconsidered under this direction.

Activity

  1. changed the title [-][Request]: Let project owners choose storage through native tools and optional integrations[/-] [+][Request]: Make every extension respect project-owner choice of libraries and providers[/+] on Sep 30, 2026
  2. jimhoyd commented on Sep 30, 2026

    @jimhoyd
    CollaboratorAuthor

    Owner decisions (2026-09-30) on the owner-choice plan:

    • Audit (resolves the conflict with Reuse audit after #841: what URLCode still owns and what a package or a cut could remove #1041 item 2): the store writes audit events into its own database, in the same transaction as the change. It still exports a small peek/ack over that event table, so an owner can forward audit events to any sink. The separate outbox/drain machinery goes; the pull contract stays, moved into core.
    • Swapping a bundled package: the name is the role. An independent package named audit, store or auth may be installed when the first-party one isn't. The refusal in addon-install.ts is lifted for that case, and the exports types move into core.
    • Better Auth: honour an owner-supplied database and options; email/password becomes a default rather than forced. When the database isn't the bundled SQLite file, the SQLite-only lock, triggers and migrate CLI don't apply, and activation says so. Hermetic test/audit runs with an owner database need an owner-provided isolated database, or they are refused. They never fall back to live data.
    • SQLite helpers: they move out of @jimhoyd/urlcode/extensions to a separate core subpath, @jimhoyd/urlcode/sqlite.
    • Also: agent guidance says "inspect the installed stack first; first-party extensions are defaults". OpenAPI security metadata is handled in [Request]: Describe principal providers truthfully in OpenAPI security schemes #1047.

    Slices, in order. All start after #1050 (one serving process per database) merges.

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