Repository navigation
feat(scenarios): a card may name a roll-up a persona is meant to read over withheld rows - #37271
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
… over withheld rows (order_to_cash: invoice.amount_paid for the sales rep) Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. 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 59d9749085954e8cc185021bcbfa987768875f12 && git checkout 59d9749085954e8cc185021bcbfa987768875f12
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 057cedfa9b6f990a7cf322118ae33bc4460ddc65 d1750933e260d92e20b253413af991e5993b06cb && git checkout -B drift-repro 057cedfa9b6f990a7cf322118ae33bc4460ddc65 && git merge --no-ff d1750933e260d92e20b253413af991e5993b06cb
node scripts/docs-audit/affected-docs.mjs --json 057cedfa9b6f990a7cf322118ae33bc4460ddc65 |
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr
Fixes #37257
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
allowedRollups(FieldRefSchema[], the card's bare names, optional, absent by default) inpackages/qa/scenarios/src/schema.ts. The persona schema refuses an allowed roll-up that the persona's ownhiddennames.rollupSourceCharges(packages/qa/scenarios/src/runner/orchestrate.ts) skips asecurity-rollup-source-unreadablefinding that is acknowledged (the rule'sinfoarm, i.e.rollupSourceUnreadableReasonon the set) AND whose roll-up the persona'sallowedRollupsnames. The card's names are prefixed with the card namespace before the comparison (invoice.amount_paidreads asdemoorder_invoice.amount_paid, the build's name). An unacknowledged finding on the allowed roll-up, and every other roll-up over withheld data, is still charged.docs/qa/scenarios/order_to_cash.json: the prompt sentence (zh and en kept in step) now says the rep sees their invoices' 已收金额 / 余额 / 状态 but not the individual payment rows; the sales-rep persona carriesallowedRollups: [{ object: invoice, field: amount_paid }].hiddenis unchanged (payment,product.unit_cost).@objectstack/scenariospatch (the package is published and ships the card library).Tests
Pin: new top-level
describeinpackages/qa/scenarios/test/runner/orchestrate.test.tson the realorder_to_cashcard, namespaced:amount_paid+ acknowledgedpayment_count, card allowsamount_paid→ onlypayment_countcharged;Ablation (once, after commit): the reader line deleted through
scripts/ablation-replace.mjs(anchor 1 → 0, blob 9f7c6d1acc4f → 38300e4a41a0) →Tests 1 failed | 4 passed(the allowed-roll-up case red:demoorder_invoice.amount_paidcharged); restored, blob == HEAD 9f7c6d1acc4f,git diff HEADempty. The test importssrc/directly, so no dist rebuild sits in the path.Acceptance notes
expect.objects, the seed carries the field) are not applied toallowedRollups: the loader is outside this claim's file surface. A misspelt entry fails closed (never matches, so the finding stays charged).namespacedScenario(runner/namespace.ts, also outside the surface) passesallowedRollupsthrough bare; the reader prefixes idempotently, so it matches either a bare or a namespaced card.runner/prompts.ts) still lists only what the persona must not read; the intent reaches the builder through the card prompt sentence.Verification
Two minutes:
pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts -t 'allows a persona'→ 5 passed.Read first:
packages/qa/scenarios/src/runner/orchestrate.ts(the one skip inrollupSourceCharges),packages/qa/scenarios/src/schema.ts(allowedRollups+ refine),docs/qa/scenarios/order_to_cash.json(prompt sentence).Local readings at d175093
pnpm --filter @objectstack/scenarios build && … test && … typecheckunder the verify lock:VERDICT command-exit 0; Test Files 42 passed (42), Tests 1336 passed (1336).node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran …: 69 derived, 68 run (all exit 0), 1 NOT-MEASURED (pnpm check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET: needs a full build; left to CI), 0 UNRUN.node scripts/pm/overlap-check.mjs --branch=HEAD: VERDICT clean exit 0.