Documentation

Docs / Reference

ADR 0020 - Bounded client URL evaluation

Status: Accepted (developer review, 2026-10-12) Date: 2026-10-12

Context

T012d requires source-backed URL builders, tables and constants without executing repository code. Opaque prefixes must not lose resource segments. FastAPI slash twins already retain their source path flags.

Options considered

Decision

Keep client evaluation syntax separate from route factory syntax. Cache lexical bindings, object property order/spans and eligible emitted helper bodies. Use the shared TypeScript resolver at link time. Follow module constants and single local const declarators under lexical/source-order rules; reject mutated module tables.

Evaluate ECMAScript values, coercion, defaults, short circuiting and conditional alternatives within T012d B1-B6. Helpers admit three levels and 2,000 steps per site; recursion and unsupported statements remain dynamic. Memoize only within a link pass; keys include depth, values, property order and literal-object origin.

Normalize alternatives under existing piece/base rules and deduplicate on template plus slash flag, with at most four entries. Nodes expose paths and capped sorted evaluated-helper identities. Node status takes the worst entry, except existing wrapper sites. Null templates retain unresolved bases despite configuration. Emit one inferred calls_route edge per linked target at the strongest existing tier, with call, property and helper-return evidence.

Slash filtering applies only to equal-template FastAPI ties containing both matching and differing flags. Preserve existing method/specificity rules and Express ambiguity. Source identities, contract v1, store interfaces/schema and dependencies are unchanged. Invalidate syntax caches with extractors-13.

Consequences

Editing a table relinks unchanged callers without reparsing them. Runtime conditions remain explicit alternatives; unsupported code remains visible as a gap. Derived attributes do not change source identities or hashes.

Known gaps

URL/Request objects, call-site let/var dataflow, nonliteral object arguments in loops, async helpers and general execution are excluded. Existing framework route-order/convertor, Express case, axios creation-order/interceptor and multi-segment dynamic-piece limits remain outside the stated rules.

Review notes (developer, 2026-10-12)

Report a problem with this pageSource: docs/adr/0020-bounded-client-url-evaluation.md