Skip to content

Commit 279ac14

Browse files
committed
fix(scenarios): name each persona grant check in the run record's build evidence
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxF3yXjruc2fxomWA5
1 parent 3d9c169 commit 279ac14

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎.changeset/33597-persona-grant-checks.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ Metadata-protocol: none
1414
- A persona whose set the build does not declare fails each of its checks.
1515

1616
Not-measured checks now leave the card score's passed and total.
17+
18+
The run record's build evidence (`./runner`, `runRecord`) lists each persona grant check beside the Build's other checks, so a failing one is named with its detail and a not-measured one with its reason. `personaGrants` also reaches `./runner` through `BuildHalf.score`.

‎packages/qa/scenarios/src/runner/scorecard.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export function runRecord(meta: RunRecordMeta, cardRun: CardRun): Record<string,
421421
const iterateOut = firstOut ?? (m.iterate?.build.notMeasured ? `not run: the iterate build was not measured (${m.iterate.build.notMeasured})` : undefined);
422422
const buildNote = (b: HalfScores['build']) => (b?.notMeasuredReason ? `not measured: ${b.notMeasuredReason}` : b ? cell(b) : '');
423423
const halves: Array<[string, Tally | undefined, string | undefined, unknown[], string]> = [
424-
['build', s.first.build, m.build?.error, m.build?.score ? [...m.build.score.expect.checks, ...m.build.score.tags.flatMap((t) => t.checks), ...m.build.score.agentActions, ...m.build.score.naming] : [], buildNote(s.first.build)],
424+
['build', s.first.build, m.build?.error, m.build?.score ? [...m.build.score.expect.checks, ...m.build.score.tags.flatMap((t) => t.checks), ...m.build.score.agentActions, ...m.build.score.personaGrants, ...m.build.score.naming] : [], buildNote(s.first.build)],
425425
['run-ask', s.first.ask, m.run?.error, m.run?.questions ?? [], s.first.ask ? cell(s.first.ask) : (firstOut ?? '')],
426426
['run-operations', s.first.operations, m.run?.error, m.run?.operations ?? [], s.first.operations ? cell(s.first.operations) : (firstOut ?? '')],
427427
['iterate-build', s.iterate?.build, m.iterate?.build.error, m.iterate?.build.score ? [...m.iterate.build.score.expect.checks, ...m.iterate.build.score.naming] : [], s.iterate?.build ? buildNote(s.iterate.build) : (firstOut ?? '')],

‎packages/qa/scenarios/test/runner/orchestrate.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ describe('runCard — the crm card, both modes, a clean agent', () => {
319319
const results = record.results as Array<{ id: string; verdict: string }>;
320320
expect(results.find((r) => r.id === 'crm_account_with_contacts.scratch.run-operations')!.verdict).toBe('pass');
321321
expect(results.find((r) => r.id === 'crm_account_with_contacts.template.build')!.verdict).toBe('not-run'); // template mode builds nothing first
322+
// The build's persona grant checks are its evidence, each named, as its other Build checks are.
323+
const grants = run.modes[0]!.build!.score!.personaGrants;
324+
expect(grants.length).toBeGreaterThan(0);
325+
const buildEvidence = (record.results as Array<{ id: string; clauses: Array<{ evidence: { check?: string } }> }>)
326+
.find((r) => r.id === 'crm_account_with_contacts.scratch.build')!
327+
.clauses.map((c) => c.evidence.check);
328+
expect(buildEvidence.filter((c) => c?.startsWith('persona-grant:'))).toEqual(grants.map((g) => g.check));
322329
expect(renderScorecard(sc)).toContain('| Run-问数 | 9/9 | — |');
323330
expect(renderScorecard(sc)).toContain('| Seed | 8/8 | — |'); // every row loaded: no warning
324331
});

0 commit comments

Comments
 (0)