You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aaa11a2
Browse filesBrowse the repository at this point in the historyBrowse files
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4n2wzAmmp4Z6W5jsqtM2qx)_Fixes#35705
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户无感:内部技能评测工具新增「只跑触发用例」模式,六个元数据技能包的一轮从约 354 次对话降到 42 次。
- 为什么做:给「技能描述改动是否让技能在该加载时加载」的测量省下约九成订阅轮次,前后两轮从约 700 次降到约 84 次。
- 出错会怎样:只影响维护者跑评测时选哪些用例、怎么汇总,不改任何对外发布的技能内容,可直接撤回。
- 要你做什么:无。
## What changes
`pnpm --filter @objectstack/scenarios skill-evals --triggers-only`
selects only the `should_trigger` cases of the selected bundles, on the
with-skill arm. It reuses the existing selection (`selectBundles`, one
path with a `triggersOnly` argument), plan (`planRound`, which already
runs a trigger case on the with-skill arm only) and summary
(`summariseRound` / `renderSummaryMarkdown`); no second path.
- **Selection** (`cases.ts`): the pool narrows to trigger cases before
the existing `--skills` checks, so a bundle named in `--skills` with no
trigger case is refused by name, and a whole-catalog selection with no
trigger case at all is refused.
- **Flags** (`cli.ts`): refused beside `--regrade` (a regrade re-draws a
round at the scope it ran) and beside `--self-test` (it runs its own
fixtures). Works with `--dry-run`, which prints the reduced plan plus
how many behaviour cases of those bundles were left out, and with
`--skills-from VERSION`.
- **Record and summary**: `round.json` records `scope.arms:
["with-skill"]` and `scope.triggersOnly: true`; `--regrade` reads that
and keeps the scope, so the behaviour cases are not listed as `added`.
The summary title says `trigger cases × the with-skill arm`, and a
trigger-only round renders the trigger section alone (no empty
per-bundle and per-case tables); the stdout excerpt follows.
- **Self-test**: two rows (floor 30 to 32): trigger cases kept on the
with-skill arm and behaviour cases dropped; and the refusals (beside
`--regrade`, beside `--self-test`, on a bundle with no trigger case),
with the flag accepted beside `--skills-from` and `--dry-run`.
- **README**: the `skill-evals` section gains the command line and a
`--triggers-only` bullet. Changeset: `@objectstack/scenarios` patch (the
package publishes, and its `README.md` is in `files[]`).
Net-added lines, whole PR: +143 / -38 = 105 (budget 150).
## Tests
- `packages/qa/scenarios/test/skill-evals/skill-evals.test.ts`: one new
case runs a trigger-only round through `executeRound` with a stub turn,
asserts both turns are with-skill, that the summary renders the trigger
section only, and that `regradeRound` on a `triggersOnly` round adds no
behaviour case and keeps the title.
- Self-test rows above.
## Acceptance notes
- `--skills-from 18.5.0 --triggers-only` is refused: that published
version predates trigger cases, so the selection is empty (`no bundle
under ... has a trigger case`). `--skills-from 18.6.0` plans the same 42
turns (138 behaviour cases left out there), which is the "before" leg
the card asks for.
- Without `--skills`, `--triggers-only` keeps every bundle that has a
trigger case and leaves out those without one; the refusal fires only
when none has one. The round title then reads `all bundles`.
- A `round.json` written before this change has no `scope.triggersOnly`
and regrades exactly as before.
- The test file
`packages/qa/scenarios/test/skill-evals/skill-evals.test.ts` is outside
the claim's declared file surface (`src/skill-evals/*` and the README);
it is the package's existing suite for this runner.
## Verification
Read first, by risk:
1. `packages/qa/scenarios/src/skill-evals/cli.ts`: the two refusals in
`parseSkillEvalArgs`, the `scope.triggersOnly` record, and the regrade
filter in `regradeRound`.
2. `packages/qa/scenarios/src/skill-evals/cases.ts`: `selectBundles`.
3. `packages/qa/scenarios/src/skill-evals/summary.ts`: the branch that
drops the behaviour tables.
Two-minute check: `pnpm --filter @objectstack/scenarios skill-evals
--skills
objectstack-data,objectstack-ui,objectstack-automation,objectstack-formula,objectstack-i18n,objectstack-query
--triggers-only --dry-run` prints the plan line below and makes no model
call.
All local readings at head `2ea2c4fe71` (feature commit `0a97625509`
plus a merge of `origin/main` at `cceb5c626d`).
<details><summary>Dry-run plan (the card's Done-when)</summary>
```text
42 trigger case(s) × the with-skill arm, × 1 = 42 turn(s), 2 at once
--triggers-only: 156 behaviour case(s) of these bundles left out
trigger cases: 30 should load the bundle, 12 should not
```
Without the flag the same bundles plan `156 behaviour case(s) × 2 arms +
42 trigger case(s) × the with-skill arm, × 1 = 354 turn(s)`.
</details>
<details><summary>Self-test</summary>
```text
✓ select: --triggers-only keeps the trigger cases on the with-skill arm and drops the behaviour cases
✓ flags: --triggers-only beside --regrade or --self-test, or on a bundle with no trigger case → REFUSED
✓ skill-evals self-test: 32 rows pass.
```
Refusal messages as the CLI prints them:
```text
--triggers-only cannot narrow --self-test: the self-test runs its own fixtures, never a selection of cases
--triggers-only cannot narrow --regrade: a regrade re-draws the recorded round at the scope it ran, so a --triggers-only round regrades as one without the flag
```
</details>
<details><summary>Package checks</summary>
```text
pnpm --filter @objectstack/scenarios run typecheck -> exit 0 (tsconfig includes test/**, so the new test is type-checked)
pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 -> Test Files 40 passed (40), Tests 1202 passed (1202)
eslint --no-inline-config on the 5 changed .ts files -> exit 0, no findings
node scripts/pm/dispatch-gates.mjs --commands -> 62 commands, each run, each exit 0
node scripts/pm/dispatch-gates.mjs --ran -> 62 derived famil(ies) accounted for, 62 run, 0 NOT-MEASURED (a DERIVED zero)
node scripts/pm/overlap-check.mjs --branch=claude/area-a4A-35705 -> origin/main merges cleanly, VERDICT clean exit 0
```
One-time ablation (not kept): deleting the `scope.triggersOnly` filter
in `regradeRound` (via `scripts/ablation-replace.mjs`, anchor 1 -> 0 on
disk) turns the new test red with `expected [ [ 'beta-skill/cases#1' ],
+0, 2 ] to deeply equal [ [], +0, 2 ]`; restored, blob equal to HEAD and
`git diff HEAD` empty.
The repo-wide lint run, `test:repo` and the type-check lanes are CI's.
</details>
No model call was made: no real round ran.
https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
skill-evals: `--triggers-only` runs the selected bundles' trigger cases alone
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
`pnpm --filter @objectstack/scenarios skill-evals --triggers-only` selects only the `should_trigger` cases of the selected bundles, on the with-skill arm, so a change to when a skill loads is measured on its trigger cases alone: the six metadata bundles plan 42 turns instead of 354. The summary is the trigger section alone; `round.json` records `scope.triggersOnly`, and `--regrade` keeps that scope. It works with `--dry-run` and `--skills-from VERSION`. It is refused beside `--regrade` or `--self-test`, and a bundle named in `--skills` with no trigger case is refused. The README section "Running the published skills' eval cases" documents it.
pnpm --filter @objectstack/scenarios skill-evals --regrade DIR # re-draw a recorded round's verdicts from its records; no model call
904
905
pnpm --filter @objectstack/scenarios skill-evals --self-test # the runner's own fixtures; no model call
905
906
```
@@ -931,6 +932,11 @@ pnpm --filter @objectstack/scenarios skill-evals --self-test # the runner's o
931
932
cases are all positive, or all negative, is refused. The summary reports trigger cases in their own section beside
932
933
the behaviour cases, never inside their pass rates: per bundle, loaded when it should, left alone when it should
933
934
not, the missed loads and the false loads.
935
+
-**`--triggers-only`**: the selected bundles' trigger cases alone, on the with-skill arm, for a change that only
936
+
touches when a skill loads (its `description`). The summary is the trigger section alone, and `round.json` records
937
+
`scope.triggersOnly`, so `--regrade DIR` keeps that scope. A bundle `--skills` names with no trigger case is refused
938
+
(a published version before trigger cases has none), and so is the flag beside `--regrade` or `--self-test`.
939
+
`--dry-run` prints the reduced plan, and `--skills-from VERSION` runs it on the published bundles.
934
940
-**Case files**: a case's `files` entries are paths under the bundle's `evals/files/` (anything else is refused, and
935
941
so is a path the bundle lacks or one with a `.claude` segment, since `.claude/` is where the runner places the skill). Each is copied, a directory whole, into both arms' directories at its path below
936
942
`evals/files/`, so the arms still differ only in the bundle. A case whose prompt states its context needs none.
if(unknown.length)thrownewError(`--skills names ${unknown.map((n)=>`\`${n}\``).join(', ')}, not a bundle under ${catalog.root} (bundles: ${catalog.bundles.join(', ')})`);
elsethrownewError(`unknown flag \`${flag}\` (see --help)`);
112
116
}
117
+
// Refused, never ignored: neither of these reads a selection the flag could narrow.
118
+
if(a.triggersOnly&&a.regrade!==undefined)thrownewError('--triggers-only cannot narrow --regrade: a regrade re-draws the recorded round at the scope it ran, so a --triggers-only round regrades as one without the flag');
119
+
if(a.triggersOnly&&a.selfTest)thrownewError('--triggers-only cannot narrow --self-test: the self-test runs its own fixtures, never a selection of cases');
* Set by `--regrade`: when, by which runner, and how many verdicts now differ
@@ -200,17 +208,17 @@ export function regradedLines(g: NonNullable<RoundRecord['regraded']>): string[]
200
208
];
201
209
}
202
210
203
-
/** `N behaviour case(s) × 2 arms [+ M trigger case(s) × the with-skill arm], × R`. Pure. */
211
+
/** `N behaviour case(s) × 2 arms [+ M trigger case(s) × the with-skill arm], × R`; the behaviour part only when there is one, or nothing else. Pure. */
if(round.skills.source!==sourceLabel)thrownewError(`--regrade: the round ran on ${round.skills.source}, not ${sourceLabel}; pass the same --skills-from`);
250
258
// The bundles may have left the catalog too; their cases are then set apart as removed.
console.log(`${turnsLine(cases.length-triggers.length,triggers.length,args.repeats)} = ${jobs.length} turn(s), ${args.concurrency} at once`);
330
+
if(args.triggersOnly)console.log(`--triggers-only: ${selectBundles(catalog,args.skills).length-cases.length} behaviour case(s) of these bundles left out`);
321
331
if(triggers.length)console.log(`trigger cases: ${triggers.filter((c)=>c.shouldTrigger).length} should load the bundle, ${triggers.filter((c)=>!c.shouldTrigger).length} should not`);
322
-
console.log(`each turn: a fresh directory holding the case's files; with-skill also holds .claude/skills/BUNDLE/ (no evals/), no-skill no skill`);
332
+
console.log(`each turn: a fresh directory holding the case's files; with-skill also holds .claude/skills/BUNDLE/ (no evals/)${args.triggersOnly ? '' : ', no-skill no skill'}`);
323
333
console.log(`argv (prompt on stdin): ${args.bin}${armArgs('TURN_DIR/mcp.json',turnOpts).join(' ')}`);
324
334
console.log('dry run: no login read, no model called, nothing written');
returnall==='1,2,3'&&jobs==='2:with-skill,3:with-skill' ? true : `without the flag [${all}], expected 1,2,3; with it [${jobs}], expected 2:with-skill,3:with-skill`;
409
+
},
410
+
},
411
+
{
412
+
label: 'flags: --triggers-only beside --regrade or --self-test, or on a bundle with no trigger case → REFUSED',
0 commit comments