Commit 53cbad9
* fix(rest): consume the parsed `api` sub-config instead of discarding it
`RestServer.normalizeConfig` ran `RestApiConfigSchema` over `config.api` and
threw the parsed output away, rebuilding the block from a `??` chain over the
raw cast. That chain restated the schema's eleven top-level `z.default(...)`s
as eleven literals in `packages/rest`, with nothing pinning that the two stayed
equal — a `packages/spec` default change would silently fail to propagate.
#11637 made the parse validate-only for two measured reasons; both have since
expired (#11983 gave `enableSearch` a declared seat, #12450 withdrew the
`projectResolution` omit). Re-measured here: the 14 keys the method reads and
the 14 the schema declares after `.omit({ requireAuth: true })` are the same
14 in both directions, so a consumed parse cannot strip anything the runtime
honours. `requireAuth` stays omitted and stays warn-and-ignore in the plugin,
which reads it off the RAW config.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(rest): pin that the `api` defaults follow `RestApiConfigSchema`
Two halves, deliberately split by whether the schema is mocked.
`rest-api-config-defaults-follow-spec.pin.test.ts` is the DISCRIMINATING pin:
it moves five `z.default(...)`s to values that differ from both the shipped
schema's and the deleted `??` chain's literals, then drives a real RestServer
construction. Asserting today's values would have been vacuous — the chain's
literals and the schema's defaults agreed key for key, which is the defect.
`rest-config-parse-not-cast.test.ts` §D is the unmocked half: the shipped
defaults are the schema's own output (derived, never restated), the normalized
key set equals the declared key set, `requireAuth: false` still constructs and
still warns through the plugin, and the one bounded behaviour delta — an
authored `documentation` / `responseFormat` now carrying its declared inner
defaults — is pinned rather than left to be rediscovered.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* chore(changeset): rest api config defaults now come from the schema
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context citations after the line shift
`content/docs/permissions/system-context.mdx` cites
`packages/rest/src/rest-server.ts` by absolute line number, so this change's
+44 net lines rotted ten anchors. Rewritten by the gate's own
`node scripts/check-system-context-census.mjs --fix`, which rewrites a pure
shift and refuses a population change.
Verified structurally rather than by line content (several anchored lines are
the same string): the census JSON re-derived at the merge base and at head is
identical in population — 106 sites both sides, 0 arrived, 0 vanished, same 45
files and 20 packages, `classified` 462 = 462. The six `rest-server.ts` sites
carry identical text at +12 / +44.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(rest): retire the two comments that still called `api` validate-only
Both were true until this branch consumed the parse, and both now contradict
the code beside them: the seam's own sibling paragraph in `rest-server.ts` and
the `api` aside in the #11984 pin file's header. Rewritten to say what is now
true, keeping the history in past tense. Repo-wide grep for the stale claim
returns only that one past-tense mention.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(changeset): state the subtractive half of the `api` parse delta
The changeset described the behaviour change on an authored
`api.documentation` / `api.responseFormat` as additive only — the objects
now carry their declared inner defaults. Measured against the built schema,
the delta is also subtractive: `RestApiConfigSchema`'s nested objects are
non-strict `z.object()`s, so inner keys they do not declare are stripped,
at both depths (`documentation.logo`, `documentation.contact.phone`,
`documentation.license.spdxId`, `responseFormat.extra`), where the deleted
`??` chain passed the authored object through by reference and kept them.
Documentation accuracy only — no code, test or pin is touched, and the
`patch` level is unchanged: the normalized block is `private` to
`RestServer` and neither key has a read site, so nothing public widens or
narrows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after merging main
`content/docs/permissions/system-context.mdx` cites `rest-server.ts` by
absolute line number, and both sides of this merge moved lines in that file:
main by +32 and this branch by +44, in disjoint regions. Row 50's five REST
anchors were the one hunk a text merge could not resolve.
Re-anchored with the gate's own `--fix`, which rewrites a pure shift and
refuses a population change. Verified structurally rather than by comparing
line content (several anchored lines are the same string): the census
re-derived with one instrument over main, this branch's pre-merge tip and the
merged tree agrees on every population number — 106 sites, 20 packages, 45
files, 871 identifier appearances, 462 classified, 0 stale ledger rows — and
site identity keyed shift-invariantly shows 0 arrived and 0 vanished in both
directions. Only `file:line` identity moves, on exactly the six rest-server
sites `--fix` rewrote.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after the second merge
`origin/main` moved again while this branch was being verified, and its new tip
moves `rest-server.ts` a second time — so row 50's five REST anchors conflicted
for exactly the same reason as the first merge. Re-anchored with the gate's own
`--fix`, a pure shift again.
Structural verification repeated with one instrument over main, this branch's
previous tip and the merged tree: 106 sites, 20 packages, 45 files, 871
identifier appearances, 462 classified, 0 stale ledger rows on all three, and
shift-invariant site identity shows 0 arrived / 0 vanished in both directions.
Only `file:line` identity moves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after the main merge
`node scripts/check-system-context-census.mjs --fix` rewrote the ten
`packages/rest/src/rest-server.ts` anchors displaced by this branch's +44-line
change to that file. Pure line rot: the census population is unchanged against
`origin/main` — 107 sites, 873 identifier appearances, 463 classified, 0
arrived, 0 vanished — and the gate now reports 141 anchors resolving with 27
declared non-read.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after the second merge
`node scripts/check-system-context-census.mjs --fix` rewrote the same ten
`packages/rest/src/rest-server.ts` anchors, displaced again by this branch's
+44-line change to that file. The instrument itself moved on main in this
window, so every figure was re-derived with the merged tree's census rather than
carried over: pure line rot, `--fix` did not refuse, and the population is
unchanged against `origin/main` — 106 sites, 885 identifier appearances, 462
classified, 0 arrived, 0 vanished. The gate now reports 140 anchors resolving
with 27 declared non-read.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after the third merge
Main landed another `packages/rest/src/rest-server.ts` comment change while the
previous sync was being verified, displacing the same ten anchors again.
`node scripts/check-system-context-census.mjs --fix` rewrote them; it did not
refuse, so this is a pure shift. Re-derived against `origin/main` abdceef
with the merged tree's own census instrument: 106 sites, 885 identifier
appearances, 462 classified, 19 packages, 44 files, 0 arrived, 0 vanished, and
scannedFiles 293 as a non-zero control on both sides. Gate: 140 anchors resolve,
27 declared non-read.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census after the fourth merge
`--fix` rewrote 5 anchors on row 50 and REFUSED ZERO files — the signal that
this is a pure line shift, not a population change. Verified structurally
against `origin/main`'s own census rather than by reading the rewritten lines:
same 105 elevation read sites, same 44 files, same 19 packages, same per-site
identity text, `staleLedgerRows` empty on both sides, and the only delta a
+12 / +44 shift inside `packages/rest/src/rest-server.ts` — this branch's two
insertion points. Zero sites arrived, zero vanished.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent e1d4f9e commit 53cbad9
6 files changed
Lines changed: 363 additions & 39 deletions
File tree
- .changeset
- content/docs/permissions
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
Lines changed: 153 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
0 commit comments