fix(execute): the final report says whether the app was seen with Claude Code's run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
050a77f513
commit
6226372eaa
3 changed files with 51 additions and 1 deletions
|
|
@ -998,3 +998,46 @@ test('keep: the other verdict-gate callers carry no --repo', () => {
|
|||
for (const h of hits) assert.ok(!h.includes('--repo'), `${rel} gained --repo: ${h.trim()}`);
|
||||
}
|
||||
});
|
||||
|
||||
// --- D67: the final report says whether the app was seen with `run` ---------
|
||||
// Phase 7's "run the thing" says to use Claude Code's built-in `run`, but the
|
||||
// final report never said whether that happened. The line is said for every
|
||||
// run, also one with no app to launch (the "no — {reason}" form).
|
||||
|
||||
const E2E = '### End to end — "run the thing" (P9 (6))';
|
||||
|
||||
/** Phase 8 of /trekexecute, read up to Phase 9 (its report fence holds its own `## ` heading). */
|
||||
function phase8(text) {
|
||||
const start = text.indexOf('## Phase 8 — Final report');
|
||||
const end = text.indexOf('## Phase 9');
|
||||
assert.ok(start !== -1 && end > start, 'Phase 8 — Final report and Phase 9 must both exist, in that order');
|
||||
return text.slice(start, end);
|
||||
}
|
||||
|
||||
test('[D67] the Phase 8 report template says, right after End to end, whether the app was seen with `run`', () => {
|
||||
const lines = phase8(read(EXEC)).split('\n');
|
||||
const e2e = lines.findIndex((l) => l.startsWith('**End to end:**'));
|
||||
assert.ok(e2e !== -1, 'the report template has no **End to end:** line');
|
||||
assert.equal(lines[e2e + 1], '**Seen with `run`:** {yes | no — {reason}}',
|
||||
'the line after **End to end:** is not the "Seen with `run`" line in its yes / no — {reason} form');
|
||||
});
|
||||
|
||||
test('[D67] the summary JSON carries "run_seen" right after "end_to_end"', () => {
|
||||
const text = read(EXEC);
|
||||
const sumIdx = text.indexOf('"trekexecute_summary": {');
|
||||
assert.ok(sumIdx !== -1, 'summary JSON block missing');
|
||||
const lines = text.slice(sumIdx, text.indexOf('\n```', sumIdx)).split('\n').map((l) => l.trim());
|
||||
const e2e = lines.findIndex((l) => l.startsWith('"end_to_end":'));
|
||||
assert.ok(e2e !== -1, 'the summary JSON has no "end_to_end" key');
|
||||
assert.equal(lines[e2e + 1], '"run_seen": "{yes | no — reason}",',
|
||||
'the key after "end_to_end" is not "run_seen" with its yes / no — reason value');
|
||||
});
|
||||
|
||||
test('[D67] the End to end section says to record run_seen, also when no app was seen, and keeps the End-to-end: command as the verdict', () => {
|
||||
const s = flat(section(read(EXEC), E2E));
|
||||
assert.match(s, /Record `run_seen`: `yes` when the app was seen and driven with Claude Code's built-in `run` in this run, else `no — \{reason\}`/,
|
||||
'the End to end section does not say to record run_seen as yes, or no with a reason');
|
||||
assert.match(s, /no app to launch/, 'the no-form does not name the run with no app to launch');
|
||||
assert.match(s, /The verdict is still the `End-to-end:` command\./,
|
||||
'the End to end section no longer says the End-to-end: command is the verdict');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue