Skip to content

fix(lint)!: refuse an action body whose regular-expression literal never closes or carries a bad flag set - #35672

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-iswnar
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-iswnar

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgTggz8AL2bCABoDGis

Fixes #35040

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no published skill teaches the action-body compile check or regular-expression literals in an action body (git grep over skills/ at df02e1c: 0 hits for does-not-compile, 0 relevant hits for regular expressions)

维护者速读

  • 改了什么:动作脚本体里写坏的正则字面量(没闭合的 /abc、非法 flag 如 /a/gg)现在在保存/校验时直接报错拒收,而不是只给警告。
  • 为什么改:这类脚本体运行时的 QuickJS 同样编译不过,之前保存成功、每次运行都 500;只有正则"模式内部"的差异(两个引擎确实不一致的地方)仍保留为警告。
  • 风险与回滚:收窄接受集(BREAKING,仅影响本来就从未跑通过的动作体);首方示例零命中;回滚即 revert 本 PR。
  • 先看:packages/lint/src/validate-action-body-compiles.ts(REGEXP_PATTERN_FAILURE 一行决定警告/拒收分界)、同目录测试文件末尾新 describe、packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts。
  • 两分钟验证:pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-action-body-compiles.test.ts,预期 25 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

action-body-does-not-compile sent every host SyntaxError whose sentence opens Invalid regular expression to warning. V8's two token errors open the same way: an unterminated literal (Invalid regular expression: missing /) and an invalid flag set (Invalid regular expression flags). QuickJS refuses both, so a body carrying one was accepted at write and failed every run with the coded 500.

  • packages/lint/src/validate-action-body-compiles.ts: the warning arm is now positively identified by V8's pattern-body shape only (Invalid regular expression: /PATTERN/FLAGS: REASON, anchored on the colon-space-slash). Every other sentence — the two token errors included, and any future one — is error. The two token errors get their own hint (close the literal / escape a slash / give a division its left operand; flags from dgimsuvy, each once, never u with v). The module docblock and the severity field doc now state the measured split.
  • packages/lint/src/rule-explanations.ts, packages/lint/src/authoring-rules.ts (comment), content/docs/automation/hook-bodies.mdx: the "a regular-expression literal the host refuses is a warning" sentence would be false after this change; each now says only a pattern is a warning.
  • packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts: new ADR-0087 semantic entry for the narrowing.
  • packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts: amended, two phrases. The entry shipped in 18.6.0 (content/docs/releases/v18/18-6.mdx row and packages/spec/CHANGELOG.md), but the registry is what os migrate meta and the upgrade guide project at HEAD; left as it was, an upgrader reading 18.7 would get "never refused" beside the new entry's "refused". The amendment keeps the 18.6 meaning for patterns and points to the new entry for tokens. The released CHANGELOG and release page are untouched.
  • .changeset/35040-action-body-regexp-literal-token-refused.md: @objectstack/lint minor, @objectstack/spec minor, both declaration lines, registered action-body-regexp-literal-token-refused.

Sibling #34987 (hook and job bodies, same file) is out of scope and untouched.

QuickJS probe (the measurement the split follows)

Host: node 22.23.5, V8 12.4.254.21-node.57, vm.Script. Runtime: quickjs-emscripten 0.32.0 (newQuickJSWASMModule, release-sync variant — the one packages/runtime/src/sandbox/quickjs-runner.ts uses), evalCode of the same wrapper (async (input, ctx) => { SOURCE }), which compiles and does not call.

