Repository navigation
fix(spec): a refusal code or reason is literal at save only when its quote closes the value - #38044
Conversation
…quote closes the value The four save-time readers (code and reason, property and assignment) stopped at the closing quote, so a value built from a literal such as 'OVER' + suffix was read as the literal OVER and refused at save. A property value is literal now only when `,` or `}` follows; an assigned one only when `;`, `,`, `}`, `)`, the source end, or a line end that does not continue the expression follows. Every literal refused before is still refused in the same words. Claude-Session: https://claude.ai/code/session_01L9qibykc1XS5J4B4J16dLb Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift Check6 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5b90fe2c09d29b201ff0d4dc1b4f1771fd7992cd && git checkout 5b90fe2c09d29b201ff0d4dc1b4f1771fd7992cd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c151c4993ee3a4409aadb1568865e4036cc4b01f 291adbd71cef38cb43655c59730076347d03d047 && git checkout -B drift-repro c151c4993ee3a4409aadb1568865e4036cc4b01f && git merge --no-ff 291adbd71cef38cb43655c59730076347d03d047
node scripts/docs-audit/affected-docs.mjs --json c151c4993ee3a4409aadb1568865e4036cc4b01f |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 291adbd · 2026-11-27T20:16Z L1-a (the seat's L1 thread) runs the isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Inputs read: card #36670 (body, triage 7100098534, claim 7226585955, amendment 7226609991; no ruling and no earlier record on the thread), PR #38044 (body, 4-file list, net diff against Check-runs on this head, read 2026-11-27T20:21Z. Concluded success: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Read, not reviewed (changeset, the lane seat's): its sentences on the two terminator sets, the worked examples and the run-time answer are true against the code. One is too wide: "Every literal code or reason the save refused before is still refused" is true of every shape it lists and false for the N1 shapes; "the ordinary literal forms" would be exact. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 The filled brief the record above (7227453550) was rendered from (L1-a, isolated Contract review brief — PR #38044 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1 ACCEPT at Contract review. The isolated
Your question: is every literal refused before still refused, in the same words? For every shape an author or a handler's
A bare CR or a no-break space before the line end also counts. The run-time refusal still catches each one, naming the code, so no undeclared code ever runs. I accept these as a deviation, not a rework. The changeset's sentence "Every literal code or reason the save refused before is still refused" is followed by the shapes it means. Scoping it to "in each of these shapes" would make it exact, and that is a prose-face change if you want it. Nits (record N1–N4, not blocking).
Report. The os-dev report sits in the project files ( |
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T20:49Z · zone
|
Requested by Tesla · project thread
Fixes #36670
repo:objectstack#3 · os-tesla · session_01L9qibykc1XS5J4B4J16dLb
Clause-②: no
Metadata-protocol: none
Clause-② citation, the published docblock of
hookRefusalCodesThrownIn(packages/spec/src/data/hook-refusal-codes.ts) onorigin/main3e8edf7: "A code that arrives any other way — a helper's parameter (refuse('…', code)), a variable, a computed value — is left to the run-time refusal". A code or reason built from a literal ('OVER' + suffix,'OVER'.concat(suffix)) is a computed value, so its save refusal was a false refusal; this PR removes only that, as PR #36666 did for the text-key reader (#35698) on the same ground. Every literal refused before is still refused, in the same words (the lit pins below).维护者速读
What changes
packages/spec/src/data/hook-refusal-codes.ts(CODE_PROPERTY,CODE_ASSIGNMENT,REASON_PROPERTY,REASON_ASSIGNMENT), which both save doors use (HookSchemaandActionSchema, throughhookRefusalCodesThrownIn/hookRefusalReasonsThrownIn), now end with a lookahead after the closing quote:PROPERTY_VALUE_END(the two property readers):,or}follows, after optional whitespace (a comment there is blanked to whitespace by the existing masking first).ASSIGNMENT_VALUE_END(the two assignment readers):;,,,}or)follows after optional whitespace, or the source ends, or a line end follows whose next line does not continue the expression. A next line opening with an operator, a member access, a call or index bracket or a template (+ suffix,.concat(suffix)) continues it, as JavaScript reads it.undeclaredHookRefusalAtRun,undeclaredHookRefusalReasonAtRunand the action twins).${}hole needed no change: the masking already blanks it. Pinned anyway (property form).,is in the assignment set beyond the card's list (e.code = 'X', e.reason = 'y'): the comma operator ends the assignment, and leaving it out would have stopped refusing a literal the save refuses today.hookRefusalCodesThrownIn/hookRefusalReasonsThrownInsay what "literal" means now. No export, schema shape,.describe()or error sentence changed.patchchangeset for@objectstack/spec.Tests
One new top-level
describein each existing harness file:packages/spec/src/data/hook-refusals.test.ts:}, by,, with a line break or a comment before the close, a backtick with no hole, insideObject.assign; assignment closed by;, a line end, a comment and a line end,,,},), the source end. Each is still refused atbody.sourcewith the unchanged sentence.+,+on the next line, backtick+,.concat, template hole; assignment+,+on the next line,.concaton the next line, backtick+. Each passes the save, and the reader returns nothing.reasons: [{ reason }]) included.packages/spec/src/ui/action-refusals.test.ts: the action twin, lit code 5, dark code 4, lit reason 2, dark reason 2.Before the fix, after, and ablation
origin/main3e8edf7 reader, file restored tree-only):Failed Tests 20, all dark cases except the template hole (already blanked by the masking); every lit case green.Tests 195 passed (195); together withhook.test.ts,hook-texts.test.ts,action-texts.test.tsbefore the new pins,Tests 326 passed (326).scripts/ablation-replace.mjson the committed fix (tests importsrcrelatively, so no dist leg); each restoreblob == HEAD (9afc30eb45f3) and git diff HEAD is empty:REASON_PROPERTYlookahead removed:Tests 4 failed | 191 passed (195), the 4 property-reason dark pins.REASON_ASSIGNMENTlookahead removed:3 failed, the assignment-reason dark pins.CODE_PROPERTYlookahead removed:7 failed, the property-code dark pins and the handler pin.CODE_ASSIGNMENTlookahead removed:6 failed, the assignment-code dark pins.[ \t]*\r?\nonly):4 failed, the next-line dark pins.4 failed, the line-end lit pins (hook code ×2, action code, hook reason).pnpm --filter @objectstack/spec buildexit 0;pnpm --filter @objectstack/spec testat 291adbd:Test Files 909 passed (909),Tests 28797 passed | 1 todo (28798);typecheckexit 0;check:generatedexit 0 ("All 14 generated artifacts are up to date").Acceptance notes
dispatch-gates --ranreconciles 85 derived, 83 run (all exit 0), 2 NOT MEASURED, 0 unrun.@objectstack/formula,@objectstack/lintand@objectstack/objectqlwere built first socheck:doc-formula-expressionsandcheck:lean-entry-closurecould measure (both exit 0).eslinton the three changed.tsfiles exit 0.check-plugin-teardown-shape.mjs --self-testreads a fixture pinned to a commit this shallow clone cannot reach;check:dual-build-cjs-loadsneeds every package'sdist/(a fullpnpm build), which this card's diff does not move.,to the card's list (;, line end,},)): the comma operator closes the assignment (e.code = 'X', e.reason = 'y'), and leaving it out would have stopped refusing a literal the save refuses today. A line end counts unless the next line continues the expression; the continuation set is the operator, member-access, bracket and template openers JavaScript does not end a statement before, broader than the claim's "a leading+or." example.Verification
Read first (by risk):
packages/spec/src/data/hook-refusal-codes.ts:PROPERTY_VALUE_ENDandASSIGNMENT_VALUE_END, and the four readers that append them.packages/spec/src/data/hook-refusals.test.ts: the new lit/dark/CONTROL describe at the end.packages/spec/src/ui/action-refusals.test.ts: the action twin.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/data/hook-refusals.test.ts src/ui/action-refusals.test.tsshows 195 passing; delete+ PROPERTY_VALUE_ENDfromCODE_PROPERTYand the same command shows 7 dark cases failing.Generated by Claude Code