mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-22 08:01:32 +01:00
READY prints real trial merges and the second-model trail read, plus six small ship-tool fixes (GST-3200) (#4529)
READY now prints each open PR's trial-merge result and the reader of the second-model trail read, or a loud MISSING line, instead of lines left to fill in. Why: agents dropped those lines as noise and skipped the trail read on three gate-class PRs. Six more small ship-tool bugs from 2026-11-19 reports are fixed here too. Nothing to do: pass `--trail ` to `gstack-ship-queue ready` on risk-class PRs. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Review-Finding: p1/outside-voice#3 reader=outside-voice Review-Finding: p1/outside-voice#4 reader=outside-voice Review-Finding: p1/outside-voice#5 reader=outside-voice Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/adversarial-native#4 reader=adversarial-native
This commit is contained in:
1 parent
50cc282273
commit
2714e9f7f3
36 files changed
+503
-68
No files matched your search
@@ -789,3 +789,48 @@ describe('printed gate-ahead command (review #3235 P2-1)', () => {
|
||||
expect(line(r.stdout, 'GATE_RECORD:')).toMatch(new RegExp(`^GATE_RECORD: pr=2 attempt=${p.attempt} exit=0 `));
|
||||
}, 180_000);
|
||||
});
|
||||
|
||||
describe('the READY tail ready fills in: TRIAL_MERGES and the cross-family trail read (GST-3200)', () => {
|
||||
// Value: protects=READY carries a computed trial-merge line per open PR sharing a file and a reviewer line read from the trail,
|
||||
// or MISSING, never a template line a lane can cut; fails_when=ready prints the TRIAL_MERGES or reviewed by <model ...>
|
||||
// placeholder (three gate-class PRs skipped the rule 27 read on 11-19); seam=bin/gstack-ship-queue ready with a gh shim
|
||||
test('one line per sibling from git merge-tree, and the reviewer from the trail-read row, else MISSING', () => {
|
||||
const repo = fixture();
|
||||
const sibling = (branch: string, files: Record<string, string>, pr: string) => {
|
||||
repo.git('checkout', '-q', 'origin/main', '-b', branch);
|
||||
for (const [f, text] of Object.entries(files)) fs.writeFileSync(path.join(repo.work, f), text);
|
||||
repo.git('add', '-A'); repo.git('commit', '-q', '-m', branch);
|
||||
publish(repo, pr);
|
||||
return repo.git('rev-parse', 'HEAD');
|
||||
};
|
||||
const conflict = sibling('pr-b', { 'pr-a.txt': 'other\n' }, '2');
|
||||
const clean = sibling('pr-c', { 'pr-a.txt': 'pr-a\n', 'c.txt': 'c\n' }, '3');
|
||||
const apart = sibling('pr-d', { 'd.txt': 'd\n' }, '4');
|
||||
const head = makePr(repo, 'pr-a', { changelog: false });
|
||||
const tree = runBin(repo, 'gstack-wtree', []).out.trim();
|
||||
const pregate = path.join(repo.root, 'pregate.json');
|
||||
fs.writeFileSync(pregate, JSON.stringify({ schema_version: 1, tree, head, verdict: 'pass', checks: FULL_CHECKS }));
|
||||
const files = (...p: string[]) => p.map(f => ({ path: f }));
|
||||
const list = [{ number: 1, headRefOid: head, files: files('pr-a.txt') }, { number: 2, headRefOid: conflict, files: files('pr-a.txt') }, { number: 3, headRefOid: clean, files: files('pr-a.txt', 'c.txt') }, { number: 4, headRefOid: apart, files: files('d.txt') }];
|
||||
const green = { check_runs: [{ status: 'completed', conclusion: 'success' }] };
|
||||
const prs = { '1': { headRefOid: head, body: shippedBody('1', head), headRefName: 'pr-a' } };
|
||||
const trail = path.join(repo.root, 'decisions.tsv');
|
||||
fs.writeFileSync(trail, 'ts\tphase\tdecision\twhy\tevidence\tresult\n2026-11-19T00:00:00Z\tstart\trun x opens this trail\tno earlier rows\trun:x\topen\n2026-11-19T00:01:00Z\ttrail-read\topenai/gpt-6.2-sol (Subagent 4)\trule 27\tflags.md\tNo flags\n');
|
||||
const r = queue(repo, ['ready', '--pr', '1', '--pregate', pregate, '--trail', trail], ghQueueShim(repo, { prs, checks: { [head]: green }, list }));
|
||||
expect(r.status, r.err).toBe(EXIT.ok);
|
||||
const cleanTree = repo.git('merge-tree', '--write-tree', head, clean);
|
||||
expect(r.out.split('\n').filter(l => l.startsWith('TRIAL_MERGES: '))).toEqual([
|
||||
`TRIAL_MERGES: #2 ${conflict.slice(0, 12)} shares pr-a.txt: CONFLICT in pr-a.txt; the lane states the resolution`,
|
||||
`TRIAL_MERGES: #3 ${clean.slice(0, 12)} shares pr-a.txt: merge-tree clean (tree ${cleanTree.slice(0, 12)})`,
|
||||
]);
|
||||
expect(line(r.out, 'Attention:')).toBe('Attention:');
|
||||
expect(r.out).toContain('\nreviewed by openai/gpt-6.2-sol (Subagent 4) (risk class unknown: the receipt records no review_depth; rule 27 cross-family trail read, trail row 2)\n');
|
||||
expect(r.out).not.toContain('<model on another family>');
|
||||
const bare = queue(repo, ['ready', '--pr', '1', '--pregate', pregate], ghQueueShim(repo, { prs, checks: { [head]: green } }));
|
||||
expect(line(bare.out, 'TRIAL_MERGES: ')).toStartWith('TRIAL_MERGES: MISSING: cannot list the open PRs into main through gh');
|
||||
expect(line(bare.out, 'MISSING: cross-family')).toStartWith('MISSING: cross-family trail read (risk class unknown: the receipt records no review_depth; rule 27): ready got no --trail <decisions.tsv>;');
|
||||
const alone = queue(repo, ['ready', '--pr', '1', '--pregate', pregate], ghQueueShim(repo, { prs, checks: { [head]: green }, list: [list[0], list[3]] }));
|
||||
expect(line(alone.out, 'TRIAL_MERGES: ')).toBe('TRIAL_MERGES: none share a file (1 open PRs checked)');
|
||||
}, 240_000);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user