case body V8 QuickJS
unterminated literal return /abc; Invalid regular expression: missing / refuses: unexpected end of regexp
unterminated, open class return /[/; missing / refuses: unexpected end of regexp
body ends inside a literal return /abc missing / refuses: unexpected end of regexp
trailing backslash return /abc + backslash missing / refuses: unexpected end of regexp
broken by a newline return /ab NL c/; missing / refuses: unexpected line terminator in regexp
repeated flag return /a/gg; Invalid regular expression flags refuses: invalid regular expression flags
unknown flag return /a/zz; flags refuses: same
unknown flag return /a/q; flags refuses: same
u with v return /a/uv; flags refuses: same
escaped flag /a/ + backslash-u0067 flags refuses: expecting ';'
flag v return /[a&&b]/v; compiles compiles
flag d, gimsuy /a/d, /a/gimsuy compiles compiles
unterminated group return /(/; pattern: Unterminated group refuses: expecting ')'
duplicate named group (two groups both named a) — pattern: Duplicate capture group name compiles
modifier group return /(?i:a)/; pattern: Invalid group compiles
nothing to repeat return /a**/; pattern refuses
class range out of order return /[b-a]/; pattern refuses
named back-reference to no group (u) — pattern refuses
unknown unicode property (u) /\p{Nope}/u pattern refuses
incomplete quantifier (u) /a{/u pattern refuses
positive lookbehind on a before b — compiles compiles
controls valid literal; const input = 1 compiles; redeclaration compiles; invalid redefinition of parameter name

Flag sweep: 55 single characters (a-z, A-Z, $, _, 0) plus all 64 ordered pairs of dgimsuvy = 119 flag sets, V8 and QuickJS agree on accept/refuse for 119/119; no flag set V8 refuses is accepted by QuickJS.

Reading: the hypothesis holds. Both token classes are refused by QuickJS in every probed case, so they go to error. The dialect gap lives in the pattern body — and it is two places, not the one the module docblock named: modifier groups are a second pattern V8 (Node 22) refuses and QuickJS runs. Pattern-body failures stay warning; some of them (unterminated group, nothing to repeat, …) are refused by QuickJS too, which this PR leaves at warning (see Acceptance notes).

Tests

New top-level describe in packages/lint/src/validate-action-body-compiles.test.ts (the rule's existing harness file):

  • four unterminated-literal shapes → [rule, severity, path] = ['action-body-does-not-compile', 'error', 'actions[0].body.source'];
  • three invalid flag sets → error;
  • duplicate named group and modifier group → still warning;
  • /a/dgimsuy and a v-flag class compile clean;
  • the doors: os validate refuses return /abc; at error, and the runtime publish gate puts it in errors, none in advisories.

Assertions are rule id + severity (+ path), no message or hint text pinned.

Results (head df02e1c)
  • pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-action-body-compiles.test.ts — Test Files 1 passed (1), Tests 25 passed (25).
  • pnpm --filter @objectstack/lint test — Test Files 220 passed (220), Tests 9288 passed / 5 skipped (9293); pnpm --filter @objectstack/lint typecheck — tsc clean, check:test-typecheck: OK.
  • pnpm --filter @objectstack/spec build && check:generated — "All 14 generated artifacts are up to date"; vitest run src/migrations — Test Files 5 passed (5), Tests 198 passed (198).
  • pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts — 3 passed (3).
  • Dogfood battery, once on head df02e1c (closure built first, under the verify lock): pnpm --filter @objectstack/dogfood test — VERDICT command-exit 0, Test Files 482 passed / 3 skipped (485), Tests 4092 passed / 68 skipped (4160), no failures.
  • First-party exposure: validateActionBodyCompiles over every action exported by examples/app-showcase/src/ui/actions/** (the only example tree carrying language: 'js' action bodies) — 0 findings.
Ablation (one-shot; no permanent file)

Committed the fix first, then node scripts/ablation-replace.mjs restored the old classifier (REGEXP_PATTERN_FAILURE back to the unanchored ^SyntaxError: Invalid regular expression) — anchor 1 → 0, blob bae57fbc → 1fb048a7. The test file went red: 8 failed / 17 passed (25) — exactly the four unterminated, three flag and one door pins; the two warning-preservation pins stayed green as they should. Restore: blob after restore = HEAD blob bae57fbc, git diff HEAD empty. The test imports the rule from src/ (relative import), so no dist/ leg applies.

Acceptance notes

  • Pattern-body failures QuickJS also refuses (unterminated group, nothing to repeat, out-of-order class range, unknown property, incomplete quantifier, dangling named back-reference) stay at warning — the card's Done-when covers the token classes only. Promoting them means an allow-list of V8 pattern reasons, which a future V8 can widen under us; left as a note, not filed. carrier: none.
  • The module docblock said the engines "disagreed in one place" (duplicate named groups); the probe found a second (modifier groups). Corrected in this PR's docblock, rule explanation and docs page.
  • Duplicate Fix Guard: the head branch is claude/project-thread-iswnar, not claude/issue-35040-… — platform exception: this card thread can push only its assigned branch (claim comment 7001374222).
  • The claim's line reads Clause-②: no with no arm; this PR and the changeset declare Clause-②: no (narrowing), because the level gate refuses Metadata-protocol: narrowed beside a line with no (narrowing) arm (scripts/check-changeset-no-major.mjs) and the change does narrow the accepted set. The title carries ! for the same reason: AGENTS.md names a (narrowing) arm BREAKING.

Verification

Local subset: node scripts/pm/dispatch-gates.mjs --commands (no paths; change set from merge base 3819afe, tree df02e1c) derived 115 families; all 115 run, reconciled with --ran: "115 derived famil(ies) accounted for — 115 run, 0 NOT-MEASURED". overlap-check.mjs before each push: VERDICT clean exit 0. Every CI family is read from this PR's check-runs, not re-run locally.

Gate readings

All 115 derived commands exited 0. Five first exited 3/1 as unmet prerequisites (nothing measured), and passed on a re-run after the prerequisite was met:

  • node scripts/check-plugin-teardown-shape.mjs --self-test — exit 3 on the shallow clone (pinned positive-control commit unreachable); after fetching that one commit into a private ref, exit 0, 48 cases.
  • pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts — exit 1 at oclif manifest load (cli not built); after @objectstack/cli... build, exit 0, 3/3.
  • pnpm --filter @objectstack/spec run check:skill-examples — exit 3 (client-react dist missing); after build, exit 0, "345 prose examples type-check".
  • pnpm check:dual-build-cjs-loads — exit 3 (dists missing); after the full packages build, exit 0.
  • pnpm check:type-check-debt — exit 3 (lock queue timeout while the dogfood run held it); run under the lock, exit 0, "0 raw tsc error(s) total, none above its recorded number".

Local-only family check:dev-prereqs (not derived): exit 1, "35 of 108 workspace packages declare an entry point under dist/ that is not on disk" — all under ui/, which this box never built; a reading of this container, not of the diff.

Main merge before opening (head bf5fc65, origin/main e91d967): merged cleanly; main changed one file in this diff's set (packages/lint/src/rule-explanations.ts, no conflict). Re-run only what it touches, after rebuilding spec dist: vitest run src/validate-action-body-compiles.test.ts 25/25; pnpm --filter @objectstack/lint test 221 files / 9322 tests passed; lint tsc --noEmit exit 0; spec vitest run src/migrations 5/5 files, 198/198; spec check:generated "All 14 generated artifacts are up to date" (first attempt hit the default heap; re-run with --max-old-space-size=8192). overlap-check.mjs: VERDICT clean exit 0, 0 PR heads. The dogfood battery and the 115-family run above are on df02e1c and were not repeated.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTggz8AL2bCABoDGis

…ver closes or carries a bad flag set

action-body-does-not-compile sent every host SyntaxError opening
"Invalid regular expression" to warning. V8's two token errors (an
unterminated literal, "missing /", and an invalid flag set) open the same
way, and QuickJS refuses both, so such a body was accepted at write and
failed every run. Only the pattern-body shape stays a warning.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTggz8AL2bCABoDGis
os-dev-report

  • issue: 35040
  • pr: 35672 (draft)
  • branch: claude/project-thread-iswnar (platform exception, see claim 7001374222)
  • head: bf5fc65 (fix 18d86e3 + merge of origin/main 24cc61f, then e91d967)
  • status: ready for L1
  • premise_still_valid: true
  • files_changed: .changeset/35040-action-body-regexp-literal-token-refused.md; content/docs/automation/hook-bodies.mdx; packages/lint/src/authoring-rules.ts; packages/lint/src/rule-explanations.ts; packages/lint/src/validate-action-body-compiles.test.ts; packages/lint/src/validate-action-body-compiles.ts; packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts; packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts
  • line_budget: n/a, no skills/** file; +179 / -23 over 8 files
  • gates: dispatch-gates --commands (merge base 3819afe, tree df02e1c) 115 families, all exit 0, --ran reconciled 115 run / 0 NOT-MEASURED, exit 0. Five first answered an unmet prerequisite (exit 3 / exit 1) and passed on re-run; listed in the PR body. After the main merge (bf5fc65): target test 25/25, lint test 221 files / 9322 tests, lint tsc exit 0, spec migrations 198/198, spec check:generated up to date. overlap-check before each push: VERDICT clean exit 0.
  • dogfood_battery: df02e1c, under os-verify-lock, closure build exit 0, Test Files 482 passed / 3 skipped (485), Tests 4092 passed / 68 skipped (4160), 0 failures
  • ablation: old unanchored classifier restored → 8 failed / 17 passed (exactly the 4 unterminated, 3 flag and 1 door pins); restore blob = HEAD blob
  • quickjs probe: token class (missing /, invalid flags) refused by QuickJS in every case, 119/119 flag sets agree; pattern class keeps warning (duplicate named group and modifier group compile on QuickJS). Table in the PR body.
  • deviations: (1) PR body and changeset declare Clause-②: no (narrowing), the claim reads Clause-②: no (check-changeset-no-major requires the arm beside Metadata-protocol: narrowed); title carries ! for the narrowing arm. (2) File surface widened to content/docs/automation/hook-bodies.mdx and an authoring-rules.ts comment, which the change would otherwise make false. (3) The released 18.6.0 semantic entry action-body-does-not-compile-refused amended in two phrases, plus the new entry action-body-regexp-literal-token-refused. (4) Commit trailer is the model-free Co-authored-by: Claude pair (pre-push hook refuses a model name). (5) The first relay pr_create (with an assignee) was refused by the session's permission check before it ran; the maintainer chose to open it without an assignee, which this PR is.
  • writes: relay 2 (pr_create, this comment); mcp_calls 0 writes
  • security_findings: none
  • out_of_scope: pattern-body failures QuickJS also refuses stay at warning; noted in Acceptance notes, not filed (carrier: none)

Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 12 documentable anchor(s).

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

  • content/docs/deployment/validating-metadata.mdx (via AUTHORING_RULES (symbol, a top-level const object))
What this run could not see
  • 4 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 d9801038abf9b0e09b334bcc35a11de1e438eb50 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 d9801038abf9b0e09b334bcc35a11de1e438eb50 → 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_01L6bhgTggz8AL2bCABoDGis

Contract-review-claim: session_01L6bhgTggz8AL2bCABoDGis · head bf5fc65 · 2026-11-19T23:04Z


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:动作脚本里的正则字面量如果没写完(漏了收尾的 /),或者标志写错(比如 /a/gg),以前只给一个警告,能保存、能发布,但每次运行都报 500;现在保存和构建时就直接拒绝,并告诉作者怎么改。正则内部写法的差异(两套引擎确实不同的地方)仍然只给警告。
  • 出错会怎样:最坏的情况是拒掉了某个其实能跑的动作脚本。但被拒的这两类,运行时的引擎同样不接受。目前一方的示例和文档中这样的脚本为零。
  • 要你做什么:不需要你做任何事。这单属于收窄,还要一次 L2 合同审核,PASS 后由区域落地。

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

  • Shape — draft, base main, 3 commits (one fix and two main merges), 8 files, +179/−23. Merge-base e91d9671. check-governed-merges.mjs --pr 35672: NOT governed, 0 of 8 paths. The title has !. Fixes #35040 is right: the card is finding and pm:dispatched, not in the decision inbox, and its Done-when covers the two token classes delivered here. Clause-②: no (narrowing), Metadata-protocol: narrowed, Skills-docs: none with its grep evidence. The changeset has @objectstack/lint and @objectstack/spec at minor. Both merges are clean: git diff-tree --cc shows 0 @@@ hunks on df02e1ce and on bf5fc651.
  • The classifier does what the card asks.
    • The old ^SyntaxError: Invalid regular expression matched three V8 sentences.
    • The warning arm is now REGEXP_PATTERN_FAILURE = /^SyntaxError: Invalid regular expression: \//, which matches only the sentence that names the literal (…: /PATTERN/FLAGS: REASON).
    • …: missing / does not match it, because m follows the colon, and … flags does not match it either, because no colon follows expression. Both therefore fall to error, with their own hints (REGEXP_UNTERMINATED, REGEXP_FLAGS). Every other sentence stays error as before.
    • The narrowing is only warning → error for the two token classes. The pattern failures (duplicate named groups, modifier groups, and the pattern errors QuickJS also refuses) stay warning, as the acceptance notes say. That leaves the pattern classes unchanged. It is the conservative side, and a later allow-list is correctly left unfiled.
  • The evidence for the narrowing is the right kind. QuickJS refuses each token class, and the PR quotes its own sentences. The flag sweep is 119 sets with full agreement. A body in these classes never ran, so no stored row that ran changes meaning. The docblock's 「disagreed in one place」 is corrected to two (modifier groups), and so are the rule explanation and hook-bodies.mdx. All three say the same thing as the code.
  • ADR-0087
    • The new entry action-body-regexp-literal-token-refused has a surface, replacement, reason and acceptance criteria. There is no tombstone (no key removed) and no conversion (D3: literal or division is the author's choice). It is registered through the changeset marker, and check-adr-0087-registration is green.
    • The amended 18.6.0-shipped entry action-body-does-not-compile-refused keeps its id and acceptance criteria. Only the replacement and reason prose narrows 「regular-expression literal」 to 「pattern」 and points to the new entry.
    • For L2: whether amending a shipped entry's prose in place is acceptable, rather than leaving it as shipped, is a contract-face judgement. I find the amendment accurate.
  • Pins
    • validate-action-body-compiles.test.ts has 25 cases, covering:
      • the four unterminated shapes, including /[/ and a literal broken by a line terminator;
      • the three flag shapes;
      • the two warning-preservation pins (duplicate named group and modifier group);
      • a control that accepts valid flags;
      • an os validate plus runtime publish door case, refused in errors and absent from advisories.
    • The ablation restores the old unanchored classifier and turns 8 of 25 red: exactly the 4 + 3 + door pins. The two warning pins stay green. The restored blob equals HEAD.
    • The lint suite is 9322 passed and spec migrations 198/198 after the merge, and check:generated is up to date. Not re-measured here: no node_modules.
  • Accepted deviations
    • (1) The claim said Clause-②: no with no arm, and the PR declares no (narrowing). That is correct: check-changeset-no-major refuses narrowed without the arm, and the accepted set does narrow. The ! follows from it.
    • (2) The file surface grew to hook-bodies.mdx and the authoring-rules.ts comment. Both describe this rule's arm, and each now states the code correctly.
    • (3) The dogfood battery and the 115-family run were on df02e1ce. After the clean merge of e91d9671, only the touched families were re-run, in line with Sales's 11-12 token rule. I checked what that merge brought: of its 886 files, the first-party stacks it touches are examples/app-showcase (3 object files plus an e2e spec) and skill or docs prose. None adds or edits an action body.source, by grep over the added lines for source:/body: in examples/, apps/, skills/ and content/docs/. So the battery's zero-exposure reading carries to this head.
  • Gates — on this head: 60 success, 10 skipped, 0 failure. Mergeable clean.
  • Landing terms — not governed, but L2 owed (CONTRACT_REVIEW_TIER): the narrowing, plus the new and amended ADR-0087 entries in packages/spec/src. Routing goes through the seat to l2-review#3. b1-C lands this head only after a ## Contract review PASS on it and 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_01L6bhgTggz8AL2bCABoDGis

Contract review brief — PR #35672 @ bf5fc6514f08e388b31e13b9b54f3fae12d102cd (card #35040)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35040: its body and EVERY comment (rulings and earlier records included)
· PR #35672: its body, its file list, and the net diff against main at bf5fc6514f08e388b31e13b9b54f3fae12d102cd
· the check-runs on bf5fc6514f08e388b31e13b9b54f3fae12d102cd: 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/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts, packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts;
Widened by the card thread (narrowing face: the PR body and changeset declare Clause-②: no (narrowing), so per
references/contract-review.md the at-tier range is the whole diff outside the prose faces): implementing files
packages/lint/src/validate-action-body-compiles.ts, packages/lint/src/rule-explanations.ts,
packages/lint/src/authoring-rules.ts (comment), with packages/lint/src/validate-action-body-compiles.test.ts read as
the pins that hold the narrowing.
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.

⛔ 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/a17c4e60-a6fd-54c0-aef1-f539b328f663/scratchpad/35040/l2/pr-35672/ 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_01L6bhgTggz8AL2bCABoDGis

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bf5fc6514f08e388b31e13b9b54f3fae12d102cd
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts, packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts + packages/lint/src/validate-action-body-compiles.ts, packages/lint/src/rule-explanations.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/validate-action-body-compiles.test.ts

Inputs read, and nothing else: card #35040 (body and its one comment, the claim 7001374222); PR #35672 (body, its eight-file list, the net diff against main at this head: merge base e91d9671f, and main at 03865ae99 has touched none of the eight files since); the dev report 7024071886; the 70 check-runs on this head. PR comment 7024718693 was not read. Brief: PR comment 7024727199. The cited code was read in the tree at this head; nothing was built, run or re-run.

Check-runs on this head: 60 success, 10 skipped, none red, none pending. The skipped ten are the opt-in harnesses, the queue-only jobs, one matrix placeholder, the schedule gate, Temporal Conformance, Dogfood Verify CLI, UI Published Artifacts and Lint UI (no ui/ path in the diff). Lint & Repo Gates, TypeScript Type Check, Type Check · source gates, Test Core (all ten shards), Build Core, Check Changeset, PR-body guards, Governed Surface Queue Guard, Dogfood Regression Gate and Spec property liveness all conclude success.

① Derived judgments

  • Accept set, narrowed: right. An L2 action body (type: 'script', the default type included, and body.language: 'js', as collectActionBodies walks them, top-level and object-inline) whose compile failure is V8's Invalid regular expression: missing / or Invalid regular expression flags moves from warning to error. That reaches os validate, os build and os lint (AUTHORING_COMMANDS, the rule runs on all three) and the publish gate (surfaces: CLI_AND_RUNTIME, runtimeTypes: ['action', 'object']), where an active save or a publish now answers 422 INVALID_METADATA instead of an advisory. A draft save stays ungated (runtime-authoring-gate.ts returns before the rules when the state is not active). It takes nothing that ran: the runtime compiles the same expression (actionBodyFunctionExpression, which quickjs-runner.ts imports), a literal ends at a line terminator or at the end of input in both engines by the same grammar rule, and the flag half rests on the recorded 119-of-119 measurement.
  • Accept set, unchanged: right. A failure inside a literal's pattern stays warning. The classifier now keys on the colon, space and slash that follow the three words, which only V8's pattern sentence carries (Invalid regular expression: /PATTERN/FLAGS: REASON). The pre-existing pin at test line 87 (the unterminated-group body, renamed only) holds this arm on any V8.
  • Stored metadata: right. Nothing is rewritten. A body with such a literal deployed under 18.6.0 keeps answering the coded 500 at run (actionBodyCompileFailure) and is refused at its next active save or publish, because the gate's candidate holds the written item and its baseline does not. No D2 conversion is offered and none could be: the edit is not a lossless mapping (ADR-0087 D2 scope), so it goes to D3 as a semantic entry.
  • Public surface of @objectstack/lint: right. No export is added, removed or retyped. The three regexps are module-private; ActionBodyCompileFinding.severity keeps its union and only its doc moves. Two new hint sentences and one os explain paragraph are author-facing strings; none carries a tracker number.
  • Public surface of @objectstack/spec: right. Step 18 gains one semantic entry, action-body-regexp-literal-token-refused, and one released entry has two of its strings amended (replacement, reason; its id, surface and acceptanceCriteria are untouched). Projections that move: the os migrate meta list, the protocol-18 upgrade guide page and spec-changes.json. The per-release section of that file is keyed by entry id (build-spec-changes.ts reads the previous tarball's ids), so the next release's delta names the new id and does not show the amended prose; that is acceptable because the new entry carries the news. No schema, api-surface or authorable-surface artifact moves, and none is in the diff.
  • Not implied: no widening, no new key, no export, no REST route, no data path.

② Semver level

  • .changeset/35040-action-body-regexp-literal-token-refused.md grades @objectstack/lint and @objectstack/spec minor. Metadata-protocol: narrowed (a value refused) takes at least minor on a package the diff moves (AGENTS.md, Post-Task Checklist step 3); the diff moves published source in exactly those two packages. No major, as the launch-window guard requires. Right.
  • Clause-②: no (narrowing): nothing is widened and no public surface grows, and the arm is the closed pair's BREAKING arm. check-changeset-no-major.mjs reads narrowed beside a line without the arm as a contradiction, so the bare no of the claim could not have shipped. The two declaration lines are the same in the PR body and in the changeset body, and the title carries !. Right.
  • The changeset carries its BREAKING banner, the FROM → TO line and the one-line fix. ADR-0087 disposition: exactly one marker, registered action-body-regexp-literal-token-refused, naming an entry this diff adds. already-registered on the older entry would have been wrong: that entry's own prose excluded the case in words.
  • Skills-docs: none holds on the tree: zero hits for the rule id under skills/ and .claude/skills/ at this head.
  • Check Changeset, Lint & Repo Gates and PR-body guards conclude success.

③ Boundary flags

Dev report 7024071886, its deviations in order:

  1. Declaration arm and ! in the title. Right, for the reason in ②.
  2. File surface widened to content/docs/automation/hook-bodies.mdx and a comment in authoring-rules.ts. Right. Both stated the sentence this change makes false. I searched this head for any other statement of the old claim outside the release-owned files and found none: content/docs/ui/actions.mdx and content/docs/deployment/validating-metadata.mdx name the rule without its regular-expression arm. The docs page is a prose face and stays the lane seat's ACCEPT.
  3. The released entry action-body-does-not-compile-refused amended in two phrases, beside the new entry. Acceptable; answered in full below, with the question an earlier reviewer posed.
  4. Commit trailer. Not a deviation from this repository's rule: AGENTS.md prescribes the model-free trailer pair, and commit 18d86e318 ends with exactly that pair, the session line and a co-author line that names no model.
  5. PR opened without an assignee. Not a contract question. The PR reads: no assignee, draft, auto-merge not armed. The maintainer's choice the report cites is not among this review's inputs, so it is neither confirmed nor disputed here; it is the card thread's record.

out_of_scope and Acceptance note 1 — pattern failures QuickJS also refuses stay at warning; "not filed, carrier: none". Two answers. The carve-out is right for this PR: the card's Done-when names the tokenizer classes, and promoting pattern reasons is a design choice of its own. "Not filed" does not stand, and I escalate it to the card thread (this review writes nothing): Prime Directive 10 files a reproducible defect, and the filing gate's first class is met. Named location: the pattern arm of validate-action-body-compiles.ts. Public reach: os validate accepts the body at warning and every run of the action answers 500. Evidence: the PR body's own probe table, six pattern classes V8 reports in the pattern shape and QuickJS refuses (unterminated group, nothing to repeat, class range out of order, and under u a dangling named back-reference, an unknown property and an incomplete quantifier). Test line 87 pins one of the six at warning. That the fix is a choice (an allow-list of V8 reasons a later V8 can widen, or something else) is a reason for the card to carry the choice, not for no card.

Acceptance note 2 — a second pattern disagreement, modifier groups. Stated consistently in the docblock, the rule explanation, the docs page and the new entry. It is true of Node 22's V8 only; see N1 and N2.

Acceptance note 3 — branch name. The claim 7001374222 names claude/project-thread-iswnar and the platform exception; PR-body guards concludes success; Implemented-by: below carries that branch.

Acceptance note 4 is deviation 1.

Open question, posed as a question: is amending the prose of the 18.6.0-released entry in place acceptable, or should it stay byte-identical with only the new entry carrying the change? Amending is acceptable, and here it is the better choice. From the tree, not from anyone's account:

  • No rule makes a released registry entry immutable. ADR-0087 (D3, D4 and its addenda), AGENTS.md and packages/spec/src/migrations/entries/README.md say nothing of the kind. The release-owned rows of AGENTS.md are content/docs/releases/** and packages/*/CHANGELOG.md, and this diff touches neither; what shipped as 18.6.0 stays in that tarball and in git.
  • The registry is this head's statement, projected verbatim into the guide, spec-changes.json and os migrate meta. packages/spec/src/migrations/migrations.test.ts says so in its own words ("a stale present-tense claim here is published advice") and pins four shipped protocol-17 texts that were corrected in place once a later change overtook them: the step-17 rationale, and the entries ui-notification-action-embed-config-retired, action-descriptor-resume-authority-default-flip and etl-pipeline-layer-retired. Commit 5dd856f40 on main did the same to publish-refuses-metadata-the-runtime-ignores when a rule's reach moved, and the comment on retired-keys/18.ui__PageComponent__responsive.ts records a ruling to repair a shipped redirect text in the same change. Left byte-identical, the protocol-18 guide would print "never refused" in one entry and "refused" in the next.
  • The opposite convention the tree also carries is kept. The comments on view-filter-rule-scalar-operator-array-refused and view-filter-rule-absent-value-refused say to record beside an entry instead of amending onto it, because a quietly rewritten shipped prescription leaves its reader no trace. Here the narrowing is carried by a new entry with its own id, which is what the id-keyed per-release section will show; the changeset says the older entry's sentence moved; and the amended sentence names the new entry's id. The amendment narrows one clause and adds a pointer. It removes no prescription a reader could have followed.
  • No per-entry pin is owed. The pins named above were added after a published sentence was found false; here the sentence moves in the same commit as the code.

SQL push-down: the diff holds no query, no id materialisation and no join. Nothing to find.

Author: objectstack-fleet[bot], so no off-relay author note is owed.

④ Design judgment

18.action-body-regexp-literal-token-refused.ts (hit) — holds. Against ADR-0087 D3 and the code it cites: the filename is the major and the id; the object is a SemanticMigration with its four required fields, no conversionIds (no conversion exists) and no relevantWhen (its released sibling carries none either, so both are always listed). surface names the carriers collectActionBodies walks and the doors the rule's registration gives it. replacement gives the remedies the rule's two new hints give, and the code the gate answers for a gating finding. reason describes the classifier as it stood on main (the removed unanchored regexp) and the 500 the runner answers. acceptanceCriteria is checkable and names os validate. The engine figures it carries (QuickJS's three sentences, 119 of 119 flag sets) are the PR's measurement and were not re-measured here; no test in the tree runs QuickJS for them, as none does for the 36-body probe already on main. Its first consumers, the guide and spec-changes.json, are generated in memory by check:upgrade-guide and check:spec-changes in TypeScript Type Check, which concludes success.

18.action-body-does-not-compile-refused.ts (hit) — holds. Two phrases, both true of the code at this head; the acceptability of the edit is answered in ③.

packages/lint/src/validate-action-body-compiles.ts — agrees with the contract. severity is warning only when the anchored pattern test matches, and error otherwise, which is the docblock's sentence ("only the pattern shape takes the warning arm, and every other compile failure, these two included, is an error") and the card's Done-when ("any other tokenizer error class the check routes to warning"): the arm is identified positively, so a sentence nobody listed is refused. The two other new regexps choose a hint and never a severity. Tried to break it, by reading:

  • A pattern sentence cannot be taken for a token sentence or the reverse: after the colon and space comes a slash in one and the word missing in the other, and the flags sentence has no colon.
  • A body that ends inside a literal: the rule's text ends at the end of input; the runtime's script goes on, on the same line, with the call's argument list, which holds no slash, and then a line terminator. Both refuse.
  • A literal broken by a real line terminator is pinned (the fourth unterminated case).
  • A keyword glued to a literal (in, instanceof) reads as flags in both engines by the same rule.
  • Literal or division: both engines decide by grammar position, over the same expression.

I found no body the rule now refuses that the runtime runs.

packages/lint/src/rule-explanations.ts — agrees, with N2. packages/lint/src/authoring-rules.ts — agrees; comment only.

packages/lint/src/validate-action-body-compiles.test.ts, read as the pins. Eight pins hold the narrowing: four unterminated shapes and three flag sets at error, by rule id, severity and path, and the door pin (os validate at error; the publish gate lists it under errors and not under advisories). No message or hint text is pinned. The block is a top-level describe in the rule's existing harness file, as AGENTS.md asks. See N1.

No must-fix, no should-fix.

  • N1 (nit, test pins): lines 183 and 184, the duplicate-named-group and modifier-group pins titled "still only warns", hold only where the host's V8 refuses those two patterns, which is Node 22's (the docblock says so). Both features ship in V8 from 12.5 (read from V8's release record, not measured here), so on a later Node the rule returns no finding and the helper only() goes red at its length assertion. CI is on Node 22 through .nvmrc, and check:node-version requires that pin to be a supported Node, so the pin moves by Node 22's end of life and these two go red on that PR. The engine-independent pin of the warning arm already exists at line 87.
  • N2 (nit, rule-explanations.ts): "they measurably differ inside the pattern of a regular expression (duplicate named groups, modifier groups)" is said of "this host's JavaScript engine" in os explain with no Node 22 qualifier; on a later Node host the two engines agree on both. The docblock carries the qualifier, the explanation and the new entry's parenthesis do not. No behaviour depends on it.
  • N3 (nit, validate-action-body-compiles.ts): the warning arm now recognises V8's sentence shape alone. The classifier on main took any sentence opening with the three words, and its removed comment named a second engine. On a host whose engine is not V8, a pattern refusal worded without the literal becomes error, a narrowing the changeset does not declare. Read, not measured: no such host was probed. No supported host is affected, since engines on lint, cli and runtime is Node 22 and up, and the new comment says "V8's sentence" and "so does any other sentence".
  • N4 (nit, the unterminated hint and the new entry's replacement): both give three remedies (close the literal, escape an inner slash, give a division its operand) and leave out the cause the fourth pin exercises, a line terminator inside the literal. That is what a backslash-n becomes when body.source travels with a single backslash in a quoted TS string or in JSON, the MCP door the card names. The finding's message does carry V8's sentence and the line number.

Disposition: all four sit in files outside the prose faces, so a fix moves the head and this record no longer covers it. N3 is an accepted deviation. N1, N2 and N4 go on the PR's review follow-ups card, apart from the defect card escalated in ③.

Implemented-by: claude/project-thread-iswnar
Reviewed-by: session_01L6bhgTggz8AL2bCABoDGis

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-19T23:25Z · The seat adopts the #35040 card thread's isolated record 7025076166 for head bf5fc651, served at CONTRACT_REVIEW_TIER and posted with --tier-evidence. The verdict is PASS with no must-fix and no should-fix items. The record's Scope: line covers both reviewFace hits (the two semantic migration entries). The brief, 7024727199, came from --brief-template --paths with its ⛔ lines kept. L1 ACCEPT is 7024718693.

The record also judges the question L1 named: editing the released 18.6.0 entry's prose in place is fine, on the precedent of four protocol-17 entries corrected the same way. N3 is accepted. The reproducible gap the record names (six pattern-error classes QuickJS also rejects still take the warning arm) gets its own card under the filing gate, and N1, N2 and N4 ride that card. The thread files it before landing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTggz8AL2bCABoDGis

Landing · 2026-11-19T23:29Z · head bf5fc6514f08e388b31e13b9b54f3fae12d102cd

reading result
check-governed-merges.mjs --pr 35672 NOT governed, 0 of 8 paths; +179 / -23 ≤ 3000
landing-k.mjs --pr 35672 K = 2 < 15; no new locale pack; no shared book moved
check-runs on head 60 success, 10 skipped, none red or pending
L1 ACCEPT 7024718693 (L1-a)
L2 PASS 7025076166 at CONTRACT_REVIEW_TIER, adopted 7025094291
dogfood battery df02e1c (this head = df02e1c + a clean merge of main only), 4092 passed, 0 failed

State change: draft → ready, auto-merge armed (squash). Follow-up gap and nits N1/N2/N4 → #35694 (filed before landing). The #35040 card closes on merge through Fixes #35040.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 23:30
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit feb9b79 Nov 19, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-iswnar branch November 19, 2026 23:58
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 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

1 participant