Skip to content

docs(skills): the automation skill teaches the namespace-qualified inbound hook of a flow name two packages hold - #32839

Merged
os-zhuang merged 1 commit into
mainfrom
claude/project-thread-13ckio
Nov 13, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/project-thread-13ckio

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

domain:skills#1 · os-elon-musk · session_016WV4d1fjXch2mNTmFrYaAu

Fixes #32776

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:objectstack-automation 技能「入站 webhook(api)触发器」一节新增一行:两个包各发一个同名 flow 时,裸地址 /hooks/:flowName/:hookId 对任何请求都回 401 INVALID_SIGNATURE(原因只写服务端日志),每个包的 flow 只能从 POST /api/v1/automation/hooks/:namespace/:flowName/:hookId 进,:namespace 是该包的 manifest.namespace,_env 表示不属于任何包的 flow。
  • 为什么改:两个不同命名空间的包现在可以各发同名 flow。技能只教了裸地址,客户的 agent 照着配发送方会一直收到 401,响应里没有原因,也找不到能用的地址。
  • 风险与回滚:只改技能文案和一个 changeset,不动代码。同文件删 9 处另有出处的重复句来付 token:6854 → 6854,上限 6861 没抬;行数 467 → 467。回滚即撤本 PR。
  • 先看:skills/objectstack-automation/SKILL.md 第 391 行(新增行);第 303 行(第 4 条删掉的尾句,最大的一处删减);第 201 行(过滤操作数的定义改为只留在第 1 条)。
  • 两分钟验证:运行 node scripts/check-skills-token-ratchet.mjs,应看到 skills/objectstack-automation/SKILL.md 6854 / 6861 (-7)。
  • 需要你做的:批准这个 Tier H PR(skills/** 需受管审批人批准),之后席位落地。

What changes

One new line in skills/objectstack-automation/SKILL.md, § Inbound webhook (api) triggers, as the last bullet of the list under the config table (L391):

A flow name two packages hold: the bare hook above answers 401 INVALID_SIGNATURE whatever the signature (cause: server log only). Each package's flow is reached only at POST /api/v1/automation/hooks/:namespace/:flowName/:hookId, by its manifest.namespace (_env there: a flow no package ships).

Nine restatements cut from the same file pay for it. Each row names the cut text and where its content still lives:

# Where Cut Its content still lives in
1 L72, parallel row "no split/join pair to mis-wire" the same cell, "joined implicitly at block end"; and the parallel_gateway / join_gateway row (L77), "Not author-facing … author the container"
2 L96, connector_action row "nothing sent" the same sentence: the input is "judged against the action's inputSchema … before dispatch: a breach fails the step"
3 L146, fault-edge note "type: 'fault' is what routes" the sentence before it (L145-146): "{ source, target, type: 'fault' } routes a failed node to a handler"
4 L160, readonly note "the value never lands" the same sentence: "the engine strips it" (L159) and "the drop is named in the step's warnings"
5 L201, Filter operands "a literal or a CEL envelope" Valid-but-silently-wrong item 1 (L225-232): "A value slot takes a literal or a CEL envelope", which lists "every CRUD filter operand"
6 L250, Valid-but-silently-wrong item 2 "writes the whole record object" the item's opening sentence (L249): "holds the created RECORD, not its id"
7 L295, the defineStack({ functions }) example the "declared writer" comment the sentence above the block (L289): "A function that writes where the platform cannot see declares it"; and effect: 'writes' on the line it annotated
8 L303, Valid-but-silently-wrong item 4 "write the value in the condition AND every fields / filter entry" the item's opening sentence (L299): "compared and written by its option value, never its label"; and its condition and fields / filter examples (L301-303)
9 L435, Integrations "(OpenAPI, remote MCP, plain REST)" the same sentence (L436): provider: 'openapi' | 'mcp' | 'rest'

No hunk touches the notify section (L106-133), which #32785 edits in parallel.

.changeset/32776-automation-skill-qualified-inbound-hook.md: '@objectstack/skills': patch, with the same nine cuts and their other homes.

Tests

Skill prose and one changeset. No package code changes, so no test is added and no ablation applies. The claim's file surface is this SKILL.md and the changeset, so no eval case is added.

packages/rest/src/meta-state-route-doc-spelling.test.ts reads this SKILL.md (its state-introspection route line, L307, which this diff does not touch): pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-state-route-doc-spelling.test.ts on head a4cd80c8, "Test Files 1 passed (1) · Tests 8 passed (8)". pnpm --filter @objectstack/spec run check:skill-examples, which is not a derived family and was run because cut 7 edits a fenced example: exit 0, "345 prose examples type-check across 3 surface(s)".

Acceptance notes

The line is read off the code on main at f770d664, not off the card's prose.

  • AutomationEngine.inboundHookSlot (packages/services/service-automation/src/engine.ts:5707): for a name flowSlots.isShared says is shared, the bare address (no address argument) answers refused with every holder; a qualified address answers served only when exactly one slot's package is among the qualifier's namespace owners, or, for _env, when the slot has no package; anything else is unadmitted. For a name that is not shared it answers undefined, and the door judges the post as before.
  • answerInboundHookSlot (packages/triggers/trigger-api/src/plugin.ts:162): served goes to the slot's own hook; refused goes to refuseSharedName, which logs the cause shared-name with the holders and answers the door's one refusal.
  • That refusal is inboundHookRefusal (packages/core/src/security/inbound-hook-answer.ts): status 401, code INVALID_SIGNATURE, the same for every cause. The slot is asked before the signature is read, hence "whatever the signature".
  • Pins: flow-triggers-per-slot.test.ts ("the inbound hook address of a shared name"), trigger-api/src/inbound-hook-member.test.ts ("a name two packages hold, on http.server"), runtime/src/domains/automation-hooks.test.ts.

The wording in each state.

  • One holder. inboundHookSlot answers undefined and the bare hook serves the flow as before. The new line opens with its condition ("A flow name two packages hold"), and the section's opening sentence still teaches the bare hook, so nothing suggests a one-holder flow needs the qualified address.
  • Two holders. The bare hook answers the one 401; each package's flow is served at the qualified hook under its package's namespace, verified with that slot's secret only.
  • A holder whose body was refused. The name is still shared (FlowSlotTable.isShared is true through heldByMany while the registry holds the name under two packages), so the bare hook still answers the 401. The one slot left is registered but not armed on its trigger (activateFlowTrigger: "registered but NOT armed … It runs when called by its package"; pinned in flow-slots-per-package.test.ts, "[M1, PR-2] the one slot left when the other holder's body was refused is not armed"), so its qualified address routes to a hook that is not armed and gets the same 401. This is why the line says each flow "is reached only at" the qualified hook, a necessary condition, where the card's sentence read "is reached at": the stronger form is false in this state.

Deviations from the card's wording, both for truth.

  1. "is reached only at" in place of "is reached at" (the refused-body state above).
  2. _env is written as a gloss on the namespace position ("_env there: a flow no package ships"). For a name two packages hold, _env reaches no hook (inboundHookSlot('t', { qualifier: '_env', … }) answers unadmitted, pinned), and a package-less slot never sits beside a package slot (flow-slots.ts, invariant D4). _env serves a flow no package ships, as admitInboundHookAddress admits it (pinned in inbound-hook-member.test.ts, "an admitted address is the bare door").

Readings (skills/**).

Before (f770d664) After (a4cd80c8)
skills/objectstack-automation/SKILL.md lines 467 467
same file, bytes 27434 27436
same file, tokens (ceiling 6861) 6854 (headroom 7) 6854 (headroom 7)
bundle, sum of the 11 skills/*/SKILL.md, lines 4604 4604
bundle, sum of the 11 skills/*/SKILL.md, tokens 58724 58724

No ceiling row moves (seat ruling 6794435934 item 2). The new line is 308 bytes; the nine cuts remove 306. No line was re-wrapped to buy room: the one line added is matched by the one line cut 8 removes.

Noted, not filed.

  • content/docs/** does not name the qualified hook either (git grep 'hooks/:n\|hooks/_env' -- content/docs has no hit; content/docs/automation/flows.mdx teaches the one 401 INVALID_SIGNATURE answer). It is outside this card's file surface. carrier: none.
  • skills, automation: teach the notify audience selectors, org:members included #32785 adds lines to this file's notify section and will look for restatements in the same file. The nine above are spent. Whichever PR lands second merges main and re-runs node scripts/check-skills-token-ratchet.mjs; this PR leaves the headroom at 7.

Verification

dispatch-gates on head a4cd80c: 46 derived, 46 run, all exit 0

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 46 commands for the two changed paths (merge base f770d664, head a4cd80c8). The 41 that read no build output ran after pnpm install --frozen-lockfile. The five that read dist/ (check:doc-formula-expressions, check:dts-closure, check:dual-build-cjs-loads, check:lean-entry-closure, check:sourcemap-no-sources-content) ran after a whole-tree pnpm build --concurrency=2 under os-verify-lock ("Tasks: 119 successful, 119 total", VERDICT command-exit 0). All 46 exit 0.

node scripts/pm/dispatch-gates.mjs --ran FILE --repo objectstack-ai/objectstack: "46 derived famil(ies) accounted for — 46 run, 0 NOT-MEASURED", exit 0.

node scripts/check-skills-token-ratchet.mjs: skills/objectstack-automation/SKILL.md 6854 / 6861 (-7); "57 authored bundle file(s) within their ceilings".

pnpm lint (the repo-wide eslint scan) was not run locally. The diff is one Markdown file and one changeset, and the scan belongs to the Lint & Repo Gates check on this PR.

# head a4cd80c8
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:skill-docs :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:skill-links :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:watch-hint-literal :: exit 0

Generated by Claude Code

…bound hook of a flow name two packages hold

The inbound webhook section gains one line: for a flow name two packages
hold, the bare hook answers 401 INVALID_SIGNATURE whatever the signature,
its cause in the server log only, and each package's flow is reached only
at POST /api/v1/automation/hooks/:namespace/:flowName/:hookId, by its
manifest.namespace (_env in that position: a flow no package ships).

The line is paid inside the file's token ceiling by nine restatements cut
from the same file; the changeset names each and where its content still
lives. The file measures 6854 tokens before and after, against a ceiling
of 6861 that does not move, and 467 lines before and after.

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

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-elon-musk · session_016WV4cwTZvo7tAGwbbRW2b8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a4cd80c8dec559cfe8d99a81d6df8dabb35a3426
Local-runs: none
Scope: skills/objectstack-automation/SKILL.md + none

Read: card #32776 (body, claim 6836085282, dev report 6836820789), seat ruling 6794435934 on #31696, PR #32839 (body, file list, net diff against main c04aa29, merge base f770d66), and the 43 check-runs on this head. The other file of the diff, .changeset/32776-automation-skill-qualified-inbound-hook.md, is the lane seat's ACCEPT at TIER_DEFAULT; it is read in ② only.

Check-runs on this head: 26 success, 16 skipped (opt-in, UI and schedule lanes that do not apply to this diff), 0 failed, 1 in progress: Test Core (1/8). Test Core (2/8) completed success during this review. Among the green ones: Lint & Repo Gates and Lint · repo & tooling gates (the token ratchet and its self-test run there), Lint · docs & code guards, Lint · PM dispatch-gates, Check Changeset, PR-body guards, Governed Surface Queue Guard, Type Check · workspace, Build Core. This record does not speak for the shard still running.

① Derived judgments

  1. Public surface: one published skill file gains one bullet and loses nine phrases. No schema, no code, no route, no accept-set moves. Right.
  2. The new bullet publishes a route shape, POST /api/v1/automation/hooks/:namespace/:flowName/:hookId. It is the mount HOOKS_ADDRESSED_PATH (packages/triggers/trigger-api/src/plugin.ts, /api/v1/automation/hooks/:ns/:flowName/:hookId) and the hosted allow-list row. The parameter is spelled :ns in the router and :namespace in the skill; a sender never sees a parameter name, and the card asks for :namespace. Right.
  3. It publishes the answer of the bare hook for a shared name as 401 INVALID_SIGNATURE. That is inboundHookRefusal (packages/core/src/security/inbound-hook-answer.ts): status 401, code INVALID_SIGNATURE, the one answer for every cause. Right.
  4. It publishes _env as the literal in the namespace position. That is ENVIRONMENT_ADDRESS_SEGMENT = '_env' (packages/spec/src/kernel/address-grammar.ts). Right.
  5. It names manifest.namespace as what the qualifier is. Both faces read registry.getNamespaceOwners(qualifier), the table keyed by the installed manifests' namespace (packages/objectql/src/registry.ts), never a package id. Right.
  6. Line budget: 467 lines before and after, 27434 to 27436 bytes. By the gate's own formula, ceil((27436 - 20) / 4) = 6854 against the row ['skills/objectstack-automation/SKILL.md', 6861]; scripts/ is not in the diff, so the row did not move. Ruling 6794435934 item 2 (no ratchet raise) is held. Right.
  7. The nine cuts are deletions of prose only; one of them removes a trailing comment inside a fenced ts example, which leaves the code of the example unchanged. Right.

② Semver level

'@objectstack/skills': patch. The package exists (packages/skills/package.json), the diff adds teaching text to one published skill and removes restatement, and nothing a consumer compiles against or calls changes. Patch matches what the diff publishes.

Clause-②: no. The PR body and the changeset both carry Clause-②: no, and the card says the same. Correct: the diff declares no new authorable capability and narrows none; it documents behaviour already on main since #32507.

③ Boundary flags

  1. "is reached only at" where the card wrote "is reached at". Answered: accepted. In the refused-body state FlowSlotTable.isShared stays true (one slot, heldByMany true), so the bare hook is still refused; the surviving slot is "registered but NOT armed" (activateFlowTrigger, engine.ts ~L4080, pinned by flow-slots-per-package.test.ts "[M1, PR-2] the one slot left ... is not armed"), so its qualified address is routed to a hook that is not armed and gets the same 401. "reached at" would be false there; "reached only at" states a necessary condition and is true in all three states. See ④ nit 2 for what the line leaves unsaid.
  2. _env written as a gloss on the namespace position. Answered: accepted. For a name two packages hold, _env is unadmitted (pinned, flow-triggers-per-slot.test.ts L233), and invariant D4 (flow-slots.ts) keeps a package-less slot from sitting beside a package slot. The gloss says what _env names ("a flow no package ships"), which is what admitInboundHookAddress admits for a name that is not shared. It does not claim _env reaches either holder.
  3. The nine paying cuts sit outside the Inbound section. Answered: accepted. The ruling says "same-file restatement", the card says "deleting restatement in the same file", and the claim's file surface names them. None is in the notify section that skills, automation: teach the notify audience selectors, org:members included #32785 edits.
  4. Branch one commit behind main (c04aa29, an auth fix). Answered: accepted. The net diff against main is these two files; c04aa29 touches no path this review reads the line against that would change the judgment (the engine, the trigger plugin and core's refusal were read on main at c04aa29 itself).

No flag is escalated.

④ Design judgment

skills/objectstack-automation/SKILL.md, the new bullet, against main:

  • One holder. inboundHookSlot returns undefined when isShared is false; the bare mount then serves the post as before. The bullet opens with its condition ("A flow name two packages hold") and the section's first sentence still teaches the bare hook. Nothing tells a one-holder author to change address. The qualified address also works there (admitInboundHookAddress), which the bullet does not deny. Holds.
  • Two holders. Bare address: refused, then answerInboundHookSlot reads the body, calls refuseSharedName (cause shared-name and the holders in the log) and answers the one refusal. The slot is asked before the signature is read, so "whatever the signature" is exact. Qualified address: served when exactly one slot's package is among the qualifier's namespace owners, served under the slot key with that slot's secret. The hosted face (packages/runtime/src/domains/automation-hooks.ts) does the same through handleInboundHook and handleInboundSlotHook. Pinned by inbound-hook-member.test.ts "a name two packages hold, on http.server" and flow-triggers-per-slot.test.ts "the inbound hook address of a shared name". Holds.
  • A holder whose body was refused. Bare: still 401. Qualified: 401 too, since the lone slot is not armed. "only at" holds; see nit 2.
  • Route shape and _env. Exactly what both faces accept; see ① 2 to 5.

The nine cuts, each read in the head's file:

  1. parallel row, "no split/join pair to mis-wire": the cell keeps "joined implicitly at block end" and the gateway row keeps "Not author-facing ... author the container". Restatement.
  2. connector_action row, "nothing sent": the sentence keeps "judged ... before dispatch: a breach fails the step". Restatement.
  3. Fault-edge note, "type: 'fault' is what routes": the sentence before it says { source, target, type: 'fault' } routes a failed node. Restatement.
  4. readonly note, "the value never lands": "the engine strips it" and "the drop is named in the step's warnings" remain. Restatement.
  5. Filter operands, "a literal or a CEL envelope": defined in Valid-but-silently-wrong item 1, which names "every CRUD filter operand". Restatement; see nit 4.
  6. Item 2, "writes the whole record object": the item's heading says the variable "holds the created RECORD, not its id", and the wrong and right spellings both remain. Restatement.
  7. The "declared writer" comment: the sentence above the block and effect: 'writes' on the same line say it. Restatement.
  8. Item 4, "write the value in the condition AND every fields / filter entry": the heading says "compared and written by its option value, never its label", and the condition and fields / filter failures remain. Restatement; see nit 5.
  9. Integrations, "(OpenAPI, remote MCP, plain REST)": provider: 'openapi' | 'mcp' | 'rest' is in the same sentence. Restatement.

No rule is lost by any of the nine.

Findings:

  • nit 1. The skill writes :namespace where the router's parameter is :ns. No effect on a sender.
  • nit 2. In the refused-body state the line is true but does not tell the reader that the qualified hook answers 401 as well until the other package's body is fixed. That state is a broken deployment the engine warns about once in the server log, the line already sends the reader to the server log for the cause, and the file has 7 tokens of headroom. Not worth a further cut.
  • nit 3. Two more states where no address reaches a holder of a shared name, both consistent with "only at": two holders that co-own one shareable namespace (two slots match the qualifier, so unadmitted), and a package whose namespace is runs (INBOUND_HOOK_QUALIFIER_EXCLUSIONS, documented in address-grammar.ts as having no qualified hook address). The line states neither and is false in neither.
  • nit 4. After cut 5 the Filter-operands bullet says "Each operand is a value slot" and the definition of a value slot follows 27 lines later, in item 1. The term is already used undefined earlier in the file (the connector_action row), so the forward reference is the file's existing habit.
  • nit 5. After cut 8, item 4 ends on "Read the field's options." with the imperative gone. The rule is in the item's bold heading; the item has never carried a corrected example.

must-fix 0 · should-fix 0 · nit 5.

Implemented-by: claude/project-thread-13ckio
Reviewed-by: session_016WV4cwTZvo7tAGwbbRW2b8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-elon-musk · session_016WV4cwTZvo7tAGwbbRW2b8

维护者速读(席位终稿)

席位核对 — ACCEPT · domain:skills#1 · head a4cd80c8dec559cfe8d99a81d6df8dabb35a3426

  • 形态: draft → main;首行 Fixes #32776(无其它卡号挨闭合关键词);作者 objectstack-fleet[bot](经中继)。
  • 前提实测: 认领 6836085282 读数成立;main 自 merge base 起未碰 skills/。
  • 门禁 check-runs(现 head): 44 个,28 success · 16 skipped · 0 failed,Test Core 全部 8 片完成绿。
  • 契约复审: CONTRACT_REVIEW_TIER PASS 6836964952,同 head;must-fix 0 · should-fix 0 · nit 5(均不推新 head)。
  • changeset(TIER_DEFAULT,席位逐句核): '@objectstack/skills': patch;正文所述新增行与九处删减逐条对得上 diff,Clause-②: no、Metadata-protocol: none 与 PR 正文一致。
  • 接受的偏差: dev 四旗(「only at」措辞、_env 作注、删减在本节外、落后 main 一个无关提交)均经复审 ③ 接受;nit 1–5 记为接受偏差。
  • 范围外去向: 无。Skills-docs: n/a(本身即 skills 卡)。
  • 落地条款: Tier H:挂 pm:awaiting-merge,请审批人 os-zhuang、hotlong;批准后席位落地(ready + auto-merge)。同文件 docs(skills): objectstack-automation teaches the notify audience selectors, org:members included #32841 在本 PR 合并后才合 main 补删减。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 12, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 12, 2026 23:39
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 522882a Nov 13, 2026
50 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-13ckio branch November 13, 2026 00:33
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…o 1 s before merged_at as the merge's (objectstack-ai#38896)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB1hPSUXVWWaX4kvGfBzBT7q)_

Fixes objectstack-ai#38863
Refs objectstack-ai#34178
Clause-②: no
Metadata-protocol: none

## 维护者速读
- 用户无感:每周治理合并审计不再把维护者本人经合并队列落地的改动,误报成席位违规。
-
为治理审计这一车队工具消除误报:合并队列在合并前一秒记下“移出队列”,旧读法把它当成最新的队列事件,读不出是谁把改动放进队列;现在只对队列机器人在合并前一秒之内的那一次移出放行,一秒是十二条误报上全部实测到的间隔。
- 出错只会让审计报告漏报或继续误报,不影响任何合并;可直接撤回本次改动恢复旧读法。
- 要你做的:这是须由维护者批准的治理面改动,批准一次即可。

## What changes

`scripts/pm/check-governed-merges.mjs` only (Tier H: an always-H
instrument).

- New `timelineAsQueued(events, landed, { enqueueEvent, dequeueEvent })`
feeds the enqueue leg of `readLandingClearance`. It keeps the events
strictly before `merged_at`, as before. It also drops the merge's own
terminal `removed_from_merge_queue`, but only when all three hold: it is
the **last** queue event the cut keeps, its actor is
`github-merge-queue[bot]` (`MERGE_QUEUE_BOT`), and it is at most
`MERGE_QUEUE_REMOVAL_WINDOW_MS` before `merged_at`. The guard's
`enqueuerFromTimeline` then reads the actor of the
`added_to_merge_queue` before it. The guard is not edited.
- `MERGE_QUEUE_REMOVAL_WINDOW_MS = 1000`. Its docblock cites the
readings: 0 s on objectstack-ai#33555, objectstack-ai#33632 and objectstack-ai#33616, and 1 s on all twelve BREACH
rows of objectstack-ai#34178 (table below). GitHub stamps whole seconds, so 1 s is the
narrowest window the readings support. No gap over 1 s was measured.
- Unchanged readings: a removal by any other actor, a removal further
out (an ejection the queue made first), and an earlier removal followed
by a re-add (the newest queue event is then the add). If the guard's
event names stop being strings, nothing is dropped and the leg stays
undetermined. It never clears on that path.
- Both callers of the landing half pick this up: the low-risk arm leg
and the `.claude/**` split leg.
- The two docblocks (the `readArmLanding` header and the self-test
fixture comment) now state the measured window instead of "shares the
merge's instant".

## Tests

Self-test pins, under `node scripts/pm/check-governed-merges.mjs
--self-test` (1017 assertions, exit 0 on `062ea49f4`):
- objectstack-ai#33603 battery, 71 → 77:
  - the one-second shape clears on the enqueue leg;
- the equal-instant control still clears, and a fleet-bot enqueue on the
one-second shape does not;
  - a removal 2 s or 60 s out stays undetermined;
  - a removal inside the window by another actor stays undetermined;
- after an earlier ejection, the re-add's enqueuer decides (the objectstack-ai#33355 /
objectstack-ai#33394 shape);
  - the pure reader, including a queue-bot removal that an add follows.
- objectstack-ai#35612 split battery, 35 → 36: the one-second shape on the split leg,
with another actor's removal and the fleet bot as controls.

<details><summary>Ablation (fix committed first; every mutation via
scripts/ablation-replace.mjs, restored to the HEAD blob)</summary>

- Enqueue leg back to the plain cut: red on 3 pins (the one-second
shape, the re-add after an ejection, the split leg's one-second shape).
The controls stay green, as expected, because the old reading was
already undetermined for them.
- Actor binding removed: red on the another-actor pin and on the split
pin. A first attempt was a no-op: the tool refused because the
replacement text already existed elsewhere. It was re-run with a unique
replacement.
- Window widened to 60 s: red on the outside-the-window pin and the
pure-reader pin.
- Last-event binding removed: green at first, which exposed a gap. Added
the pin for a queue-bot removal that an add follows (commit
`062ea49f4`). Re-ablated: red.

</details>

## Re-run on objectstack-ai#34178's rows

Enqueue leg, read on each PR's **live** timeline and `merged_at` through
the real guard, before (strict cut) and after (`timelineAsQueued`):

| PR | queue events (UTC) | gap | before | after |
|---|---|---|---|---|
| objectstack-ai#37072 | add os-zhuang 19:16:14 · rem bot 19:34:41 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#36775 | add os-zhuang 22:00:38 · rem bot 22:21:05 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#36067 | add os-zhuang 17:33:58 · rem bot 18:06:13 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#35673 | add os-zhuang 22:28:18 · rem bot 23:03:52 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#35709 | add os-zhuang 04:52:39 · rem bot 05:21:36 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#33355 | add · rem 09:52:16 · re-add os-zhuang 11:13:10 · rem bot
11:50:11 | 1 s | undetermined | authorized (os-zhuang) |
| objectstack-ai#33577 | add os-zhuang 02:51:26 · rem bot 04:44:21 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#33589 | add os-zhuang 02:50:20 · rem bot 04:44:21 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#33394 | add · rem 21:48:10 · re-add os-zhuang 22:52:01 · rem bot
00:44:32 | 1 s | undetermined | authorized (os-zhuang) |
| objectstack-ai#32841 | add os-zhuang 01:28:50 · rem bot 02:13:54 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#32839 | add os-zhuang 23:39:46 · rem bot 00:33:14 | 1 s |
undetermined | authorized (os-zhuang) |
| objectstack-ai#32313 | add os-zhuang 23:44:14 · rem bot 00:13:08 | 1 s |
undetermined | authorized (os-zhuang) |
| control objectstack-ai#33555 | removal == merged_at | 0 s | authorized (os-zhuang) |
authorized (os-zhuang) |
| control objectstack-ai#33632 | removal == merged_at | 0 s | authorized (os-zhuang) |
authorized (os-zhuang) |
| control objectstack-ai#33616 | enqueued by objectstack-fleet[bot] | 0 s |
unauthorized | unauthorized |

End-to-end sweep, the real CLI on both trees with `--since
2026-11-24T19:30:00Z --repos objectstack --json`. Both runs complete,
228 entries each:
- objectstack-ai#37072 goes from `breach` (stage) on `197e3ff3b` to `cleared` by
enqueue (os-zhuang) on `062ea49f4`.
- One more entry moved, outside the 12: **objectstack-ai#38233**, from `pass` to
`cleared` by enqueue. Its timeline has the same shape: added by
os-zhuang 09:48:54, removed by the bot 10:20:32, merged 10:20:33. It was
listed as a seat landing on a record, but it was the maintainer's
enqueue.
- No other entry changed state.

NOT MEASURED: the end-to-end sweep row for the other eleven PRs. A
window back to 2026-11-10 timed out at 570 s, and a 7-day window already
takes about 8 minutes per tree, so this container's 10-minute foreground
limit cannot fit it. Their enqueue-leg reading is in the table above.
The weekly audit job will read them on its next run.

## Smaller finding: recommendation for the seat to route

Recommendation: **enforce the record template where the record is
written. Do not widen the reader.** This PR changes no recogniser
(`record-recognisers.mjs` is outside the claimed surface).

- Evidence: the template the reviewer is handed already spells both
forms the 8 rows missed (`scripts/pm/record-recognisers.mjs` lines
2555–2559 on `197e3ff3b`): a clean round is written `No must-fix, no
should-fix.`, and the delta record names what it closes as `S1: closed`.
The rows wrote `must-fix 0 · should-fix 0`, `S1 closed.` and `F1
(must-fix on SHA): fixed.`, which are off-template.
- Reason: the audit reads records through the queue guard's own reader,
so the audit and the queue agree on what a record says. Widening the
reader alone would make them disagree. Widening it for both changes what
the queue accepts, a contract we own on both ends (AGENTS.md Prime
Directive objectstack-ai#12: reject off-spec input at authoring, never accept a
dialect). A check when the record is written tells the reviewer at once,
while the record can still be fixed.
- After this PR, those 12 rows clear on the enqueue leg, so the phrasing
gap no longer decides them. It matters only for seat landings, where the
queue already refuses the same phrasing.

## Acceptance notes

- `origin/main` moved one commit past the base (`3c617a28e`,
`packages/spec` and `ui/` only, nothing under `scripts/pm/`). It was not
merged in, because the diff does not overlap it.
- For the live sweep, this container's shallow clone was deepened with
`git fetch --shallow-since=2026-11-02 origin main` (additive).

## Verification

Read first:
1. `timelineAsQueued` and `MERGE_QUEUE_REMOVAL_WINDOW_MS` (the risk
hunk: the three conditions that drop an event).
2. The one-line change in `readLandingClearance`.
3. The `WINDOW` pins in the objectstack-ai#33603 battery.

Two-minute check: run `node scripts/pm/check-governed-merges.mjs
--self-test`. Expected: `✓ check-governed-merges --self-test: 1017
assertions`, exit 0.

<details><summary>Local gates on 062ea49</summary>

- The derived set is `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack`, 63 commands. Reconciled with
`--ran`: `63 derived, 61 run, 2 NOT-MEASURED, 0 UNRUN`.
- NOT MEASURED, both left to CI:
- `pnpm check:i18n-coverage`: exit 3, PREREQUISITE NOT MET (no CLI or
examples build in this worktree).
- `pnpm check:pm-dispatch-gates`: killed by timeout at 200 s and again
at 280 s on the shared box, so it never reached a verdict.
- `node scripts/check-self-test-workflow-commands.mjs` first failed when
its spawn timed out (`spawnSync node ETIMEDOUT`) while the box was
loaded. Re-run alone: exit 0.
- Every other command: exit 0.
- No changeset: `scripts/pm/**` is not published (`skip-changeset`).

</details>

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

---------

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

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s 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.

skills(objectstack-automation): teach the namespace-qualified inbound hook of a flow name two packages hold

3 participants