Repository navigation
Commit d8599c2
fix(scenarios): a withheld field the reply calls "no data" or "not available" is no decline (#36323)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_
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`.
<details><summary>Test readings (red before the fix, green after,
ablation)</summary>
- 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 16bc317 →
3fa8bb7b8850; `Tests 1 failed | 71 passed (72)`, the failing case the
value-absent wordings one. Restored: blob == HEAD 16bc317, `git
diff HEAD` empty.
</details>
## 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.
<details><summary>Gate readings (local subset at head
6b49242)</summary>
- `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.
</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>1 parent e4f5e56 commit d8599c2
3 files changed
Lines changed: 125 additions & 5 deletions
File tree
- .changeset
- packages/qa/scenarios
- src/score
- test/score
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
672 | 691 | | |
673 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
674 | 696 | | |
675 | 697 | | |
676 | 698 | | |
| |||
776 | 798 | | |
777 | 799 | | |
778 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
779 | 815 | | |
780 | 816 | | |
781 | 817 | | |
| |||
817 | 853 | | |
818 | 854 | | |
819 | 855 | | |
820 | | - | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
821 | 860 | | |
822 | 861 | | |
823 | 862 | | |
| |||
903 | 942 | | |
904 | 943 | | |
905 | 944 | | |
906 | | - | |
907 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
908 | 949 | | |
909 | 950 | | |
910 | 951 | | |
| |||
940 | 981 | | |
941 | 982 | | |
942 | 983 | | |
943 | | - | |
944 | 984 | | |
945 | 985 | | |
946 | 986 | | |
| 987 | + | |
947 | 988 | | |
948 | 989 | | |
949 | 990 | | |
| |||
964 | 1005 | | |
965 | 1006 | | |
966 | 1007 | | |
| 1008 | + | |
967 | 1009 | | |
968 | 1010 | | |
969 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
0 commit comments