Documentation

Docs / Reference

ADR 0084 - Unknown-prefix paths

Status: Accepted (delegated review, 2026-11-24)

Context

A route whose prefix the code does not fix gets no path today. The route extractors compose a route's paths from its registration up to a root; where a prefix is not a constant (dozzle's r.Route(base, ...) with base from configuration, an Express use(process.env.BASE, router), a FastAPI include_router(r, prefix=settings.PREFIX), an Axum nest(&base, api())) or a router is reached through a hop no row proves (miniflux's UI mux behind a middleware chain and an unread StripPrefix), composition stops, the route keeps its node with an empty paths, and the shared diagnostic route_prefix_unresolved or route_mount_unresolved names the hop (ADR 0013, ADR 0076 decision 9). Since T029 FU-2 (ADR 0081) the route also stores the hop in unresolved_mounts, with the paths proven below it, so that a value set by you in explorer.path_values can place it in the generated OpenAPI document; the index itself never takes that value.

The consequence is that such a route has no callers: the client matcher (ADR 0018) only reads paths. On the pinned corpora, dozzle has 0 of 85 production routes with a path, miniflux 74 of 174 (its 100 UI routes sit behind the unproven hop), while the Express, FastAPI and Axum corpora have none of this form. The developer decided (GO3, option (b) of the Go routers task's open point O3) that such routes keep a path entry with an explicitly unknown prefix, matched only by the client matcher's suffix tier, as a change shared by every framework.

Three facts from the T033 investigation analysis (task record, internal) shape the decision:

Options considered

  1. Entries in paths with "prefix": "unresolved", contract version bump. The developer's example shape, in the existing attribute. Every paths consumer changes in the same change, and contract v1's rule for a change of an existing record's meaning applies: bump contract_version to 2, update the schemas, docs and every golden. Rejected: the largest change for no capability the other options lack, and an external indexer written for v1 is refused.
  2. Entries in paths without a bump, as Next.js already does for a basePath read as not literal (row NX-R4, resolution: unresolved). Rejected: the Next.js precedent shows the cost (its entries are shown as full paths by the Routes list today), and it silently changes what older readers of the stored data see.
  3. A new optional route attribute unresolved_prefix_paths holding entries of the developer's shape (template, prefix: "unresolved") plus where the unknown part is (hop, above, prefix_reason); paths keeps its meaning. Additive: contract v1 allows optional attributes in the open attributes map without a version change, as for unresolved_mounts, shape and model_uses.
  4. No new attribute; the matcher reads unresolved_mounts[].paths. The smallest change (no extractor or route golden change). Rejected as the stored form: the attribute exists for explorer path values, its entries also exist for hops this design may refuse, the generated server case (GR-G1) has no hop, and every surface would re-derive the same projection. It remains the source the extractor projects from.
  5. Resolve configuration defaults (go-arg or flag struct tags, the option (c) of O3). A new library surface per configuration package, and a default is not the deployed value. Not this task.

For the matcher: (a) the existing suffix tier extended to these entries with its literal-count ranking; (b) a separate fallback tier, considered only for an alternative the existing tiers leave without a candidate, with a minimum of two matched literal segments and no ranking between its candidates (any second route that matches makes the alternative ambiguous); (c) no matching, entries for display only.

Decision

Option 3 for storage, matcher option (b), as the Draft claim contract unknown-prefix-paths (rows UP-1..UP-49) states:

Consequences

Known gaps

Review notes (2026-11-24)

Report a problem with this pageSource: docs/adr/0084-unknown-prefix-paths.md