Skip to content

fix(spec): the save door reads ctx.text?.( as a literal text-key ask - #35686

Merged
objectstack-fleet[bot] merged 22 commits into
mainfrom
claude/project-thread-lryneu
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 22 commits into
mainfrom
claude/project-thread-lryneu

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Requested by Sales · project thread
Fixes #35512
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/objectstack-data/references/data-hooks.md and skills/objectstack-ui/rules/actions.md already teach "an undeclared key is refused at save when asked for literally, else at run" without naming a call shape; this diff makes that sentence hold for the optional-call shape, so nothing new is taught. The one hand-written page that names the call shape, content/docs/automation/hooks.mdx (~499), now names ctx.text?.('key') beside ctx.text('key')

维护者速读

  • 用户无感的作者面变化:写钩子或脚本动作的作者,用可选调用 ctx.text?.( 的写法去取一句没声明的文案时,保存时就被拒,以前要等运行时才报错。
  • 属于"组织语言文案"那组工作:兑现钩子与动作文案字段已经写明的承诺,即按字面取的未声明文案在保存时就被拒。
  • 若出错,受影响的是用 ctx.text?.( 写法取了未声明文案的钩子或动作,保存会被拒;声明那句文案即可通过,本改动可直接撤回。
  • 无

What changes

  • TEXT_CALL in packages/spec/src/data/hook-refusal-codes.ts, the one literal key reader behind both save doors (HookSchema at hook.zod.ts and ActionSchema at action.zod.ts, through hookTextKeysAskedIn), now also reads ctx.text?.('k'), awaited or not. So an undeclared key asked for in that shape is refused at save with the existing undeclaredHookTextKeyAtSave / undeclaredActionTextKeyAtSave sentence, at body.source (or handler for an in-process hook handler). The masking of comments and longer strings and the snake_case key group are unchanged.
  • Shape decisions: whitespace or a line break around ?. is read (ctx.text ?. ('k')), matching the reader's existing whitespace tolerance around the dot. The card's second shape, non-null ctx.text!('k'), is deliberately NOT read (patch round 1, L2 S1 on 7025732554): it is TypeScript with no JavaScript form. A handler's ! is erased before the save reads Function.prototype.toString(), so main already reads it as the plain call; in a js body it is a syntax error (an action is refused as action-body-does-not-compile, a hook body never runs). So the card's !( ask is moot, and a pin documents why. ctx?.text( and ctx!.text( are left out: ctx is the bound parameter and is never optional in the type.
  • The refusal sentence's echo stays (`ctx.text('k')`). It names the call, not the spelling the author used, and it reads correctly for both read shapes (the plain call and ?.). Its bytes, which tests pin, are unchanged.
  • Rider (accepted L1 nit on PR feat(spec): the Studio hook form offers texts, and HookContext declares ctx.text #35510): the TSDoc that describes the literal-only save check now names the ?.( shape. That covers HookSchema.texts, HookContext.text, ActionSchema.texts, the two internal docblocks beside the doors, and the header comments above TEXT_CALL. .describe() strings are unchanged.
  • ADR-0087: a registered semantic entry, hook-action-text-key-optional-call-refused. The narrowed kind refuses no-migration-prescription, and there is no mechanical rewrite.
  • Changeset: @objectstack/spec minor (the kind is narrowed), with a BREAKING FROM/TO section and the fix.

Tests

  • Pins in packages/spec/src/data/hook-texts.test.ts and packages/spec/src/ui/action-texts.test.ts, one per shape (ctx.text?.(, await ctx.text?.() for each door. A lit pin checks that an undeclared key is refused at body.source with the exact sentence. A dark pin checks that a declared key, and a computed key in that shape, still pass save. The hook file also has a reader pin for whitespace and a line break around ?., a handler-path pin (an inline handler asking ctx.text?.('undeclared') is refused at handler, the strict-TypeScript case; an action has no handler path), and a pin that ctx.text!('k') is not read, with the reason.
  • On head 0acd17d both files are green (51/51).
  • Ablation on head 0acd17d: replacing the optional-call arm text(?:\s*\?\.)?\s*\( with the old text\s*\( (one occurrence) turned 8 of the 51 tests red. The restore was proved by an empty git diff HEAD. (The earlier 12-red-first and 13-red readings were taken on 269566b, before patch round 1 removed the !( arm.)
  • pnpm --filter @objectstack/spec test: 859 files / 27461 tests passed. pnpm --filter @objectstack/spec typecheck: exit 0.

Acceptance notes

  • ctx?.text( and ctx!.text( are still not read at save (see above). If one of them is used with an undeclared key, the runtime refuses it when the code runs.
  • A real producer of the new shape already exists in this tree with a declared key: packages/spec/src/data/hook-context-text.test.ts:43 (ctx.text?.('follow_up_subject', …)), and it stays green. The runtime's own ctx.text!(String(key), …) in packages/runtime/src/sandbox/quickjs-runner.ts is host TypeScript, never a saved body. The break is the hook half only: ActionSchema.texts is unreleased (pending changeset), so the action half ships already narrowed (L2 N1).

Verification

Two-minute check: pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/data/hook-texts.test.ts src/ui/action-texts.test.ts, including the two ctx.text?.( shape rows per door and the handler pin.

Read first, by risk:

  1. packages/spec/src/data/hook-refusal-codes.ts: the TEXT_CALL regex hunk (the (?:\s*\?\.)? arm) and its header comment on why ! is not read.
  2. .changeset/35512-text-call-shapes.md: the declarations and the BREAKING section.
  3. packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts.

All the local readings below were taken at head 269566b8.

Local gates (derived list, 96 commands)
  • pnpm --filter @objectstack/spec build: VERDICT command-exit 0. check:generated: all 14 artifacts are up to date (exit 0).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 96 commands, and I ran all 96. On the first pass, 86 exited 0.
  • Six spec gates exited 3 (PREREQUISITE NOT MET: dist predated a later TSDoc rewrap). After a spec rebuild they exited 0: check:api-surface, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any (and check:docs / check:authorable-surface again).
  • Four gates were missing workspace builds on the first pass and exited 0 once the dogfood/cli closure was built: the cli migrate-meta-engine-guidance test (3/3), check:doc-formula-expressions, check:lean-entry-closure and check:dual-build-cjs-loads.
  • NOT MEASURED: check-plugin-teardown-shape.mjs --self-test, because the shallow clone cannot reach its battery. CI runs it.
  • Changeset gates, each exit 0: check-adr-0087-registration (registered hook-action-text-key-optional-call-refused), check-changeset-no-major and check-empty-changeset.
  • --ran reconciliation: 96 derived, 96 run, 0 UNRUN.
  • overlap-check --branch=HEAD: VERDICT clean exit 0, against origin/main 03865ae.
Dogfood battery (owed by the narrowing arm)
  • I built the @objectstack/dogfood^... closure under the lock (exit 0), then ran pnpm --filter @objectstack/dogfood test at 269566b8.
  • Result: VERDICT command-exit 0, Test Files 482 passed / 3 skipped (485), Tests 4092 passed / 68 skipped (4160). No failures.

Generated by Claude Code

The hook form gains a key-only record row for HookSchema.texts beside
refusals, with message and params, and the reconciliation ledger drops
its hook/texts omit row.

Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
Co-authored-by: Claude <noreply@anthropic.com>
A typed hook handler can call ctx.text(key, params) against HookContext:
the member is declared the way api and notice are (z.unknown at parse, a
static cast for the type), with the signature the runtime binds, and the
named HookTextReader type beside HookNoticeSetter.

Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
Co-authored-by: Claude <noreply@anthropic.com>
…ms packs

en regenerated from the form source; the ten translated packs carry
hand-written translations following each pack's refusals wording.

Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
Co-authored-by: Claude <noreply@anthropic.com>
The action form gains a texts row beside the script body: a key-only
record keyed by the snake_case key the body asks for with ctx.text,
each entry editing message and params, gated like the body. The
action/texts omit row is retired from the reconciliation ledger.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
… the eleven metadata-forms packs

en regenerated from the form; the ten translated locales hand-written
from each pack's hook texts wording. The action enumerated-children pin
moves 7 to 9 and the translated row-label pin 744 to 747.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
The action form gains a refusals row between the script body and texts:
the hook form's key-only record (message, status, reasons, params), the
entry the one factory builds for both, gated like the body. The
action/refusals omit row is retired from the reconciliation ledger.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
… in the eleven metadata-forms packs

en regenerated from the form; the ten translated locales reuse each
pack's hook refusals entries for the five entry fields (the en sources
are identical) and hand-write the top row. The action enumerated-children
pin moves 9 to 14 and the translated row-label pin 747 to 753. Adds the
changeset for both rows.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
…s and refusals gates

The two new action form rows are each gated on data.type == 'script', so
the shipped-predicate pin moves 91 to 93 and the literal-comparison pin
65 to 67 (on main as of 5c5b54d, merged in the previous commit).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
…-lryneu

# Conflicts:
#	packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts
…t?.( and ctx.text!(

Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
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 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 5 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/hook-bodies.mdx (via HookContextSchema (symbol, a top-level const))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via HookContextSchema (symbol, a top-level const), HookSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-7.mdx (via HookSchema (symbol, a top-level const))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 174 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 c03a8a342805186e04e05d9903f7f1913b43dabe → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 409d4682368db65d9a588cb894e719637b80e00b — the merge of head 0acd17d22771e033de2fe8233b64433119c187ff into base c03a8a342805186e04e05d9903f7f1913b43dabe, 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 409d4682368db65d9a588cb894e719637b80e00b && git checkout 409d4682368db65d9a588cb894e719637b80e00b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c03a8a342805186e04e05d9903f7f1913b43dabe 0acd17d22771e033de2fe8233b64433119c187ff && git checkout -B drift-repro c03a8a342805186e04e05d9903f7f1913b43dabe && git merge --no-ff 0acd17d22771e033de2fe8233b64433119c187ff

node scripts/docs-audit/affected-docs.mjs --json c03a8a342805186e04e05d9903f7f1913b43dabe

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs c03a8a342805186e04e05d9903f7f1913b43dabe → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Final green head for review: 269566b8c479ac1c9192593eee89ef8904a88bdd (2026-11-19T23:42Z).

Every check-run on this head is success or an expected skip (58 success, 11 skipped). No patch round: this is the head the PR opened on.

Owed: L1 (thread L1-a) and L2 at CONTRACT_REVIEW_TIER (non-test packages/spec/src paths: data/hook-refusal-codes.ts, data/hook.zod.ts, ui/action.zod.ts, migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts). Declared Clause-②: no (narrowing) (the claim wrote yes (narrowing); the dev measured that yes is the widening arm and this diff only narrows) and Metadata-protocol: narrowed, spec minor with an ADR-0087 semantic entry; the dogfood battery ran green.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:写钩子或脚本动作的作者,如果用 ctx.text?.('键') 或 ctx.text!('键') 这两种写法去取一句没有声明的文案,现在保存时就会被拒,提示与普通写法 ctx.text('键') 相同;以前要等到运行时才报错。
  • 出错会怎样:最坏的情况是某个钩子或动作被拒存。但被拒的这些,取的键本来在运行时也会失败,声明那句文案就能通过。
  • 要你做什么:不需要你做任何事。这单属于收窄,还要一次 L2 合同审核(正在跑),PASS 后由卡线程或席位落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head 269566b8c479ac1c9192593eee89ef8904a88bdd · 2026-11-19T23:44Z

  • Shape — draft, base main, 7 files, +120/−11. Merge-base c0716ed4. The branch carries feat(spec, platform-objects): Studio action form rows for texts and refusals #35636's history, which was squashed on main. The three-dot diff and GitHub's file list are the same 7 files, and the last main merge 7a158d4b shows 0 @@@ hunks. check-governed-merges.mjs --pr 35686: NOT governed, 0 of 7 paths.
    • Fixes #35512.
    • Clause-②: no (narrowing) with Metadata-protocol: narrowed. That is the canonical breaking spelling, and the claim's yes (narrowing) (the widening-plus-narrowing arm) was wrong for a diff that only narrows. The deviation is accepted.
    • The Skills-docs: none reason holds. Both skills teach the rule without naming a call shape, so they become true for more shapes and say nothing false.
    • @objectstack/spec minor, with FROM/TO.
  • The reader — TEXT_CALL gains (?:\s*\?\.|[ \t]*!)? between text and \s*\(. I traced the edges:
    • ctx.text?.('k') matches, and so does ctx.text ?. ('k'). A ?. on the next line is still an optional call in JS and is read, which is correct.
    • ctx.text!('k') and ctx.text !('k') match.
    • ctx.text\n!('k') does not match, because the ! takes only blanks, so ASI ends the statement. Pinned.
    • ctx.text !== x does not match: \s*\( fails.
    • The leading (?<![\w$.]) and the key and quote groups are unchanged. Comments and long strings are still blanked first.
    • It stays one reader behind both doors (hookTextKeysAskedIn, used by HookSchema and ActionSchema), so the hook and the action cannot drift.
    • ctx?.text( and ctx!.text( are left out, as the acceptance notes declare. They stay judged at run time, which is the safe side.
  • Why the narrowing is safe — the key it now refuses is one the runtime already refused on every run, with a fault naming the hook or action and the key. A declared key passes in every shape (CONTROL, per shape), and so does a computed key.
    • Observation, not blocking: a js body cannot hold ! (it is TypeScript-only syntax), so that arm can only bite TypeScript source. It is harmless either way, because it refuses only a key the run would refuse.
  • ADR-0087 — the new entry hook-action-text-key-optional-call-refused has a surface, replacement, reason and acceptance criteria. There is no tombstone and no D2 conversion, because which sentence was meant is a judgement. It is registered through the changeset marker.
  • Pins
    • hook-texts.test.ts and action-texts.test.ts each cover the four shapes (plain or await, ?. or !). Each refusal carries the existing sentence (undeclaredHookTextKeyAtSave / undeclaredActionTextKeyAtSave) at body.source, and each shape has a declared-plus-computed CONTROL. The hook file also has the whitespace and next-line-! case.
    • The pins went red first (12 failed), and the ablation turns 13 red. The dogfood battery is green at this head (dev report 7024765229).
    • Not re-measured here: no node_modules.
  • Docs — content/docs/automation/hooks.mdx:500 「names it literally in ctx.text('key')」 is incomplete but not wrong. My call: nothing owed. It can ride a later docs touch.
  • Gates — on this head: 58 success, 11 skipped, 0 failure. Mergeable clean.
  • Landing terms — not governed, but L2 owed (CONTRACT_REVIEW_TIER) for the narrowing and the new ADR-0087 entry. It is running in an isolated reviewer. The seat or card thread lands this head after a ## Contract review PASS on it, with all checks green. A new push needs a fresh L1 unless it is a clean main merge.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 269566b8c479ac1c9192593eee89ef8904a88bdd
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts + packages/spec/src/data/hook-texts.test.ts, packages/spec/src/ui/action-texts.test.ts
Security-touching: no

① Derived judgments

Read for this record: card #35512 (body and all 5 comments), PR #35686 (body, its 2 comments, the 7 files, the net diff from merge base c0716ed4) and the 69 check-runs on the head. The head did not move during the review.

  1. HookSchema accept set narrows: right. A hook that declares texts and whose code asks ctx.text?.('k') for a key texts does not declare is now refused, at body.source for a js body and at handler for an inline function (the door reads the function's own compiled source, hook.zod.ts:276-292). Hook texts shipped in 18.6.0 (packages/spec/CHANGELOG.md:504), so this narrows a published accept set. It is the refusal the HookSchema.texts TSDoc already stated and the runtime already made when the call ran.
  2. ActionSchema accept set narrows the same way at body.source: right, and no break against any release. ActionSchema.texts is itself unreleased (.changeset/34374-action-texts-org-locale.md is still pending), so the action half ships already narrowed.
  3. ctx.text!('k') with an undeclared key in a js body is now refused on both doors: right as a refusal, wrong as described. No document that could run is lost. The description is S1 in ④.
  4. Nothing widens. TEXT_CALL feeds only hookTextKeysAskedIn, and its two callers (hook.zod.ts:362, action.zod.ts:2683) turn each undeclared key into an issue, so reading more shapes can only add refusals. Nothing refused on main is accepted here.
  5. Public surface: unchanged. No export, type, key, enum member or error code is added or removed. hookTextKeysAskedIn keeps its signature and returns more keys for the same source; the two doors are its only callers in the tree.
  6. Sentences and JSON Schema: unchanged. The two save-refusal sentences keep their bytes, and no .describe() string moves.
  7. The step-18 ledger gains one entry. It records the narrowing; it is not an accept set.

② Semver level

  • Level. @objectstack/spec: minor matches. A narrowed kind takes at least minor on a package the diff moves (AGENTS.md, Post-Task Checklist step 3), and spec is the only package moved. No check-run on the head is red, Check Changeset included.
  • Kind. narrowed matches: a document an author could save is refused. The hook half alone carries it (judgment 1).
  • Clause ② line. no (narrowing), as the PR body and the changeset declare, is what the repo's definition requires. The value answers one question: does the diff widen an accept set or enlarge the public surface (scripts/pm/clause2-line.mjs:90, .claude/skills/pm-dispatch/references/execution-duties.md:72). This diff does neither (judgments 4 and 5). The same file reserves yes (narrowing) for "a diff that widens one surface and narrows another" (:113) and defines no (narrowing) as "NOT a widening, but breaking" (:115), and execution-duties.md:110 says a card that narrows a published accept set is no. So the claim's yes (narrowing) (comment 7023306761, and the released claim 7022933757 before it) declared a widening the card never had. os-dev.md:276 tells the dev to copy the claim's two lines unchanged; the dev departed from it and said so in the report, and the departure is correct. The seat should correct the claim line on the card so the card and the PR agree. That is a card edit and does not move the head.
  • ADR-0087. Matches what a declared narrowing owes. The changeset carries one marker, registered hook-action-text-key-optional-call-refused. The id is new in this diff, and its file name is the id under step 18, the current protocol major. no-migration-prescription is closed to a narrowed changeset, so a new entry is the route. No tombstone is owed (no key leaves) and no D2 conversion (which key the author meant is a judgement).
  • BREAKING section. The banner, FROM, TO and the one-line fix are all present, and both declaration lines sit at line start in the changeset body. Its content is right for ?.( and wrong for !( (S1). Its action clause describes a break no released version can meet (N1).
  • Title. It carries no !. Nothing requires one: the banner, the arm and the kind each carry the breaking signal.

③ Boundary flags

  • open_questions is empty in the report. Nothing to answer.
  • Deviation, the clause line: answered in ②.
  • Deviation, a title without !: accepted (②).
  • Deviation, the branch recreated by a plain push after feat(spec, platform-objects): Studio action form rows for texts and refusals #35636 merged: no effect on the contract. The net diff from the merge base is exactly the 7 files.
  • Out of scope, ctx?.text( and ctx!.text( stay run-time refusals: accepted. The TSDoc names the spellings the save reads and sends every other key to run time, so the text is exact about them. No card is owed until a producer is measured.
  • The PR body's skills-and-docs line says none. Its reason holds for the two skill files it names: skills/objectstack-data/references/data-hooks.md:875 and skills/objectstack-ui/rules/actions.md:151 name no call shape. It is silent on content/docs/automation/hooks.mdx:499-501, which does name one: a key is refused at save "if the hook names it literally in ctx.text('key'), otherwise when the hook runs". After this diff that sentence is incomplete, not wrong. Its instruction (declare the key) and its example still hold, but "otherwise when the hook runs" now misplaces ctx.text?.('key'), which is refused at save. It errs toward promising less than the door does. One sentence there should name the optional call, or name no spelling, as the skills do. It should not teach ctx.text!( for a js body (S1). That is a prose edit or a follow-up card, and the line should then read follow-up owed with that file. content/docs/ui/actions.mdx:228-231 names no shape and holds.
  • Dogfood. On a pull request neither dogfood leg runs: both check-runs are skipped and the Dogfood Regression Gate roll-up counts zero legs (.github/workflows/ci.yml:2751). The battery this narrowing owes has one witness on this head, the dev's local run in the report (482 files, 4092 tests, none red). The queue build runs the shards before landing.
  • Check-runs on the head: 58 success, 11 skipped, none red.
  • main is at 03865ae9, 12 commits past the merge base. None touches a file of this diff.
  • SQL push-down: the diff adds no data access.
  • Author: the PR was opened by objectstack-fleet[bot], the relay. There is no other login to name.

④ Design judgment

No must-fix.

S1 (should-fix) — the ctx.text!( shape is taught as a legal call in a js body, and its FROM describes something that never happened.

  • What the save can see. A hook's save reads a js body's source, else an inline handler's Function.prototype.toString() (hook.zod.ts:276-292). An action's save reads body.source alone (action.zod.ts:2666-2686). A non-null ! is TypeScript and has no JavaScript form. Whatever turns a handler into a function (esbuild under the CLI loader and vitest, tsc, native type stripping) erases it first, so a handler's ctx.text!('k') reaches the door as the plain call, which main already refuses. In a js body, ctx.text!('k') on one line is a syntax error. The sandbox evaluates the source as written, inside an async arrow function (packages/runtime/src/sandbox/quickjs-runner.ts:432), so the body throws before its first statement, whatever texts declares.
  • What follows. The ! arm of TEXT_CALL matches one input only: TypeScript pasted into a js body. Refusing that earlier is harmless. Four sentences around it are not accurate:
    • Entry replacement, line 18: "ctx.text?.(KEY) and ctx.text!(KEY) stay legal for a declared key." On body.source, the first surface the entry names, ctx.text!(KEY) does not compile. An action that carries it is refused at the authoring doors as action-body-does-not-compile (the step-18 entry action-body-does-not-compile-refused). A hook that carries it saves clean, because the hook parse check reads the body as TypeScript and only warns (packages/lint/src/validate-hook-body-writes.ts:670), and then throws on every run.
    • Entry reason, lines 22-23, and the changeset FROM: "the runtime refused the key only when the code ran, as a fault naming the hook or action and the key." That is true for ?.(. For !( the runtime never reached the key.
    • The changeset's fix line: "A declared key is accepted in every shape."
    • The ActionSchema.texts TSDoc (action.zod.ts:1575-1577) lists ctx.text!('key') among the ways the body asks, on a schema whose only code is a js body.
  • Why it matters. The entry is the prescription os migrate meta and the upgrade guide print, and the TSDoc is what an author, often an AI, reads before writing a body. A hook body written to those sentences passes save and throws on every run.
  • Fix, one of two. Keep the arm and say where a ! can occur: it is TypeScript, a handler's is erased before the save reads it, and one in body.source must be removed, not kept. That touches the entry's four fields, the changeset and the TSDoc sites. Or drop the ! arm and its mentions and keep ?.( alone. Either way, add one pin on the handler path: an inline handler asking ctx.text?.('undeclared'), refused at handler. That is the strict-TypeScript scenario the card is accepted against, and the new pins drive body.source only.

Each file, beyond S1:

  • hook-refusal-codes.ts: the ?. arm holds. It reads a legal JavaScript optional call, with whitespace or a line break on either side, on both inputs the doors read, behind the same mask for comments and longer strings. The ! arm is held to one line, which matches JavaScript (a ! on the next line starts a new statement) and TypeScript alike. The pattern has no nested quantifier and adds no backtracking cost. It introduces no false reading of its own; the one it inherits is N2.
  • hook.zod.ts: both TSDoc hunks agree with the reader. The HookSchema.texts sentence is true for all three spellings as an author writes them, the ! one through erasure in a handler. No .describe() string is touched.
  • action.zod.ts: TSDoc only. See S1.
  • The entry: all four required fields are present, the file name is derived from the id, and it carries no relevantWhen, so it is always listed, which is the safe default. Its content: S1 and N1.
  • The two test files: each shape has a lit pin and a dark pin on body.source for both doors, and the hook file adds the whitespace and next-line controls. They agree with the reader. The !( pins hand a js body a line that is not JavaScript, which is the S1 case.

Nits:

  • N1 (nit) — the BREAKING banner and the entry's surface name the action half as a break. ActionSchema.texts is unreleased, so no released document is refused there. Harmless; reword with S1 or leave.
  • N2 (nit) — inherited, in the unchanged tail of TEXT_CALL: the reader stops at the closing quote, so ctx.text?.('follow_up' + x) reads follow_up as a literal key. main does the same for the plain call, and this diff carries it to two more shapes. A follow-up card, not a fix here.
  • N3 (nit) — two internal docblocks still name the plain call alone: refuseUndeclaredLiteralTextKey (hook.zod.ts:338-339) and refuseUndeclaredLiteralActionTextKey (action.zod.ts:2661-2662).
  • N4 (nit) — accepted as they are: the refusal sentence echoes ctx.text('k') whichever spelling the author wrote (the key is the anchor and the bytes are pinned), and the entry spells calls with their opening parenthesis against the entries README's advice (no live ratchet matches, and here the call shape is the surface).

Implemented-by: claude/project-thread-lryneu
Reviewed-by: session_01L6bhgX6mQpVU8yUysiRAFC — rendered by an isolated sub-agent of the card thread. A sub-agent shares its parent's session id, and the claim (7023306761) signs the implementing thread with this same id, so the pair does not differ by session id. Independence rests on the isolation: this agent drafted none of the diff and judged it from the card, the PR, the check-runs and the tree.

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

The brief this card thread handed its isolated CONTRACT_REVIEW_TIER sub-agent for the record posted just above, beside it for the seat to read before it adopts the record. Delivery deviations: the sub-agent wrote the record to a file and this thread posted it with --tier-evidence; the record's independence line names the shared session. Beyond the brief, the thread asked the reviewer to judge (a) Clause-②: no (narrowing) vs the claim's yes (narrowing), (b) whether the ADR-0087 entry, minor and BREAKING match a narrowing of a save accept set, and to read docs teaching the literal save refusal — each asked without an answer.

Contract review brief — PR #35686 @ 269566b8c479ac1c9192593eee89ef8904a88bdd (card #35512)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35512: its body and EVERY comment (rulings and earlier records included)
· PR #35686: its body, its file list, and the net diff against main at 269566b8c479ac1c9192593eee89ef8904a88bdd
· the check-runs on 269566b8c479ac1c9192593eee89ef8904a88bdd: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — if a hits path is under skills/** or ui/skills/** and the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/2c84582e-bf62-5756-b5c5-2410a75aecc8/scratchpad/pr-35686/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.


Generated by Claude Code

…all; docs name ctx.text?.(

Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:比上一版少了一种写法。只有 ctx.text?.('键') 这种可选调用在保存时会被读出来,没声明的键当场拒存。ctx.text!('键') 不再单独判断:它只是 TypeScript 写法,编译后 ! 会被去掉,变成普通调用,本来就会被读到;写在 js 正文里则根本跑不起来。动作的文案功能还没正式发布,所以这次只对钩子作者算破坏性变更。
  • 出错会怎样:和上一版一样,最坏的情况是某个钩子拒存,而这类钩子本来在运行时就会失败。
  • 要你做什么:不需要你做任何事。还差一次 L2 增量审核(正在跑),另外 PR 标题要去掉 ctx.text!(,之后由卡线程落地。

席位核对 — delta ACCEPT (L1-a) · repo:objectstack#1 · head 0acd17d22771e033de2fe8233b64433119c187ff · 2026-11-20T00:52Z

  • Delta — one commit, 0acd17d2, on 269566b8 (my ACCEPT 7025435232). 8 files, +71/−58. No main merge. It answers L2 S1, N1 and N3 (record 7025732554).

  • S1, the non-null arm is dropped. TEXT_CALL is now ctx\s*\.\s*text(?:\s*\?\.)?\s*\(. The [ \t]*! arm and the same-line rule that came with it are gone. The reason is sound on both paths:

    • A handler reaches the save as Function.prototype.toString() of compiled JavaScript, where a non-null ! is erased. It arrives as ctx.text('k'), which main already reads.
    • In a js body, ctx.text!('k') on one line is a JavaScript syntax error. A line break before the ! ends the statement.

    Nothing reachable is lost. The pins match: a negative pin (ctx.text!('a_key') is not read, with the reason), the ! rows removed from both SHAPES tables, whitespace and a line break around ?. read, and a new handler-path pin. In that pin an inline handler awaits ctx.text?.('follow_up_title'), and it is refused at handler with undeclaredHookTextKeyAtSave(..., 'handler'). That is the strict-TypeScript case the card was about. In the tree, the only ctx.text!( left outside tests and TSDoc is packages/runtime/src/sandbox/quickjs-runner.ts:1088, which is host TypeScript and never a saved body.

  • N1, the BREAKING scope is the hook half only. I checked this against main:

    • ActionSchema.texts is still pending in .changeset/34374-action-texts-org-locale.md (Clause-②: yes (widening: a new optional authorable key ActionSchema.texts …)), and packages/spec/CHANGELOG.md on main has no action-texts entry.
    • Hook texts and ctx.text are released (CHANGELOG line ~510).

    So the changeset's "no released action is affected" holds. The ADR-0087 entry's surface, reason and acceptanceCriteria now name the hook half, and say the action half ships already narrowed. Its id and filename keep hook-action-…. That is fine: an id is a key, and renaming it would only churn the registry. The FROM, TO and Fix lines match the code sentence by sentence, including "at body.source for a js body or at handler for an in-process handler".

  • N3 and the docs. The TSDoc on HookSchema.texts, HookContext.text, ActionSchema.texts, refuseUndeclaredLiteralTextKey and refuseUndeclaredLiteralActionTextKey now names the two shapes read. hooks.mdx ~499 now names ctx.text?.('key'), which closes the gap I noted at 7025435232. Two TSDoc lines in hook.zod.ts (~821) and action.zod.ts (~1577) now run past the column the rest of those blocks wrap at. That is cosmetic, and nothing is owed.

  • Should-fix before landing (prose, no head move): the PR title still reads "the save door reads ctx.text?.( and ctx.text!( as literal text-key asks". It should drop "and ctx.text!(" to match the body and the changeset, because the squash subject is what main keeps. The PR body is already right: line 20 states the !( ask is moot, with the reason.

  • Gates — at reading time on this head: 61 success, 12 skipped, 0 failure, and Check Changeset in progress (a re-run after the body edit). This ACCEPT holds when that run finishes green.

  • Landing terms — unchanged: narrowing, Clause-②: no (narrowing). A same-head ## Contract review delta PASS is owed from the original reviewer, who is running it now. The card thread or the seat lands this head once that PASS is in and every check is green. A new push needs a fresh L1 unless it is a clean main merge.


Generated by Claude Code

@objectstack-fleet objectstack-fleet Bot changed the title fix(spec): the save door reads ctx.text?.( and ctx.text!( as literal text-key asks fix(spec): the save door reads ctx.text?.( as a literal text-key ask Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0acd17d22771e033de2fe8233b64433119c187ff
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts + packages/spec/src/data/hook-texts.test.ts, packages/spec/src/ui/action-texts.test.ts
Security-touching: no

① Derived judgments

This is a delta record (record 7025732554: PASS on 269566b8, should-fix S1, nits N1 to N4). It judges head 0acd17d2, one commit on 269566b8. Read for it: the diff between the two heads, the net diff from merge base c0716ed4 (8 files), the PR body as edited, the two new comments on card #35512 (7025770466, 7026823508) and the 78 check-runs on this head. The head did not move during the review. The PR title did: it was corrected at 00:54Z (N5).

  1. The net narrowing against main is now the optional call alone: right. TEXT_CALL is main's pattern plus one optional ?. between text and the parenthesis. Judgments 1, 2 and 4 to 7 of the first record stand unchanged on this head.
  2. Judgment 3 of the first record no longer applies. ctx.text!('k') is not read at save, exactly as on main, so this head changes nothing for that spelling.
  3. Against 269566b8 the reader matches a strict subset. Every key this head reads from a source, that head read from the same source. Nothing this head refuses was accepted there.
  4. Public surface, sentences and .describe() strings: still unchanged. The delta touches a regex, comments, pins, the entry's prose, one docs sentence and the changeset.

② Semver level

  • Level, kind and clause line. Unchanged and still right: @objectstack/spec: minor, narrowed, no (narrowing). Check Changeset re-ran green after the body edit and again after the title edit (00:56:19Z). The claim line on the card now agrees (correction 7025770466).
  • ADR-0087. Unchanged and still right: one registered marker, and the id is still new in this diff.
  • BREAKING section. It now matches. The banner names the hook alone and says no released action is affected. FROM, TO and the fix speak of the optional call alone, and "A declared key is accepted in both shapes" is true.
  • One condition on that banner. "No released action is affected" holds while .changeset/34374-action-texts-org-locale.md is still pending, as it is on main at 7c8d6895. If a release is cut before this PR lands, the banner and the entry's surface need the action half back.

③ Boundary flags

  • Addendum flag, nothing re-measured locally (7026823508): answered in two parts.
    • The pins. Test Core is green on this head, 10 of 10 shards, and a spec diff puts the spec suite in that run. That is the one run the new pins have on this head.
    • The dogfood battery. It has no run on this head: a pull request skips both dogfood legs, and the dev's run was at 269566b8. os-dev.md:273 asks for it once on the final head. The earlier run still covers this head by containment (judgment 3): a stack that parsed under the stricter reader parses under this one, and nothing else in the delta executes. The queue build runs the shards before landing. I would not ask for a re-run; the seat decides.
  • The card's second ask, the !( shape, is declined with its reason on the card (7026823508), in the PR body and in a pin (hook-texts.test.ts:141). Fixes #35512 stands.
  • content/docs/automation/hooks.mdx:499-502 joined the diff. It is a prose face and outside the claim's file surface; the first record asked for the edit and the addendum reports it. The sentence now names both spellings the save reads and is right.
  • The PR body's skills-and-docs line still has the value none, while its reason reports a docs page updated in this diff. Whether the value should read updated here is the seat's call.
  • N2 of the first record is filed as hook and action texts: the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) is refused at save as an undeclared literal key 'k' #35698 (open).
  • For the seat's filing gate, not a finding on this PR: nothing at save refuses a hook js body that does not compile. The action half has action-body-does-not-compile; the hook parse check reads the body as TypeScript and only warns. The new header comment states the consequence ("the body never runs").
  • Check-runs on this head: 78, of which 64 success, 14 skipped, none red, none pending. The addendum's 60 and 10 predate the eight re-runs the body edit and the title edit triggered.
  • main is at 7c8d6895, 15 commits past the merge base. None touches a file of this diff, and GitHub reports the merge clean.
  • SQL push-down: the diff adds no data access.
  • Author: the PR is still objectstack-fleet[bot]'s, the relay. There is no other login to name.

④ Design judgment

No must-fix, no should-fix.

S1: closed.

The dev took the second route the first record offered and dropped the ! arm. Each of the four inaccurate sentences is gone or corrected, and the pin the record asked for is in:

  • Entry replacement now reads "The optional call stays legal for a declared key." That is true on both inputs the doors read.
  • Entry reason and the changeset FROM now describe the optional call alone, for which "the runtime refused the key only when the hook ran" is what happened.
  • The changeset's fix line now says "accepted in both shapes", the plain call and the optional call.
  • The ActionSchema.texts TSDoc lists the two spellings the reader matches and no other.
  • hook-texts.test.ts:133-139 refuses an inline handler asking ctx.text?.('follow_up_title'), at handler, with the exact sentence.

Each file on this head:

  • hook-refusal-codes.ts: the pattern reads a legal JavaScript optional call, with whitespace or a line break on either side of ?., on both inputs the doors read. The header comment's account of why a non-null ! is not read holds sentence by sentence: a handler's is erased before Function.prototype.toString(), and one in a js body is a syntax error.
  • hook.zod.ts, action.zod.ts: TSDoc only. Every site names the two spellings the reader matches, the two internal docblocks included.
  • The entry: surface, replacement, reason and acceptanceCriteria speak of the hook and of the optional call, and each sentence holds against the doors. It teaches no spelling that does not compile.
  • The two test files: two shapes per door, each with a lit pin and a dark pin, a reader pin for whitespace and a line break, the handler pin, and a dark pin that holds the ! spelling unread. main's reader cannot match text?.(, so the lit pins, the handler pin, the whitespace pin and the hook dark pins' reader assertions are red on it by construction. The ! pin is green on both and guards against the arm's return.

Nits:

  • N1: closed. The banner and the entry's surface name the hook half as the break.
  • N2: filed as hook and action texts: the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) is refused at save as an undeclared literal key 'k' #35698.
  • N3: closed. Both internal docblocks name the optional call.
  • N4: stands, accepted as it is.
  • N5 (nit) — the PR body's Tests section still reports 269566b8's readings as current (57/57, 12 red first, a 13-red ablation over the removed arm), and its third summary bullet still speaks of two spellings and of actions. Both are PR-body edits and do not move the head. The title, which becomes the squash subject on main, said the save door reads ctx.text!( when this review began. It was corrected during the review and now reads "the save door reads ctx.text?.( as a literal text-key ask", which is right.
  • N6 (nit) — the edit left two TSDoc lines unwrapped: hook.zod.ts:821 (125 columns) and action.zod.ts:1577 (117). Lint · ESLint is green. Leave them; a rewrap would move a reviewed file.

Implemented-by: claude/project-thread-lryneu
Reviewed-by: session_01L6bhgX6mQpVU8yUysiRAFC — rendered by the same isolated sub-agent that rendered record 7025732554. A sub-agent shares its parent's session id, and the claim (7023306761) signs the implementing thread with this same id, so the pair does not differ by session id. Independence rests on the isolation: this agent drafted none of the diff and judged it from the card, the PR, the check-runs and the tree.

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Delta brief for PR #35686 at head 0acd17d2, rendered from record-recognisers --brief-template (⛔ lines kept), for the re-run of the delta review the seat asked for. The delta record 7026970968 was drawn under the round-1 template brief 7025740503 (head 269566b8) plus a non-template note naming the new head, the patch-round commit and addendum 7026823508; that note was not template-rendered, so the delta is re-rendered under this brief. Delta context handed beside it (inputs only, no conclusions): the earlier record 7025732554 and its finding ids; the commit 269566b8..0acd17d2.

Contract review brief — PR #35686 @ 0acd17d22771e033de2fe8233b64433119c187ff (card #35512)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35512: its body and EVERY comment (rulings and earlier records included)
· PR #35686: its body, its file list, and the net diff against main at 0acd17d22771e033de2fe8233b64433119c187ff
· the check-runs on 0acd17d22771e033de2fe8233b64433119c187ff: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — if a hits path is under skills/** or ui/skills/** and the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/2c84582e-bf62-5756-b5c5-2410a75aecc8/scratchpad/pr-35686/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0acd17d22771e033de2fe8233b64433119c187ff
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts + packages/spec/src/data/hook-texts.test.ts, packages/spec/src/ui/action-texts.test.ts
Security-touching: no

① Derived judgments

This is a delta record, drawn under brief 7027008067. It judges head 0acd17d2, one commit on 269566b8, against the first record (record 7025732554: PASS on 269566b8, should-fix S1, nits N1 to N4). It replaces the delta record that was drawn under a free-form note (record 7026970968: PASS on this head). Every judgment below was derived again from the brief's inputs, and the outcome is the same.

Read for it: card #35512 (body and all 7 comments), PR #35686 (body, the 8 files, the net diff from merge base c0716ed4, the commit between the two heads) and the 78 check-runs on this head. The head did not move during the review.

  1. The net narrowing against main is the optional call alone: right. TEXT_CALL is main's pattern plus one optional ?. between text and the parenthesis. Judgments 1, 2 and 4 to 7 of the first record stand unchanged on this head.
  2. Judgment 3 of the first record no longer applies. ctx.text!('k') is not read at save, exactly as on main, so this head changes nothing for that spelling.
  3. Against 269566b8 the reader matches a strict subset. Every key this head reads from a source, that head read from the same source. Nothing this head refuses was accepted there.
  4. Public surface, sentences and .describe() strings: still unchanged. The commit touches a regex, comments, pins, the entry's prose, one docs sentence and the changeset.

② Semver level

  • Level, kind and clause line. Unchanged and still right: @objectstack/spec: minor, narrowed, no (narrowing), on the PR body and in the changeset. Check Changeset is green on this head (latest run 00:56:19Z). The claim line on the card agrees since correction 7025770466.
  • ADR-0087. Unchanged and still right: one registered marker, and the id is still new in this diff.
  • BREAKING section. It now matches. The banner names the hook alone and says no released action is affected. FROM, TO and the fix speak of the optional call alone, and "A declared key is accepted in both shapes" is true.
  • One condition on that banner. "No released action is affected" holds while .changeset/34374-action-texts-org-locale.md is still pending, as it is on main at 238661f4. If a release is cut before this PR lands, the banner and the entry's surface need the action half back.
  • Title. "the save door reads ctx.text?.( as a literal text-key ask" names what this head does.

③ Boundary flags

  • Addendum flag, nothing re-measured locally (7026823508). It has two parts.
    • The pins: answered. Test Core is green on this head, 10 of 10 shards, and a spec diff puts the spec suite in that run. That is the one run the new pins have on this head.
    • The dogfood battery: escalated to the seat. It has no run on this head: a pull request skips both dogfood legs (.github/workflows/ci.yml:2751), and the dev's run was at 269566b8 (report 7024765229). os-dev.md:273 asks for it once on the final head. My reading is that no re-run is needed for correctness. The earlier run covers this head by containment (judgment 3): a stack that parsed under the stricter reader parses under this one, and nothing else in the commit executes there. The queue build runs the shards before landing. Whether the duty's letter is held or waived is the seat's decision.
  • The addendum's counts, 60 success and 10 skipped, predate eight re-runs that the PR-body and title edits triggered. This head now has 78 check-runs: 64 success, 14 skipped, none red, none pending.
  • The card's second ask, the !( shape, is declined with its reason on the card (7026823508), in the PR body and in a pin (hook-texts.test.ts:141). The reason holds against the tree (④). Fixes #35512 stands.
  • content/docs/automation/hooks.mdx:499-502 joined the diff. It is a prose face and outside the claim's file surface (7023306761); the first record asked for the edit and the addendum reports it. The sentence names both spellings the save reads and is right.
  • The PR body's skills-and-docs line has the value none, while its reason reports a docs page updated in this diff. The line's grammar offers updated here for that (.claude/skills/pm-dispatch/SKILL.md:322). Which value is right is the seat's call.
  • N2 of the first record is filed as hook and action texts: the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) is refused at save as an undeclared literal key 'k' #35698, per the claim correction (7025770466).
  • For the seat's filing gate, not a finding on this PR: nothing at save refuses a hook js body that does not compile. The action half has action-body-does-not-compile; the hook parse check reads the body as TypeScript and only warns (packages/lint/src/validate-hook-body-writes.ts:670). The new header comment states the consequence ("the body never runs").
  • open_questions is empty in the report, and the addendum adds none.
  • main is at 238661f4, 17 commits past the merge base. None touches a file of this diff, and GitHub reports the merge clean.
  • SQL push-down: the diff adds no data access.
  • Author: the PR is objectstack-fleet[bot]'s, the relay. There is no other login to name.

④ Design judgment

No must-fix, no should-fix.

S1: closed.

The dev took the second route the first record offered and dropped the ! arm. Each of the four inaccurate sentences is gone or corrected, and the pin the record asked for is in:

  • Entry replacement now reads "The optional call stays legal for a declared key." That is true on both inputs the doors read.
  • Entry reason and the changeset FROM now describe the optional call alone, for which "the runtime refused the key only when the hook ran" is what happened.
  • The changeset's fix line now says "accepted in both shapes", the plain call and the optional call.
  • The ActionSchema.texts TSDoc lists the two spellings the reader matches and no other.
  • hook-texts.test.ts:133-139 refuses an inline handler asking ctx.text?.('follow_up_title'), at handler, with the exact sentence.

Each file on this head:

  • hook-refusal-codes.ts: the pattern reads a legal JavaScript optional call, with whitespace or a line break on either side of ?., on both inputs the doors read. ?. followed by a parenthesis is never a conditional, so the arm brings no new false reading; the one it inherits is N2. The header comment's account of why a non-null ! is not read holds sentence by sentence: a handler's is erased before Function.prototype.toString(), and one in a js body is a syntax error, because the sandbox evaluates the source as written (packages/runtime/src/sandbox/quickjs-runner.ts:432).
  • One limit of the handler path, not a finding: the door reads a handler's compiled text, so a build that lowers below ES2020 rewrites the optional call first, and that key then goes to the run-time refusal, as on main. The repo's own targets (es2020, node18) keep the operator, and the handler pin is green in Test Core.
  • hook.zod.ts, action.zod.ts: TSDoc only. Every site names the two spellings the reader matches, the two internal docblocks included (hook.zod.ts:340, action.zod.ts:2661).
  • The entry: surface, replacement, reason and acceptanceCriteria speak of the hook and of the optional call, and each sentence holds against the doors (hook.zod.ts:344-367, action.zod.ts:2665-2686). It teaches no spelling that does not compile.
  • The two test files: two shapes per door, each with a lit pin and a dark pin, a reader pin for whitespace and a line break, the handler pin, and a dark pin that holds the ! spelling unread. main's reader cannot match text?.(, so eight of them are red on it by construction: the four lit pins, the handler pin, the whitespace pin and the two hook dark pins' reader assertions. The ! pin is green on both and guards against the arm's return.

Nits:

  • N1: closed. The banner and the entry's surface name the hook half as the break.
  • N2: filed as hook and action texts: the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) is refused at save as an undeclared literal key 'k' #35698.
  • N3: closed. Both internal docblocks name the optional call.
  • N4: stands, accepted as it is.
  • N5 (nit) — the PR body carries leftovers from 269566b8. Its Tests section reports that head's readings as current: 57/57 for the two files (they hold 51 tests on this head, by count of the files), 12 red first, and a 13-red ablation over the arm this head removed. Its note that local readings were taken at 269566b8 sits below that section and covers the two folded blocks only. Its third summary bullet still speaks of two spellings and of actions, and What changes still says "all three shapes". All are PR-body edits and do not move the head.
  • N6 (nit) — the edit left two TSDoc lines unwrapped: hook.zod.ts:821 (125 columns) and action.zod.ts:1577 (117). Lint · ESLint is green. Leave them; a rewrap would move a reviewed file.

Implemented-by: claude/project-thread-lryneu
Reviewed-by: session_01L6bhgX6mQpVU8yUysiRAFC — rendered by the same isolated sub-agent that rendered records 7025732554 and 7026970968. A sub-agent shares its parent's session id, and the claim (7023306761) signs the implementing thread with this same id, so the pair does not differ by session id. Independence rests on the isolation: this agent drafted none of the diff and judged it from the card, the PR, the check-runs and the tree. No judgment here rests on the seat's or the L1 reviewer's comments.

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

L2 adoption · 2026-11-20T01:10Z · The seat adopts the #35512 card thread's isolated delta record 7027208368 for head 0acd17d2. It is served at CONTRACT_REVIEW_TIER, which this Clause-②: no (narrowing) change owes, and posted with --tier-evidence. It re-judges the delta under template brief 7027008067 (⛔ lines kept), and it supersedes 7026970968. It is the delta for first-round record 7025732554, by the same reviewer.

The verdict is PASS, with no must-fix and no should-fix items. S1 is closed. N2 rides #35698, and N4, N5 (PR-body prose only) and N6 stand as accepted deviations. On the reviewer's escalated item, the seat rules that no dogfood re-run is owed on this head, because its reader matches a strict subset of what the 269566b run covered. The Scope: line covers the record's path hits.

L1-a delta ACCEPT on this head is 7026874816. check-governed-merges --pr 35686 reads not governed, with 162 changed lines, and landing-k reads K = 5. #35610 is still open, so no Rule-change: line is owed yet. The card thread lands it through the ordinary queue.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Landing (2026-11-20T01:46Z) · head 0acd17d22771e033de2fe8233b64433119c187ff

Readying and arming auto-merge; the queue lands it.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 01:46
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 5d2ce34 Nov 20, 2026
83 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-lryneu branch November 20, 2026 02:22
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

Development

Successfully merging this pull request may close these issues.

hook texts: the save door's literal ctx.text check misses ctx.text?.('k') and ctx.text!('k'), so an undeclared text key passes save

2 participants