fix(ship-budget): check prints the reservation id alone as RESERVATION_ID: <id>; the review prose reads that line

gstack-evals #36 round 3: a child misparsed a reservation id out of the
RESERVATION: line, which gave UNMEASURED and then BUDGET_CHECK_SKIPPED at close.
check keeps RESERVATION: and adds RESERVATION_ID: <id>; the pass program, Steps
9, 11 and 14.5 and the Capy skill pass that line's value to --reservation.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-30 03:12:00 +00:00
1 parent c24e7d6c96
commit 2aa160dda2
13 files changed
+36 -12

No files matched your search

+16
View File
@@ -139,6 +139,22 @@ describe('gstack-review-log --start under a token cap', () => {
expect(close.code, close.out).toBe(0);
});
// Value: protects=the reservation id is printed alone on its own line, so a child copies it without parsing the RESERVATION: line (gstack-evals #36 round 3: a misparsed id gave UNMEASURED, then BUDGET_CHECK_SKIPPED at close); fails_when=check prints no RESERVATION_ID: line, or it differs from RESERVATION: id=;
// why_new=every test reads the id out of the RESERVATION: line; seam=none; no_claim=that the agent copies the right line
test('check prints RESERVATION_ID: <id> alone beside the RESERVATION: line, for a dispatch and a step, and the id starts a review', () => {
const h = fresh();
const run = capped(h);
const dispatch = h.sb(['check', '--run', run.run, '--step', '9', '--next', 'dispatch:specialist', '--reading', '0']);
const step = h.sb(['check', '--run', run.run, '--step', '1', '--next', '2', '--reading', '0']);
for (const out of [dispatch.out, step.out]) {
const ids = out.split('\n').filter(l => l.startsWith('RESERVATION_ID:'));
expect(ids).toHaveLength(1);
expect(ids[0]).toBe(`RESERVATION_ID: ${h.field(out, 'RESERVATION', 'id')}`);
}
const id = /^RESERVATION_ID: (\S+)$/m.exec(dispatch.out)![1]!;
expect(h.reviewLog(['--start', 'review', '--reservation', id]).code).toBe(0);
});
test('close prints one BUDGET_CHECK_SKIPPED line per unreserved dispatch and ends incomplete', () => {
const h = fresh();
const run = capped(h);
+8
View File
@@ -69,6 +69,14 @@ describe('ship budget skill structure', () => {
expect(capy).toMatch(/all in that same (?:execute )?program/);
});
// Value: protects=every prose site that takes a reservation id reads the RESERVATION_ID: line, never a field cut from RESERVATION:; fails_when=a dispatch section or the Capy skill names the id without that line;
// why_new=the line is new; seam=none; no_claim=the agent copies it
test('the review pass, Steps 9, 11 and 14.5 and the Capy skill read the id from the RESERVATION_ID: line', () => {
for (const rel of ['ship/sections/budget-handoff.md.tmpl', 'ship/sections/review-army.md.tmpl', 'ship/sections/adversarial.md.tmpl', 'ship/sections/documentation.md.tmpl', 'capy/skill/gstack/SKILL.md']) {
expect(read(rel), rel).toContain('`RESERVATION_ID:`');
}
});
test('every review-log --start in the dispatch sections takes a reservation when a cap is set', () => {
for (const rel of ['ship/sections/review-army.md.tmpl', 'ship/sections/adversarial.md.tmpl']) expect(read(rel)).toContain('--reservation');
});