Skip to content

feat(spec)!: the AI-door confirmation rule binds every AI door, the in-app assistant included - #34001

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-yg8bqb
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-yg8bqb

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #33808

Clause-②: no (narrowing)
Metadata-protocol: semantic

维护者速读

  1. 改了什么:AI 入口确认契约(ai-service.ts)写明:规则对所有 AI 入口生效,包括应用内助手;应用内助手保留自己的确认卡和收件箱,并写明三点:只有本人能同意、只认登录状态、同意后按本人权限重查再执行。IAIService 的三个待批成员的注释同步写明这三点,签名不变。
  2. 为什么改:Contract: a confirmation-required action on an AI door is confirmed by a human through MCP elicitation, never by the caller's own confirm: true #33689 Q1 已裁 B(「B 同一规则,两套流程暂留」)。契约原来只写了 MCP 两个工具,应用内助手是一条绕过同一个「需要确认」声明的旁路。
  3. 风险与回滚:属于收紧(breaking,实现落地时生效):管理员不能再替别人批应用内的待批动作,API key/token 也不能批。本次发版不改变任何入口的行为,只改契约文字、固定测试,并登记一条升级提示(semantic 迁移条目)。回滚即还原这两个提交。
  4. 先看:packages/spec/src/contracts/ai-service.ts 新增的「The in-app assistant door」一节(三点、对队列里每一项都生效、未接通则不提供该动作);.changeset/33808-ai-door-confirmation-in-app.md 的 BREAKING 说明与 FROM/TO;新迁移条目 18.in-app-pending-action-decided-by-person.ts。
  5. 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/contracts/action-confirmation-contract.pin.test.ts src/contracts/ai-service.test.ts,预期 46 个测试全绿(换回 main 的契约文字时新增的 4 个转红)。
  6. 需要你做的:无,席位落地(落地前席位做一次契约档复核)。

What changes

packages/spec/src/contracts/ai-service.ts, contract text only; no export, type or signature moves.

  • Rule 1 of the confirmation contract (the docblock of AI_ACTION_CONFIRMATION_CAPABILITY) now covers EVERY AI door that starts an action declaring ai.requiresConfirmation: true: the MCP run_action and resume_run tools and the in-app assistant's action tools (ADR-0011's actions-as-tools runtime). Rules 2 to 4 are named as the MCP doors' channel; rules 5 and 6 bind the in-app door as written.
  • New section, "The in-app assistant door: the same rule, its own channel", citing ruling record 6893484458 on Contract: a confirmation-required action on an AI door is confirmed by a human through MCP elicitation, never by the caller's own confirm: true #33689 (「B 同一规则,两套流程暂留」). The door asks through the pending-action queue of IAIService (inline pending-approval card plus inbox, the tool answers pending_approval); when that channel is not wired it does not offer a declared-gated action as a tool at all. Its three points:
    1. Who decides: only the person the call ran as. Holding ai:approve or any other permission does not let another user decide; a second approver uses the existing held outcome (the approvals engine).
    2. Which credential: the approve and reject doors take a person's signed-in session to the app and nothing else; an API key, token, other service credential or AI identity is refused, whoever it resolves to.
    3. As whom it runs: as that person, never as a synthetic AI principal, every gate and permission re-checked at the moment of approval; a refusal there runs nothing and the row is failed.
      Neither the model's own confirmation nor the caller's confirm counts.
  • Every queued item (review S1): one sentence in the in-app section: the three points bind EVERY item in the in-app queue, whichever trigger queued it (the declared flag or the destructive heuristic), because a pending row does not record why it was queued and the queue has one decider rule; an administrator who must also approve does so through held. Rule 1's reach for the MCP doors is unchanged (the declared flag alone).
  • Its bounds: the in-app queue and IActionConfirmationService stay two seams (merging them was not ruled; Contract: merge the in-app pending-action queue into the AI-door confirmation seam (#33689 Q1, option C deferred) #33806).
  • When it binds: the in-app door's FROM half is stated (today any ai:approve holder decides, the routes take whatever credential they authenticate, an approved item goes through ADR-0011's pre-registered dispatcher), beside the MCP doors' existing one.
  • IAIService.proposePendingAction / approvePendingAction / rejectPendingAction stay, signatures unchanged; each docblock now states the points that bind it (approvePendingAction: actorId must be the row's proposed_by, the calling door admits only a signed-in session, the re-dispatch runs as that person with every gate re-checked, a second approver uses held). proposePendingAction also names ai.requiresConfirmation: true as a queueing trigger, as ADR-0011's table already does.
  • .changeset/33808-ai-door-confirmation-in-app.md (review M1): feat(spec)!:, Clause-②: no (narrowing) (nothing widens), Metadata-protocol: semantic, @objectstack/spec minor, the BREAKING-when-implemented banner and the ADR-0087 marker registered in-app-pending-action-decided-by-person, matching the Contract: a confirmation-required action on an AI door is confirmed by a human through MCP elicitation, never by the caller's own confirm: true #33689 changeset for the same contract.
  • packages/spec/src/migrations/entries/semantic/18.in-app-pending-action-decided-by-person.ts: the new semantic entry that marker names, written conditionally like action-requires-confirmation-elicited, so the upgrade guide and os migrate meta carry the notice.
  • Generated artifacts: none move. check:generated --fix built packages/spec itself and answered "All 14 generated artifacts are up to date"; the registry is written at build time and git-ignored.

Not here, by the card: docs/adr/** (ADR-0011's amendment note already says the three changes land through #33808), the cloud approve and reject routes (#33809), the seam merge (#33806), the runtime and MCP switch (the implementing card).

Why

#33689 Q1 was ruled B: 「新规则对所有 AI 入口生效:只有本人、在登录状态下能同意,同意后按本人权限重查再执行。应用内确认卡保留,管理员代批改走暂挂审批。」 Until the contract says so, the in-app door is a side path around a declared confirmation gate.

First-party exposure of the narrowing (read only, at merge base 895783a)

The narrowing lands with the implementing change; nothing below moves in this PR.

  • ui inbox and in-chat card: 15 source files (51 with tests) under ui/apps and ui/packages name the pending-action seam (git grep -l -E 'pending-actions|PendingActions|usePendingActions|useHitlInChat|AiPendingAction', CHANGELOGs and locale bundles excluded). The card's count of 21 used a different pattern; this one is reproducible. Two of them DECIDE: ui/packages/plugin-chatbot/src/usePendingActions.ts (approve :385, reject :396) and ui/packages/plugin-chatbot/src/useHitlInChat.ts (:223-231). Both POST with credentials: 'include' (the session cookie) and merge caller-supplied headers, documented as possibly carrying Authorization. Exposed once enforced: an inbox operator deciding another user's item is refused, and a host that authenticates the inbox by bearer only is refused.
  • Client SDK: client.ai.pendingActions.approve / reject (packages/client/src/index.ts :7744-7765); its docblock says deciding takes ai:approve. An SDK caller on an API key or token is refused once enforced. Docs mirror: content/docs/api/client-sdk.mdx :418-426.
  • examples: examples/app-todo/src/actions/task.actions.ts :143-153 mentions the queue in comments; zero decision call sites.
  • skills: skills/objectstack-ai/SKILL.md :163-166 says "an operator approves or rejects in Studio's AI Pending Actions inbox (or via GET/POST /api/v1/ai/pending-actions/...)" (the changeset's Skills-docs: line).

Tests

  • New, packages/spec/src/contracts/action-confirmation-contract.pin.test.ts: "the rule binds EVERY AI door, the in-app assistant included, through its own channel" (rule 1's new reach with the MCP-only reading as a negative control, the section heading, not-offered-when-unwired, the three points, the every-queued-item sentence with rule 1's declared-flag predicate as its control, the model's own confirmation, two seams, the in-app FROM half). The amended describe's header names it.
  • New, packages/spec/src/contracts/ai-service.test.ts: a top-level describe pinning the three members' docblocks (one it per member), plus a control that listPendingActions carries none of the deciding points, so the docblock reader is shown not to answer every member alike.
  • Forced test edits: none. Every existing assertion in both files passes unchanged.
  • Reverse verification (one-off, no file kept): with ai-service.ts set to main's 895783a text, the four new member/section tests went red (Tests 4 failed | 36 passed (40), lock VERDICT command-exit 1) and the listPendingActions control and every pre-existing test stayed green; restored with git checkout HEAD --, hash equal to HEAD's blob, git diff HEAD empty.

Acceptance notes

Follow-ups (from contract review 6897177404)

  • For the in-app door's implementing card: it must refuse to queue an in-app item without the person the call ran as (proposedBy); ProposePendingActionInput.proposedBy stays optional in this PR (review flag 1, option A).
  • N1, implementing card: say how a refused decision reaches the caller. approvePendingAction's failed means an approved item whose execution failed, so a refusal of another user (and on rejectPendingAction likewise) has to be a throw; the docblocks could say so.
  • N2, implementing card: an in-app item whose person never answers, or has left, stays pending, since only that person may reject it. The hand-off text leaves lapse to the host in words; the in-app text could say the same.
  • N3, a separate prose card: proposePendingAction's sentence still lists "has confirmText" as a danger signal, while skills/objectstack-ai/SKILL.md :153 says confirmText is dialog copy and not a destructive signal. Older than this PR and outside the card.

Verification

Head is now 9a9adad: a merge of main only (e71ecc1, via scripts/pm/os-regen-merge.sh, no rebase, no force-push), made under the seat's K ≥ 15 landing rule because main had moved 15+ commits past the merge base. The figures below were taken at b091e45 (round 1 on top of 10b5d04), on a worktree build of @objectstack/spec from that head. The PR's own diff is byte-identical: git diff b091e451 9a9adad0 over the five PR files is empty, and origin/main...9a9adad0 is still those five files, +294/−8.

At the previous merge head 7af536e (main b4ce310, same diff) the readings were: a full pnpm build exit 0; @objectstack/spec test exit 0 with Test Files 842 passed (842), Tests 26966 passed | 1 todo; spec typecheck exit 0; the same 88 derived gates all exit 0; and every CI check green or skipped.

spec package
  • pnpm --filter @objectstack/spec build: exit 0.
  • pnpm --filter @objectstack/spec test: exit 0, Test Files 842 passed (842), Tests 26961 passed | 1 todo (26962).
  • pnpm --filter @objectstack/spec typecheck: exit 0.
  • pnpm --filter @objectstack/spec check:generated --fix (it rebuilds spec first): exit 0, "All 14 generated artifacts are up to date", nothing written. A first check:generated on this head read check:docs stale while the gate sweep was regenerating the git-ignored json-schema/ tree beside it in the same worktree; the standalone check:docs gate and the --fix run that builds its own input both answer clean, and git status stayed empty.
  • packages/spec/src/migrations/migrations.test.ts (reads the semantic entries directory, so it reads the new entry) with the two pin files, at b091e45: Test Files 3 passed (3), Tests 198 passed (198), lock VERDICT command-exit 0.
  • Round 0's reverse verification still stands for the round-0 pins; the S1 assertions sit in the same it, beside rule 1's declared-flag predicate as their control.
dogfood battery (Clause-② now carries the narrowing arm)
  • b091e45 · pnpm --filter @objectstack/dogfood test under the lock after a full build of its closure · VERDICT command-exit 0 · Test Files 467 passed | 3 skipped (470) · Tests 3959 passed | 42 skipped (4001) · no failure.
consumers
  • ui/packages/plugin-chatbot/src/__tests__/spec-symbol-batch6.test.ts (imports PendingActionRow / PendingActionStatus from the spec contract), run from the ui root at 10b5d04: Test Files 1 passed (1), Tests 22 passed (22); round 1 moves no type.
  • packages/mcp/src/plugin.ts and packages/runtime/src/domains/ai.ts import IAIService for chat and the tool registry only; no test in either imports the pending members or these pins, and no type moved.
derived gates at b091e45: 88 derived, 88 run, all exit 0 (dispatch-gates --ran: 0 NOT-MEASURED, 0 UNRUN)

Derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (merge base 895783a, 5 paths). Round 1's migration entry adds check:spec-changes, check:upgrade-guide, check:role-word and check:settings-bind-window to round 0's 84. check:type-check-debt first answered exit 3 (its build queued behind the dogfood hold and timed out, nothing measured) and was re-run under the lock: exit 0, 0 raw tsc errors, none above its recorded number.

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 :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dev-prereqs.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-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: 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/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/check-governed-queue-guard.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:api-surface :: exit 0
pnpm --filter @objectstack/spec run check:authorable-surface :: exit 0
pnpm --filter @objectstack/spec run check:browser-reachable-entries :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:dual-source-exports :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:entry-nameability :: exit 0
pnpm --filter @objectstack/spec run check:export-origins :: exit 0
pnpm --filter @objectstack/spec run check:exported-any :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm --filter @objectstack/spec run check:spec-changes :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:upgrade-guide :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:adr-symbol-anchors :: 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:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: 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:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:spec-docblock-symbol-anchors :: exit 0
pnpm check:spec-parsed-alias :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

…door

Rule 1 of the confirmation contract now covers every AI door that starts
a declared-gated action, the in-app assistant included. A new section
states the in-app door's own channel (pending-approval card and inbox,
not offered when unwired) and its three points: only the person the call
ran as decides, only on a signed-in session, and the approved action runs
as that person with every gate re-checked. The IAIService pending-action
members carry the same points; their signatures do not change. Pins
follow the new sentences.

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

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/kernel/contracts/index.mdx (via IAIService (symbol, a top-level interface))

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

  • content/docs/releases/v17/17-0.mdx (via IAIService (symbol, a top-level interface))

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 — 173 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 e71ecc1b32cca6a8c56ae1d949c0b9100465475e → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 e71ecc1b32cca6a8c56ae1d949c0b9100465475e → 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

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 10b5d04 · 2026-11-15T15:47Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 10b5d04babce3a274793983aa868c14fc00db455
Local-runs: none
Scope: packages/spec/src/contracts/ai-service.ts + packages/spec/src/contracts/action-confirmation-contract.pin.test.ts, packages/spec/src/contracts/ai-service.test.ts

Inputs read: card #33808 (body and all four comments), ruling record 6893484458 on #33689, PR #34001 (body, file list, net diff against main), the check-runs on this head. Code read, not reviewed: docs/adr/0011-actions-as-ai-tools.md (invocation flow, confirmation table, amendment note), skills/objectstack-ai/SKILL.md :150-166, packages/client/src/index.ts :7707-7765, scripts/pm/clause2-line.mjs, .changeset/33689-ai-action-confirmation-elicited.md, AGENTS.md Post-Task Checklist item 3. The service-ai approve and reject routes are not in this repository (cloud, #33809), so the first consumer was judged from ADR-0011 and the client SDK.

Check-runs at reading time. Completed, success: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, PR-body guards, Spec property liveness, Dogfood Regression Gate, Flag docs affected by code changes, Auto Label, filter, Plan Test Core shards, Plan Test UI shards. STILL IN PROGRESS, so no verdict from them: Build Core, Build UI Deps, Test Core 1/8 to 8/8 (the shards that run the two pin files), Type Check (workspace, source gates, consumer gates, debt ledger), Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates (carries the ADR-0087 registration gate), Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Live E2E UI. No failed run. The rest are skipped.

① Derived judgments

  • Public surface: no export, type, signature or schema moves. Right. The diff is TSDoc on AI_ACTION_CONFIRMATION_CAPABILITY and on three IAIService members, plus prose pins.
  • Accept set, widening: none. Nothing a caller or an author can do today is newly admitted.
  • Accept set, narrowing, stated by the contract for the implementing doors: (a) a holder of ai:approve no longer decides another user's item; (b) the approve and reject doors refuse an API key, a token, any service credential and an AI identity; (c) an approved item runs as the person with every gate re-checked, not through the pre-registered dispatcher; (d) rule 1 reaches the in-app assistant's action tools. Each is right against the ruling record (only the person the call ran as; a signed-in session only; runs as that person, permissions re-checked; the in-app card and inbox stay; a second approver goes through held).
  • The narrowing is published by this diff as contract text and declared by it as bare yes. Wrong: see M1.
  • No generated artifact moves. Right for TSDoc on interfaces and a constant; the check:generated verdict is in the unfinished Build and Test runs.

② Semver level

M1 (must-fix) — the Clause-②: line under-declares a breaking narrowing. The PR body and the changeset both read Clause-②: yes. In the one reader (scripts/pm/clause2-line.mjs) bare yes is "a widening", and this diff widens nothing. What it publishes is a narrowing, and the changeset says so itself: its sentence after the line names two refusals, and its last section is a FROM/TO migration for callers who are refused. The card asked for Clause-②: yes (narrowing); the seat's claim dropped the arm without a stated reason, and the PR copied the claim. The dev's ground for keeping it (nothing changes at a door in this release) was equally true of PR #33725 for #33689, which shipped the same kind of text in the same file under yes (narrowing), with a ! title, a BREAKING banner and an ADR-0087 marker. Two changesets on one contract cannot answer that question two ways. The arm is also load-bearing: the ADR-0087 registration gate keys on it, so without it the narrowing ships with no disposition and that gate has nothing to refuse. Deferring the declaration to "the implementing change" does not hold either: the deciding routes are in another repository (#33809), and IAIService is a contract a third-party host implements from the release that carries this text.
Fix: the seat re-claims with the (narrowing) arm, and the PR body and changeset carry the same line. no (narrowing) is the truthful spelling since nothing widens; the card's yes (narrowing) is also acceptable, as both read as breaking. The changeset then adds its ADR-0087 disposition marker and the BREAKING-when-implemented banner, as the #33689 changeset does, and the dogfood battery runs on the final head. The fix moves the head, so it earns a delta review.

③ Boundary flags

  • Dev flag 1, ProposePendingActionInput.proposedBy stays optional: answered, option A. No shape change in this PR. By the letter of the new text an item with no recorded person is decidable by nobody (actorId is a required string and must equal proposed_by), so the gap fails closed; and rule 6, which rule 1 now applies to the in-app door as written, means a declared-gated call with no person behind it is not queued at all. The implementing card must refuse to queue without the person. The seat owes that sentence on the implementing card, which no input names by number; until it is written there this flag is only parked.
  • Dev flag 2, bare yes against the card's yes (narrowing): answered, option B. This is M1.
  • Dev deviation, PR assignee unset: no contract effect; the seat's.
  • Out-of-scope findings in the dev report (skills paragraph, client SDK docblock and docs page, ui decision hooks, cloud routes): correctly left out by the card's scope and named in the changeset's Skills-docs: line. Not reviewed.
  • Security line: n/a, no hits path is under skills/** or ui/skills/**. The change is a permission boundary by the triage's own word; the label is the seat's call.

④ Design judgment

packages/spec/src/contracts/ai-service.ts, against the ruling record, ADR-0011 and the first consumer.

Holds:

  • Rule 1 now names the in-app assistant's action tools beside the two MCP tools, keeps the DECLARED predicate, and says which rules are channel (2 to 4, MCP) and which bind every door (5 and 6). That is the ruling's "same rule, two flows".
  • The in-app section matches ADR-0011 as it stands: the handler enqueues and answers pending_approval; the card and inbox show the item; with the queue unwired a gated action is not registered as a tool (ADR table rows 2 and 3, SKILL.md :152-156). "Not offered when unwired" is today's behaviour, stated, not a new rule.
  • The three points are the ruling's three, and mirror the hand-off sentence for sentence (rule 3 step 2 and rule 4's last paragraph): who decides, session only with the same refused set, runs as the person through the admitted sequence (packages/runtime/src/action-dispatch.ts :4) with a refusal recorded as failed, a state PendingActionStatus and the client SDK's approve docblock already carry.
  • The second-approver path is the existing held outcome, whose docblock is unchanged and consistent.
  • "Its bounds" keeps the two seams apart, as the ruling left them (Contract: merge the in-app pending-action queue into the AI-door confirmation seam (#33689 Q1, option C deferred) #33806). "When it binds" states the in-app FROM half, and it matches ADR-0011's flow (operator approves, pre-registered bypass dispatcher) and the client SDK docblock (ai:approve).
  • The three member docblocks agree with the section. Signatures are untouched.

Findings:

S1 (should-fix) — the scope of the three points is stated two ways. Rule 1 limits the contract to the DECLARED flag, "never the listing heuristic", and the in-app section sits under that rule. The member docblocks bind every item: proposePendingAction says it is used when the action is dangerous by the heuristic OR declares the flag, and that the three points bind "the item from the moment it is recorded"; approvePendingAction and rejectPendingAction require actorId to be proposed_by with no condition. The changeset also says "someone else's in-app pending action", every one. A row does not record why it was queued (PendingActionRow has no such field), so an implementer cannot apply the points to declared-gated items only. A reader of rule 1 alone concludes that a heuristic-queued delete stays decidable by an ai:approve holder; a reader of the member concludes it does not. At a permission boundary the contract has to pick. Fix: one sentence in the in-app section saying the three points bind every item in the in-app queue, whichever trigger queued it, because the queue has one decider rule; or restrict the members and add what tells the two kinds of row apart. The first is the reading the tapped option supports (the in-app card stays, an administrator's approval moves to held). If the seat reads the ruling record's "for a declared-gated action" as excluding heuristic-queued items, that is a question for the maintainer, not for the dev.

N1 (nit) — approvePendingAction says another user "is refused" and the row stays pending, but not how the refusal reaches the caller. The return type's failed means an approved item whose execution failed, so a refusal has to be a throw; the docblock could say so. rejectPendingAction likewise. Left to the implementing card.
N2 (nit) — the in-app section says nothing about an item whose person never answers or has left. With only that person able to reject, such an item stays pending. The hand-off text leaves lapse to the host in words; the in-app text could say the same. Follow-up.
N3 (nit) — the sentence the diff extends in proposePendingAction still lists "has confirmText" as a danger signal, where skills/objectstack-ai/SKILL.md :153 says confirmText is dialog copy and not a destructive signal. Older than this PR and outside the card. Follow-up.

packages/spec/src/contracts/action-confirmation-contract.pin.test.ts and packages/spec/src/contracts/ai-service.test.ts, as the enforcement of the prose.

  • Read against the head text with comment gutters folded, every new pattern matches a sentence that is there, and each pins a sentence of the ruling: rule 1's reach with the MCP-only wording as a negative control, the section heading, not-offered-when-unwired, the three points, held for a second person, two seams, the in-app FROM half, and the three members with listPendingActions as the control that carries none of them. memberDoc anchors on the member's declaration, not on a {@link} mention, and checks that the docblock closes above it.
  • The pins agree with the contract. They pin wording only, as their header says. Their run verdict is the Test Core shards, still in progress.
  • The S1 fix adds a sentence a pin should follow.

The changeset and the PR body's prose are not reviewed beyond ② and the declaration lines.

Implemented-by: claude/project-thread-yg8bqb
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: FAIL

…y queued item

The in-app door's three points bind every item in its pending queue,
whichever trigger queued it: a row does not record why it was queued
and the queue has one decider rule. Pinned beside a control that rule 1
keeps the declared-flag predicate for the MCP doors.

The changeset now declares the narrowing, carries the
BREAKING-when-implemented banner, and registers the new semantic
migration entry in-app-pending-action-decided-by-person so the upgrade
guide and os migrate meta carry the notice.

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

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head b091e45 · 2026-11-15T16:39Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b091e451b9773e1777dfdf67676b55fd311152ca
Local-runs: none
Scope: delta round over round 1 (record 6897177404, head 10b5d04b, FAIL on M1 with S1 open). One commit, 10b5d04..b091e45: .changeset/33808-ai-door-confirmation-in-app.md, packages/spec/src/contracts/ai-service.ts, packages/spec/src/contracts/action-confirmation-contract.pin.test.ts, packages/spec/src/migrations/entries/semantic/18.in-app-pending-action-decided-by-person.ts (new), and the PR title and body as they stand.

Read: round-1 record 6897177404 in full; the seat's corrected claim 6897186176 on card #33808 (Clause-②: no (narrowing), Metadata-protocol: semantic) and the card's comment list; PR #34001 title, body, labels, file list and comment list as of this reading (updated_at 2026-11-15T16:39:37Z, draft); the delta commit's message and full patch; ai-service.ts at the head, the in-app section and rule 1; PR #33725 (title, declaration lines, file list); .changeset/33689-ai-action-confirmation-elicited.md; packages/spec/src/migrations/entries/semantic/18.action-requires-confirmation-elicited.ts; packages/spec/src/migrations/types.ts (SemanticMigration) and migrations.test.ts (how the directory is read); scripts/pm/clause2-line.mjs (arm grammar); scripts/check-adr-0087-registration.mjs (marker grammar and breaking signals); AGENTS.md Post-Task Checklist item 3 and the Tier S paragraph. Code read, not run. packages/spec/src/contracts/ai-service.test.ts is unchanged by the delta and was not re-read.

Check-runs on b091e451 at reading time: 67 runs, all completed, none failed, cancelled or timed out. Success: Build Core, Build UI Deps, Test Core and its 8 shards, Test UI and its 16 shards, TypeScript Type Check and the four Type Check jobs (workspace, source gates, consumer gates, debt ledger), Type Check UI, Lint & Repo Gates and its jobs (ESLint, docs & code guards, repo & tooling gates, CI, release & engine gates, PM dispatch-gates, the three scoped jobs), Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, Check PR Size, PR-body guards, Governed Surface Queue Guard, Spec property liveness, Flag docs affected by code changes, Auto Label, filter, both shard planners. Skipped: Lint UI, Temporal Conformance, Dogfood Verify CLI, UI Published Artifacts, the Dogfood Regression Gate shard matrix, Build Docs, Queue verdict, Borrowed queue verdict, Schedule gate, 18.x upgrade harness, Packed-tarball smoke. The job that carries the ADR-0087 registration gate is green on this head with the new marker and entry in the diff; the Test Core shards that run the pin files and migrations.test.ts are green.

① Derived judgments

  • Public surface: still no export, type, signature or schema move. Right. The delta adds one TSDoc paragraph, three pin assertions, changeset prose and one semantic migration entry.
  • Accept set: the delta changes no judgment of round 1. Nothing widens. The narrowing is the same four statements, now with its reach over the queue stated once (S1).
  • The new file is a registry entry, not a contract shape: packages/spec/src/migrations/entries/semantic/ is read by directory listing at build and in migrations.test.ts, so no index edit is owed and none is missing. It carries no conversionIds and no relevance, which matches its sibling 18.action-requires-confirmation-elicited.ts and is right for a notice with no mechanical move.
  • No generated artifact moves in the delta. Right: the registry is generated from the entry files at build and is not committed; the API-surface files do not move for TSDoc.
  • The declaration now exists in three places that must agree: the claim, the changeset and the PR body. Two agree. The PR body does not: see M1.

② Semver level

  • Level: @objectstack/spec minor with Metadata-protocol: semantic. Unchanged and right, as in round 1; the new entry is a semantic entry and takes no higher level.
  • Clause-② in the changeset: Clause-②: no (narrowing), line-initial, the arm the first token in the parentheses, explanation after it. Well formed in clause2-line.mjs (declared, value no, arm narrowing), and it equals the claim 6897186176. Right.
  • BREAKING carriers in the changeset: summary feat(spec)!:, the marker <!-- adr-0087: registered in-app-pending-action-decided-by-person -->, the banner "BREAKING, when the implementing change ships" naming who is affected, the ⚠ line that nothing changes at any door in this release, the sentence that the semantic entry carries the same notice, and the FROM/TO list. This is the Contract: a confirmation-required action on an AI door is confirmed by a human through MCP elicitation, never by the caller's own confirm: true #33689 changeset's structure line for line. The marker names exactly one id, the id equals the entry's id and the file's name stem, and the entry is added by this diff, so registered is the honest disposition. Right.
  • Semantic entry: step 18, all four required fields present, kebab-case id, license header, header comment saying why it is a structured TODO and why it is written conditionally. surface names the declared flag and "every other action the in-app assistant queues for approval", which agrees with the S1 sentence. replacement leads with the timing (until the release whose changelog says the door enforces it), as the sibling entry does. Consistent with the prior narrowing entry on the same contract.
  • Clause-② in the PR body, and the PR title: WRONG on this head. See M1.

M1 (must-fix, carried from round 1, fixed in the changeset only) — the PR body and title still carry the round-1 declaration. As read now:

  • body line 5 is Clause-②: yes. The claim and the changeset say no (narrowing). Round 1's fix was "the PR body and changeset carry the same line"; AGENTS.md checklist item 3 requires the declaration in both.
  • the title is feat(spec): the AI-door confirmation rule binds every AI door, the in-app assistant included, with no !. PR feat(spec)!: a declared-gated action on an AI door is confirmed by a person through MCP elicitation #33725 is titled feat(spec)!: …, and this PR's own commit and changeset summary carry the !. The PR title is what the landed commit is named by.
  • the body's Acceptance notes still say "the claim carries yes, copied here", which is no longer true of the claim.
  • the body's last line still reads "Dogfood battery: n/a, no ! in the title and no (narrowing) arm on the claim's Clause-② line". Both grounds are gone. Round 1 asked for the battery on the final head, as feat(spec)!: a declared-gated action on an AI door is confirmed by a person through MCP elicitation #33725 reported its own; the body reports none. On the head only the Dogfood Regression Gate summary job ran, and its shard matrix is skipped.
  • the body's Verification block is headed "Head 10b5d04", lists three touched pin files and 46 tests, and does not mention the new semantic entry, the S1 sentence or migrations.test.ts. The "What changes" list names the changeset as "both declaration lines, Skills-docs: follow-up, FROM/TO" with no marker, banner or entry.
    Why it fails the PR and is not a nit: the body is the maintainer's reading surface and one of the two places the declaration is required. As it stands, the body tells the maintainer this change is a widening with no breaking treatment while the changeset in the same PR ships it as a BREAKING narrowing. That is the round-1 defect, moved from the changeset to the body.
    Fix: edit the PR, no code change. Title to feat(spec)!: …. Body line to Clause-②: no (narrowing). Rewrite the Acceptance note and the Dogfood line to the present facts, and run and report the dogfood battery on b091e451 as feat(spec)!: a declared-gated action on an AI door is confirmed by a person through MCP elicitation #33725 did (or state in the body, by rule, why it is not owed). Bring the Verification block and the "What changes" list to this head, including the new entry. The head does not move, so the seat can re-read the title and body against this record; no further code review is needed unless a commit is pushed.

③ Boundary flags

  • Round-1 dev flag 1 (proposedBy stays optional): unchanged by the delta. Still parked until the sentence is on the implementing card; the seat's.
  • Round-1 dev flag 2 (bare yes): answered by the claim and the changeset; the PR body is M1.
  • The seat's choice on S1 (every item, heuristic-queued included) is the first of the two fixes round 1 offered and the reading the tapped option supports. If the maintainer reads the ruling record's "declared-gated action" as excluding heuristic-queued items, the new paragraph and its pin are the place to change. Flagged, not blocking.
  • Labels on the PR are documentation, size/m, tests, tooling. Whether a breaking or security label is owed is the seat's call; no contract effect.
  • Security line: n/a, as in round 1; no path under skills/** or ui/skills/**.

④ Design judgment

packages/spec/src/contracts/ai-service.ts, the delta paragraph in "The in-app assistant door".

S1: FIXED. The section now says, directly after the three points: "The three points bind EVERY item in the in-app queue, whichever trigger queued it: an action declaring ai.requiresConfirmation: true, or one the destructive heuristic gates (ADR-0011's confirmation table). A pending row does not record why it was queued, and the queue has one decider rule; an administrator who is to approve as well does so through held, never by deciding the person's item." That is the sentence round 1 asked for, with its reason. It agrees with the three member docblocks (which already bound every item) and with the changeset's new bullet. It does not disturb rule 1: rule 1 keeps "(the DECLARED flag, never the listing heuristic; …)" for the refusal on the MCP doors, and the wider reach is stated as the queue's decider rule, not as a wider refusal predicate. The two statements are about different things and do not conflict.

Nothing new is wrong in the contract text. One observation, not a finding: with every item bound, "not offered when unwired" still speaks of a declared-gated action only, which is correct, since ADR-0011's table decides the heuristic rows and this section does not restate them.

packages/spec/src/contracts/action-confirmation-contract.pin.test.ts, the delta assertions.

  • Two new patterns pin the S1 paragraph: the "bind EVERY item … whichever trigger queued it: an action declaring ai.requiresConfirmation: true, or one the destructive heuristic gates" sentence and the "A pending row does not record why it was queued, and the queue has one decider rule" reason. Read against the head text with the comment gutter folded, both match what is there.
  • A control pins that rule 1 still carries "(the DECLARED flag, never the listing heuristic;", so the queue's reach cannot leak into the MCP predicate unnoticed. This is the right control for this change.
  • Not pinned: the trailing clause about an administrator and held in the new paragraph. The held path is already pinned under point 1, so nothing is lost.
  • The run verdict is the Test Core shards: green on this head.

packages/spec/src/migrations/entries/semantic/18.in-app-pending-action-decided-by-person.ts: judged under ②. The prose matches the contract's three points and the FROM half, and promises nothing the contract does not say. The route paths it names (/api/v1/ai/pending-actions/:id/approve and /reject) are the ones the client SDK docblock and SKILL.md already name.

Round-1 nits N1 to N3 are untouched by the delta and stay as follow-ups.

Result of the delta: S1 fixed and pinned. M1 fixed in the changeset, the registration and the claim; NOT fixed in the PR title and body, which still declare Clause-②: yes with no ! and no breaking treatment. Nothing new is wrong in the code delta.

Implemented-by: claude/project-thread-yg8bqb
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: FAIL

@objectstack-fleet objectstack-fleet Bot changed the title feat(spec): the AI-door confirmation rule binds every AI door, the in-app assistant included feat(spec)!: the AI-door confirmation rule binds every AI door, the in-app assistant included Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 7af536e · 2026-11-15T17:20Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7af536e27e06f9ec4377f8d2a3d799de5b725784
Local-runs: none
Scope: round 3 over round 2 (record 6897827483, head b091e451, FAIL on M1 only, code delta clean, S1 fixed). Two things moved since: the PR title and body were edited, and one merge commit 7af536e2 (parents b091e451 and main b4ce310b, 41 main commits, 183 files) was pushed. Judged: whether the merge changes the PR's own diff, whether every item of the round-2 M1 fix list is now true, whether anything main brought in touches this contract, and the check-runs on the head.

Read: round-2 record 6897827483 in full; PR #34001 title, body, draft state, labels, head and base as of updated_at 2026-11-15T17:20:26Z; the PR comment list, including the review claim 6898309924 for head 7af536e2; the merge commit's parents and its remerge diff; the PR diff at both heads (895783a1..b091e451 against b4ce310b..7af536e2) and the blob ids of its five files at both heads; main's side 895783a1..b4ce310b for packages/spec/src/contracts/, packages/spec/src/migrations/, AGENTS.md, scripts/pm/clause2-line.mjs, scripts/check-adr-0087-registration.mjs, ADR-0011, skills/objectstack-ai, the two deciding ui hooks and packages/client/src/index.ts; the id values of every file in packages/spec/src/migrations/entries/semantic/ at the head; b4ce310b..origin/main (fb79d47c, 10 commits) for the same contract paths; AGENTS.md rule 14 (Tier S), the green-means-success and two-speeds paragraph, and discipline rule 10 ("dogfood once, on the final head"). Code read, not run. The contract text, pins, changeset and entry were not re-read line by line: their blobs equal the ones round 2 read.

Check-runs on 7af536e2 at reading time: 67 runs, all completed; 56 success, 11 skipped, none failed, cancelled, timed out or in progress. Success: Build Core, Build UI Deps, Test Core and its 8 shards, Test UI and its 16 shards, TypeScript Type Check and the four Type Check jobs, Type Check UI, Lint & Repo Gates and its eight jobs, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset, Check PR Size, PR-body guards, Spec property liveness, Flag docs affected by code changes, Auto Label, filter, both shard planners. Skipped: Lint UI, Temporal Conformance, Dogfood Verify CLI, UI Published Artifacts, the Dogfood Regression Gate shard matrix, Build Docs, Queue verdict, Borrowed queue verdict, Schedule gate, 18.x upgrade harness, Packed-tarball smoke. Same roster and same split as on b091e451. Of the eleven required contexts, ten are success and Lint UI is skipped, as it was in round 2. GitHub reports the PR mergeable, state clean.

① Derived judgments

  • The merge changes nothing in the PR's own diff. The diff b4ce310b..7af536e2 is byte-identical to 895783a1..b091e451: five files, 294 insertions, 8 deletions. Each of the five files has the same blob id at both heads (ai-service.ts is 3f1c8285 at both). The remerge diff of 7af536e2 is empty, so the merge had no conflict and no hand resolution, in the PR's files or anywhere else.
  • Main's 41 commits do not touch this contract. Under packages/spec/src/contracts/ main changed data-driver.ts only. ai-service.ts, ai-service.test.ts and action-confirmation-contract.pin.test.ts are untouched on main's side. Under packages/spec/src/migrations/ main changed the prose of 18.notify-channel-unknown-refused.ts only; it added no entry. The semantic entries directory at the head differs from the old merge base by exactly one file, this PR's. No id is duplicated in the directory, and in-app-pending-action-decided-by-person appears in one entry file and in this PR's changeset only.
  • The grammar and gate the declaration is judged by did not move: scripts/pm/clause2-line.mjs and scripts/check-adr-0087-registration.mjs are unchanged on main's side. Main's AGENTS.md edit is two lines of rule 14's CODEOWNERS wording (chore(governance): drop the skills CODEOWNERS rows; the mirror exempts low-risk arm rows #33948); the Tier S paragraph and checklist item 3 read as they did.
  • The first-party files the body names as exposed (the two ui hooks, the client SDK, skills/objectstack-ai, ADR-0011) are unchanged on main's side, so the body's exposure section still describes them. Its file and line citations are stated at merge base 895783a1 and remain true of the head for those files.
  • Main after the merge (b4ce310b..fb79d47c, 10 commits): adds automation-service.ts and a pin beside it under contracts; nothing in ai-service.ts, its pins or the semantic entries directory.
  • Public surface, accept set, generated artifacts: unchanged from round 2. No export, type, signature or schema moves; nothing widens; no committed generated file moves.

② Semver level

  • Level: @objectstack/spec minor with Metadata-protocol: semantic. Unchanged and right.
  • Declaration agreement, the round-2 M1. The claim, the changeset and the PR body now carry the same line. Each item of the fix list, as read now:
    • Title: feat(spec)!: the AI-door confirmation rule binds every AI door, the in-app assistant included. Has the !. TRUE.
    • Body line 5: Clause-②: no (narrowing), line-initial, well formed in clause2-line.mjs, followed by Metadata-protocol: semantic. TRUE.
    • Acceptance notes: the "claim carries yes" sentence is gone; the one remaining note is the ADR-0011 pointer follow-up. TRUE.
    • Dogfood battery: the "n/a" line is gone. The body reports b091e451 · pnpm --filter @objectstack/dogfood test … VERDICT command-exit 0 · Test Files 467 passed | 3 skipped (470) · Tests 3959 passed | 42 skipped (4001). TRUE as asked in round 2, which named b091e451. Currency is judged in ③.
    • Verification block: headed b091e451, names the new semantic entry, migrations.test.ts with the two pin files (3 files, 198 tests), and the 88 derived gates. TRUE.
    • "What changes" list: now names the S1 sentence, the changeset's feat(spec)!:, both declaration lines, the BREAKING banner, the ADR-0087 marker and the new entry file. TRUE.
  • The maintainer summary (item 3) states the change as a narrowing that is breaking when implemented, and that nothing changes at any door in this release. That agrees with the changeset. M1: FIXED.

③ Boundary flags

  • Dogfood figure and the head. AGENTS.md discipline rule 10 says "dogfood once, on the final head". The body's battery and its Verification heading ("Final head b091e45") name b091e451; the head is now 7af536e2. Judged acceptable for this PR, for three reasons. (1) The PR's contribution at 7af536e2 is the byte-identical five files, and it is TSDoc, test assertions, changeset prose and one registry entry: nothing dogfood executes changed between the two heads on the PR's side. (2) What the merge added is main's own 41 commits, each landed through the queue, and the queue is where the dogfood shards run on the rebuilt generation (AGENTS.md two-speeds paragraph; "that second CI round is where joint breakage surfaces"). A battery on any PR head is one generation behind the queue's by design. (3) The fast Dogfood Regression Gate context is success on 7af536e2. The battery's purpose here, showing the narrowing's text and entry break no first-party consumer, is met by the b091e451 run. What is not acceptable is leaving the label inexact: "Final head b091e45" is no longer the final head. Nit N4 below; the seat's call whether to re-run instead.
  • The merge itself. Rule 10 allows a main merge after the PR is open only on a GitHub-reported conflict, a main-caused CI red or a queue removal, and then asks for the scoped re-checks (spec moved on main's side: 9 files). The body gives no reason for the merge and reports no post-merge re-check. CI on 7af536e2 is green across Test Core, the type checks and Lint & Repo Gates, which covers the scoped set by run. Process flag for the seat; no contract effect.
  • The PR is still draft. Labels are documentation, size/m, tests, tooling. Both the seat's.
  • Round-1 flags 1 and 2 and the S1 reading flag from round 2 stand as recorded; nothing new.
  • Security line: n/a; no path under skills/** or ui/skills/** in the PR's file list.

④ Design judgment

packages/spec/src/contracts/ai-service.ts, the pins, the changeset and 18.in-app-pending-action-decided-by-person.ts: byte-equal to what round 2 judged. Round 2's judgment carries over whole: S1 fixed and pinned, rule 1's declared-flag predicate for the MCP doors undisturbed, the entry consistent with its sibling on the same contract. Nothing main brought in sits beside these texts or contradicts them.

N4 (nit, PR body only): the Verification heading "Final head b091e45" and the gates heading "derived gates at b091e45 … (merge base 895783a)" are true as run records and stale as head labels. One line would make them exact, for example: "Figures taken at b091e45. Head is now 7af536e, a merge of main only; the PR's diff is byte-identical (same five blobs)."

N1 to N3 from round 1 stay as the body's listed follow-ups.

Result: the merge commit is content-neutral for this PR (identical diff, identical blobs, empty remerge diff). Main brought nothing into ai-service.ts, its pins or the semantic entries that collides. Every item of the round-2 M1 fix list is true in the title and body as they stand. All 67 check-runs on the head are completed with no failure. One nit (N4) and one process flag (the unexplained merge) are left to the seat.

Implemented-by: claude/project-thread-yg8bqb
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 9a9adad · 2026-11-15T17:26Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9a9adad009b29127e6f551fc959a06adedf0fdf0
Local-runs: none
Scope: round 4 over round 3 (record 6898359414, head 7af536e2, PASS). A merge delta only: one merge commit 9a9adad0 (parents 7af536e2 and main e71ecc1b; 15 main commits, 71 files) and a PR body edit. Judged: whether the merge changes the PR's own diff, whether anything main brought in touches this contract, whether the title and body still carry the declaration, and the check-runs on the new head. The verdict below is the design verdict only. CI on this head was still running at reading time, so landing waits for green.

Read: round-3 record 6898359414 in full; PR #34001 title, body, draft state, labels, head and base as of updated_at 2026-11-15T17:26:51Z; the PR comment list, including the review claim 6898388671; the commits in 7af536e2..9a9adad0 that are not on main; the merge commit's parents and its remerge diff; the PR's three-dot diff at both heads (b4ce310b..7af536e2 against e71ecc1b..9a9adad0) and the blob ids of its five files at both heads; main's side b4ce310b..e71ecc1b for packages/spec/src/contracts/, packages/spec/src/migrations/, scripts/pm/clause2-line.mjs, scripts/check-adr-0087-registration.mjs, AGENTS.md, .changeset/, ADR-0011, skills/objectstack-ai, the two deciding ui hooks and packages/client/src/index.ts; the file list and the id value of every file in packages/spec/src/migrations/entries/semantic/ at the head; the check-runs on 9a9adad0. Code read, not run. The contract text, pins, changeset and entry were not re-read: their blobs equal the ones rounds 2 and 3 judged.

Check-runs on 9a9adad0 at reading time: 40 runs registered. 22 completed (10 success, 12 skipped), 18 in progress, none failed, cancelled or timed out. In progress: Build Core, Build UI Deps, Check Changeset (two runs), the seven Lint jobs, Live E2E UI, both shard planners, the four Type Check jobs. The roster is incomplete: round 3 counted 67 runs on 7af536e2, and the test shards had not registered yet. GitHub reports the PR mergeable, state blocked, still draft.

① Derived judgments

  • (a) One commit lies between the two heads and off main: 9a9adad0, "Merge remote-tracking branch 'origin/main' into claude/project-thread-yg8bqb". No other commit was added.
  • (a) The merge is content-neutral for this PR. Its remerge diff is empty (0 bytes), so there was no conflict and no hand resolution anywhere. The three-dot diff is byte-identical at both heads (same sha256, d7eed1ec…): five files, 294 insertions, 8 deletions. Each of the five files has the same blob id at both heads: changeset c19a4a18, pin test b6dd6777, ai-service.test.ts 4fed3b1e, ai-service.ts 3f1c8285, the entry 5bbc4211.
  • (b) Main's 15 commits do not touch this contract. Under packages/spec/src/contracts/ main changed automation-service.ts and added automation-dry-run.pin.test.ts, both from one commit (e5c2d765, feat(spec): IAutomationService.dryRun contract, a dry run of an unpublished flow definition #33799). ai-service.ts, ai-service.test.ts and action-confirmation-contract.pin.test.ts are untouched.
  • (b) Main changed nothing under packages/spec/src/migrations/: no new step-18 entry, no edit to an existing one. The semantic entries directory at the head differs from main by exactly one file, this PR's. Of its 609 files no id is duplicated, and in-app-pending-action-decided-by-person appears in the entry file and this PR's changeset only.
  • (b) scripts/pm/clause2-line.mjs, scripts/check-adr-0087-registration.mjs and AGENTS.md are unchanged on main's side, so the grammar and the gate the declaration is judged by did not move.
  • The first-party files the body names as exposed (the two ui hooks, packages/client/src/index.ts, skills/objectstack-ai, ADR-0011) are unchanged on main's side.
  • Public surface, accept set, generated artifacts: unchanged from round 3.

② Semver level

  • Level: @objectstack/spec minor with Metadata-protocol: semantic. Unchanged and right.
  • (c) Title: feat(spec)!: the AI-door confirmation rule binds every AI door, the in-app assistant included. Has the !.
  • (c) Body line 5 Clause-②: no (narrowing), line 6 Metadata-protocol: semantic, both line-initial. They agree with the changeset, whose blob is unchanged.
  • (c) The round-3 nit N4 is fixed. The Verification section now opens: "Head is now 9a9adad: a merge of main only (e71ecc1 …) … The figures below were taken at b091e45 … The PR's own diff is byte-identical". The line names the right head and the right main commit, and its byte-identical claim matches what ① found. It also records the readings taken at 7af536e2.

③ Boundary flags

  • CI is not finished on this head. Nothing has failed, but 18 runs were in progress and the test shards had not registered. This PASS does not stand in for green: the seat lands only after every required context completes.
  • The round-3 process flag (a merge with no stated reason) is answered: the body now gives one, the seat's K ≥ 15 landing rule, with main 15 commits past the merge base. The count is right (b4ce310b..e71ecc1b is 15 commits). Whether that rule satisfies discipline rule 10 is the seat's call; no contract effect.
  • Dogfood figure and the head: as judged in round 3. The battery was run at b091e451, the PR's five blobs are the same at this head, and the body now labels the figure exactly.
  • The PR is still draft; labels are documentation, size/m, tests, tooling. Both the seat's.
  • Security line: n/a; no path under skills/** or ui/skills/** in the PR's file list.

④ Design judgment

ai-service.ts, the pins, the changeset and 18.in-app-pending-action-decided-by-person.ts are byte-equal to what rounds 2 and 3 judged, so that judgment carries over whole. Main's one contract change (the IAutomationService.dryRun member and its pin) is a different contract and neither sits beside these texts nor contradicts them.

N1 to N3 from round 1 stay as the body's listed follow-ups. No new nit.

Result: the merge is content-neutral for this PR (one merge commit, empty remerge diff, identical three-dot diff, identical five blobs). Main brought nothing into ai-service.ts, its pins, the semantic entries, clause2-line.mjs or check-adr-0087-registration.mjs. The title and body carry the declaration, and the head-label line is present and accurate. The design verdict is PASS; landing waits for the check-runs on 9a9adad0 to finish green.

Implemented-by: claude/project-thread-yg8bqb
Reviewed-by: session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

ACCEPT · PR #34001 (#33808) · head 9a9adad009b29127e6f551fc959a06adedf0fdf0 · 2026-11-15T17:58Z

席位核对

  • 形态: 5 files, read from the PR's file list (+294 / −8):
    • packages/spec/src/contracts/ai-service.ts (TSDoc: rule 1's reach over every AI door, the in-app assistant section with its three points and the every-queued-item sentence);
    • two pin/test files;
    • one new semantic entry 18.in-app-pending-action-decided-by-person.ts;
    • one changeset (@objectstack/spec minor, feat(spec)!:, ADR-0087 marker registered in-app-pending-action-decided-by-person, BREAKING-when-implemented banner, FROM/TO).
    • No governed path (check-governed-merges.mjs --pr 34001: NOT governed; under 3000 lines). A packages/spec/src/contracts hit, so the contract review applies. Tier S, the seat's own ACCEPT.
  • 前提实测: the seat read the title and body against round 2's fix list. Title feat(spec)!:, body Clause-②: no (narrowing) / Metadata-protocol: semantic, equal to the corrected claim 6897186176 and to the changeset.
  • 契约复审: at CONTRACT_REVIEW_TIER, four rounds:
    • r1 FAIL 6897177404 (M1 declaration, S1 scope);
    • r2 FAIL 6897827483 (M1 half-fixed: PR title/body);
    • r3 PASS 6898359414 @7af536e2;
    • r4 PASS 6898419500 @ this head (merge-only, PR diff and all five blobs byte-identical).
  • 门禁 check-runs: latest attempt on this head 71 runs: 58 success, 13 skipped, 0 failed, 0 cancelled.
  • 接受的偏差:
  • 范围外去向:
  • 落地条款: ready + auto-merge now, under the maintainer's standing orders 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). K = 2 first-parent commits on main past this head's merge base e71ecc1b (< 15).

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43744184060 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 8 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43747954544 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-28: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-29: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 20 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43754681198 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-28: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-02-29: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/scenarios:test:  FAIL  test/runner/run-date.test.ts > every dated card, rebased onto each run date > run on 2028-03-31: today is the run date, every date moves as the card's rebase says, 
      ↳ 失败原因: @objectstack/scenarios:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 2 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 28 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Requeue · PR #34001 · head 9a9adad009b29127e6f551fc959a06adedf0fdf0 · 2026-11-15T22:47Z

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit fa1fb6f Nov 15, 2026
72 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-yg8bqb branch November 15, 2026 23:18
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…y its read action does not declare, as connector_action does (objectstack-ai#34089)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_

Fixes objectstack-ai#33894

Clause-②: no (narrowing) — a mapping whose `connectorSource.input`, or
the watermark parameter the pull adds to its `query`, carries a key the
read action's `inputSchema` does not declare used to pull and send that
key to the provider; the pull now fails before the call with
`VALIDATION_ERROR`. Nothing published widens: no export, no key, no
option is added. First-party mappings affected: 0 (no `connectorSource`
under `examples/` or `packages/apps/`).
Metadata-protocol: narrowed
Skills-docs: none — `git grep -i 'connectorSource|watermark' -- skills/`
has 0 hits: no published skill teaches the connector pull door's input

## 维护者速读

- 改了什么:映射的连接器拉取入口(`connectorSource.input`)也像 `connector_action`
节点一样,拒收读取动作 `inputSchema` 未声明的输入键,包括拉取入口自己加进 `query` 的水位参数(如
`since`);拒绝时报 `VALIDATION_ERROR`,点名该键和修法,不调用外部服务、不写入。
- 为什么改:维护者裁决
6896271476「多余参数直接报错」:凡是调用连接器动作的入口,对输入一视同仁;以后新入口直接继承,不再回来要裁决。
- 风险与回滚:收窄。定时拉取没有 fault 边,带多余键的映射每次运行都失败(`sys_sync_run` 记 failed),直到映射或
OpenAPI 文档修好;水位参数只在目标已有值后才发送,所以首拉成功、第二次起失败。第一方受影响 0 处;rest 连接器的 `query`
是开放的,不受影响。回滚 = revert 本 PR。
- 先看:`packages/services/service-automation/src/connector-pull.ts`
的判定段(打开
`refuseUndeclaredKeys`,以及单独判定水位参数以便在拒绝句里点名它);`connector-pull-undeclared-input-key.test.ts`;changeset
的迁移说明。
- 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run
src/connector-pull-undeclared-input-key.test.ts
src/connector-pull.test.ts`,预期全部通过(新文件 6 个用例,翻转后的拒绝 pin 在
`connector-pull.test.ts`)。
- 需要你做的:无,席位落地(合同档复核由区域安排)。

## What changes

- `packages/services/service-automation/src/connector-pull.ts`: the pull
door judges the input it is about to send with `judgeConnectorInput(...,
{ refuseUndeclaredKeys: true })`, as `connector_action` does (ruling
6896271476: every door that dispatches a connector action judges its
input alike). The refusal keeps its `VALIDATION_ERROR` 400
`input_schema_mismatch` envelope and appends the pull door's own hint:
remove the key from `connectorSource.input` or declare it in the action
(for `openapi`, in the OpenAPI document). When the undeclared key is the
watermark parameter the door added itself (judged alone against the
schema, so the sentence never blames the watermark for an author's key),
the refusal names it and says to declare it as an `in: query` parameter
of the operation.
- `connector-pull.test.ts`: the pin `[objectstack-ai#33553] an undeclared key is not
refused here` (formerly 385-398) is flipped in place to a refusal pin:
`code` + `status` + `reason`, both undeclared keys named, handler never
called, nothing written.
- New `connector-pull-undeclared-input-key.test.ts` (named by the card):
the door-added watermark key. An openapi-shaped operation that lists
only `query.limit`, and one that emits no `query` section, both refuse
`since` naming it and the OpenAPI fix; an author's stray key with the
watermark declared does not mention the watermark. Controls: the
declared watermark is sent; the first pull (nothing stored) sends no
watermark and is not refused; a `rest` connector's open `query` takes
the watermark as before.
- `packages/spec/src/data/mapping.zod.ts` (`connectorSource.input`
describe) and the generated `content/docs/references/data/mapping.mdx`:
input is judged before the call; an undeclared key is refused, the
watermark parameter included.
- New semantic migration entry
`18.connector-pull-undeclared-input-key-refused` (entry 18
`connector-action-undeclared-input-key-refused`, shipped in 18.5.0, is
not touched).
- `content/docs/automation/jobs.mdx`: the `connectorSource` run bullet
says the input is judged, names the watermark parameter and the OpenAPI
fix, and that a scheduled run has no `fault` edge, so the refusal fails
every run until fixed.
- BREAKING changeset (`minor` on `@objectstack/service-automation` and
`@objectstack/spec`) with the ADR-0087 marker and the FROM → TO
migration.

**For the sync-in owner (ADR-0153 D2, Proposed):** when the pull door
starts sending paging parameters (`connectorSource.paging`), they are
judged by this same rule, so the design now presumes the read action
declares them; a paging parameter an `openapi` operation does not list
will be refused like the watermark.

## Tests

<details><summary>Touched-package suites and typecheck (head before the
last main merge; re-run touched files on the final head where
noted)</summary>

- `pnpm --filter @objectstack/service-automation test`: Test Files 283
passed (283), Tests 4003 passed (4003).
- `pnpm --filter @objectstack/service-automation typecheck` (tsc +
check:test-typecheck): exit 0 after typing the new file's handler (first
run named TS2493 in the new file, fixed).
- `pnpm --filter @objectstack/spec test`: Test Files 842 passed (842),
Tests 26961 passed, 1 todo; `pnpm --filter @objectstack/spec typecheck`:
exit 0.
- `pnpm --filter @objectstack/spec check:generated`: 1 of 14 stale
(`check:docs`), regenerated with `--fix`, committed.
- The four connector-pull files (unit, new file, integration through the
real `rest` connector, service door): 64 passed.

</details>

<details><summary>Ablations (each red, then restored with blob == HEAD
and git diff HEAD empty)</summary>

- A, drop `{ refuseUndeclaredKeys: true }` from the door's judge: 4
failed (the flipped pin and three new-file pins), "the pull must refuse,
not resolve: expected undefined to be an instance of
ConnectorPullError".
- B, never name the watermark (`addedUndeclared = false`): 2 failed,
"expected ... to contain 'watermark parameter 'since''".
- C, make the watermark probe always undeclared: 1 failed, "expected ...
not to contain 'watermark parameter'".

</details>

## Acceptance notes

- First pull edge: the watermark parameter is sent only once the target
holds a value, so a mapping whose operation does not declare it pulls
once and fails from the second run on. The changeset, the migration
entry and the refusal say so; judging it on the first pull too would be
a further narrowing not in the ruling.
- `connector-input-schema.ts`'s header and
`ConnectorInputJudgeOptions.refuseUndeclaredKeys` doc name only the
`connector_action` node as the door that opts in; they stay true but
incomplete (outside the claim's file surface, left untouched).
- `packages/spec/docs/SYNC_ARCHITECTURE.md` says the pull judges
required parameters and types "as a `connector_action` flow node's is";
it does not list the undeclared-key refusal (outside the claim's file
surface).
- The 18.5.0 changeset for the node half ends "The connector pull door
(`connectorSource.input`) is unchanged."; released text, true when
shipped, superseded by this changeset; not edited here.

## Verification

- Hot-file rule: no open PR shares a file with this branch (59 open PRs'
file lists read). `git merge-tree --write-tree --name-only` against
origin/main and the two PRs that add sibling files in
`entries/semantic/` (objectstack-ai#33970, objectstack-ai#34001): exit 0, no conflicted paths.
- Dogfood battery and the derived gate subset: see the report comment on
the card.

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.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 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.

Contract: AI-door confirmation rule binds every AI door, including the in-app assistant (#33689 Q1 ruled B)

1 participant