Skip to content

[Decision] order_to_cash: may a sales rep see an invoice's 已收金额 (a roll-up of payments the card hides from reps)? #37257

In progress

Description

@objectstack-fleet

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Found by eval#1's #37234 run, reading on #34920. Filed by seat repo:objectstack#4 under the maintainer's delegation, which says: "If security-rollup-source-unreadable recurs, the seat files the card."

维护者速读

  • 卡在哪: order_to_cash 这次搭建 Seed 满分。Build 167 项只差 1 项,原因是销售代表能看到发票上的「已收金额」。
  • 这个金额怎么来的: 它是该发票所有收款的汇总,而场景卡写明销售代表看不到收款记录。
  • 搭建的 AI 怎么处理的: 它保留了可见,并写了说明理由。评分器的规则是「卡上隐藏的明细,其汇总必须遮蔽,写理由不算数」,所以照样扣分。
  • 要你定: 卡的原意是代表能看自己发票的已收金额、余额和状态,只是看不到一笔笔的收款(B),还是连已收金额也不能看(A)。
  • 我推荐 B。

The fact

  • docs/qa/scenarios/order_to_cash.json, prompt: 「销售代表只能看到自己客户的订单、发票和活动,看不到收款记录和产品成本」.
  • The sales-rep persona's hidden is objects: ["payment"] plus product.unit_cost.
  • The prompt also asks for: 「发票的已收金额汇总其收款,余额 = 金额 − 已收,状态随之变为部分收款或已收清」.
  • So invoice.amount_paid is a summary over payment.amount.
  • The runner (rollupSourceCharges, packages/qa/scenarios/README.md, "Roll-ups over withheld data") charges every security-rollup-source-unreadable finding on a persona's set when the card hides the child. That includes findings acknowledged with rollupSourceUnreadableReason: "a total the card withholds is masked, never explained".
  • The build kept demoorder_invoice.amount_paid readable for demoorder_sales_rep, with a written reason. Build scored 166/167 on that one charge. The same trap appeared on 2026-11-18 (N3).

Re-check: git show origin/main:docs/qa/scenarios/order_to_cash.json | grep -o '销售代表只能看到[^。]*'

Governing text

  • packages/qa/scenarios/README.md § Roll-ups over withheld data.
  • @objectstack/lint rule security-rollup-source-unreadable (os explain security-rollup-source-unreadable).
  • The card's prompt and expect.personas[].hidden.

Options

What changes Work
A — masked The card says reps do not see 已收金额. A correct build masks invoice.amount_paid for reps. It must then mask balance and status too, because balance = amount − amount_paid and status reveal the same total. Nothing changes in the runner. XS: card prompt, plus the hidden fields
B — visible (recommended) The card says reps see their invoices' 已收金额, 余额 and 状态, but not individual payment rows. The card names that roll-up as allowed for the persona, and the runner does not charge an acknowledged finding on a roll-up the card allows. Every other roll-up stays charged. S: card prompt, plus one card key read by rollupSourceCharges, plus a pin

Four axes

  • Real business need: an order-to-cash rep chases their own customers' invoices. Whether an invoice is paid, partly paid or overdue is the working fact; the payment rows are not. The prompt already shows reps their invoices, and the invoice's balance and status are both stated in terms of the paid total. The reading that A needs (reps see an invoice but not whether it is paid) has no stated pull. B is favoured.
  • Long-term soundness: B keeps the rule meaningful: an aggregate leak is charged unless the card says the aggregate is meant. A makes the card hide three invoice fields to keep one total secret, a shape no real deployment asked for. B is favoured, at the cost of one card key.
  • Making AI builds hard to get wrong: under A, a correct build has to see that balance and status derive from the hidden total. The runner checks only the roll-up, so a build that masks amount_paid but leaves balance readable passes while still leaking. Under B, the card states the intent outright, and the acknowledgement the build already writes becomes the right move. B is favoured.
  • No spread at the startup stage: A adds no runner surface. B adds one optional card key with one reader. This axis leans A.

Recommendation: B. Three axes favour it, including long-term soundness, which carries at least half the weight.

Done when

Activity

  1. added
    priority:p2
    needs-user-decision
    domain:devx
    area:ai
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T08:35Z. Typed Task (a decision card). area:ai · p2 · needs-user-decision are kept. The A/B choice goes to the maintainer through seat 4, under the delegation recorded on #37234. Triage does not grade the choice.

  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Ruled: B (visible) · 2026-11-25T09:14Z · by the maintainer, in seat repo:objectstack#4's session. Verbatim: 「#37257 B、#37230 A、#37236 B、#36412 B」.

    The ruling:

    • In order_to_cash, a sales rep sees 已收金额, 余额 and 状态 on their own invoices. They do not see individual payment rows.
    • The card names that one roll-up (invoice.amount_paid) as allowed for the sales-rep persona.
    • rollupSourceCharges does not charge an acknowledged security-rollup-source-unreadable finding on a roll-up the card allows. Every other roll-up over withheld data is still charged.

    The work:

    • the card's prompt sentence;
    • one optional card key with one reader in rollupSourceCharges;
    • a pin that is red when the reader is removed;
    • the README section "Roll-ups over withheld data" updated to match.

    Size S. After it lands, eval#1 re-runs #37234; Build and Seed both passing closes #37234 and unblocks #34920.

    State: needs-user-decision → pm:queue, routed to zone a4-A (area:ai).

  4. added
    pm:queue
    and removed
    needs-user-decision
    on Nov 25, 2026
  5. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

    Claim: PM loop round 7 · 2026-11-25T09:19Z
    Area: a4-A
    Session: session_01QSeKYo86w1wqy2z2fMrryr
    Account: os-justin
    Branch: claude/issue-37257-o2c-allowed-rollup
    Worktree: objectstack-issue-37257
    Domain: domain:devx
    Seat: repo:objectstack#4
    File surface: docs/qa/scenarios/order_to_cash.json (the prompt sentence and the sales-rep persona's new key), packages/qa/scenarios/src/schema.ts (the one optional card key), packages/qa/scenarios/src/runner/orchestrate.ts (rollupSourceCharges, its one reader), a pin under packages/qa/scenarios/test/**, packages/qa/scenarios/README.md § Roll-ups over withheld data, one changeset if the package is published (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (a ruled card/runner change, ruling 7158069260)
    Thread-read: 7158069260
    Premise: holds (main 7939732: the prompt reads 「销售代表只能看到自己客户的订单、发票和活动,看不到收款记录和产品成本」; rollupSourceCharges at packages/qa/scenarios/src/runner/orchestrate.ts:858 charges every finding, acknowledged or not, when the card hides the child)
    Serial constraints cleared: overlap-check probe at 7939732f35: the four files merge cleanly with origin/main and every open PR head (0 touch them)
    Pre-claim lane: domain:devx — packages/qa/scenarios/**, docs/qa/scenarios/**
    Pre-claim deps: none. Unblocks #37234 (re-run) and #34920.
    Prior rulings read: 7158069260 (B, the maintainer's 「#37257 B」)

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First-touch audit 2026-11-25T09:22Z. The maintainer ruled B (7158069260), so needs-user-decision is resolved. The card stays area:ai · Task · p2, now dispatched to seat 4 zone a4-A. Done when: the card text and runner change land, and a re-run of #37234 passes Build and Seed, which closes #37234 and unblocks #34920.

  8. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr
    os-dev-report

    {
      "issue": 37257,
      "status": "done",
      "branch": "claude/issue-37257-o2c-allowed-rollup",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37271",
      "session": "session_01QSeKYo86w1wqy2z2fMrryr",
      "premise_still_valid": true,
      "summary": "Ruling B implemented. A scenario-card persona may carry optional allowedRollups (FieldRef list in bare card names; the persona schema refuses one its own hidden names). rollupSourceCharges skips a security-rollup-source-unreadable finding only when it is acknowledged (the rule's info arm, rollupSourceUnreadableReason) AND its roll-up is in that persona's allowedRollups, comparing after the card namespace prefix (invoice.amount_paid -> demoorder_invoice.amount_paid); unacknowledged findings on it and all other roll-ups stay charged. order_to_cash: prompt sentence rewritten in zh and en (reps see their invoices' amount paid, balance and status, not payment rows), sales_rep carries allowedRollups [invoice.amount_paid], hidden unchanged. README section and a patch changeset (the package is published and ships the card library) added. Premise measured at 7939732f35: prompt text, hidden and orchestrate.ts:858 as stated; no card-hash pins exist for order_to_cash.",
      "tests": "At d1750933e2, under os-verify-lock: pnpm --filter @objectstack/scenarios build && test && typecheck -> VERDICT command-exit 0; Test Files 42 passed (42), Tests 1336 passed (1336). (A first run without building the package itself had 2 dist-reading files red with 'build @objectstack/scenarios first'; not a defect.) New pin: describe 'rollupSourceCharges — a roll-up the card allows a persona is not charged once acknowledged' in test/runner/orchestrate.test.ts, 5 cases (card carries the key; ack allowed not charged + ack other charged; key removed -> both charged; unacknowledged allowed -> charged; schema refuses allowed-but-hidden). Ablation once, after commit, via scripts/ablation-replace.mjs --delete on the reader line: anchor 1 -> 0, blob 9f7c6d1acc4f -> 38300e4a41a0, run 'Tests 1 failed | 4 passed' (the allowed case red, demoorder_invoice.amount_paid charged); restore blob == HEAD 9f7c6d1acc4f, git diff HEAD empty. Test imports src directly, no dist in the path.",
      "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands (repo objectstack-ai/objectstack at d1750933e2) derived 69; all run with exit captured before pipes: 68 exit 0, pnpm check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET: needs full pnpm build; NOT MEASURED, left to CI). --ran reconciliation: '69 derived famil(ies) accounted for — 68 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)', exit 0. scripts/pm/overlap-check.mjs --branch=HEAD: VERDICT clean exit 0 (before the last push). test:repo not run locally (diff touches no repo-project test), declared to CI. CI on PR head d1750933e2 at report time: Check Changeset, Lint ·*, Type Check ·*, Governed Surface Queue Guard, PR-body guards all in_progress; skipped: 18.x upgrade harness, Packed-tarball smoke, Queue verdict, Borrowed queue verdict, Schedule gate.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 relay write (fleet-write pr_create: POST pulls + POST issues/37271/assignees, run 45592815701, read-back 4563/4563 bytes identical) + 1 post-stamped comment on #37257 (this report); git push x4 to the branch (not REST)",
      "open_questions": [
        { "question": "allowedRollups is not cross-checked by the loader (object in expect.objects, seed carries the field) and namespacedScenario passes it through bare; both files were outside the claim's surface. Extend?", "options": ["A leave as is: a misspelt entry fails closed (stays charged); the reader prefixes idempotently", "B a follow-up adds the loader refusal next to hidden's and the prefix in namespacedScenario, dropping the reader's local prefix"], "recommendation": "B as a small follow-up, because the loader is where hidden is validated and namespace.ts claims to prefix every item a card names; A is safe meanwhile" }
      ],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: none · noted, not filed: the build prompt's persona line (runner/prompts.ts) lists only what a persona must not read, not its allowed roll-ups; the intent reaches the builder through the card prompt sentence (PR Acceptance notes)"]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:devxpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions