Skip to content

fix(spec): a ctx.text key is literal at save only when its closing quote ends the argument - #36666

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-35698-text-key-literal-close
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-35698-text-key-literal-close

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35698
repo:objectstack#7 · os-alice · session_011y7As8yeqbR9TKANdPKRxt

Clause-②: no
Metadata-protocol: none

Clause-② citation, the published docblock of hookTextKeysAskedIn (packages/spec/src/data/hook-refusal-codes.ts) on origin/main 9348f02: "A key that arrives any other way (a variable, a computed value) is left to the run-time refusal." A key built from a literal ('k' + suffix, 'k'.concat(suffix)) is a computed value, so its save refusal was a false refusal; this PR removes only that. Every literal ask refused before is still refused, in the same words (the lit pins below).

维护者速读

  • 搭建者在钩子或动作代码里用拼接方式拼出文本键时,保存不再被误拒;直接写死的文本键照旧在保存时检查,用户无其它感知变化。
  • 属于钩子与动作「按组织语言写入记录的文本」这条线,替写拼接键的搭建者解决保存被误拒的问题。
  • 出错的话,拼接出的键若没有声明,会在运行时才报错并点名该键(本来就有的运行时拒绝);改动可以直接撤回。
  • 无

What changes

  • TEXT_CALL, the one reader both save doors use (HookSchema and ActionSchema, through hookTextKeysAskedIn), now ends with the lookahead (?=\s*[,)]) after the closing quote: a key is literal only when its closing quote ends the argument, , or ) following after optional whitespace (a comment there is blanked to whitespace by the existing masking first).
  • Anything else after the quote (+, a member access) leaves the argument to the run-time refusal, which already names the key (undeclaredHookTextAtRun / undeclaredActionTextAtRun).
  • A template literal with a ${} hole needed no change: measured on origin/main, the masking already blanks it (its contents are not a snake_case key), so it was never read as literal. Pinned anyway.
  • Docblocks of TEXT_CALL, hookTextKeysAskedIn and the hook-texts section header say what "literal" means now. No export, schema shape, .describe() or error sentence changed.
  • patch changeset for @objectstack/spec.

Tests

New top-level describe in each existing harness file (packages/spec/src/data/hook-texts.test.ts, packages/spec/src/ui/action-texts.test.ts):

  • lit (hooks 7 shapes, actions 6): a lone argument, a first argument, whitespace before the comma, a line break before the close, a comment before the close (hook), a backtick with no hole, the optional call. Each is still refused at body.source with the unchanged sentence.
  • dark (hooks 7 shapes plus an inline handler, actions 5): 'k' + suffix, the same on the next line (hook), in the optional call, a backtick concatenation, 'k'.concat(suffix), a template hole (plus the optional call, hook). Each passes the save.
  • CONTROL (hook): a literal ask beside a computed one in the same body is still refused, exactly once.
Before the fix (origin/main reader, new pins), after, and ablation
  • Before (pins on the unfixed reader): Tests 10 failed | 68 passed (78), the 10 being every dark + / member-access case on both doors; the 4 template-hole dark cases and every lit case were already green.
  • After, at dc8f1ab: the two harness files plus hook.test.ts and action-refusals.test.ts: Test Files 4 passed (4), Tests 207 passed (207).
  • Ablation (committed fix, lookahead removed through scripts/ablation-replace.mjs; tests import src relatively, so no dist leg): anchor 1 -> 0, blob c25b9072dccd -> 8bd13ccf2097 → Tests 10 failed | 68 passed (78), direction red as predicted; restore blob == HEAD (c25b9072dccd) and git diff HEAD is empty.
  • pnpm --filter @objectstack/spec test at dc8f1ab: Test Files 879 passed | 1 skipped (880), Tests 28083 passed | 1 skipped | 1 todo (28085), lock VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec typecheck at dc8f1ab: VERDICT command-exit 0 (test layer: debt ledger held).

Acceptance notes

  • Declared narrowing of the local gate set: another build-heavy dev run shared this container, so per dispatch no spec build was run. 18 derived families ran locally, all exit 0 (changeset gates, comment-mask adoption and corpus, issue citations, affected docs, drift comment, nul bytes, doc authoring, spec docblock symbol anchors, spec parsed alias, keyed text bounds, cross-package test inputs, test source alias, adr anchors, closed ceremony text, watch hint literal). The dist-reading spec families (check:api-surface, check:docs, check:authorable-surface, …) and the remaining 67 are CI's. No export, schema or .describe() changed, so none of them should move.
  • Sibling readers, same shape, not changed here: the refusal code and reason readers in the same file (code: 'X', e.code = 'X', reason: 'x', e.reason = 'x') also stop at the closing quote. Measured at the hook save door: a body throwing { code: 'OVER' + suffix } with refusals declaring OVER_LIMIT is refused at body.source as code 'OVER', against the hookRefusalCodesThrownIn docblock ("a computed value — is left to the run-time refusal"). Their terminator set differs from a call argument's (, } for a property, ; / line end for an assignment), so it is not this PR's mechanical shape; reported to the seat for one family card.

Verification

Read first (by risk):

  1. packages/spec/src/data/hook-refusal-codes.ts: the TEXT_CALL hunk, the one behavioural line.
  2. packages/spec/src/data/hook-texts.test.ts: the new lit/dark describe.
  3. packages/spec/src/ui/action-texts.test.ts: the action twin.

Two-minute check: pnpm --filter @objectstack/spec exec vitest run src/data/hook-texts.test.ts src/ui/action-texts.test.ts shows every lit and dark case passing; delete (?=\s*[,)]) from TEXT_CALL and the same command shows 10 dark cases failing.


Generated by Claude Code

…ote ends the argument

A key built from a literal ('k' + suffix, 'k'.concat(suffix)) is a computed
key, left to the run-time refusal, as the hookTextKeysAskedIn docblock already
says. Pins lit and dark on the hook and action save doors.

Claude-Session: https://claude.ai/code/session_011y7As8yeqbR9TKANdPKRxt
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 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 — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2113393e6464a0287a5822d2c7ce8f4a3dd287f6 — the merge of head dc8f1abe60d3f9b070197b9f02a8ebf904401f95 into base 6a731859def47e2c8cefcab4d635a1c45c60c2c1, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2113393e6464a0287a5822d2c7ce8f4a3dd287f6 && git checkout 2113393e6464a0287a5822d2c7ce8f4a3dd287f6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a731859def47e2c8cefcab4d635a1c45c60c2c1 dc8f1abe60d3f9b070197b9f02a8ebf904401f95 && git checkout -B drift-repro 6a731859def47e2c8cefcab4d635a1c45c60c2c1 && git merge --no-ff dc8f1abe60d3f9b070197b9f02a8ebf904401f95

node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As88pUDUZHGdwFmizG4

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: dc8f1abe60d3f9b070197b9f02a8ebf904401f95
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts + none

Inputs read: card #35698 (body, triage 7026722554, claim 7097848971, dev report 7098411542; no ruling and no earlier record on the thread), PR #36666 (body, 4-file list, net diff against main), and the check-runs on this head. Remainder of the diff, the lane seat's ACCEPT at TIER_DEFAULT: .changeset/35698-text-key-literal-close.md, packages/spec/src/data/hook-texts.test.ts, packages/spec/src/ui/action-texts.test.ts. Code read outside the diff, not reviewed: packages/spec/src/data/hook.zod.ts (refuseUndeclaredLiteralTextKey), packages/spec/src/ui/action.zod.ts (refuseUndeclaredLiteralActionTextKey), packages/runtime/src/sandbox/hook-text.ts (buildDeclaredTextSurface), content/docs/automation/hooks.mdx.

① Derived judgments

  • Accept set, save doors of HookSchema and ActionSchema (the only two callers of hookTextKeysAskedIn, at hook.zod.ts:363 and action.zod.ts:2687): WIDER by exactly the bodies whose ctx.text( or ctx.text?.( first argument opens with a quoted snake_case key and continues past the closing quote with anything other than whitespace, a comment, , or ). Right: that set is the computed keys, and each was refused at save for a key the body never asks for.
  • Refusal set kept: every body where the quoted key is the whole first argument is refused as on main, same path (body.source or handler), same sentence (undeclaredHookTextKeyAtSave, undeclaredActionTextKeyAtSave untouched). Right.
  • Run-time half unchanged and real on both owners: buildDeclaredTextSurface throws owner.undeclaredAtRun(key, declared) for any key texts does not own, wired to undeclaredHookTextAtRun and undeclaredActionTextAtRun. A body newly accepted at save is therefore still refused, naming the built key, when the built key is undeclared. Right.
  • Public surface: no export added, removed or retyped; TEXT_CALL is module-private; no schema shape, .describe() or error sentence moved. The three docblock hunks are prose on a published file and agree with the code (④). Right. Spec property liveness, Lint · docs & code guards, Type Check · source gates, Flag docs affected by code changes all concluded success on this head.
  • Published prose elsewhere stays true without an edit: the texts .describe() on both schemas ("at save when the hook asks for it literally, otherwise at run time") and hooks.mdx ("if the hook names it literally in ctx.text('key') or ctx.text?.('key'), otherwise when the hook runs"). Right.

② Semver level

  • patch on @objectstack/spec, Metadata-protocol: none: right. A bug fix in a released package; nothing an author can write as metadata is added, removed or re-meant. Check Changeset concluded success.
  • Clause-②: no — holds. The diff does accept at save a body main refused, so the question is whether the published text had promised that refusal. It had not; it had promised the opposite, three times on main: the hookTextKeysAskedIn docblock ("A key that arrives any other way (a variable, a computed value) is left to the run-time refusal"), the texts .describe() on both schemas, and hooks.mdx. 'follow_up' + suffix is a computed value under every one of them. The only main text that could be read the other way is the private TEXT_CALL docblock, which shows the open prefix ctx.text('key' and says both shapes "ask for the key literally"; that sentence describes the two call shapes, not what may follow the quote, and it is not a published promise. The save now matches the published contract; the contract did not move. No (widening) arm is owed.
  • PR body and changeset carry the same two declaration lines.

③ Boundary flags

  • open_questions: empty.
  • Dev flag, out-of-scope finding (class b): CODE_PROPERTY, CODE_ASSIGNMENT, REASON_PROPERTY, REASON_ASSIGNMENT stop at the closing quote the same way. Confirmed on the head: all four end at the back-reference to their opening quote with nothing after it, against the hookRefusalCodesThrownIn docblock. Answered: correctly not folded in, since a property and an assignment end differently from a call argument; it is owed ONE family card from the seat, not a change on this head.
  • Dev flag, declared narrowing of the local gate set (67 of 85 derived families unrun locally): answered by the check-runs on this head, every one success or skipped, Governed Surface Queue Guard and Lint · PM dispatch-gates included.
  • Dev deviations (trailer amended before first push; PR body line order; attribution footer form): process notes, no effect on the contract; the lane seat's.
  • SQL push-down: not applicable. The diff is one regular expression and prose; no query, no id materialisation, no in-app join.

④ Design judgment

packages/spec/src/data/hook-refusal-codes.ts, against the card's ask, ruling 6913660232 parameter 7 as the section header cites it, and its two consumers.

No must-fix, no should-fix.

Attempts to break the lookahead (?=\s*[,)]):

  • A literal ask main refused that the head lets through: none found in valid JavaScript. After a first argument that is one string literal, the grammar allows only whitespace, a comment, , or ). Whitespace of every kind is \s, line and paragraph separators and the byte-order mark included. A block comment and a line comment are blanked by maskedSource in scan order with their line breaks kept, so 'key' /* don't */), 'key' // it's\n) and 'key'\n// note\n, params all still match; a quote inside such a comment cannot desynchronise the string scan because the comment is consumed whole first. A trailing comma ('key',) matches. 'key' as const and 'key'! are TypeScript, erased before Function.prototype.toString() and a syntax error in a js body.
  • A computed key still read as literal: none introduced. A comment that hides an operator is blanked and the operator after it is then seen ('key' /* x */ + suffix, 'key' // x\n + suffix, 'key'\n.concat(suffix), 'key'\n[0] all fail the lookahead). 'a' + 'b' keeps both literals under the masking exception and fails on +.
  • Masking against the docblock's claims: "a comment is blanked to whitespace first" is true, newlines survive and are whitespace. "a template with a ${} hole is never kept as a literal by the masking at all" is true for every hole: $ and { are outside both kept patterns, so the contents are blanked and the key pattern has no letter to start on. "Longer strings are blanked" keeps the quotes and blanks the contents, so the , or ) the lookahead needs can never come from inside a string. The lookahead is zero-width, so the global scan resumes at the closing quote as before and the first-seen order and the de-duplication of hookTextKeysAskedIn are unchanged.
  • Consumers: both save doors only iterate the returned keys and compare against Object.keys(texts); neither depends on match offsets, so the change reaches them as a smaller key list and nothing else.

Docblocks, sentence by sentence: the section header ("the quote closing the argument ... a key built from a literal included"), the TEXT_CALL block and the hookTextKeysAskedIn block each say what the expression does. The retained ctx.text!( paragraph is still true.

  • N1 (nit) — "literal" is syntactic, so a first argument that always evaluates to its literal but is not one token ('key' || fallback, 'key' ?? fallback, 'key' + '') moves from the save refusal to the run-time refusal. The docblock's own definition covers it ("a literal joined to something"), the run-time fault names the key, and no author writes these on purpose. Accepted deviation; no change asked.

Read, not a finding on this diff (same on main, unchanged by it): a literal ask written inside a template hole, a parenthesised key (('key')), and a literal fallback ctx.text(k || 'key') are not read at save and fall to the run-time refusal; and the masking has no notion of a regular-expression literal, so a quote inside one can shift the string scan. All four are in the direction of the run-time half, none is a false save refusal.

Implemented-by: claude/issue-35698-text-key-literal-close
Reviewed-by: session_011y7As88pUDUZHGdwFmizG4

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As88pUDUZHGdwFmizG4

维护者速读

  • 钩子和动作代码里用拼接方式拼出的文本键(如 'follow_up' + suffix),保存时不再被误当成写死的键拒掉;写死的键照旧在保存时检查。
  • 属于「钩子与动作的组织语言文本」这条线,纠正保存检查的一个误拒。
  • 出错的话,拼接出的未声明键会在运行时才报错并点名该键(原有的运行时拒绝);改动可直接撤回。
  • 无需你操作;L2 契约审核已过(PASS)。

席位核对

Verdict: ACCEPT at head dc8f1abe60d3f9b070197b9f02a8ebf904401f95 (read 2026-11-23T11:24Z).

  1. Shape. Open, draft, base main, first line Fixes #35698; the diff delivers the card's whole ask (the ,/) terminator rule plus lit and dark pins on both the hook and action doors), so Fixes is right. No closing keyword binds another card. mergeable_state: clean.
  2. Premise measured. origin/main 9348f02: TEXT_CALL ends at \k<tquote> with nothing after it (re-read). The dev's correction of the dispatch assumption (a template with a ${} hole was already blanked by the masking, so never read as literal) is stated in the PR body and the report; those cases are pinned, not "fixed". The run-time half that now decides a built key exists and names the key (undeclaredHookTextAtRun / undeclaredActionTextAtRun, consumed by packages/runtime/src/sandbox/hook-text.ts). Both save doors read the one reader (hook.zod.ts, action.zod.ts → hookTextKeysAskedIn → maskedSource then TEXT_CALL), so the masking runs before the lookahead as the docblock says.
  3. Gates at this head (check-runs). 58 success · 11 expected skip · 0 unexpected skip · 0 failed · 0 pending; Lint & Repo Gates and TypeScript Type Check both success (l1-face.mjs --pr 36666, clean on all 13 items). The dev's declared narrowing of local families (no spec build in a shared container) is covered by CI's run of every family at this head.
  4. Accepted deviations. Tests: positive control present — the 10 dark +/member-access pins were red on the unfixed reader and turn red again under ablation of the lookahead, restored to the head blob. Rejection pins assert the exact save sentence at body.source; these are schema safeParse refusals, not HTTP envelopes, so the ADR-0112 code/status check does not apply. Changeset read sentence by sentence against the diff: true, with one nit accepted as is — "A key built from a literal is refused when the hook or action runs" means "when it is undeclared" (the paragraph before sets that context); no follow-up card.
  5. Out of scope. The sibling code/reason readers (same family, different terminator set) are filed as hook and action refusals: the save door's code and reason readers stop at the closing quote, so code: 'OVER' + suffix is refused at save as code 'OVER' #36670 (finding, area:build), not fixed here: right, they are not this PR's mechanical shape. Skills-docs: not owed (Metadata-protocol: none, no narrowing arm).
  6. Landing. Changeset @objectstack/spec patch present; no content/docs/releases/ path; not governed (no governed path in the 4 files). Contract face: packages/spec/src/data/hook-refusal-codes.ts is the published-schema face, so an L2 at CONTRACT_REVIEW_TIER is owed whatever the Clause-②: line says. L2 record: PR fix(spec): a ctx.text key is literal at save only when its closing quote ends the argument #36666 comment 7099600018 — Served-tier: CONTRACT_REVIEW_TIER, head dc8f1abe60d3f9b070197b9f02a8ebf904401f95, Scope: equals the hits (hook-refusal-codes.ts), tier verified on the reviewer's transcript, PASS, no must-fix or should-fix; its nit N1 (a first argument such as 'key' || fallback now falls to the run-time refusal) is accepted as is. Land only while this head stays the head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8yeqbR9TKANdPKRxt

Landing · 2026-11-23T11:26Z · head dc8f1abe60d3f9b070197b9f02a8ebf904401f95

Reading Answer
check-governed-merges.mjs --pr 36666 NOT governed · 0 of 4 paths on the register · 121 changed lines ≤ 3000
landing-k.mjs --pr 36666 OK · K = 1 < 15 · no new locale pack · no shared book moved
check-runs at head 58 success · 11 expected skip · 0 failed · mergeable clean
records at head L1 ACCEPT 7099628446 · L2 PASS 7099600018 (CONTRACT_REVIEW_TIER)

State: ready + auto-merge. On MERGED, #35698 closes by Fixes and its pm:dispatched comes off.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 11:26
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 4fb7169 Nov 23, 2026
70 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35698-text-key-literal-close branch November 23, 2026 12:06
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…quote closes the value (objectstack-ai#38044)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao6KhaLUWiS7aqNWvg6hcE74)_

Fixes objectstack-ai#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`) on `origin/main`
3e8edf7: "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 objectstack-ai#36666 did
for the text-key reader (objectstack-ai#35698) on the same ground. Every literal
refused before is still refused, in the same words (the lit pins below).

## 维护者速读
- 搭建者在钩子或动作代码里用拼接方式拼出拒绝码或拒绝原因时,保存不再被误拒;直接写死的拒绝码和原因照旧在保存时检查,用户无其它感知变化。
- 属于钩子与动作「按声明的拒绝目录拒绝」这条线,替写拼接拒绝码的搭建者解决保存被误拒的问题,和已合并的文本键同类修复是一族。
- 出错的话,拼接出的码或原因若没有声明,会在运行时才报错并点名它(本来就有的运行时拒绝);改动可以直接撤回。
- 无

## What changes
- The four save-time readers in
`packages/spec/src/data/hook-refusal-codes.ts` (`CODE_PROPERTY`,
`CODE_ASSIGNMENT`, `REASON_PROPERTY`, `REASON_ASSIGNMENT`), which both
save doors use (`HookSchema` and `ActionSchema`, through
`hookRefusalCodesThrownIn` / `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.
- Anything else after the quote leaves the value to the run-time
refusal, which already names the code or reason
(`undeclaredHookRefusalAtRun`, `undeclaredHookRefusalReasonAtRun` and
the action twins).
- A reason under a computed code is no longer read either: the existing
rule reads a property reason only beside exactly one literal code, and a
computed code is no longer one.
- A template literal with a `${}` 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.
- Docblocks of the two lookaheads and of `hookRefusalCodesThrownIn` /
`hookRefusalReasonsThrownIn` say what "literal" means now. No export,
schema shape, `.describe()` or error sentence changed.
- `patch` changeset for `@objectstack/spec`.

## Tests
One new top-level `describe` in each existing harness file:
- `packages/spec/src/data/hook-refusals.test.ts`:
- **lit code** (13 shapes): property closed by `}`, by `,`, with a line
break or a comment before the close, a backtick with no hole, inside
`Object.assign`; assignment closed by `;`, a line end, a comment and a
line end, `,`, `}`, `)`, the source end. Each is still refused at
`body.source` with the unchanged sentence.
- **dark code** (9 shapes plus an inline handler): property `+`, `+` on
the next line, backtick `+`, `.concat`, template hole; assignment `+`,
`+` on the next line, `.concat` on the next line, backtick `+`. Each
passes the save, and the reader returns nothing.
- **lit reason** (5) / **dark reason** (5): the same split for reasons,
a listed reason (`reasons: [{ reason }]`) included.
- **CONTROL**: a literal code beside a computed one in the same body is
still refused, exactly once.
- `packages/spec/src/ui/action-refusals.test.ts`: the action twin, lit
code 5, dark code 4, lit reason 2, dark reason 2.

<details><summary>Before the fix, after, and ablation</summary>

- Before (new pins on the `origin/main` 3e8edf7 reader, file restored
tree-only): `Failed Tests 20`, all dark cases except the template hole
(already blanked by the masking); every lit case green.
- After, at 291adbd: the two harness files `Tests 195 passed (195)`;
together with `hook.test.ts`, `hook-texts.test.ts`,
`action-texts.test.ts` before the new pins, `Tests 326 passed (326)`.
- Ablation through `scripts/ablation-replace.mjs` on the committed fix
(tests import `src` relatively, so no dist leg); each restore `blob ==
HEAD (9afc30e) and git diff HEAD is empty`:
- `REASON_PROPERTY` lookahead removed: `Tests 4 failed | 191 passed
(195)`, the 4 property-reason dark pins.
- `REASON_ASSIGNMENT` lookahead removed: `3 failed`, the
assignment-reason dark pins.
- `CODE_PROPERTY` lookahead removed: `7 failed`, the property-code dark
pins and the handler pin.
- `CODE_ASSIGNMENT` lookahead removed: `6 failed`, the assignment-code
dark pins.
- Line-end branch made non-continuing (`[ \t]*\r?\n` only): `4 failed`,
the next-line dark pins.
- Line-end branch removed: `4 failed`, the line-end lit pins (hook code
×2, action code, hook reason).
- `pnpm --filter @objectstack/spec build` exit 0; `pnpm --filter
@objectstack/spec test` at 291adbd: `Test Files 909 passed (909)`,
`Tests 28797 passed | 1 todo (28798)`; `typecheck` exit 0;
`check:generated` exit 0 ("All 14 generated artifacts are up to date").
</details>

## Acceptance notes
- Derived local gate set at 291adbd: `dispatch-gates --ran` reconciles
85 derived, 83 run (all exit 0), 2 NOT MEASURED, 0 unrun.
`@objectstack/formula`, `@objectstack/lint` and `@objectstack/objectql`
were built first so `check:doc-formula-expressions` and
`check:lean-entry-closure` could measure (both exit 0). `eslint` on the
three changed `.ts` files exit 0.
- Declared narrowing, the 2 NOT MEASURED (exit 3, prerequisite not met),
both CI's: `check-plugin-teardown-shape.mjs --self-test` reads a fixture
pinned to a commit this shallow clone cannot reach;
`check:dual-build-cjs-loads` needs every package's `dist/` (a full `pnpm
build`), which this card's diff does not move.
- The assignment terminators add `,` 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.
- Out of scope, noted not filed: none found.

## Verification
Read first (by risk):
1. `packages/spec/src/data/hook-refusal-codes.ts`: `PROPERTY_VALUE_END`
and `ASSIGNMENT_VALUE_END`, and the four readers that append them.
2. `packages/spec/src/data/hook-refusals.test.ts`: the new
lit/dark/CONTROL describe at the end.
3. `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.ts` shows 195
passing; delete `+ PROPERTY_VALUE_END` from `CODE_PROPERTY` and the same
command shows 7 dark cases failing.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibykc1XS5J4B4J16dLb)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:data protocol:ui size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants