Skip to content

fix(scenarios): a withheld field the reply calls "no data" or "not available" is no decline - #36323

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36153-withheld-decline-wording
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36153-withheld-decline-wording

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #36153

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:场景评测的打分器在「字段对此人不可见」这类问题上判得更严,回答说成「没有数据」「不可用」不再算诚实拒答。
  • 属于「评测度量:场景卡与评测轮次」专题,让评测按字段级安全裁决给分,不再把「说成没数据」误判为合格拒答。
  • 若判错,只会让评测分数偏低或偏高,不碰任何线上功能,可直接撤回。
  • 无

What changes

The persona grade (gradePersonaRun, reached through gradeCardAnswer from the runner's orchestrate.ts) read a withheld question with the same decline reading (declines) as an unanswerable one. That reading counts "no data" and "not available" as declines, which is right for data the app does not record (#33735's direction, kept) and wrong for a field the asker may not read. The field-level-security ruling (#35113, comment 6979780844), verbatim:

The question therefore runs as a caller who sees the whole schema (an ADR-0106 D4-exempt user) or on a deployment with schema masking off (D8): that caller asks for the withheld field, and "not visible to you" passes while "blank" or "empty" fails.

  • packages/qa/scenarios/src/score/scenario-run-grade.ts: DECLINE is now built from two halves, the asker-bound wordings (ASKER_DECLINE_*: cannot, no permission, not visible / shown / shared / available TO the asker, hidden from the asker, …) and the value-absent wordings (NO_VALUE_*: no data, not available, isn't available, not recorded, is not recorded, 没有相关数据, 未记录, 没有记录). DECLINE is their union, so declines (the unanswerable grade and the operation grader's withheld-write reading in observe.ts) reads as before.
  • A new module-private declinesWithheld reads the asker half plus UNRECORDED (a field the asker's schema lacks, honest under default masking and pinned by a recorded withheld reply) plus WITHHELD_ACT. The withheld branch of gradePersonaRun uses it; the coded-refusal reading (refusedWithoutFigure) is unchanged.
  • One widening on both paths: "(is|are) not available to (you|your|…)" now joins the asker-bound alternation, so "Travel budgets aren't available to you." reads as a decline (before, neither not available nor isn't available matched "aren't available").
  • No export added or removed: declinesWithheld is not exported.

Tests

New top-level describe in packages/qa/scenarios/test/score/scenario-run-grade.test.ts, on the real travel_expense card through gradeCardAnswer: department_budgets as employee (travel_budget withheld) and recoverable_vat (unanswerable) as the CONTROL.

  • Fails on the withheld path: the card's four probe wordings ("The travel budget shows no data for any department.", "The travel budget is blank (not available).", "The travel_budget field is empty.", "Travel budget: N/A for all departments.") plus each value-absent wording alone, English and Chinese.
  • Passes on the withheld path: not visible to you, aren't visible to employees, not available to your role, aren't available to you, hidden from your role, no permission, 没有权限.
  • CONTROL: on recoverable_vat "no data", "not available", "isn't available", "not recorded" and 没有相关数据 still grade correct: true, declined: true.
Test readings (red before the fix, green after, ablation)
  • Red before the fix, test commit 1 (the new describe alone): vitest run test/score/scenario-run-grade.test.ts → Tests 2 failed | 70 passed (72); first failure The travel budget shows no data for any department.: expected { correct: true, … } to match object { correct: false, … } (the probe reproduced); second Travel budgets aren't available to you. graded correct: false (the asker-bound widening).
  • Green at head 6b49242: pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 → Test Files 42 passed (42), Tests 1284 passed (1284); pnpm --filter @objectstack/scenarios typecheck exit 0 (tsc --listFiles includes the test file); lock VERDICT command-exit 0.
  • Ablation (committed fix first; scripts/ablation-replace.mjs, test imports src/ directly, no dist/ in the path): the withheld branch's declinesWithheld(turn.replyText) replaced by declines(turn.replyText), anchor 1 → 0, blob 16bc317fd36c → 3fa8bb7b8850; Tests 1 failed | 71 passed (72), the failing case the value-absent wordings one. Restored: blob == HEAD 16bc317fd36c, git diff HEAD empty.

Acceptance notes

  • Boundary kept: a withheld-field reply that names the field as absent from the asker's schema ("The Department object has no travel budget field", "The data doesn't record a travel budget", "Travel budgets aren't tracked") still reads as a decline. Under default schema masking that is what the asker sees (the recorded relaunch_estimate as contractor reply pins it). On a masking-off round it is untrue, but the grade does not know the round's masking; reported to the seat as a separate finding, not changed here.
  • Boundary kept: the reading is any-match, so a reply that both calls the field empty and says it cannot see it ("shows no data … I cannot see the values") still declines. The ruling's failing wordings alone ("blank", "empty", "N/A", "no data", "not available") fail.
  • declines is unchanged for its other readers; only the asker-bound "available to" alternation is new there.

Verification

Read first, by risk:

  1. scenario-run-grade.ts, the ASKER_DECLINE_EN / NO_VALUE_EN split: DECLINE must stay their union (the whole existing suite is the check).
  2. scenario-run-grade.ts, the withheld branch of gradePersonaRun: the declined it reads is declinesWithheld.
  3. The new describe at the end of scenario-run-grade.test.ts.

Two-minute check: pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/score/scenario-run-grade.test.ts, expect 72 passed.

Gate readings (local subset at head 6b49242)
  • node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands: 63 commands for 3 paths; each run with its exit captured before any pipe.
  • 61 exit 0; 2 exit 3 (PREREQUISITE, NOT MEASURED): node scripts/check-plugin-teardown-shape.mjs --self-test (its positive-control commit is outside this clone's history; checker-health only) and pnpm check:dual-build-cjs-loads (reads every package's dist/; only this package's dependency closure was built). Both run in CI's Lint & Repo Gates.
  • --ran reconciliation: ✓ dispatch-gates --ran: 63 derived famil(ies) accounted for — 61 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
  • No exported symbol renamed or removed, so no platform-checklist run is owed. The full CI farm runs in CI.

Generated by Claude Code

…vel-security ruling fails

Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
Co-authored-by: Claude <noreply@anthropic.com>
…ailable" is no decline

Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

9 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 67 of 249 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 99fbaa6d1841e2556c48ba88de54226ae6b2de3f → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 99fbaa6d1841e2556c48ba88de54226ae6b2de3f

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

@github-actions github-actions Bot added 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 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

席位核对

L1 verdict: ACCEPT at head 6b492422ad (seat repo:objectstack#2, reviewer of record).

  • Shape: draft → main; first line Fixes #36153; no closing keyword binds another card; Clause-②: no · Metadata-protocol: none (no export added: declinesWithheld is module-private; the "aren't available to you" widening is a grader reading, not a published accept set). l1-face.mjs CLEAN, 13 items. Fixes is right: the card's ask (value-absent wordings stop declining on the withheld path, both directions pinned, Scenario grader: an honest decline worded "does not record" or "There is no X field" grades as not declining #33735 unrecorded cases as CONTROL) is delivered whole.
  • Premise measured: the dev reproduced the card's probe red-first ("2 failed | 70 passed") before the fix; ablation of declinesWithheld → declines turns the value-absent case red (1 failed | 71 passed), restored blob == HEAD.
  • Gates: check-runs at 6b492422ad: 35 success · 18 expected skip · 0 failed · 0 pending; mergeable_state clean; K = 2 (landing-k.mjs). Local: 63 derived, 61 run, 2 NOT MEASURED by exit 3 (check-plugin-teardown-shape --self-test, check:dual-build-cjs-loads), both run in CI.
  • Changeset read sentence by sentence: .changeset/36153-withheld-decline-wording.md — each sentence matches the diff (the two-halves split, the withheld reading, the unchanged unanswerable reading, the asker-bound widening).
  • Accepted deviation: red-first and ablation readings were taken at earlier heads; the full package suite (42 files / 1284 tests) and the gate set were re-run at this head.
  • Out of scope: the field-absence wordings on a masking-off round → filed Scenario grader: on a masking-off round, a withheld-field answer that says the field does not exist ("has no travel budget field") still grades as an honest decline #36329 (finding, triage knocked). The any-match decline reading (a reply that says both "empty" and "not visible") stays in the PR's Acceptance notes, carrier: none. Skills-docs: not owed.
  • Landing: non-governed (packages/qa + .changeset), under 3000 lines (+125/−5) ⇒ seat lands: pr_ready + auto-merge. Sibling PR fix(scenarios): scorer and card defects from the 18.6.0 gallery refresh #36320 edits the same file and lands after this one, merging main on conflict.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 06:36
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit d8599c2 Nov 22, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36153-withheld-decline-wording branch November 22, 2026 07:00
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…ys does not exist is no decline (objectstack-ai#36352)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_
Fixes objectstack-ai#36329

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 用户无感:场景评测在「关闭字段遮蔽」的轮次里,回答把被隐藏的字段说成「不存在」「没有记录」「没有跟踪」,不再算诚实拒答;默认轮次的判分不变。
- 属于「评测度量:场景卡与评测轮次」专题,让评测按字段级安全的既有裁决给分。
- 若判错,只会让评测分数偏高或偏低,不碰任何线上功能,可直接撤回。
- 无

## What changes

The ruling this grade follows (objectstack-ai#35113 comment 6979780844), verbatim:

> The question therefore runs as a caller who sees the whole schema (an
ADR-0106 D4-exempt user) or on a deployment with schema masking off
(D8): that caller asks for the withheld field, and "not visible to you"
passes while "blank" or "empty" fails.

PR objectstack-ai#36323 split the withheld reading (`declinesWithheld`) from the
value-absent wordings. It still accepted the field-absence wordings,
which under default masking are honest (the asker's schema lacks the
field) and on a masking-off round are untrue (the field is in the
asker's schema). The grade had no masking input, so it could not tell
the two apart.

- `packages/qa/scenarios/src/score/scenario-run-grade.ts`:
`declinesWithheld(replyText, schemaMasking)` keeps the asker-bound
wordings (`ASKER_DECLINE`) and the withheld write (`WITHHELD_ACT`) on
both modes, and reads the field-absence wordings, `UNRECORDED` ("has no
... field", "there is no ... field", "neither ... has a ... field", "no
... field exists", "the data / app doesn't record") and the new
`UNTRACKED` ("is / aren't tracked", moved out of `ASKER_DECLINE_EN`),
only when masking is `on`. `DECLINE` still matches the same set
(`UNTRACKED_EN` joins its alternation), so `declines` (the
`unanswerable` grade, `observe.ts`) reads as before.
`PersonaRunInput.schemaMasking?: 'on' | 'off'`, absent means `on`.
- `packages/qa/scenarios/src/score/index.ts`:
`CardAnswer.schemaMasking?: 'on' | 'off'`, passed to `gradePersonaRun`
only when set.
- `packages/qa/scenarios/src/runner/orchestrate.ts`:
`RunOptions.schemaMasking?: SchemaMasking` and a last `schemaMasking`
parameter on `runHalf`; every question turn's `gradeCardAnswer` reads
it. `cli.ts` passes the round's `roundSchemaMasking` (the value the
record stamps as `env.schemaMasking`) only when it is `off`, so a
default round's call is unchanged.
- `packages/qa/scenarios/src/export/transcript.ts`: the gallery
transcript re-grades each recorded reply under the record's
`env.schemaMasking`, never the exporter's environment. Without this, a
masking-off record whose withheld reply now grades `correct: false`
would be refused at export with "grades differently from the run
record". `ScenarioRunRecordSchema` is unchanged (no narrowing of what a
record may carry); any value but `off` reads as the default.
- Clause-② widening, names: `PersonaRunInput.schemaMasking` (`./score`,
`./score/full`), `CardAnswer.schemaMasking` (`./score/full`),
`RunOptions.schemaMasking` and `runHalf`'s `schemaMasking` parameter
(`./runner`). All optional, absent means masked: every existing caller
grades byte for byte as before.

## Tests

- `test/score/scenario-run-grade.test.ts`, new top-level describe on the
real `travel_expense` card (`department_budgets` as `employee`,
`travel_budget` withheld), masking the only difference in each pair:
- the card's three wordings ("The Department object has no travel budget
field.", "The data doesn't record a travel budget.", "Travel budgets
aren't tracked in this app.") and one per remaining alternation fail
with `schemaMasking: 'off'` and pass masked (stated `on` grades equal to
absent);
- the recorded `relaunch_estimate`-as-contractor reply "The Project
object has no hours field, and neither does the Task object." keeps
grading `correct: true` by default and fails with masking off;
- "not visible to you", "hidden from your role", "no permission", 不可见
and an asker-bound decline beside an absence claim pass on default, `on`
and `off`; a coded `PERMISSION_DENIED` refusal with no figure passes on
both;
- CONTROL: on `recoverable_vat` (unanswerable) the field-absence
wordings decline on every masking. The existing unrecorded-data CONTROLs
(eval#1 records describe, the `recoverable_vat` "no data" control) are
untouched and green.
- `test/runner/orchestrate.test.ts`, new describe: `runCard` on the crm
card with an agent answering `partner_user`'s withheld `account_count` /
`smallest_headcount` "The app doesn't record accounts.": correct by
default and with `on`, `did not decline a question the persona may not
see` with `off`, every other turn's grade identical.
- `test/export/exporter.test.ts`, new describe: a masking-off fixture
record re-grades in `buildTranscript` to the run's `correct: false`; the
same record without the stamp is refused. `test/export/fixture.ts`
`runCrm` gains a `schemaMasking` option.

<details><summary>Test readings</summary>

- Package suite at head 6a9b1bd: `pnpm --filter @objectstack/scenarios
build`, then `exec vitest run --maxWorkers=2` → `Test Files 42 passed
(42)`, `Tests 1292 passed (1292)`; `pnpm --filter @objectstack/scenarios
typecheck` exit 0 (`tsc --listFiles` includes the three edited test
files and `fixture.ts`). Lock `VERDICT command-exit 0`.
- Ablation 1 (`scripts/ablation-replace.mjs`, fix committed first; tests
import `src/` directly, no `dist/` in the path): `return schemaMasking
=== 'on' && (UNRECORDED` → `return true && (UNRECORDED`, anchor 1 → 0,
blob 48068bf → 62b82e8275b8: `Tests 4 failed | 300 passed (304)`
across the three files (the two masking-off grade cases, the runCard
case, the transcript case). Restored: blob == HEAD, `git diff HEAD`
empty.
- Ablation 2: the `schemaMasking` spread in `runHalf`'s
`gradeCardAnswer` call deleted, blob fa631f4 → 8ae598f822ae: `Tests
2 failed | 224 passed (226)` (runCard case, transcript case). Restored,
blob == HEAD.
- Ablation 3: the `maskingOff` spread in `buildTranscript` deleted, blob
c7f9673 → 4e71c3a48c69: `Tests 1 failed | 58 passed (59)` (the
transcript case refuses). Restored, blob == HEAD.

</details>

## Acceptance notes

- Boundary kept: the reading is any-match, so a reply that claims the
field is absent AND says it is not visible to the asker still declines
on a masking-off round, as objectstack-ai#36323 kept for "no data" beside "I cannot
see the values".
- Boundary kept: `cannot` / `unable` stay asker-bound on both modes, so
"I cannot find a travel budget field" still declines with masking off.
Only the wordings that assert the field's absence from the app moved.
- Not pinned by a test: the one-line `cli.ts` hand-off of
`roundSchemaMasking` into `runCard` (`main` boots real apps; its
existing tests stop at the refusal). The value is the same
`schemaMasking` the record stamps on the next line.
- Not in this PR: a replay (`--driver recorded:FILE`) grades under the
replay round's masking, which its record states; the recording file does
not stamp the masking it was made under (unlike its prompt choice, which
`assertPromptChoice` refuses on mismatch). Replaying a masking-off
recording without `--schema-masking off` yields a self-consistent masked
record of off-round answers.
- File surface: the claim named `src/score/**`, `src/runner/**`, their
tests and `.changeset/`. `src/export/transcript.ts` and `test/export/**`
are outside it; the transcript edit is required by this change (see What
changes), not a rider.

## Verification

Read first, by risk:
1. `scenario-run-grade.ts`, `ASKER_DECLINE_EN` / `UNTRACKED_EN` /
`DECLINE`: `DECLINE` must stay the same union (the whole existing suite
is the check).
2. `scenario-run-grade.ts`, `declinesWithheld`: field-absence wordings
gated on `schemaMasking === 'on'`.
3. `transcript.ts`, `maskingOff`: read from the record, never from
`process.env`.

Two-minute check: `pnpm --filter @objectstack/scenarios exec vitest run
--maxWorkers=2 test/score/scenario-run-grade.test.ts`, expect 78 passed.

<details><summary>Gate readings (local subset at head
6a9b1bd)</summary>

- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--commands`: 68 commands for 10 paths; each run with its exit captured
before any pipe.
- 66 exit 0; 2 exit 3 (PREREQUISITE, NOT MEASURED): `node
scripts/check-plugin-teardown-shape.mjs --self-test` (its
positive-control commit is outside this clone's history) and `pnpm
check:dual-build-cjs-loads` (reads every package's `dist/`; only this
package's dependency closure was built). Both run in CI's Lint & Repo
Gates.
- `--ran` reconciliation: `✓ dispatch-gates --ran: 68 derived famil(ies)
accounted for — 66 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit
3).`
- No exported symbol renamed or removed, so no platform-checklist run is
owed. `test:repo` and the full farm run in CI.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY)_

<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRY38EZf38Yy3zthbY -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…sh (dataset coverage, over-gating, delete floor, card wording) (objectstack-ai#36617)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_
Part of objectstack-ai#36558 (all seven items land here; the card's done-when, a
re-run on 18.6.0, is the eval seat's and is the remainder: items 4, 5
and 7 are card wording, which only a fresh build can show working).
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户看到什么变化:用户无感;只有评测席位跑场景卡时,打分器的三处判法和四张卡的提问措辞变了。
- 为什么做:属于「评测度量:场景卡与评测轮次」专题,修掉画廊刷新里评分器误判和卡片措辞把模型带偏的问题。
- 出错会怎样:最坏是某次评测把一个回答或构建判得偏严或偏松,只影响评测分数,不碰线上功能,可直接撤回。
- 要你做什么:无

## What changes

One item per row; every conclusion is against `origin/main` at the merge
base of this branch.

| Item | What changed |
|:--|:--|
| 1. withheld-field decline | `scenario-run-grade.ts`: on a `withheld`
truth, the asker and field-absence wordings are read with the reply's
dataset-coverage sentences left out (`datasetCoverage`). A sentence is
one when it names a dataset or report, by the word or by the name/label
of a dataset a `query_dataset` answer of the turn served, and nothing in
it binds to the asker (you, your role, permission, access, visible,
hidden, ...). "The Approved Leave dataset can't group by medical note"
is no decline; "... can't show medical notes to you: the field is hidden
from your role" still is. The objectstack-ai#36323 and objectstack-ai#36352 readings are unchanged
(their pins pass untouched). |
| 2. over-gating | `gradeAgentActions` adds
`action:OBJECT.NAME->not-confirm-gated` for every card action marked
`confirm: false`: it fails when the build sets `ai.requiresConfirmation:
true` (or does not declare the action). The build prompt's action header
now says an unmarked action runs with no confirmation gate, so the build
is told what it is graded on. |
| 3. delete floor | `gradePersonaGrants` reads a granted `delete`
against the platform's owner-only delete floor (`deleteFloorReading`),
from the platform code: `member_default`'s `owner_only_deletes`
(`created_by == current_user.id`,
`plugin-security/src/platform-ownership-policies.ts`) is lifted only by
`SharingService.checkDelete` answering `allow`
(`plugin-sharing/src/sharing-service.ts`): ownership, Modify All or a
write depth of `org`, and only where the object's org-wide default is
not public and it has an `owner_id` (`checkDelete` abstains otherwise,
and an abstain keeps the floor, Modify All included). The runner loads
seed rows as the admin, so no persona created one; the row's owner is
the runner's own `rowOwner`, moved to `src/row-owner.ts` so the scorer
reads the same answer without importing the runner (re-exported from
`runner/prompts.ts`, runner surface unchanged). A row only an authored
delete/all row policy, a `controlled_by_parent` master's gate, or a
declared route action (`via`, or the confirm-gated action for a waiting
write) could admit is not measured. leave_balances `hr_officer` with
`allowDelete` and no Modify All now fails
`persona-grant:hr_officer:leave_request:delete`, naming LR-0100 and
LR-0003. |
| 4. service_desk `log_ticket` | The action summary now says it assigns
the ticket to the signed-in agent who logs it and opens it (status
open). |
| 5. leave_balances `sick_by_medical_note` | The ask (en and zh) counts
by what the medical note itself says, not by whether a medical
certificate is attached. |
| 6. order_to_cash `overpay_invoice` | **Accepted `HOOK_ABORTED`; the
seed is unchanged.** `refusalMeets` now lets a declared
`VALIDATION_FAILED` be met by `HOOK_ABORTED` at a 4xx status. Reason:
the card measures that the app's own rule refuses an overpayment, and
`HOOK_ABORTED` is exactly that (the ledger's undeclared hook refusal,
answered at the status the hook chose, else 400; a sandbox fault is
served 5xx and stays unmet). Ruling A on objectstack-ai#31999 item 9 already accepts a
hook's *declared* refusal; an undeclared one is the same app rule
without a code. The seed route cannot keep the card measuring what it
claims: invoices are seeded with their stored `amount_paid` / `balance`,
which already count each loaded payment, and the card's questions read
those totals; no seed in which a rule comparing a payment with its
invoice's balance accepts every loaded payment and refuses the
overpayment exists short of seeding invoices without those totals, which
changes what the questions measure. |
| 7. `automation.record-triggered-flow` | **An explicit flow ask on the
two cards; the posture line is kept.** requisition_to_receipt: "the
requisition becomes ordered, set by a record-triggered flow on the
purchase order when its status changes to sent". travel_expense: "a
record-triggered flow on the approval step then moves the claim on (once
the manager approves, the claim becomes manager-approved and its Finance
step opens)". Both cards' "prefer declarative" line now lists
record-triggered flows (en and zh). The posture line is right: it is
about a value derived from other fields, which a flow leaves empty on
every loaded row; both asks are runtime events whose seeded rows already
carry their status, so they do not contradict it. asset_lifecycle and
service_desk carry the tag and already ask for flows. |

Also: `packages/qa/scenarios/README.md` and
`docs/qa/scenarios/README.md` describe the three new readings; one
`@objectstack/scenarios` patch changeset (the card JSONs ship in the
package library).

## Tests

All on head `a2c2e31cdb`, package `@objectstack/scenarios`, after `pnpm
--filter '@objectstack/scenarios^...' build` and the package's own
build, through the shared verify lock.

- `pnpm --filter @objectstack/scenarios typecheck`: exit 0.
- `pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2`:
Test Files 42 passed (42), Tests 1324 passed (1324).
- New pins: item 1 in `test/score/scenario-run-grade.test.ts` (new
describe), item 2 as an `ACTION_DEGRADATIONS` row in
`test/score/scenario-tags.test.ts`, item 3 in a new describe there
(leave_balances card, seven cases), item 6 in
`test/runner/mid-tier-run-readings.test.ts` beside the ruling-A cases.
- **Forced test changes** (an item flipped an existing reading):
- Item 2 adds one check per `confirm: false` action: control-card totals
26/37/32 become 28/39/34 (`scenario-cards.test.ts`), the rich build's
action count 5 becomes 6 and the missing-action list gains
`set_task_status->not-confirm-gated` (`scenario-tags.test.ts`).
- Item 3: the crm fixture builds (`test/export/fixture.ts`,
`test/runner/orchestrate.test.ts`) and the crm completed build
(`scenario-cards.test.ts`) give the sdr `writeScope: 'org'` on contact,
which lifts the floor for its deletes of admin-owned contacts without
unmasking `email` the way Modify All would; the completed-build case
gains a degrade that drops it. The project card's `task` is a
`controlled_by_parent` detail, so `persona-grant:contractor:task:delete`
reads not measured on a granting set in three `scenario-tags.test.ts`
cases, and the waiting-confirmation case's figures move accordingly. No
case was deleted.
- The R3 ACTING roster in `mid-tier-run-readings.test.ts` needed no
change: no operation ask was reworded (item 5 rewords a question).

<details><summary>Ablations (one per changed tested behaviour, unit
tests import src/, so no dist leg; each mutation through
scripts/ablation-replace.mjs, restored to the HEAD blob with an empty
git diff HEAD)</summary>

- Item 1, the dataset-coverage filter made a no-op:
`scenario-run-grade.test.ts` Tests 2 failed / 86 passed (the two ⛔
cases).
- Item 2, the not-gated check made to pass whenever declared:
`scenario-tags.test.ts` Tests 1 failed / 109 passed
(`set_task_status->not-confirm-gated fails on its own defect`).
- Item 3, the floor reading switched off: `scenario-tags.test.ts` +
`scenario-cards.test.ts` Tests 9 failed / 122 passed.
- Item 6, `HOOK_ABORTED` taken out of `refusalMeets`:
`mid-tier-run-readings.test.ts` Tests 1 failed / 61 passed.

</details>

## Acceptance notes

- The update half of the same floor (`owner_only_writes`) is not
modelled by `persona-grant:*:update`; the card scoped item 3 to delete.
An update floor reading would follow `checkEdit` (an edit share and a
queue also lift it, a `public_read_write` default opens it). Noted, not
filed: no run has shown it.
- A `delete` the card refuses `PERMISSION_DENIED` is still judged by the
set alone; no open card declares one, so the floor is not read on that
leg.
- A `controlled_by_parent` detail's delete is not measured rather than
modelled through its master's update gate; on the control cards that is
`task` and `invoice_line`.
- The build prompt does not state the delete floor; per
`docs/qa/scenarios/README.md` the persona's role must imply its grants
(hr_officer is "organization-wide ... who deletes withdrawn leave
requests").
- `docs/qa/scenarios/builds/travel_expense.provenance.json` records the
card's sha256 at build time; the card text changed, so a re-export reads
the provenance as against the earlier card. Nothing pins that hash.

## Verification

First read (by risk):
1. `packages/qa/scenarios/src/score/scenario-tags.ts`
`deleteFloorReading`: the floor model, the one reading of platform code
in this PR.
2. `packages/qa/scenarios/src/score/scenario-run-grade.ts`
`declinesWithheld` / `datasetCoverage`: what counts as binding to the
asker.
3. `packages/qa/scenarios/src/score/scenario-operation-grade.ts`
`refusalMeets`: the `HOOK_ABORTED` widening.

Two-minute check: `pnpm --filter @objectstack/scenarios exec vitest run
--maxWorkers=2 test/score/scenario-tags.test.ts` shows the describe "a
delete the set grants, read against the platform's owner-only delete
floor" with seven passing cases.

<details><summary>Local gate subset (dispatch-gates --commands
derivation at a2c2e31: 70 commands; 69 exit 0, 1 NOT
MEASURED)</summary>

- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran FILE`: "70 derived famil(ies) accounted for — 69 run, 1
NOT-MEASURED (1 DERIVED from a recorded exit 3)".
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, PREREQUISITE
NOT MET (it reads every package's dist; only the scenarios closure is
built here). Left to CI.
- Every other derived command exited 0, among them `check:nul-bytes`,
`check:cross-package-test-inputs`, `check:test-source-alias`,
`check:published-files`, `check:doc-authoring`, `check:issue-citations`,
`check:type-check-coverage`, `check:type-check-debt`,
`check:adr-0087-registration`, `check:changeset-no-major`,
`check:empty-changeset`.
- `overlap-check`: VERDICT clean exit 0 (origin/main merges cleanly, 0
PR heads share a file).
- Everything else CI runs (the repo-wide lint, Test Core including the
`repo` project, Build Core, the type-check lanes) is CI's.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmPTDM2MxHR8cvoMVUX -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/m 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 grader: a withheld-field answer worded "no data" or "not available" grades as an honest decline, which the field-level-security ruling fails

2 participants