Repository navigation
feat(scenarios): the confirm-first line asks the build to lock the change a gated action makes - #36091
Conversation
…ange a gated action makes Claude-Session: https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 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 |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B) · 2026-11-21T15:46Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. Fixes is right. The card's three Done-when items:
Premise, checked against main.
Audit spot-checks, against the card JSON.
Tests.
Changeset, sentence by sentence.
Note (non-blocking). The card asked the build to lock the field. Whether a build obeys the line is not scored ( Landing: non-governed, Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Landing (area a4-B) · 2026-11-21T16:21Z · ACCEPT → PR #36091 comment 7065229387 (L1-a, at
State change: ready + auto-merge now; on MERGED, |
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 toupdate_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-datarules/security.md, row-conditioned edit lock):Two limits come from the card audit below, and are why the wording is not a bare field lock:
when, notreadonly: trueand not an unconditional field permission). A whole-field lock onticket.statusfor the team lead would refuseresolve_without_codewith403 PERMISSION_DENIEDbefore validation runs, breaking service_desk'swrite_validationguardrail, which expectsVALIDATION_FAILED.readonly: truewould strip every non-system write of the field, including the support agent's applied resolve.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.dispose_asset(disposal_request)dispose_scrapped_asset, dr04approved)status,disposed_onatapprovedassetandcheckout). dept_manager's appliedmanager_approves_scrapwritesstatustoo: another persona, its set is not lockeddelete_contact(contact)remove_tech_contact)remove_ben: sdr, applied delete of a contactdelete_invoice_line(invoice_line)remove_inv001_line)remove_line: sales_rep, applied delete of a linedelete_leave_request(leave_request)delete_zoes_withdrawn_request)delete_withdrawn_request: hr_officer, applied delete of a requestwrite_off_balance(invoice)write_off_balance, inv005open)statusat the open-balance stagesoverpay_invoice(refusedVALIDATION_FAILED) is apaymentinsert, refused before any invoice writedelete_task(task)drop_relaunch_task)drop_packing: contractor, applied delete of a taskcancel_purchase_order(purchase_order)cancel_sent_po, po116sent)statusatsentraise_po_from_text(applied; target statestatus: sent) moves draft to sent, a different stage.fix_chair_quantitywritespo_lineon adraftPOsentmeets awhenlock (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 actionclose_ticket(ticket)close_ticket, t062resolved)statusatresolvedreassign_ticket(applied) writesassigneeonly.resolve_without_code(refusedVALIDATION_FAILED, thewrite_validationguardrail) writesstatuson t114 atopen, outside the lock's stage, so validation still answerspay_claim(expense_claim)pay_claim, c118finance_approved)status,paid_onatfinance_approvedmanager_approved, a different stageResult: 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, crmremove_ben, invoiceremove_line). The audit found a fourth: project_with_tasksdrop_packing.Tests
describeinpackages/qa/scenarios/test/runner/units.test.ts(the package's prompt harness):close_ticketline carries the lock, the stage scope and the delete exemption, and the three plain action lines carry none of it.pnpm --filter @objectstack/scenarios build && … test && … typecheck: Test Files 40 passed (40), Tests 1213 passed (1213),tsc --noEmitexit 0. The package tsconfig includestest/**/*.(confirm first)throughscripts/ablation-replace.mjs(anchor 1 → 0, blob b0cd81603b22 → 582d46117f0c). Result: 2 failed and 77 passed inunits.test.ts, both new pins red. Restored: blob equals HEAD andgit diff HEADis empty. The tests importsrc/directly, so no rebuild leg was needed.Acceptance notes
prompts.tsheader), so the build reads which fields change, and at which stage, from the action summary and the app prompt.gradeAgentActionschecksai.exposedandai.requiresConfirmationonly. 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
Local gate subset at 274fb5f: 61 derived families, 59 exit 0, 2 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 61 commands. Each was run with its exit code captured before any pipe.--ranreconciliation: "61 derived famil(ies) accounted for — 59 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".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.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.mjsbefore each push: VERDICT clean exit 0, 0 PR heads overlap.check:commit-card-trailers: 2 commit messages carry no card relation and no model identifier.Files to read first, by risk:
packages/qa/scenarios/src/runner/prompts.ts: theCONFIRM_FIRST_LOCKtext and its docblock. This is the hunk at risk: the wording decides what every gated build locks.packages/qa/scenarios/test/runner/units.test.ts: the newdescribe.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt