Documentation

Docs / Reference

ADR 0035 — Angular router syntax cache

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

Context

T014d1's census found all 28 corpus route objects in existing declaration constants. Existing client calls retain provideRouter's scope but omit the seven top-level decorator registrations. Bootstrap chains share start offsets. T014d2 needs registration evidence, static loader targets and missing array forms without changing historical payloads or graph records.

Options considered

Decision

Add router beside template_syntax, declarations and injections in the TypeScript cache envelope. Version 1 requires calls, loaders and arrays, including empty arrays. Incomplete, missing or obsolete payloads miss. Invalidate aggregate caches with extractors-23; contract v1 is unchanged.

Capture only the filters and forms in Angular router syntax. Compact callee references omit duplicated text and arguments. First arguments use DeclarationExpr; bootstrap receivers retain syntax and their called callee. Retain default-export literal arrays and module const arrays wrapped in satisfies only when absent from DeclarationSyntax.Constants.

Reuse an existing scope after matching full call span and callee and checking relevant source binding agreement. Otherwise keep module scope plus sorted source-only shadow names. For calls, relevant names include the callee root and every identifier and shorthand property identifier in the first argument subtree, excluding property keys, member property names and type nodes. Both shadow intersection and cached-scope reuse use this set; conservative over-inclusion keeps resolution unresolved. Sync loaders retain root-only shadows. Binding patterns exclude parameter default expressions; blocks, loop headers and catch clauses are included. Sync loaders include callback parameters. Earlier scopes and payloads are never modified.

Relevant local shadows always use the fallback: older scopes have no declaration spans to prove the nearest binding among multiple same-name locals. Scope roots follow called receivers and subscripts as well as plain member chains. Type annotations on an identifier then-callback parameter do not change its binding.

Consequences

The new fixture has a router-only golden, independent assertions and shared backend round-trip coverage. Postgres runs only in CI. No dependencies, schema, store interface, historical payload, node, edge, diagnostic or identity changes are introduced. Framework proof and routing graph output remain T014d2 work.

Known gaps

Async/generator functions, dynamic/escaped specifiers, unsupported then callbacks and multi-statement bodies remain explicit syntax gaps. Capture is not Angular proof; consumers must reject unrelated APIs and local shadows. provideRoutes, raw ROUTES providers and resetConfig remain outside capture and are counted by grep in the census.

Review notes (delegated review, 2026-11-01)

Report a problem with this pageSource: docs/adr/0035-angular-router-syntax-cache.md