Skip to content

feat(scenarios): the confirm-first line asks the build to lock the change a gated action makes - #36091

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-a4B-35908
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-a4B-35908

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #35908
Clause-②: no
Metadata-protocol: none

维护者速读

  • 评测场景卡的搭建提示词变了,用户无感:需先确认的操作那一行,现在还要求搭建方把这次改动锁住,只能经该操作改。
  • 属于场景卡评测工具;落实维护者「三个问题 同意」里的补充:确认门不扩到直接改记录,所以由搭建方加锁堵住绕行。
  • 出错只影响评测跑出的应用:锁错了某人的其他正常改动会被拒,评测分数失真;只改提示词文本,可直接撤回。
  • 无

What changes

packages/qa/scenarios/src/runner/prompts.ts: the build contract's line for each confirm-gated agent action (run.agentActions[].confirm: true) used to end in (confirm first) only. The gate (ai.requiresConfirmation) guards the action's own door, and on the maintainer's ruling it is not widened to update_record, so an agent that met the gate could still write the target state through the raw data door. The line now also asks the build to lock that change, with the mechanism the published skills teach (objectstack-ai pitfall "Gating the action, not the state"; objectstack-data rules/security.md, row-conditioned edit lock):

(confirm first; the confirmation guards this action’s own door only, so also lock the change it makes: if it changes fields of its row, make those fields not editable for each person who runs it, at the stage it acts on (a field permission when in their permission set), and have the action write them elevated, so a plain record update cannot make that change while those people’s other changes to the same fields still land; an action that deletes its row locks nothing, and those people keep their delete right)

Two limits come from the card audit below, and are why the wording is not a bare field lock:

  1. Stage-scoped, per person (a field permission when, not readonly: true and not an unconditional field permission). A whole-field lock on ticket.status for the team lead would refuse resolve_without_code with 403 PERMISSION_DENIED before validation runs, breaking service_desk's write_validation guardrail, which expects VALIDATION_FAILED. readonly: true would strip every non-system write of the field, including the support agent's applied resolve.
  2. Deletes lock nothing. Four cards gate a delete action and give the same persona an applied plain delete of the same object; locking deletion would deny them.

Lines for actions that are not confirm-gated are unchanged. No card JSON changes.

Card audit (the card's ask)

Gated action → the op that exercises it (pending_confirmation) → what the stage-scoped lock covers → the same persona's other operations on that field.

Card Gated action (object) Runs it Lock under the new wording Same persona's other ops on the field Verdict
asset_lifecycle dispose_asset (disposal_request) asset_admin (dispose_scrapped_asset, dr04 approved) status, disposed_on at approved none (asset_admin's applied ops write asset and checkout). dept_manager's applied manager_approves_scrap writes status too: another persona, its set is not locked no conflict
crm_account_with_contacts delete_contact (contact) sdr (remove_tech_contact) nothing: a delete remove_ben: sdr, applied delete of a contact no conflict, because the wording exempts deletes
invoice_with_line_items delete_invoice_line (invoice_line) sales_rep (remove_inv001_line) nothing: a delete remove_line: sales_rep, applied delete of a line no conflict, because the wording exempts deletes
leave_balances delete_leave_request (leave_request) hr_officer (delete_zoes_withdrawn_request) nothing: a delete delete_withdrawn_request: hr_officer, applied delete of a request no conflict, because the wording exempts deletes
order_to_cash write_off_balance (invoice) ar_clerk (write_off_balance, inv005 open) status at the open-balance stages none applied. overpay_invoice (refused VALIDATION_FAILED) is a payment insert, refused before any invoice write no conflict
project_with_tasks delete_task (task) contractor (drop_relaunch_task) nothing: a delete drop_packing: contractor, applied delete of a task no conflict, because the wording exempts deletes
requisition_to_receipt cancel_purchase_order (purchase_order) buyer (cancel_sent_po, po116 sent) status at sent raise_po_from_text (applied; target state status: sent) moves draft to sent, a different stage. fix_chair_quantity writes po_line on a draft PO no conflict, with one hazard: an insert sent straight at sent meets a when lock (an insert is judged on the row as sent). The wording asks that the same people's other changes still land, so the build routes the raise through draft or an elevated action
service_desk close_ticket (ticket) team_lead (close_ticket, t062 resolved) status at resolved reassign_ticket (applied) writes assignee only. resolve_without_code (refused VALIDATION_FAILED, the write_validation guardrail) writes status on t114 at open, outside the lock's stage, so validation still answers a whole-field lock conflicts; resolved by the stage wording
travel_expense pay_claim (expense_claim) finance_officer (pay_claim, c118 finance_approved) status, paid_on at finance_approved none on the card. The finance step's approval moves the claim at manager_approved, a different stage no conflict

Result: no card needs an edit. Every conflict is resolved in the prompt wording: the delete exemption covers crm, invoice, leave and project; the stage scope covers service_desk and requisition. The PM brief named three same-persona applied deletes (leave delete_withdrawn_request, crm remove_ben, invoice remove_line). The audit found a fourth: project_with_tasks drop_packing.

Tests

  • New top-level describe in packages/qa/scenarios/test/runner/units.test.ts (the package's prompt harness):
    • service_desk: the confirm-first close_ticket line carries the lock, the stage scope and the delete exemption, and the three plain action lines carry none of it.
    • Across all nine cards, each confirm-gated line asks for the lock and each plain line does not (9 gated lines counted).
  • pnpm --filter @objectstack/scenarios build && … test && … typecheck: Test Files 40 passed (40), Tests 1213 passed (1213), tsc --noEmit exit 0. The package tsconfig includes test/**/*.
  • Ablation: the line restored to (confirm first) through scripts/ablation-replace.mjs (anchor 1 → 0, blob b0cd81603b22 → 582d46117f0c). Result: 2 failed and 77 passed in units.test.ts, both new pins red. Restored: blob equals HEAD and git diff HEAD is empty. The tests import src/ directly, so no rebuild leg was needed.

Acceptance notes

  • The wording does not name fields or values. The build contract never states operations or their outcomes (prompts.ts header), so the build reads which fields change, and at which stage, from the action summary and the app prompt.
  • Out of reach of this card: the scorer does not check that the lock exists. gradeAgentActions checks ai.exposed and ai.requiresConfirmation only. Whether a build obeys the new line shows up only in a run's confirm turn.

Verification

Two-minute check: run pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/units.test.ts -t "stage-scoped field lock". Expected result: 2 passed.

Dry-run of the build prompt (service_desk, crm_account_with_contacts): the action section
== service_desk
Business actions an AI agent may call (expose each to AI; ask before acting where marked):
- `demohelpdesk_log_ticket` on `demohelpdesk_ticket`: Log a ticket for a customer, with its first comment, in the right group's queue.
- `demohelpdesk_reply_to_customer` on `demohelpdesk_ticket_comment`: Post a public reply or an internal note on a ticket, with the minutes spent.
- `demohelpdesk_resolve_ticket` on `demohelpdesk_ticket`: Resolve a ticket with its resolution code; this sends the satisfaction survey.
- `demohelpdesk_close_ticket` on `demohelpdesk_ticket`: Close a resolved ticket for good; irreversible. (confirm first; the confirmation guards this action’s own door only, so also lock the change it makes: if it changes fields of its row, make those fields not editable for each person who runs it, at the stage it acts on (a field permission `when` in their permission set), and have the action write them elevated, so a plain record update cannot make that change while those people’s other changes to the same fields still land; an action that deletes its row locks nothing, and those people keep their delete right)
== crm_account_with_contacts
Business actions an AI agent may call (expose each to AI; ask before acting where marked):
- `democrm_create_contact` on `democrm_contact`: Add a contact, optionally under an account.
- `democrm_reassign_contact` on `democrm_contact`: Move a contact to another account.
- `democrm_delete_contact` on `democrm_contact`: Delete a contact; irreversible. (confirm first; …same line…)
Local gate subset at 274fb5f: 61 derived families, 59 exit 0, 2 NOT MEASURED
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 61 commands. Each was run with its exit code captured before any pipe. --ran reconciliation: "61 derived famil(ies) accounted for — 59 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".
  • NOT MEASURED: pnpm check:dual-build-cjs-loads, exit 3, PREREQUISITE NOT MET (reads every package's dist; only the scenarios closure was built). Left to CI.
  • NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, exit 3 (pinned fixture commit unreachable from a shallow clone). Left to CI.
  • scripts/pm/overlap-check.mjs before each push: VERDICT clean exit 0, 0 PR heads overlap.
  • Pre-push check:commit-card-trailers: 2 commit messages carry no card relation and no model identifier.

Files to read first, by risk:

  1. packages/qa/scenarios/src/runner/prompts.ts: the CONFIRM_FIRST_LOCK text and its docblock. This is the hunk at risk: the wording decides what every gated build locks.
  2. packages/qa/scenarios/test/runner/units.test.ts: the new describe.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt

@github-actions github-actions Bot added size/s 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 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 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 — 1 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 15b7f51b2796ce29d1b027c7033da604df52bb06 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 15b7f51b2796ce29d1b027c7033da604df52bb06

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B) · 2026-11-21T15:46Z: 274fb5f7323b752a588fc7eafd04bc0e47037e18. No further push is planned; L1 reads this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): ACCEPT at head 274fb5f7323b752a588fc7eafd04bc0e47037e18 (Fixes #35908). Full read of the diff against main: 3 files, +77/-1.

席位核对

Shape and gates. l1-face --pr 36091 at 274fb5f: nothing flagged. Draft against main, first line Fixes #35908, and no closing keyword binds another card. @objectstack/scenarios (public) has a patch changeset. Clause-②: no, Metadata-protocol: none. Check-runs: 33 success, 16 expected skip, 0 failed, 0 pending, mergeable_state clean. Lint & Repo Gates and TypeScript Type Check are success. Dogfood not owed. Not governed. 77 lines with a src/ change, so this L1 read is owed (not self-review).

Fixes is right. The card's three Done-when items:

  • The prompt line asks for the lock: CONFIRM_FIRST_LOCK replaces (confirm first) on confirm-gated action lines only.
  • A dry run shows it: the PR body has the action section for service_desk and crm_account_with_contacts.
  • The card audit is in the PR body: 9 cards, one gated action each.

Premise, checked against main.

  • The mechanism is the one the skill teaches: skills/objectstack-ai/SKILL.md:343-358, pitfall 2 "Gating the action, not the state". It describes the gated action plus a field lock, with the action body writing elevated.
  • Field permission when (packages/spec/src/security/permission.zod.ts:1148) votes only on the rows the condition matches and is absent on the others. It is judged on the stored row before an update and on the incoming row of an insert.
  • So the stage-scoped wording does what the audit says. It does not lock earlier stages. The requisition hazard (an insert sent straight at sent meets the lock) is real and correctly named.

Audit spot-checks, against the card JSON.

  • The 9 gated actions: docs/qa/scenarios/*.json has exactly 9 cards with one confirm action each (dispose_asset, delete_contact, delete_invoice_line, delete_leave_request, write_off_balance, delete_task, cancel_purchase_order, close_ticket, pay_claim). This matches the test's gated === 9 and its file list.
  • service_desk: resolve_without_code is a team_lead update of t114 to status: resolved, refused VALIDATION_FAILED. close_ticket is a team_lead update of t062 to closed, pending_confirmation. A whole-field lock on status for team_lead would turn the first into a 403 before validation runs. That is the conflict the stage wording resolves.
  • Four of the gated actions are deletes, and the delete exemption covers them. That matches the audit's four same-persona applied deletes.

Tests.

  • The new describe pins the service_desk line (lock, stage and delete-exemption fragments) and checks that the three plain lines carry none of it.
  • It also sweeps all 9 cards: every gated line asks for the lock and no plain line does.
  • Positive control: the ablation in the PR body. Restoring (confirm first) turns both new pins red, and the blob is restored identical.

Changeset, sentence by sentence.

  • "guards its own door only; the gate is not widened to the raw data door": this is the skill's pitfall and the maintainer answer the card cites.
  • "made not editable for each person who runs it, at the stage the action acts on (a field permission when …), and the action writes them elevated": this is CONFIRM_FIRST_LOCK.
  • "An action that deletes its row locks nothing … Lines for actions that are not confirm-gated are unchanged": the test pins both.

Note (non-blocking). The card asked the build to lock the field. Whether a build obeys the line is not scored (gradeAgentActions reads ai.exposed and ai.requiresConfirmation only). The PR body says so under Acceptance notes. A future card for the eval seat would be needed if the lock should be graded. This PR does not owe it.

Landing: non-governed, Clause-②: no. The area lands it after check-governed-merges.mjs --pr 36091.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Landing (area a4-B) · 2026-11-21T16:21Z · ACCEPT → PR #36091 comment 7065229387 (L1-a, at 274fb5f732).

Probe Reading
Head 735db113e0e1cbc77557ca5da7cb326740285bb2 = 274fb5f732 + a platform merge of main (relay pr_update_branch, K was 24); the PR's own diff is unchanged (3 files, +77/-1), so the ACCEPT carries
Checks at head (pr-state) 33 success · 16 expected skip (check-expected-skips: OK, every one in main's roster) · 0 failed · 0 pending · mergeable_state clean
check-governed-merges --pr 36091 NOT governed · 78 changed lines ≤ 3000
landing-k --pr 36091 K = 1 < 15 · no locale pack · no shared book moved
Contract review not owed: Clause-②: no, no packages/spec/src/** path, no governed path, no narrowing arm

State change: ready + auto-merge now; on MERGED, Fixes #35908 closes the card and this area removes pm:dispatched there.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 16:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit f555352 Nov 21, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-a4B-35908 branch November 21, 2026 16:44
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/s 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.

Scenario build prompt: the 'confirm first' line should also ask the build to lock the field a gated action changes

2 participants