You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(docs-audit): scope the route-matcher narrowing to the two hits that were wrong
The first cut refused a concrete example value in ANY parameter with no static
segment behind it in the tail. Measured over the 228 declared route tails
against all 195 hand-written docs, that reads -36.3% and takes the good rows
with it: `/data/:object` stops matching a page that writes
`POST /api/v1/data/accounts`, which is the leniency working as designed.
Only the tail's LAST segment has nothing behind it in the pattern, so only
there does a concrete value have to end the documented path. Re-measured:
571 -> 524 rows, -8.2%, zero tails going from matching some page to matching
none, and the 42 rows arm 2 drops are one shape — a page documenting a LONGER
route, or a monorepo source path (`packages/core`) matched as the wire route
`/api/v1/packages/:id`.
README carries both narrowings, the rejected variant with its number, and the
comment-provenance clause.
Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: scripts/docs-audit/README.md
+61-2Lines changed: 61 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,9 +87,9 @@ Each anchor kind names its own origin, from the same field the JSON publishes as
87
87
| kind | the clause |
88
88
|:--|:--|
89
89
|`symbol`|`a field of interface MetaOverlayCacheKey` · `a method of class RestServer` · `a top-level function`|
90
-
|`route`|`a path literal in RestServer` · `bridged from symbol enforceEnvironmentOwnership — its route-source handler names it`|
90
+
|`route`|`a path literal in RestServer` · `a path literal in a comment in meta` · `bridged from symbol enforceEnvironmentOwnership — its route-source handler names it`|
91
91
|`sdk`|`the route ledger binds it to GET /api/v1/ui/view/:object/:type`|
92
-
|`literal`|`a string literal in cacheKeyOf`|
92
+
|`literal`|`a string literal in cacheKeyOf`· `a string literal in a comment in cacheKeyOf`|
93
93
|`command`|`read off packages/cli/src/commands/environments/bind.ts`|
94
94
|`rule`|`a @docs-rule block in packages/objectql/src/engine.ts`|
95
95
@@ -108,6 +108,65 @@ cannot start deciding with it without going red. Container-qualified *discrimina
108
108
the separate, later step below (option D), and it decides from the declarations directly,
109
109
never by parsing this clause back out.
110
110
111
+
### A row says whether its anchor came from CODE or from PROSE (#16696)
112
+
113
+
A comment line is a changed line, so a path written in a JSDoc mints a `route` anchor like
114
+
any other. That is deliberate and stays: a doc comment that newly documents a real route is
115
+
sometimes exactly the signal that the page documenting it needs re-reading, and ⛔ excluding
116
+
comments from anchor sources is the one repair ruled out. What was missing is the reader's
117
+
half — the row did not say which kind of line it found.
118
+
119
+
Measured on PR #16694: seven of that run's nine hand-written rows rode
120
+
`/environments/:environmentId`, and that anchor entered the diff on **exactly one added
121
+
line**, English prose inside a JSDoc block in `packages/client/src/index.ts`. Every row read
122
+
`a path literal in meta`, indistinguishable from a registration. A reader who opens seven
123
+
pages and finds seven non-answers stops opening them, and then the list fails on the PR
124
+
where it is right.
125
+
126
+
So the clause carries the strength beside the location: `a path literal in a comment in meta`
127
+
against `a path literal in meta`. Like every other clause it is **publication, not
128
+
discrimination** — the mask is read only to word the clause, nothing is admitted or dropped
129
+
by it, and `--self-test` pins both directions: the comment-only anchor is still an anchor,
130
+
and a code occurrence still produces a clause that says nothing about comments.
131
+
132
+
### A route anchor must name the route the page names (#16696)
133
+
134
+
The doc-side matcher lets a page spell a parameter three ways — `:type`, `{type}`, or a
135
+
concrete example value — so `GET /api/v1/meta/object/account/history` counts as documenting
136
+
`/:type/:name/history`. Both leniencies used to be unconditional, and each one alone is
137
+
enough to list a page for a route it does not document. `protocol/kernel/metadata-service.mdx`
138
+
was listed via `/environments/:environmentId`, a string that page does not contain, on:
139
+
140
+
```
141
+
:204 `/pub/v1/environments/:id/artifact[?commit=<id>]` — a DIFFERENT parameter name
0 commit comments