Repository navigation
fix(cli): the hook-body bound-handle look-back crosses a line break or comment like the rule - #39774
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
…r comment like the rule
The extractor's bound-handle look-back read the receiver chain between `=`
and `.object(` with `[ \t]` only, so `const repo = ctx.api` then
`.object('x');` on the next line (or after a line comment) bound no handle,
while the capability rule binds it. The chain now takes `\s`, the rule's
own step; the comment half is the comment-blanked copy already scanned.
The PARITY/ENUMERATION census gains the bound-handle spellings.
Claude-Session: https://claude.ai/code/session_01Utp6Cb7xdFx3kJYWTmyntt
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 41 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 99a0600bfb9ce4df85bc0937032e26c4e220a0b3 && git checkout 99a0600bfb9ce4df85bc0937032e26c4e220a0b3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 64b295cdd75b8fe0aafe158bdb0d7aa54d737b79 eb8b8bd96a925e9db5f27fd819178dd9e45214d3 && git checkout -B drift-repro 64b295cdd75b8fe0aafe158bdb0d7aa54d737b79 && git merge --no-ff eb8b8bd96a925e9db5f27fd819178dd9e45214d3
node scripts/docs-audit/affected-docs.mjs --json 64b295cdd75b8fe0aafe158bdb0d7aa54d737b79 |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cwiNRyb9B38wT2fjYj CI note: 2026-12-05T01:54Z · Generated by Claude Code |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY 席位核对L1 verdict (L1-b): ACCEPT at head Face: Against the card. The card asks for three things. (1) The look-back takes the rule's whitespace and comment step: the receiver-chain class goes from Changeset: a patch on N1 (nit, accepted here): the class still admits identifiers and whitespace between Landing: not governed, Generated by Claude Code |
Requested by Elon · project thread
Fixes #38777
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/cli/src/utils/extract-hook-body.ts: the bound-handle look-back (callsObjectLeafThroughHandle) read the receiver chain between=and.object(with space and tab only, soconst repo = ctx.apifollowed by.object('x');on the next line bound no handle, while the publish rule binds it. The chain now takes any whitespace (the rule's own step). The comment half rides on the comment-blanked copy the extractor already scans (blankComments), soctx.api // cthen a newline and.object('x')is read too.packages/cli/test/extract-hook-body-local-alias-38690.test.ts:gatedCalls(the census that feeds ENUMERATION, PARITY and REBOUND) gains four bound-handle spellings for everyobject-leafgate: one line, a line break, a line comment, a block comment. So both directions are pinned: the build infers the token (ENUMERATION) and the publish rule draws no capability finding on the lowered body (PARITY)..changeset/38777-hook-body-bound-handle-lookback.md:@objectstack/clipatch.Metadata-protocol re-measured:
noneholds. The diff touches no file underpackages/specorpackages/lint; the metadata schema and the publish rule accept and refuse exactly what they did. What moves is the build-side inference for direct callers of the published./hook-bodyentry;os buildreprints handlers on one line through its bundler and is not reached.Tests
PARITY file, at 029f290
pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/extract-hook-body-local-alias-38690.test.tsAblation: the look-back put back to space and tab only
node scripts/ablation-replace.mjs --file packages/cli/src/utils/extract-hook-body.ts --anchor ... -- vitest run (same file); the test imports../src/, so no build sits between the mutation and the run.Acceptance notes
node scripts/ci/snapshot-next.mjs --self-testexits 1 locally on this tree, case "live: an older version commit's push run in flight, found by the waiting reader alone".scripts/ciis byte-identical toorigin/main56bed06 on this branch and the case is offline (mocked HTTP), so this diff does not reach it; reported to the seat.typecheckand the gates that read built declarations (check:dts-closure,check:dual-build-cjs-loads,check:i18n*) were not measured locally (the shared verify lock was held throughout); they are CI's, on this PR's checks.Verification
Files to read first:
packages/cli/src/utils/extract-hook-body.ts, the one-character-class hunk incallsObjectLeafThroughHandle([\w$.? \t]to[\w$.?\s]): the risk is the look-back now crossing a line break into an unrelated earlier statement; the^\s*(?:;|\n|$)tail check on what follows.object(...)is unchanged.packages/cli/test/extract-hook-body-local-alias-38690.test.ts,gatedCalls.Two-minute check:
pnpm --filter @objectstack/cli exec vitest run test/extract-hook-body-local-alias-38690.test.tsreports 284 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj