Skip to content

docs(router): reframe matching review as a durable reference - #547

Merged
ivogt merged 3 commits into
mainfrom
docs/matching-lazy-discovery-reframe
Jun 8, 2026
Merged

ivogt merged 3 commits into
mainfrom
docs/matching-lazy-discovery-reframe

Conversation

@ivogt

@ivogt ivogt commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

What

Reframes the matching/lazy-discovery internal doc from a point-in-time v1 stability review into a durable architecture & accepted-tradeoffs reference, and renames it to match:

docs/internal/matching-stability-review.md → docs/internal/matching-and-lazy-discovery.md

Docs + code-comments only — no behavior change. Committed with [skip ci].

Why

The review framing had served its purpose: the v1 matching-stability work is done (#535, #537–#541, #544–#546). What was left was ~60% transient process scaffolding — "Pass 1/2 landed" changelog, implementation plan, next actions, the per-finding M/C/R status catalogs, and write-ups of the multi-agent workflows we ran. That half is already captured by git history and the merged PRs, so as a current-state doc it would only rot. The remaining ~40% is genuinely durable and worth keeping as reference.

What the reference keeps

  • How matching works — trie canonical, regex latent; the single shared buildPerRouterTrie for both dev and prod.
  • The dev/prod contract table — updated to reflect the now-unified builder (no more inline visitPrefixNode row).
  • Invariants & design decisions with rationale — the still-relevant findings folded in as decisions rather than changelog: trie precedence (M4), bare-prefix wildcard (C1), joinPrefix normalization (C5), find-match cache clone (C7), shared-staticPrefix omission (C19), leaf-vs-non-leaf precompute (C8), trailing-slash modes (M3).
  • Accepted performance tradeoffs — LP1/LP3/LP4 with the measured numbers + the vitest bench lazy-include-cost artifact, framed as "do not re-litigate without re-running the bench."
  • Tests that pin each invariant, and a short optional / not-v1 list.

Mechanics

  • git mv (history preserved; the large rewrite means git shows it as add+delete in the diff, but --follow tracks it).
  • Finding IDs (C1/C5/C19/M3/M4/LP1/LP3/LP4) kept as decision labels so the 5 code-comment cross-references still resolve.
  • Updated all 6 references: docs/README.md (nav entry reworded) + 5 code comments (manifest.ts, lazy-includes.ts, trie-regex-parity.test.ts, lazy-include-perf.test.ts, lazy-include-cost.bench.ts). Verified no stale references to the old filename remain.

Test plan

  • typecheck / unit 3383 / lint / format clean; pre-commit (lint/format/e2e-bucketing) green
  • no behavior change → [skip ci]
  • grep confirms zero remaining references to the old filename

ivogt added 3 commits June 8, 2026 15:22
Rename matching-stability-review.md -> matching-and-lazy-discovery.md and rewrite
it from a point-in-time v1 *review* (Pass-1/2-landed changelog, implementation
plan, next actions, per-finding M/C/R status catalogs, workflow write-ups) into a
durable *reference*: how matching works (trie canonical, regex latent; one shared
buildPerRouterTrie), the dev/prod contract table (updated for the unified builder),
the matching invariants with rationale (C1/C5/C7/C19/C8/M3/M4 folded in as design
decisions), the measured-and-accepted lazy-include cost tradeoffs (LP1/LP3/LP4 with
numbers + the bench), the tests that pin each, and a short optional/not-v1 list.

The changelog half is already captured by git history + the merged PRs, so it is
dropped. Finding IDs (C1/C5/C19/M3/M4/LP1/LP3/LP4) are kept as decision labels so the
code-comment cross-references still resolve.

- git mv preserves history.
- Updated the 6 references to the new path: docs/README.md (nav entry reworded) and
  5 code comments (manifest.ts, lazy-includes.ts, trie-regex-parity.test.ts,
  lazy-include-perf.test.ts, lazy-include-cost.bench.ts).

Docs + comments only; no behavior change. typecheck / unit 3383 / lint / format green.
@ivogt

ivogt commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-on commits on this branch (both [skip ci], docs-only):

  • Warmer tone — rewrote the reframed doc in a senior-engineer-onboarding-a-teammate voice (every fact/table/ref/ID intact).
  • Doc-voice guide — codified that voice in AGENTS.md (→ also CLAUDE.md, which symlinks it), pointing at this doc as the reference exemplar. Sits beside the existing PR-description and internal-reference-docs guides.

So this PR now: renames + reframes the matching doc, warms its tone, and records the voice guide it exemplifies.

@ivogt
ivogt merged commit cd92c44 into main Jun 8, 2026
@ivogt
ivogt deleted the docs/matching-lazy-discovery-reframe branch June 8, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant