Skip to content

feat(spec, objectql, runtime): the in-product AI path can name itself on ExecutionContext.performedBy, and hooks see it on HookContext.provenance - #34018

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

objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/project-thread-hictiz

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33786

Clause-②: yes
Metadata-protocol: none

Claim by domain:spec#2 (6896038213). The spec half of #33694 (cloud#3826 phase 2). Ruling-ref: the account owner on objectstack-ai/cloud#3826, 「3826 照建议(征询版)」 (decision request 6890278459), as carried in the #33694 body: "Accept AI-on-behalf, conversation id and confirmation id on the write context, using the existing performed_by / on_behalf_of columns plus contract fields. Do not add a new actor vocabulary."

维护者速读

  • 改了什么:写入上下文 ExecutionContext.performedBy 在 clientId 旁新增 agentId、conversationId、confirmationId 三个可选键;hook 上下文 provenance 同步新增三个对应标记,引擎和沙箱都会带过去。
  • 为什么改:产品内 AI 以本人身份写数据,之前写入上下文没有位置标明「是 AI 替本人做的、哪次对话、哪次确认」,而且引擎解析时会把多出来的键丢掉,审计日志无从记录。
  • 风险与回滚:只放宽,原来只带 clientId 的上下文解析结果不变;clientId 在类型上变为可选,读它的 TypeScript 代码需判空(第一方读者都已判空)。回滚即 revert。
  • 先看:packages/spec/src/kernel/execution-context.zod.ts 的 performedBy 块,packages/objectql/src/engine-execution-plumbing.ts 的 buildProvenance,packages/spec/src/data/hook.zod.ts 的 provenance。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/engine.test.ts -t "in-product AI performer",预期 2 条全过。
  • 需要你做的:无,席位落地。审计日志写入那一半在 sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694,ADR-0090 D10 第 4 条的补注由 skills 车道另行提交。

What changes

  • packages/spec/src/kernel/execution-context.zod.ts (performedBy): three optional sibling keys beside clientId.
    • agentId: the in-product AI agent that performed the write for the signed-in person. Same value as ToolExecutionContext.agentId (the agent the chat runs as). Never a sys_user id or an OAuth client id, so one key never holds two id namespaces.
    • conversationId: same id as ToolExecutionContext.conversationId.
    • confirmationId: the id of the pending item the person's approval decided, i.e. the in-app pending action id (IAIService.proposePendingAction's id, the seam Contract: AI-door confirmation rule binds every AI door, including the in-app assistant (#33689 Q1 ruled B) #33808 aligns) or the pending-confirmation service's ActionConfirmationPending.pendingId. Absent when no confirmation was needed.
    • clientId is now optional, because the shape forces it: the in-product AI has no OAuth client. The object takes .refine(requiredOneOf(['clientId', 'agentId'])), so a performedBy naming no performer is still refused at parse, as it was when clientId was required. The rule is on the projectable closed list, so the published JSON Schema states it (allOf: [{ anyOf: [{ required: [clientId] }, { required: [agentId] }] }]) and dropped-refinements.baseline.json does not grow.
    • The docblock and .describe stop saying "Set only at the /mcp OAuth door". They name both producers: the /mcp OAuth door (clientId) and the server-constructed in-product AI path acting for and running as the signed-in person (agentId + conversationId + confirmationId). The ruling chain is cited in the jsdoc only. Kept as is: server-constructed only, never client-supplied; attribution only; never the authorization subject; userId stays the person; no onBehalfOf on the in-product path, since the write runs on the person's own grants. The ADR-0090 2026-09-20 room for an agent-run id stays reserved; conversationId is not that id.
    • The in-product producer's duty (review S1): its ids can start as values a request named (the chat route's :agentName, a continued conversation, the pending item an approval names). It stamps one only after the server resolved it in its own store for the person in userId: agentId the agent it actually ran, conversationId a conversation that person owns, confirmationId a pending item that person's approval decided for this operation. An unresolved id is not stamped.
    • The audit writer (review S2): the descriptions say the audit writer records clientId as performed_by beside on_behalf_of, which is true today, and that the in-product keys are carried for it and not recorded yet. How they are recorded is sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694's.
  • packages/spec/src/data/hook.zod.ts (HookContext.provenance): performedByAgentId, performedByConversationId, performedByConfirmationId, flattened the way performedByClientId copies clientId. The provenance docblock goes from four marks to five.
  • packages/objectql/src/engine-execution-plumbing.ts (buildProvenance): copies the three keys. Its own docblock says a key declared on hook.zod.ts and missing there is declared and never populated (ADR-0049), so the spec keys need this copy to be live.
  • packages/runtime/src/sandbox/body-runner.ts and script-runner.ts: the sandboxed body face carries the three marks member by member, like the other four, so a lowered hook body reads them on ctx.provenance too.
  • Not touched: packages/plugins/plugin-audit/** (the writer half stays on sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694), docs/adr/**, the MCP door (packages/core/src/security/assemble-execution-context.ts still sets { clientId } alone).
  • Why the widening is needed, not only declared: ObjectQL#createContext runs ExecutionContextSchema.parse(ctx), which keeps declared keys only. On main an agentId a host put on performedBy was dropped there.

Tests

  • packages/spec/src/kernel/execution-context.test.ts, a new top-level describe. CONTROL: { clientId } alone parses unchanged. The three new keys survive a parse. A write with no confirmation parses. {}, { conversationId } and { confirmationId } are refused at path performedBy. A non-string agentId is refused. The description names both producers and no longer says "Set only at the /mcp OAuth door".
  • packages/spec/src/data/hook.test.ts, a new top-level describe. CONTROL: performedByClientId alone parses unchanged. The three marks survive a parse. A non-string mark is refused.
  • packages/objectql/src/engine.test.ts, a new describe at the engine seam. A write whose context carries performedBy: { agentId, conversationId, confirmationId } reaches a beforeInsert hook with the three provenance marks, and session stays the person with no performedBy. CONTROL: { clientId } alone still gives provenance: { performedByClientId }.
  • Forced test edit: packages/cli/test/lowered-body-face-enumeration.test.ts pins the in-process and body provenance member sets. Both now list seven members instead of four.

Acceptance notes

Verification

Head and readings are listed in the os-dev-report on #33786. Every heavy run went under os-verify-lock.

Round 2 (review S1, S2), at bfaef935, changes prose only: the two .zod.ts docblocks and descriptions, and the three regenerated reference pages. Spec pins 146/146 and check:generated are green there. ceeec029 merges main b4ce310b, and the round 2 contract review (6898426121) is on that head.

Current head 75dcf734 is a merge-only commit made under the seat's K ≥ 15 landing rule. It merges main 529ed7d9 into ceeec029 with no hand resolution, and all 13 PR files are byte-identical to ceeec029 (+311/-49). On it, the spec build, check:generated (14/14 up to date) and the spec pins (146/146) are green.

Consumer test runs (branch at ca6e40c, before the main merge)
  • spec 842 files / 26965 passed (1 todo). objectql 596 / 13174. core 147 / 3402. mcp 65 / 1185. rest 412 / 8442 (332 skipped). plugin-audit 94 / 1541. runtime 605 / 10958 (19 skipped). plugin-auth 277 / 5485 (10 skipped). cli: test/lowered-body-face-enumeration.test.ts (unit) 4 / 4; the rest of the cli unit layer is left to CI.
  • Typecheck of spec, objectql, runtime, core, mcp, rest, plugin-audit, plugin-auth and cli: all exit 0.
After merging main 0ac112f (head 93b0b11), and again b4ce310 (head ceeec02)
  • check:generated: all 14 artifacts up to date. Closure build 113/113.
  • Rerun: spec pins 146/146, objectql engine.test.ts 138/138, cli face test 4/4, runtime hook-provenance-signal.integration.test.ts 1/1, objectql and runtime typecheck exit 0.
  • The same reruns on ceeec029 were all green, and dispatch-gates there gave 118 derived, 118 run, 0 NOT-MEASURED.
Ablations (each through scripts/ablation-replace.mjs, restored with blob == HEAD and git diff HEAD empty)
  1. objectql buildProvenance stops copying agentId: engine.test.ts "copies agentId, conversationId and confirmationId onto provenance" red.
  2. spec .refine(requiredOneOf(...)) becomes .refine(() => true): "REJECTS a performedBy naming no performer" red (1 failed / 45).
  3. body-runner drops the performedByAgentId projection: cli face test 3 failed / 4.
  4. Type reverse check against the rebuilt spec dist, in objectql: a typed performedBy: { agentId, probeBogusKey } gives TS2353 on probeBogusKey only, while { agentId, conversationId, confirmationId } and a reader of performedBy?.agentId compile. The probe file was deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRAvNc1qLS722dnoqn

…By and HookContext.provenance

performedBy gains agentId, conversationId and confirmationId beside clientId;
HookContext.provenance mirrors them, objectql copies them and the sandbox body
face carries them.

Claude-Session: https://claude.ai/code/session_01ADHkmRAvNc1qLS722dnoqn
Co-authored-by: Claude <noreply@anthropic.com>
…Of so the published schema states it

Claude-Session: https://claude.ai/code/session_01ADHkmRAvNc1qLS722dnoqn
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data 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 3 package(s): @objectstack/objectql, @objectstack/runtime, @objectstack/spec, touching 7 documentable anchor(s).

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

  • content/docs/automation/connectors.mdx (via clientId (literal, a string literal in ExecutionContextSchema))
  • content/docs/automation/hook-bodies.mdx (via HookContextSchema (symbol, a top-level const), ScriptContext (symbol, a top-level interface))
  • content/docs/kernel/contracts/auth-service.mdx (via clientId (literal, a string literal in ExecutionContextSchema))
  • content/docs/permissions/authentication.mdx (via clientId (literal, a string literal in ExecutionContextSchema))
  • content/docs/permissions/sso.mdx (via clientId (literal, a string literal in ExecutionContextSchema))
  • content/docs/permissions/system-context.mdx (via ExecutionContextSchema (symbol, a top-level const))
  • content/docs/plugins/index.mdx (via clientId (literal, a string literal in ExecutionContextSchema))

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

  • content/docs/releases/v17/17-0.mdx (via HookContextSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-7.mdx (via agentId (literal, a string literal in ExecutionContextSchema))

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
  • 1 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 — 178 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 529ed7d9391bcb47ea859bfe9ae4b0d1766fc234 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 529ed7d9391bcb47ea859bfe9ae4b0d1766fc234

⚠️ 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 529ed7d9391bcb47ea859bfe9ae4b0d1766fc234 → 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 93b0b11 · 2026-11-15T16: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: 93b0b1196366f9d9fda4becdb6e1e7926ba8f202
Local-runs: none
Scope: packages/spec/src/kernel/execution-context.zod.ts, packages/spec/src/data/hook.zod.ts + packages/objectql/src/engine-execution-plumbing.ts, packages/runtime/src/sandbox/body-runner.ts, packages/runtime/src/sandbox/script-runner.ts

Read: card #33786 (body and all six comments, the os-dev-report 6897591859 included), #33694 (body; the owner's ruling on cloud#3826 is read as that body quotes it, cloud#3826 itself was not an input), ADR-0090 D10 rule 4 with its 2026-09-16 and 2026-09-20 notes, ADR-0151 D5, PR #34018 (body, 13 files, net diff against merge base 0ac112fc). The remaining eight files (tests, regenerated content/docs/**, the changeset, the cli pin) are the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on this head at review time. Completed, success: Check Changeset, Spec property liveness, Type Check · source gates, Lint · ESLint, Lint · docs & code guards, Lint · PM dispatch-gates, the three Lint · scoped jobs, Governed Surface Queue Guard, PR-body guards, Build Docs, Build UI Deps, Check Documentation Links, Check PR Size, Dogfood Regression Gate, Flag docs, Auto Label, filter, both shard planners. STILL IN PROGRESS, so no gate verdict yet: Build Core, Test Core 1/8 to 8/8, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check UI, Lint · CI, release & engine gates, Lint · repo & tooling gates, Test UI 1/16 to 16/16, Build & E2E UI, Live E2E UI. No check-run has failed. This record's verdict is the contract's; it does not stand in for those conclusions.

① Derived judgments

  1. ExecutionContext.performedBy gains optional agentId, conversationId, confirmationId. Accept-set widening. Right. Because the object strips unknown keys, a host that already put agentId there had it dropped on main and now has it carried to hooks; that is the intended effect and the changeset says it.
  2. clientId required to optional, with .refine(requiredOneOf(['clientId', 'agentId'])). It is BOTH, on two different faces:
    • Accept set (what parses): a pure widening. Every value that parsed on main parses to the same output; { agentId } newly parses; {}, { conversationId } and { confirmationId } are refused before and after. Nothing is newly refused, so no (narrowing) arm is owed.
    • Reader guarantee (what a consumer of a parsed context may assume): narrowed. ExecutionContext['performedBy']['clientId'] goes from string to string | undefined, and the published schema's required: [clientId] becomes an anyOf. A strict TypeScript reader outside the repo that dereferences performedBy.clientId as a string stops compiling.
    • The declaration lines: Clause-②: yes with the word "widened" is right for the accept set, and the changeset body states the reader-side loss in its "What to do" paragraph with the one-line fix. That is sufficient under the repo's definition of the arm (the arm is read off the accept set). The PR body's 「只放宽」 is true of the accept set only; the next clause of the same sentence corrects it. Right.
    • First-party readers, read in the tree: runtime/src/action-execution.ts#apiForwardAgentOf, mcp/src/tool-call-interceptor.ts, the three plugin-audit writers and plugin-auth all guard clientId with a typeof or nonEmpty check, and each also requires principalKind === 'agent' or a string clientId before acting. An { agentId } context makes none of them treat the caller as an OAuth agent. Right.
  3. The refusal of a performer-less performedBy changes shape: on main an invalid_type issue at performedBy.clientId, now a custom issue at performedBy. Still a refusal; a consumer matching on the old path or code is the only thing that moves. Not declared; harmless (N3).
  4. HookContext.provenance gains optional performedByAgentId, performedByConversationId, performedByConfirmationId. Widening of what a hook may read. Right.
  5. ScriptContext.provenance (exported interface of @objectstack/runtime) gains the same three optional members. Widening. Right.
  6. The claim that the published JSON Schema carries the rule as allOf: [{ anyOf: [...] }] and that dropped-refinements.baseline.json does not grow is not visible in the diff (the regenerated .mdx shows four optional keys and no rule) and was not probed. requiredOneOf is on the projectable list in packages/spec/src/shared/refinement-projection.ts and the baseline file is not in the diff, which is consistent with the claim; Test Core and the generated-artifact gates, in progress, are what confirm it.

② Semver level

  • .changeset/33786-in-product-ai-performed-by.md: @objectstack/spec, @objectstack/objectql, @objectstack/runtime at patch. Those are exactly the three released packages whose src the diff moves; packages/cli moves a test only. Right.
  • Clause-②: yes on both the PR body and the changeset. Right: a published schema's accept set moves.
  • Metadata-protocol: none on both. Right by the definition of record ("the change to what a metadata author can WRITE"): ExecutionContext is assembled by the server and HookContext.provenance is stamped by the engine; a metadata author writes neither, and no authorable key, value or type is added. none takes patch, and a non-protocol widening ships patch. Check Changeset concluded success on this head.

③ Boundary flags

  • Shape, optional siblings (A) or a discriminated union (B): A is accepted. B would add a discriminant, which is the new actor vocabulary the ruling refuses, and would break every performedBy?.clientId reader on the other arm. The cost of A is that the schema admits combinations no producer builds, { clientId, agentId } and { clientId, conversationId }; see N1.
  • Key names: agentId / conversationId / confirmationId accepted over agentName / pendingId. agentId and conversationId are the ToolExecutionContext names for the same values. confirmationId is right and pendingId would be wrong: the key names a decided confirmation and must cover both confirmation seams in packages/spec/src/contracts/ai-service.ts, whose ids are spelled differently (proposePendingAction returns id, IActionConfirmationService.submit returns pendingId). See N2 for what that costs.
  • Hook-side names: the flattened performedBy + key prefix accepted; it is the existing performedByClientId convention and a nested object would be a second shape for one mark.
  • Metadata-protocol: none versus added on the feat(audit): AI service accounts, O4 of ADR-0151 — principalKind reaches hooks and explain, so an account is attributed as itself #31740 precedent: answered none, see ②. The precedent was not re-read (not an input); if the seat holds hook-READABLE members to be protocol, that is a reading of the definition for the seat to rule, and it would flip the line and the spec level together. Not escalated: the text of record says "write".
  • Widened file surface (objectql buildProvenance, the two sandbox files, the cli pin): accepted, and necessary. Without the buildProvenance copy the three hook keys would be declared and never populated (ADR-0049), and the cli pin enumerates the body face. The round-2 claim 6897603637 already names these files. No write reaches packages/plugins/plugin-audit/** or docs/adr/**.
  • Item (b), the ruling: the owner's ruling as sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 carries it ("Accept AI-on-behalf, conversation id and confirmation id on the write context, using the existing performed_by / on_behalf_of columns plus contract fields. Do not add a new actor vocabulary") covers a second producer of performedBy on the write context. ADR-0151 D5 does not refuse it: D5 refuses performedBy for a performer that IS the subject, and here the subject is the person. The dev's no-stop is right.
  • ESCALATED to the seat (bookkeeping, not a finding on this head): the tree's ADR text now disagrees with the spec. ADR-0090 D10 rule 4 says a caller of any kind other than an agent principal "records the principal it authenticates as, and the missing performed_by is itself the record that the principal acted for itself"; ADR-0151 lists "the meaning of ExecutionContext.performedBy (the OAuth client that acted for a person)" under Leaves unchanged; the 2026-09-20 note calls it a one-key object. The dev report says the ADR note is "Noted, not filed". The carrier card on the skills lane should exist before this merges, naming all three passages, so the disagreement is tracked and not merely remembered.
  • No hits path is under skills/** or ui/skills/**; no security label is owed by that rule.

④ Design judgment

packages/spec/src/kernel/execution-context.zod.ts

  • Against the ruling: holds. The existing pair is used, no actor vocabulary is added, actor does not move, userId stays the person, and onBehalfOf is deliberately NOT set on the in-product path. That last choice is what keeps attribution out of authorization: onBehalfOf is the key the confused-deputy intersection reads, so setting it would have made this an authorization input.
  • Against ADR-0151 D5's three reasons: reason 1 (the row would say the agent acted for itself) does not arise, on_behalf_of is the person; reason 2 (one key, two id namespaces) is honoured on the envelope by separate clientId and agentId keys; reason 3 (delegated model) does not arise, the person is the subject on their own grants.
  • Never an authorization input: checked in the tree. No reader of performedBy outside the audit writers and the forward-credential mint exists, and the mint requires principalKind === 'agent', an oauthScopes array and a string clientId. assemble-execution-context.ts still emits { clientId } or undefined and nothing else, so no door in this repository can be made to emit agentId from a request.
  • S1 (should-fix) — the "server-constructed" sentence does not hold against the values the same docblock equates the keys to. The docblock says "No request header, body member or model output may set any key of it", and in the same breath defines agentId as "the same value as ToolExecutionContext.agentId" and conversationId as "the same id as ToolExecutionContext.conversationId". ToolExecutionContext.agentId is documented in ai-service.ts as "the :agentName from /api/v1/ai/agents/:agentName/chat", and a conversation id reaches the tool loop from the caller that continues a thread. Read literally the sentence forbids the first producer's only sources; read loosely it admits a caller-named id onto an envelope whose own ADR note (2026-09-20) refused traceId and requestId for being caller-controlled. The contract has to say which: state the producer's obligation, that a key may carry an id a request named only after the server resolved it in its own store for the person in userId (the agent it actually ran, a conversation that person owns, a pending item that person's approval decided for this operation), and that an unresolved id is not stamped. Without it the audit answer sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 exists to give, "AI changed this for this person in this conversation", can name a conversation the person never had. Prose only: the docblock and the .describe strings, plus the regenerated reference.
  • N1 (nit) — the schema admits { clientId, agentId } and { clientId, conversationId }, while the prose says each key is "set only by its own producer". Server-constructed, so nothing reaches it; left as an accepted deviation of shape A.
  • N2 (nit) — confirmationId is one key over two stores (the in-app pending action id and the pending-confirmation service item id), the pattern the docblock avoids for the performer. Which store an id resolves in follows from the performer key beside it; sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 should say so when it records the id. Follow-up on sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694, no change here.
  • N3 (nit) — the performer-less refusal now reports at path performedBy with a custom code. Accepted.

packages/spec/src/data/hook.zod.ts

  • The docblock's count (five marks), the copy rule ("each key is copied from its ExecutionContext.performedBy sibling") and "never an authorization input" agree with buildProvenance and with the audit writer's rule of reading provenance, never session.
  • S2 (should-fix) — the published description states an audit behaviour the tree does not have, and pre-decides the mapping sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 owns. performedByAgentId's .describe says "the audit writer records it in sys_audit_log.metadata as performed_by beside on_behalf_of", and the ExecutionContext.performedBy describe says the same of all four keys. At this head packages/plugins/plugin-audit/src/audit-writers.ts (~:2117 and ~:2270) reads provenance.performedByClientId and nothing else, so an in-product AI write produces a row identical to the person's own; the changeset says so ("a separate change to the audit writer") and the description contradicts it. It also commits the writer to putting the agent id in the performed_by key that holds sys_oauth_application ids today, which is ADR-0151 D5 reason 2 and which this PR's own body tells sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 not to do. Reword both descriptions to what is true on this head: the key is carried for the audit writer, which records it under sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694, without naming the column as fact.
  • The performedByClientId description is untouched and still true.

packages/objectql/src/engine-execution-plumbing.ts — agrees. buildProvenance copies each of the three keys from its performedBy sibling and from nothing else, coerces with String, drops empty values, and keeps returning undefined when no mark survives, so a write with no origin still carries no provenance. buildSession is untouched, so the performer never reaches session; the new engine test asserts exactly that.

packages/runtime/src/sandbox/body-runner.ts — agrees. The three marks are projected member by member through declaredStringMarks, from the engine's buildProvenance output and never from the payload, as the comment above the block requires.

packages/runtime/src/sandbox/script-runner.ts — agrees. The ScriptContext.provenance type lists the same seven members the body runner projects and the spec declares.

Tried and not broken: an { agentId } context reaching the forward-credential mint (refused by the principalKind and clientId guards); a hook or body writing provenance back (not a path this diff opens); { agentId: '' } (parses, and buildProvenance drops it, the same class as an empty clientId on main).

Open on this head: S1, S2. No must-fix. Both fixes are prose in the two hits files and their regenerated references; each moves the head and earns a delta review.

Implemented-by: claude/project-thread-hictiz
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 ceeec02 · 2026-11-15T17:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ceeec0297dae222c3b0b1e2547226aa1f1a41985
Local-runs: none
Scope: round 2 delta on record 6897691839 (head 93b0b1196366f9d9fda4becdb6e1e7926ba8f202). packages/spec/src/kernel/execution-context.zod.ts, packages/spec/src/data/hook.zod.ts + packages/objectql/src/engine-execution-plumbing.ts, packages/runtime/src/sandbox/body-runner.ts, packages/runtime/src/sandbox/script-runner.ts

Read: record 6897691839 in full; card #33786 (body and all five comments: triage 6893867283, claims 6896002823, 6896038213 and 6897603637, os-dev-report 6897591859); PR #34018 body, labels and file list at this head; git diff 93b0b119..bfaef935 (5 files, +49/-32); the merge ceeec029 (parents bfaef935, b4ce310b) as a combined diff; git diff 0ac112fc..b4ce310b on main (32 commits) searched for the contract's terms; #33821's commit 0593356f (stat, and its packages/runtime/src/action-execution.ts hunk); docs/adr/0011-actions-as-ai-tools.md :238-242 at this head; packages/plugins/plugin-audit/src/audit-writers.ts and packages/core/src/security/assemble-execution-context.ts at this head (grep of performedBy). The test files, the changeset and the cli pin did not move since round 1 and stay the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on this head at review time (GET commits/ceeec029…/check-runs, 68 runs): all completed, none in progress, none failed, none cancelled. Success (58): Check Changeset, Spec property liveness, Build Core, Build Docs, Build UI Deps, Build & E2E UI, Live E2E UI, Test Core and its 8 shards, Test UI and its 16 shards, TypeScript Type Check, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check · source gates, Type Check UI, Lint & Repo Gates, Lint · ESLint, Lint · docs & code guards, Lint · PM dispatch-gates, Lint · CI, release & engine gates, Lint · repo & tooling gates, the three Lint · scoped jobs, Governed Surface Queue Guard, PR-body guards, Check Documentation Links, Check PR Size, Dogfood Regression Gate, Flag docs, Auto Label, filter, both shard planners. Skipped (10): 18.x upgrade harness (opt-in), Packed-tarball smoke (opt-in), Queue verdict, Borrowed queue verdict, Schedule gate, Dogfood Regression Gate matrix placeholder, Dogfood Verify CLI, Lint UI, Temporal Conformance, UI Published Artifacts. Every run round 1 listed as in progress has concluded success on this head. The PR is a draft, mergeable_state: clean, no auto-merge armed.

① Derived judgments

  1. The delta since round 1 is prose and its regeneration, nothing else. 93b0b119..bfaef935 touches five files: the two .zod.ts files (docblocks and .describe strings only; no key, type, optionality, .refine or message moves) and three generated reference pages. The accept set, the reader guarantee and the refusal shape are byte-for-byte those round 1 judged; its judgments 1 to 5 stand unchanged.
  2. Round 1's judgment 6 (the published JSON Schema carries the anyOf; dropped-refinements.baseline.json does not grow) was left to the gates. They have now concluded: Test Core 1/8 to 8/8, Lint · docs & code guards and Lint · repo & tooling gates are success on this head. Confirmed by gate, not probed here.
  3. The merge did not change the PR's own diff. ceeec029 has no combined-diff hunk (no conflict was resolved by hand), bfaef935 and ceeec029 are identical on all 13 PR files, and no commit on main between the old base 0ac112fc and the new base b4ce310b touches any of the 13. The patch-id of b4ce310b..ceeec029 equals that of 0ac112fc..bfaef935 restricted to those files: the three-dot diff is round 1's diff plus the two prose commits, 13 files, +311/-49.
  4. Nothing on main interacts with the contract. Across the 32 merged commits no added or removed line names performedBy, buildProvenance, ExecutionContextSchema or HookContextSchema; no commit touches execution-context.zod.ts, hook.zod.ts, packages/plugins/plugin-audit/**, packages/core/src/security/**, engine-execution-plumbing.ts, the two sandbox files or ai-service.ts.
  5. First-party state round 1 relied on is unchanged at this head: assemble-execution-context.ts:380 still emits { clientId } or undefined; audit-writers.ts:2117 and :2275 still read provenance.performedByClientId and nothing else. The reworded prose is judged against exactly that.

② Semver level

  • .changeset/33786-in-product-ai-performed-by.md is unchanged since round 1: @objectstack/spec, @objectstack/objectql, @objectstack/runtime at patch. Right, and still exactly the released packages whose src the diff moves. The round 2 commits move packages/spec/src only (descriptions) plus generated docs; patch on spec covers them and no new package is owed.
  • Clause-②: yes and Metadata-protocol: none on the PR body and the changeset: unchanged and still right, for round 1's reasons. A reworded .describe moves the published description text, not the accept set, so no second declaration is owed.
  • Check Changeset is success on this head. fix(objectql,runtime)!: a package-less action is kept on its own owner key, and a route serves the one on its key #33821 on main is a ! change with its own changeset; it does not bear on this PR's level.

③ Boundary flags

  • Round 1's shape, key-name, hook-name and file-surface flags stand; the delta opens none of them.
  • The ADR escalation is CLOSED by the seat's ruling: the owner's cloud#3826 ruling is of record in ADR-0011, and the ADR-0090 D10 rule 4 note becomes a skills-lane carrier card after merge. Read at this head: docs/adr/0011-actions-as-ai-tools.md :239 records the ruling chain (「3826 照建议(征询版)」, the account owner on cloud#3826) for phase 1, the confirmation contract. The sentence that accepts AI-on-behalf, the conversation id and the confirmation id on the write context is carried by the sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 body and by this PR's jsdoc, not by that note. That is enough for the chain to be of record; the carrier card still owes the three passages round 1 named (ADR-0090 D10 rule 4, ADR-0151 "Leaves unchanged", the 2026-09-20 one-key note). The PR body and the spec docblock both say the note is filed separately, so the tree does not claim an ADR text it lacks. Round 1 asked for the card before merge; the seat ruled after merge. Accepted as the seat's call, not a finding.
  • The delta writes no path under docs/adr/**, packages/plugins/plugin-audit/**, skills/** or any governed surface. The governed-surface file list of the PR is empty; Governed Surface Queue Guard is success.
  • New in the delta, a forward obligation on sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694: both files now carry revision-bound sentences ("at this revision it reads performedByClientId only" in two docblocks; "which does not record it yet" / "does not record them yet" in two published descriptions, one of which regenerates into 12 rows of data-engine.mdx). They are true on this head and go false the moment the writer half lands, so sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 must reword them and regenerate. See N4.

④ Design judgment

packages/spec/src/kernel/execution-context.zod.ts

  • S1 — FIXED, as asked. Round 1 asked the contract to state the producer's obligation in three parts and one negative; each is there, in the docblock and in the published strings:
    • "No request header, body member or model output may set any key of it" became "A request header, body member or model output never sets a key of it", followed by the admission round 1 said was missing: the in-product path's ids "can START as values a request named (the :agentName of the chat route, the conversation a caller continues, the pending item an approval names)". The contradiction with ToolExecutionContext.agentId's own definition is gone: the sentence no longer forbids the producer's only sources, it conditions them.
    • The obligation: the producer "stamps such an id only after the server resolved it in its own store for the person in userId": agentId the agent it actually ran, conversationId a conversation that person owns, confirmationId a pending item that person's approval decided for this operation. Those are round 1's three resolutions, word for word in substance.
    • The negative: "An id the server did not resolve is not stamped."
    • The tie to the envelope's own precedent: "That keeps the envelope's refusal of caller-controlled ids (ADR-0090 D10's 2026-09-20 note: traceId, requestId) whole."
    • Published face: the three per-key .describe strings each carry their own clause ("only after the server resolved it as the agent it actually ran"; "…as a conversation the person in userId owns"; "Stamped only after the server resolved it as a pending item the person in userId decided for this operation"), and the object's .describe carries the general rule and the negative. Each string appears once in the source and once in content/docs/references/kernel/execution-context.mdx.
    • Against the code: this is a duty on a producer that does not exist in this repository yet. No first-party path emits agentId (assemble-execution-context.ts emits { clientId } alone), so nothing at this head can contradict it, and nothing enforces it either. A schema cannot enforce it: resolution is a store lookup. The contract is the right place for it and sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694's producer is where it is tested. Not a finding here.
  • S2 (this file's half) — FIXED. The docblock no longer says the four keys are "recorded by the audit writer"; it says the audit writer records clientId in sys_audit_log.metadata as performed_by beside on_behalf_of, and that the in-product keys "are carried for the audit writer, which records them under sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 (at this revision it reads performedByClientId only)". The object's .describe says the same in published words: "The audit writer records clientId as sys_audit_log.metadata.performed_by beside on_behalf_of; the in-product AI keys are carried for the audit writer, which does not record them yet." Both halves agree with audit-writers.ts:2117/:2275. The old sentence ("recorded by the audit writer as sys_audit_log.metadata.performed_by") occurs nowhere at this head, in source or references. No column is named for the new keys, so the mapping stays sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694's.
  • N2 is answered in the contract, beyond what round 1 asked: the confirmationId docblock now says "Which store it names follows from the performer key beside it", and the PR body carries the note to sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694. Accepted.
  • N1 and N3 stand as accepted deviations; the PR body now lists them as such, citing this record's predecessor.
  • N4 (nit) — the "yet" and "at this revision" wording is time-relative prose on a published surface. Round 1's own remedy asked for "what is true on this head", so this is the fix as ordered, not a defect of it; the cost is the forward obligation in ③. No change here.

packages/spec/src/data/hook.zod.ts

  • S2 — FIXED. performedByAgentId's .describe drops "the audit writer records it in sys_audit_log.metadata as performed_by beside on_behalf_of" and says "carried for the audit writer, which does not record it yet". It also gains S1's clause on the hook face: copied from ExecutionContext.performedBy.agentId, "which only the server-constructed in-product AI path sets, after resolving it as the agent it actually ran". The provenance docblock's bullet changes "The same performed_by mark from its second producer" to "Rule 4's attribution from its second producer", which removes the last place that equated the agent id with the performed_by column (ADR-0151 D5 reason 2), and ends "carried for the audit writer, which records them under sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 (at this revision it reads performedByClientId only)".
  • performedByClientId's description is untouched and still true of the writer. performedByConversationId and performedByConfirmationId never claimed an audit behaviour and are untouched.
  • N5 (nit) — in performedByAgentId's description, "ATTRIBUTION ONLY, exactly like performedByClientId: carried for the audit writer, which does not record it yet" puts "exactly like" in front of the one respect in which the two keys now differ (the client id IS recorded). The comparison governs "ATTRIBUTION ONLY", and a careful reader gets there; sys_audit_log: mark in-product AI writes (AI on behalf of a person, conversation id, confirmation id) #33694 rewrites the sentence anyway. No change here.

packages/objectql/src/engine-execution-plumbing.ts, packages/runtime/src/sandbox/body-runner.ts, packages/runtime/src/sandbox/script-runner.ts — not in the delta, identical to round 1's head, and round 1's "agrees" stands. buildProvenance's docblock says the AI that performed the write "reaches the audit writer here, never through session": it describes the channel, not a recorded column, so it does not restate the claim S2 removed.

Regenerated references — consistent. hook.mdx moves one row (performedByAgentId); execution-context.mdx moves four rows (performedBy and its three new keys); data-engine.mdx moves 12 rows, all the inlined performedBy description (12 occurrences of "does not record them yet" there, one in execution-context.mdx, one in the source). Every new source string is in the reference exactly as written, and no reference keeps an old string. Lint · docs & code guards and Build Docs are success on this head, which is the generated-artifact gate's word on it.

PR body against this head — holds. The declaration lines (Fixes #33786, Clause-②: yes, Metadata-protocol: none) are unchanged and right. The "What changes" list gained two bullets, "The in-product producer's duty (review S1)" and "The audit writer (review S2)", and each describes the head's text accurately. The "Not touched" list is still true. "Round 2 … changes prose only: the two .zod.ts docblocks and descriptions, and the three regenerated reference pages" matches the delta's five files. PR-body guards is success.

  • N6 (nit) — the body does not mention the second merge of main (b4ce310b); its verification headings stop at "After merging main 0ac112f (head 93b0b11)" and "the new head" in the round 2 line reads as bfaef935. The merge is diff-neutral (① 3) and CI ran on ceeec029, so nothing is misdescribed; the os-dev-report on the card still names head 93b0b119 and should be restamped when the dev next reports.

Tried and not broken: a main-side change to a performedBy reader slipping in under the merge (none: apiForwardAgentOf, the audit writer and the MCP door are as round 1 read them); a hand resolution in the merge altering a PR file (no combined-diff hunk; PR files identical across the merge); a reference page keeping the removed audit sentence (none found); the reworded "never sets a key" being weaker than "may not set" for a request-borne value (it is not: the next sentences bind the only request-originated ids to a server resolution and refuse the unresolved one).

Open on this head: none. S1 and S2 are closed. N1, N2, N3 stand as round 1 left them; N4, N5, N6 are nits with no change asked on this PR. Carried forward, off this PR: #33694 rewords the revision-bound sentences and regenerates, tests the resolve-before-stamp duty at its producer, and keeps the agent id out of the OAuth-client performed_by namespace; the skills-lane carrier card for the ADR-0090 D10 rule 4 note is filed after merge, per the seat's ruling.

Implemented-by: claude/project-thread-hictiz
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 75dcf73 · 2026-11-15T17:38Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 75dcf734c357ea2305e4123bbddbf19e01e8724a
Local-runs: none
Scope: round 3, the merge delta only, on record 6898426121 (head ceeec0297dae222c3b0b1e2547226aa1f1a41985, PASS). packages/spec/src/kernel/execution-context.zod.ts, packages/spec/src/data/hook.zod.ts + packages/objectql/src/engine-execution-plumbing.ts, packages/runtime/src/sandbox/body-runner.ts, packages/runtime/src/sandbox/script-runner.ts

Read: record 6898426121 in full; git log ceeec029..75dcf734 --not origin/main; the merge 75dcf734 (parents ceeec029, 529ed7d9) as a remerge diff; the three-dot diffs b4ce310b...ceeec029 and 529ed7d9...75dcf734; blob ids of the 13 PR files at both heads; git diff b4ce310b..529ed7d9 on main (16 commits, 79 files) by file list and by a search of its added and removed lines for the contract's terms; the packages/spec/src/kernel/public-auth-features.ts hunk and the packages/spec/api-surface/contracts.json hunk in full; the imports of packages/spec/src/contracts/automation-service.ts at 529ed7d9; packages/spec/scripts/build-docs.ts at this head (its input directories); PR #34018 body at 17:39:33Z; card #34057 (number, state, title); check-runs on this head at 17:39:22Z and 17:39:44Z.

Check-runs on this head at review time (GET commits/75dcf734…/check-runs, 37 runs so far): CI is STILL RUNNING. Full listing at 17:39:22Z: 19 in progress, 18 completed, none failed, none cancelled. A recount at 17:39:44Z: 17 in progress, still none failed or cancelled.

  • In progress (19, at 17:39:22Z): Build Core, Build Docs, Build UI Deps, Live E2E UI, Plan Test Core shards, Plan Test UI shards, Check Changeset, Flag docs affected by code changes, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check · source gates, Lint · ESLint, Lint · docs & code guards, Lint · PM dispatch-gates, Lint · CI, release & engine gates, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus. (The two shard planners have not finished, so the Test Core and Test UI shards are not created yet; round 2's head had 68 runs.)
  • Success (9): Auto Label, Dogfood Regression Gate, Lint · scoped · tooling self-tests, Spec property liveness, Check PR Size, filter, Governed Surface Queue Guard, Check Documentation Links, PR-body guards.
  • Skipped (9): UI Published Artifacts, Temporal Conformance, Dogfood Verify CLI, Dogfood Regression Gate matrix placeholder, Packed-tarball smoke (opt-in), Schedule gate, Borrowed queue verdict, 18.x upgrade harness (opt-in), Queue verdict.
  • The PR is a draft, mergeable_state: blocked.
  • The PASS below is the design verdict only. Landing waits for these runs to conclude green on 75dcf734; in particular Lint · docs & code guards and Build Docs (the generated-artifact gate) and the Test Core shards have not reported on this head.

① Derived judgments

  1. One commit lies between the two heads and off main: the merge 75dcf734 itself ("Merge remote-tracking branch 'origin/main' into claude/project-thread-hictiz", parents ceeec029 and 529ed7d9). No other commit. 529ed7d9 is main's tip at review time.
  2. The merge is content-neutral for the PR.
    • git show --remerge-diff 75dcf734 is empty: no conflict, no hand resolution.
    • The three-dot diff is byte-identical: b4ce310b...ceeec029 and 529ed7d9...75dcf734 are both 13 files, +311/-49, and the two diff texts have the same sha256 (55c1ac75…340ff1cc).
    • All 13 PR files have the same blob id at ceeec029 and 75dcf734.
  3. Nothing on main b4ce310b..529ed7d9 touches the contract. No commit touches execution-context.zod.ts, hook.zod.ts, packages/plugins/plugin-audit/**, packages/core/src/security/assemble-execution-context.ts, engine-execution-plumbing.ts, either sandbox runner or packages/runtime/src/action-execution.ts (apiForwardAgentOf still reads ec.performedBy?.clientId at :1744). No added or removed line in the whole range names performedBy, performed_by, buildProvenance, ExecutionContextSchema, HookContextSchema or apiForwardAgentOf. Main moved no file under packages/objectql, packages/runtime or packages/core.
  4. The two packages/spec moves on main do not bear on it.
  5. The three regenerated pages still match the merged tree, by input: build-docs.ts renders from packages/spec/json-schema/, which is built from the .zod.ts files. Main changes no .zod.ts file under packages/spec/src, nothing under packages/spec/scripts, no packages/spec/package.json and no page under content/docs/references/. The three pages carry none of main's new strings (ban_user, resend_invitation, gatedInputs, dryRun, FlowDryRun: 0 hits in each). The generator's inputs for kernel/execution-context.mdx, data/hook.mdx and data/data-engine.mdx are therefore the ones round 2 judged. Judged by input, not regenerated here; check:generated in CI is the gate's word and is still running.

② Semver level

  • Unchanged. .changeset/33786-in-product-ai-performed-by.md is the same blob as at round 2: @objectstack/spec, @objectstack/objectql, @objectstack/runtime at patch. Main's 12 new changesets are its own and none names this change.
  • Clause-②: yes and Metadata-protocol: none are unchanged on the PR body and still right.
  • fix(auth)!: the environment-access gate on /oauth2/authorize judges every client the request names #33937 on main is a ! change (fix(auth)!, the /oauth2/authorize environment gate) with its own changeset; it does not bear on this PR's level. Check Changeset has not concluded on this head.

③ Boundary flags

④ Design judgment

packages/spec/src/kernel/execution-context.zod.ts, packages/spec/src/data/hook.zod.ts, packages/objectql/src/engine-execution-plumbing.ts, packages/runtime/src/sandbox/body-runner.ts, packages/runtime/src/sandbox/script-runner.ts — identical blobs to round 2's head. Round 2's judgments stand in full: S1 and S2 closed; N1, N2, N3 as round 1 left them; N4, N5 nits with no change asked.

PR body against this head, read at 17:39:33Z (body last updated 17:38:52Z):

Tried and not broken: a second commit riding in beside the merge (none: one commit off main); a hand resolution altering a PR file (empty remerge diff, identical blobs); main changing a performedBy reader or producer under the merge (no such path or term in the range); main changing a generator input of the three pages (no .zod.ts, no generator script, no reference page moved); the new IAutomationService.dryRun contract reading performedBy (type import of ExecutionContext only).

Open on this head: none on the contract. N6 and N7 are body nits. CI on 75dcf734 is in progress; this verdict is the design verdict and landing waits for green.

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

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

ACCEPT · PR #34018 (#33786) · head 75dcf734c357ea2305e4123bbddbf19e01e8724a · 2026-11-15T18:06Z

席位核对

  • 形态: 13 files, read from the PR's file list (+311 / −49). check-governed-merges.mjs --pr 34018: NOT governed, ≤ 3000 lines. Kernel and data contract paths are hit, so the contract review applies. Tier S, the seat's own ACCEPT.
    • ExecutionContext.performedBy gains optional agentId / conversationId / confirmationId. clientId becomes optional, with an at-least-one-of clientId/agentId refinement.
    • HookContext.provenance gains the three performedBy* copies.
    • The objectql provenance copy and the two sandbox runners pass the new keys through.
    • Spec, objectql and cli pin tests; three regenerated reference pages.
    • Changeset: patch on spec, objectql and runtime.
  • 前提实测: the seat read the remainder at TIER_DEFAULT.
  • 契约复审: CONTRACT_REVIEW_TIER.
    • r1 PASS with S1 (producer's resolve-before-stamp duty) and S2 (no audit claim the writer does not honour): 6897691839 @93b0b119.
    • r2 PASS @ceeec029, S1 and S2 fixed sentence by sentence: 6898426121.
    • r3 PASS @ this head: 6898581614. Merge-only; the three-dot diff and all 13 blobs are byte-identical, and main touches no generator input of the three reference pages.
  • 门禁 check-runs: latest attempt on this head, 72 runs: 60 success, 12 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 = 1 first-parent commit on main past this head's merge base 529ed7d9 (< 15).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 18:07
@github-actions

Copy link
Copy Markdown
Contributor

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

队列构建 43745034457 红了。队列跑的是全量套件(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 无队列失败记录(首次)。
  • 过去 24h 队列共有 13 个失败构建(不含本次)。

分诊清单:

  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 构建失败 — 先分诊,再决定要不要重排

队列构建 43745641090 红了。队列跑的是全量套件(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 队列共有 17 个失败构建(不含本次)。

分诊清单:

  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 构建失败 — 先分诊,再决定要不要重排

队列构建 43754687220 红了。队列跑的是全量套件(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-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 队列共有 25 个失败构建(不含本次)。

分诊清单:

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

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

队列构建 43761140033 红了。队列跑的是全量套件(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-29: 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 已在队列失败 3 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 30 个失败构建(不含本次)。

分诊清单:

  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 #34018 · head 75dcf734c357ea2305e4123bbddbf19e01e8724a · 2026-11-15T22:49Z

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 2539ad9 Nov 15, 2026
73 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-hictiz branch November 15, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:data 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

2 participants