mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-30 03:44:38 +01:00
Code changes get a second-model review of their final fixes, and the shipping record names that model's family (GST-4140) (#4886)
When a code change's first review leads to fixes, the second-model review now reads those fixes and the final review again, instead of being skipped once it had run. A reviewer from the same model family as the author (a Claude reader checking Claude's work) no longer counts as the second model, and the review record names the model family that reviewed. Nothing to do: when the second model can't run (Codex down, rate-limited or refused), that is still recorded and never blocks shipping. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: s11/outside-voice#1 reader=outside-voice Review-Finding: s11/outside-voice#2 reader=outside-voice Review-Finding: s11/outside-voice#3 reader=outside-voice Review-Finding: s11/outside-voice#4 reader=outside-voice Review-Finding: s11/adversarial-native#1 reader=adversarial-native Review-Finding: s11/adversarial-native#2 reader=adversarial-native Review-Finding: s11/adversarial-native#3 reader=adversarial-native Review-Finding: s11/adversarial-native#5 reader=adversarial-native Review-Finding: s11/adversarial-native#7 reader=adversarial-native
This commit is contained in:
1 parent
942a12c618
commit
4a40464ea7
20 files changed
+557
-38
No files matched your search
@@ -1 +1 @@
|
||||
{"sha":"d6f474b5320d9b94715e79400647ab215942ed2f5c60636ea8a82e890ab21b6f","replay":"GSTA-861"}
|
||||
{"sha":"e474e1fc2e33997b420c54527b749108552243ced44370f4b94e53e056414f64","replay":"GST-4140"}
|
||||
@@ -0,0 +1 @@
|
||||
{"replay":"GST-4140","justification":"GST-4140 deterministic no-loss replay, no paid run (CREW rule 13/15): lib/review-depth.ts only adds readers. After Step 11 ran (--adversarial-ran), a full pass at standard or full depth on code or gate class lists the outside voice again (unless its fix range changes no runtime lines), and the read-only final review of such a diff lists the native adversarial again too (appended after the keepReader Red Team, so that reader is kept). Docs, tests, light depth, lean mode, scoped, fix-check and voices steps keep main's dispatches and skip lines byte for byte. test/helpers/gst4140-replay.ts asserts every added reader is exactly one of these and reads the plan back as main's: the GST-967 grid (1,440 cases; 104 add the outside voice), the GST-972 grids (132 and 56) and the GST-1350 grids (398 and 388) keep their frozen main hashes, and the GST-3562 replays (test/review-depth.test.ts, test/review-depth-lean.test.ts, test/review-risk-token-paths.test.ts) keep every case's kind and step. No brief body, effort, depth rule (rules= is unchanged) or History field changes."}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* GST-4140's no-loss replay. After Step 11 ran (--adversarial-ran), a later full pass on a code or gate diff at standard or full
|
||||
* depth lists the outside voice again, and the read-only final review of such a diff lists the native adversarial again too, so
|
||||
* the final head never ships without a second-model read. Main dropped both as "run once per invocation". The change only adds
|
||||
* readers: asMainBeforeGst4140 checks each added reader is exactly one of these and reads the plan back as main's, so every grid
|
||||
* frozen to an older main keeps its hash.
|
||||
* outside: the full pass lists `outside-voice` at the host effort where main listed none, or listed it only as
|
||||
* `outside-voice (numbers changed)` (read back under that name). A pass 2 whose fix range changes no runtime lines adds no
|
||||
* outside voice: it plans main's readers and only words its skip line apart.
|
||||
* adversarial: the read-only final review lists one more `adversarial-native` at full effort, after every reader main listed.
|
||||
*/
|
||||
import { expect } from 'bun:test';
|
||||
import type { PlanInput, ReviewPlan } from '../../lib/review-depth';
|
||||
|
||||
export type Gst4140Kind = 'outside' | 'outside+adversarial';
|
||||
|
||||
export function asMainBeforeGst4140(input: PlanInput, plan: ReviewPlan): { plan: ReviewPlan; kind?: Gst4140Kind } {
|
||||
const h = input.history;
|
||||
const dcls = plan.stepDepth === 'full' ? 'gate' : plan.class;
|
||||
if (!(plan.mode === 'panel' && plan.next.step === 'full' && plan.stepDepth !== 'light' && h.fullPasses > 0 && input.adversarialRan && (dcls === 'code' || dcls === 'gate'))) return { plan };
|
||||
const range = !!plan.next.rangeReaders && (h.rangeRuntimeLines ?? 0) > 0;
|
||||
const final = !!plan.next.readOnly && !range;
|
||||
const numbersChanged = input.numbers.publishes && input.reviewedNumbers !== undefined && input.reviewedNumbers !== input.numbers.fingerprint;
|
||||
const added = final || h.rangeRuntimeLines !== 0;
|
||||
const outside = plan.dispatches.filter(d => d.role === 'outside-voice');
|
||||
expect([h, outside.map(d => `${d.name}:${d.effort}`)]).toEqual([h, added ? ['outside-voice:host'] : numbersChanged ? ['outside-voice (numbers changed):host'] : []]);
|
||||
let dispatches = !added ? plan.dispatches : plan.dispatches.flatMap(d => d.role !== 'outside-voice' ? [d] : numbersChanged ? [{ ...d, name: 'outside-voice (numbers changed)' }] : []);
|
||||
if (final) {
|
||||
const last = dispatches.map(d => d.role).lastIndexOf('adversarial-native');
|
||||
expect([h, dispatches.filter(d => d.role === 'adversarial-native').length, dispatches[last]?.effort, dispatches.slice(last + 1).every(d => d.role === 'targeted')]).toEqual([h, 1, 'full', true]);
|
||||
dispatches = [...dispatches.slice(0, last), ...dispatches.slice(last + 1)];
|
||||
}
|
||||
const quiet = 'outside-voice (run once per invocation: the fix range changes no runtime lines)';
|
||||
const skipped = plan.skipped.filter(s => s !== 'adversarial-native (run once per invocation)' && s !== quiet);
|
||||
expect([h, plan.skipped.length - skipped.length]).toEqual([h, (range || final ? 0 : 1) + (!added && !numbersChanged ? 1 : 0)]);
|
||||
const at = skipped.indexOf('targeted (already read this product patch)');
|
||||
const was = range ? 'outside-voice (run once per invocation)' : 'adversarial-native and outside-voice (run once per invocation)';
|
||||
return { plan: { ...plan, dispatches, skipped: at < 0 ? [...skipped, was] : [...skipped.slice(0, at), was, ...skipped.slice(at)] }, ...(added ? { kind: final ? 'outside+adversarial' as const : 'outside' as const } : {}) };
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/**
|
||||
* GST-4140: an outside voice from the lane's own model family is one voice, never outside coverage. gstack-review-dispatch collect
|
||||
* refuses it and records the provider, model and family of every outside read; verify prints OUTSIDE_VOICE_RECORD: for the
|
||||
* receipt; gstack-ship-receipt write records it as outside_voice and refuses a same-family completed read. Missing coverage
|
||||
* stays unavailable or skipped and never blocks.
|
||||
*/
|
||||
import { afterAll, afterEach, describe, expect, test } from 'bun:test';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { runScriptSync } from '../lib/script-invocation';
|
||||
import { appendEvent, outsideVoiceRecord, readLedger, verify } from '../lib/review-ledger';
|
||||
import { familyOf, outsideProvenance, outsideVoiceProblem, parseOutsideStatus, sameFamily, UNPROVEN_FAMILY, UNPROVEN_NATIVE } from '../lib/outside-voice-record';
|
||||
import { validateReceipt } from '../lib/ship-receipt';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dir, '..');
|
||||
const DISPATCH = path.join(ROOT, 'bin', 'gstack-review-dispatch');
|
||||
const RECEIPT = path.join(ROOT, 'bin', 'gstack-ship-receipt');
|
||||
const dirs: string[] = [];
|
||||
afterEach(() => { while (dirs.length) fs.rmSync(dirs.pop()!, { recursive: true, force: true }); });
|
||||
const tmp = (p: string) => { const d = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), p))); dirs.push(d); return d; };
|
||||
const dispatch = (args: string[]) => runScriptSync(DISPATCH, args, { cwd: ROOT, encoding: 'utf8', timeout: 60_000 });
|
||||
const REPLY = 'No blocking issue in the retry path.\nRecommendation: ship because the fix holds\n';
|
||||
|
||||
function pass() {
|
||||
const out = tmp('outside-family-');
|
||||
const ledger = path.join(out, 'review-ledger.jsonl'), merged = path.join(out, 'merged.jsonl');
|
||||
const w = (n: string, t: string) => { const f = path.join(out, n); fs.writeFileSync(f, t); return f; };
|
||||
const file = /file=(\S+)/.exec(dispatch(['render', '--role', 'specialist', '--name', 'testing', '--out', out, '--diff-base', 'a'.repeat(40)]).stdout)?.[1] ?? '';
|
||||
expect(dispatch(['sent', '--ledger', ledger, '--role', 'specialist', '--name', 'testing', '--sent', file]).status).toBe(0);
|
||||
const outside = (extra: string[], reply = REPLY) => dispatch(['collect', '--ledger', ledger, '--role', 'outside-voice', '--output', w(`o${Math.random()}.txt`, reply), '--merged', merged, ...extra]);
|
||||
return { out, ledger, merged, w, outside };
|
||||
}
|
||||
|
||||
let worktree = '';
|
||||
afterAll(() => { if (worktree) spawnSync('git', ['-C', ROOT, 'worktree', 'remove', '--force', worktree], { encoding: 'utf8', timeout: 60_000 }); });
|
||||
const gitIn = (cwd: string, args: string[]) => spawnSync('git', ['-C', cwd, ...args], { encoding: 'utf8', timeout: 30_000 }).stdout.trim();
|
||||
/**
|
||||
* A clean ledger holding only the outside voice: its brief rendered in a clean checkout of HEAD and sent verbatim, a reply that
|
||||
* names that checkout's REVIEWED_TREE, then judge. verify prints OUTSIDE_VOICE_RECORD only on a ledger like this.
|
||||
*/
|
||||
function cleanVoice(extra: string[], reply = REPLY) {
|
||||
if (!worktree) {
|
||||
worktree = path.join(fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'outside-family-wt-'))), 'wt');
|
||||
const add = spawnSync('git', ['-C', ROOT, 'worktree', 'add', '--detach', worktree, 'HEAD'], { encoding: 'utf8', timeout: 120_000 });
|
||||
expect(add.status, add.stderr).toBe(0);
|
||||
}
|
||||
const out = tmp('outside-clean-');
|
||||
const ledger = path.join(out, 'review-ledger.jsonl'), merged = path.join(out, 'merged.jsonl'), output = path.join(out, 'outside.txt');
|
||||
const inTree = (args: string[]) => runScriptSync(DISPATCH, args, { cwd: worktree, encoding: 'utf8', timeout: 60_000 });
|
||||
const file = /file=(\S+)/.exec(inTree(['render', '--role', 'outside-voice', '--out', out, '--diff-base', gitIn(worktree, ['rev-parse', 'HEAD'])]).stdout)?.[1] ?? '';
|
||||
expect(dispatch(['sent', '--ledger', ledger, '--role', 'outside-voice', '--sent', file]).status).toBe(0);
|
||||
fs.writeFileSync(output, `REVIEWED_TREE: ${gitIn(worktree, ['rev-parse', 'HEAD^{tree}'])} ${worktree}\n` + reply);
|
||||
const c = inTree(['collect', '--ledger', ledger, '--role', 'outside-voice', '--output', output, '--merged', merged, ...extra]);
|
||||
expect([c.status, c.stdout + c.stderr]).toEqual([0, expect.stringContaining('COLLECT: reader=outside-voice')]);
|
||||
expect(dispatch(['judge', '--ledger', ledger, '--merged', merged, '--judged', path.join(out, 'judged.jsonl')]).status).toBe(0);
|
||||
const v = dispatch(['verify', '--ledger', ledger]);
|
||||
expect([v.status, v.stdout]).toEqual([0, expect.stringContaining('VERIFY: clean')]);
|
||||
return v.stdout.split('\n').find(l => l.startsWith('OUTSIDE_VOICE_RECORD:'));
|
||||
}
|
||||
|
||||
describe('the outside voice record (lib/outside-voice-record.ts)', () => {
|
||||
// Value: protects=R38/R129's second family: a same-family fallback never reads as outside coverage; fails_when=a Claude reader beside a
|
||||
// Claude lane, by flag or by its OUTSIDE_STATUS line, passes as cross-family, or a cross-family pair is refused; seam=outsideProvenance, sameFamily
|
||||
test('flags win over the OUTSIDE_STATUS line; the same family is refused and another family is not', () => {
|
||||
expect(parseOutsideStatus('x\nOUTSIDE_STATUS: completed provider=codex-cli model=gpt-6.2-astra family=openai pass=2\n')).toEqual({ status: 'completed', provider: 'codex-cli', model: 'gpt-6.2-astra' });
|
||||
expect(parseOutsideStatus('OUTSIDE_STATUS: completed provider=codex host=claude')).toEqual({ status: 'completed', provider: 'codex', model: undefined });
|
||||
for (const model of ['claude-opus-4', 'anthropic/claude-opus-5-5']) expect(sameFamily(outsideProvenance({ model, nativeModel: 'anthropic/claude-opus-5-5', output: '' })!)).toContain('both anthropic');
|
||||
const status = outsideProvenance({ nativeModel: 'claude-opus-5-5', output: 'OUTSIDE_STATUS: completed provider=host-subagent model=anthropic/claude-opus-4-8 family=anthropic' })!;
|
||||
expect([status.provider, status.family, !!sameFamily(status)]).toEqual(['host-subagent', 'anthropic', true]);
|
||||
const cross = outsideProvenance({ model: 'openai/gpt-6.2-sol', provider: 'host-subagent', nativeModel: 'anthropic/claude-opus-5-5', output: 'OUTSIDE_STATUS: completed provider=x model=claude-opus-4 family=anthropic' })!;
|
||||
expect([cross, sameFamily(cross)]).toEqual([{ provider: 'host-subagent', model: 'openai/gpt-6.2-sol', family: 'openai', native_model: 'anthropic/claude-opus-5-5', native_family: 'anthropic' }, undefined]);
|
||||
expect(outsideProvenance({ output: REPLY })).toBeUndefined();
|
||||
expect(['openrouter/anthropic/claude-opus-5-5', 'tencent/hy4', 'gpt-6.2-astra', 'mystery-model', 'bedrock/anthropic.claude-opus-5'].map(familyOf)).toEqual(['anthropic', 'unknown', 'openai', 'unknown', 'unknown']);
|
||||
});
|
||||
// Value: protects=only the provider's own closing status line and the model id name the family; fails_when=a status line quoted inside the
|
||||
// review text, or a printed family= with no model, proves a second family (Step 11 outside-voice#1, adversarial-native#2 on #4886); seam=parseOutsideStatus, outsideProvenance
|
||||
test('a status line that is not the reply\'s last line, and a printed family= without a model, prove nothing', () => {
|
||||
expect(parseOutsideStatus('OUTSIDE_STATUS: completed provider=host-subagent model=openai/gpt-6.2-sol\nNo blocking issue.\n')).toBeUndefined();
|
||||
expect(outsideProvenance({ nativeModel: 'anthropic/claude-opus-5-5', output: 'Recommendation: ship\nOUTSIDE_STATUS: completed provider=codex family=openai\n' })).toMatchObject({ model: 'unknown', family: 'unknown' });
|
||||
});
|
||||
// Value: protects=a completed record always proves a recognized family beside a different recognized native family; fails_when=collect without
|
||||
// --native-model, or a family the model id doesn't name, records or binds a completed second-model read (Step 11 outside-voice#1 on #4886); seam=outsideVoiceRecord, outsideVoiceProblem
|
||||
test('a read with no native family, or an unrecognized family, is unavailable, and write refuses it as completed', () => {
|
||||
const p = pass();
|
||||
expect(p.outside(['--outside-model', 'openai/gpt-6.2-sol', '--outside-provider', 'host-subagent']).status).toBe(0);
|
||||
expect(outsideVoiceRecord(p.ledger)).toEqual({ status: 'unavailable', provider: 'host-subagent', model: 'openai/gpt-6.2-sol', family: 'openai', reason: UNPROVEN_NATIVE });
|
||||
const ok = { status: 'completed', provider: 'host-subagent', model: 'openai/gpt-6.2-sol', family: 'openai', native_family: 'anthropic' };
|
||||
expect(outsideVoiceProblem(ok)).toBeUndefined();
|
||||
for (const bad of [{ ...ok, native_family: undefined }, { ...ok, native_family: 'unknown' }, { ...ok, model: 'tencent/hy4', family: 'tencent' }]) expect(outsideVoiceProblem(bad)).toContain('record it as unavailable');
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
describe('gstack-review-dispatch collect and verify: the outside voice\'s family (GST-4140)', () => {
|
||||
// Value: protects=the ledger never records a same-family outside read as coverage, and verify hands the receipt who read; fails_when=collect
|
||||
// merges a claude-opus-4 or anthropic/claude-opus-5-5 outside read on an Anthropic lane, records no family, or verify prints no record; seam=the bin
|
||||
test('a same-family outside read is COLLECT_SAME_FAMILY and merges nothing; a cross-family read is recorded and verify prints its record', () => {
|
||||
const p = pass();
|
||||
for (const model of ['claude-opus-4', 'anthropic/claude-opus-5-5']) {
|
||||
const same = p.outside(['--outside-model', model, '--outside-provider', 'host-subagent', '--native-model', 'anthropic/claude-opus-5-5']);
|
||||
expect([same.status, same.stdout]).toEqual([1, expect.stringContaining(`COLLECT_SAME_FAMILY: reader=outside-voice model=${model} family=anthropic native=anthropic/claude-opus-5-5`)]);
|
||||
expect(same.stdout).toContain('a file that holds only the reason, not this reply (--unavailable refuses output that holds findings)');
|
||||
}
|
||||
const viaStatus = p.outside(['--native-model', 'claude-opus-5-5'], REPLY + 'OUTSIDE_STATUS: completed provider=host-subagent model=claude-opus-4 family=anthropic\n');
|
||||
expect([viaStatus.status, viaStatus.stdout]).toEqual([1, expect.stringContaining('COLLECT_SAME_FAMILY')]);
|
||||
expect(readLedger(p.ledger).filter(e => e.event === 'output' && e.reader === 'outside-voice')).toEqual([]);
|
||||
const ok = p.outside(['--outside-model', 'openai/gpt-6.2-sol', '--outside-provider', 'host-subagent', '--native-model', 'anthropic/claude-opus-5-5']);
|
||||
expect([ok.status, ok.stdout]).toEqual([0, expect.stringContaining('COLLECT: reader=outside-voice')]);
|
||||
const record = { status: 'completed', provider: 'host-subagent', model: 'openai/gpt-6.2-sol', family: 'openai', native_family: 'anthropic' };
|
||||
expect(outsideVoiceRecord(p.ledger)).toEqual(record as never);
|
||||
const v = dispatch(['verify', '--ledger', p.ledger]);
|
||||
expect([v.status, v.stdout]).toEqual([1, expect.stringContaining('OUTSIDE_VOICE_RECORD_WITHHELD: VERIFY is dirty')]);
|
||||
expect(v.stdout).not.toContain('OUTSIDE_VOICE_RECORD: ');
|
||||
expect(v.stdout).not.toContain('SAME_FAMILY');
|
||||
expect(cleanVoice(['--outside-model', 'openai/gpt-6.2-sol', '--outside-provider', 'host-subagent', '--native-model', 'anthropic/claude-opus-5-5'])).toBe(`OUTSIDE_VOICE_RECORD: ${JSON.stringify(record)}`);
|
||||
}, 120_000);
|
||||
test('missing coverage is recorded as unavailable with its provenance; a same-family read written into a ledger makes verify dirty; the flags are the outside voice\'s only', () => {
|
||||
const p = pass();
|
||||
const lost = p.outside(['--outside-model', 'claude-opus-4', '--native-model', 'anthropic/claude-opus-5-5', '--unavailable', 'no other family online'], 'outside voice failed\n');
|
||||
expect([lost.status, lost.stdout]).toEqual([0, expect.stringContaining('COLLECT_UNAVAILABLE: reader=outside-voice')]);
|
||||
expect(outsideVoiceRecord(p.ledger)).toMatchObject({ status: 'unavailable', model: 'claude-opus-4', family: 'anthropic', reason: 'no other family online' });
|
||||
expect(verify(p.ledger).rows.some(r => r.kind === 'OUTSIDE')).toBe(false);
|
||||
appendEvent(p.ledger, { event: 'output', reader: 'outside-voice', sha256: 'x', file: null, merged: p.merged, ids: [], review: true, outside: { provider: 'host-subagent', model: 'claude-opus-4', family: 'anthropic', native_model: 'claude-opus-5-5', native_family: 'anthropic' } });
|
||||
const v = verify(p.ledger);
|
||||
expect([v.clean, v.rows.find(r => r.kind === 'OUTSIDE')]).toEqual([false, { kind: 'OUTSIDE', reader: 'outside-voice', status: 'SAME_FAMILY', detail: expect.stringContaining('family=anthropic native_family=anthropic') }]);
|
||||
const spec = dispatch(['collect', '--ledger', p.ledger, '--role', 'specialist', '--name', 'testing', '--output', p.w('s.txt', 'NO FINDINGS\n'), '--merged', p.merged, '--outside-model', 'openai/gpt-6.2-sol']);
|
||||
expect([spec.status, spec.stderr]).toEqual([2, expect.stringContaining('is not the outside voice')]);
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
describe('gstack-ship-receipt write: outside_voice (GST-4140)', () => {
|
||||
let repo = '', env: NodeJS.ProcessEnv = {};
|
||||
const setup = () => {
|
||||
const t = tmp('gstack-receipt-outside-');
|
||||
repo = path.join(t, 'repo');
|
||||
fs.mkdirSync(repo);
|
||||
const gitconfig = path.join(t, 'gitconfig');
|
||||
fs.writeFileSync(gitconfig, '');
|
||||
env = { ...process.env, HOME: t, USERPROFILE: t, GSTACK_STATE_ROOT: path.join(t, 'state'), GSTACK_HOME: path.join(t, 'state'), GSTACK_SESSION_KIND: 'attended',
|
||||
GIT_CONFIG_GLOBAL: gitconfig, GIT_CONFIG_NOSYSTEM: '1', GIT_DIR: undefined, GIT_WORK_TREE: undefined, GIT_INDEX_FILE: undefined };
|
||||
const git = (...args: string[]) => expect(spawnSync('git', args, { cwd: repo, env, encoding: 'utf8', timeout: 30_000 }).status).toBe(0);
|
||||
git('init', '-q', '-b', 'main');
|
||||
fs.writeFileSync(path.join(repo, 'a.txt'), 'a\n');
|
||||
git('add', 'a.txt');
|
||||
git('-c', 'user.email=fixture@example.test', '-c', 'user.name=Fixture', '-c', 'commit.gpgsign=false', 'commit', '-qm', 'fixture');
|
||||
git('update-ref', 'refs/remotes/origin/main', 'HEAD');
|
||||
git('switch', '-q', '-c', 'feat');
|
||||
return t;
|
||||
};
|
||||
const write = (voice: string) => runScriptSync(RECEIPT, ['write', '--base', 'main', '--json', '--outside-voice', voice], { cwd: repo, env, encoding: 'utf8', timeout: 60_000 });
|
||||
// Value: protects=the receipt names the second-model read and its family, and a same-family completed read never binds; fails_when=write drops
|
||||
// outside_voice, accepts a same-family or unknown-family completed read, or refuses honest unavailable or skipped coverage; seam=the bin and validateReceipt
|
||||
test('records a cross-family completed read, explicit unavailable and skipped coverage; refuses a same-family or unrecognized completed read', () => {
|
||||
const t = setup();
|
||||
const ok = { status: 'completed', provider: 'host-subagent', model: 'openai/gpt-6.2-sol', family: 'openai', native_family: 'anthropic' };
|
||||
const w = write(`OUTSIDE_VOICE_RECORD: ${JSON.stringify(ok)}`);
|
||||
expect(w.status, w.stderr).toBe(0);
|
||||
expect(JSON.parse(w.stdout).outside_voice).toEqual(ok);
|
||||
const file = path.join(t, 'verify.txt');
|
||||
fs.writeFileSync(file, `VERIFY: clean briefs=3 outputs=3 voided=0\nOUTSIDE_VOICE_RECORD: ${JSON.stringify({ status: 'unavailable', provider: 'codex-cli', model: 'unknown', family: 'unknown', reason: 'rate limited' })}\n`);
|
||||
const lost = write('@' + file);
|
||||
expect([lost.status, JSON.parse(lost.stdout || '{}').outside_voice?.status]).toEqual([0, 'unavailable']);
|
||||
const skipped = write(JSON.stringify({ status: 'skipped', provider: 'none', model: 'none', family: 'unknown', reason: 'the review plan listed no outside voice' }));
|
||||
expect([skipped.status, JSON.parse(skipped.stdout || '{}').outside_voice?.status]).toEqual([0, 'skipped']);
|
||||
const pretty = path.join(t, 'pretty.json');
|
||||
fs.writeFileSync(pretty, JSON.stringify(ok, null, 2) + '\n');
|
||||
const full = path.join(t, 'verify-full.txt');
|
||||
fs.writeFileSync(full, `OUTPUT outside-voice MATCH sha=abc findings=0\nOUTSIDE_VOICE_RECORD: ${JSON.stringify(ok)}\nVERIFY: clean briefs=1 outputs=1 voided=0\n`);
|
||||
for (const f of [pretty, full]) {
|
||||
const r = write('@' + f);
|
||||
expect([r.status, JSON.parse(r.stdout || '{}').outside_voice], r.stderr).toEqual([0, ok]);
|
||||
}
|
||||
const empty = path.join(t, 'empty.txt');
|
||||
fs.writeFileSync(empty, '');
|
||||
const withheld = path.join(t, 'withheld.txt');
|
||||
fs.writeFileSync(withheld, "OUTSIDE_VOICE_RECORD_WITHHELD: VERIFY is dirty, so the outside voice's record does not bind\nVERIFY: dirty briefs=1 outputs=1 voided=0\n");
|
||||
for (const f of [empty, withheld]) {
|
||||
const r = write('@' + f);
|
||||
expect([r.status, r.stderr]).toEqual([2, expect.stringContaining('verify prints it only when VERIFY is clean')]);
|
||||
}
|
||||
for (const bad of [{ ...ok, model: 'claude-opus-4', family: 'anthropic' }, { ...ok, model: 'anthropic/claude-opus-5-5', family: 'anthropic' }, { ...ok, family: 'unknown' }, { ...ok, model: 'claude-opus-4' }, { ...ok, native_family: undefined }, { ...ok, model: 'tencent/hy4', family: 'tencent' }]) {
|
||||
const r = write(JSON.stringify(bad));
|
||||
expect([bad.model, bad.family, r.status, r.stderr]).toEqual([bad.model, bad.family, 1, expect.stringContaining('RECEIPT_INVALID')]);
|
||||
}
|
||||
expect(write('not json').status).toBe(2);
|
||||
}, 120_000);
|
||||
// Value: protects=verify's record always binds: a cross-family read whose family was never recorded (the Codex block's
|
||||
// OUTSIDE_STATUS line names no model) is missing coverage, never a completed read write refuses; fails_when=verify prints a
|
||||
// record write rejects, or calls an unproven read completed; seam=collect, verify and write end to end
|
||||
test('verify reports an outside read with no recorded family as unavailable, and write binds that record', () => {
|
||||
setup();
|
||||
const line = cleanVoice([], REPLY + 'OUTSIDE_STATUS: completed provider=codex host=claude\n')!;
|
||||
expect(JSON.parse(line.slice('OUTSIDE_VOICE_RECORD:'.length))).toEqual({ status: 'unavailable', provider: 'codex', model: 'unknown', family: 'unknown', reason: UNPROVEN_FAMILY });
|
||||
const w = write(line);
|
||||
expect([w.status, JSON.parse(w.stdout || '{}').outside_voice?.status]).toEqual([0, 'unavailable']);
|
||||
}, 120_000);
|
||||
test('a receipt without outside_voice stays valid; validateReceipt rejects a same-family completed record', () => {
|
||||
const base = { schema_version: 1, head: 'a'.repeat(40), base: 'main' };
|
||||
expect(validateReceipt(base)).toEqual([]);
|
||||
expect(validateReceipt({ ...base, outside_voice: { status: 'completed', provider: 'host-subagent', model: 'claude-opus-4', family: 'anthropic', native_family: 'anthropic' } }).map(e => e.code)).toEqual(['RECEIPT_INVALID']);
|
||||
expect(outsideVoiceProblem({ status: 'unavailable', provider: 'codex-cli', model: 'unknown', family: 'unknown' })).toBeUndefined();
|
||||
expect(outsideVoiceProblem({ status: 'done', provider: 'x', model: 'y', family: 'z' })).toContain('status must be one of');
|
||||
});
|
||||
});
|
||||
@@ -8,6 +8,7 @@ import { summarizeReviewLoop } from '../lib/review-scope';
|
||||
import { sectionTexts } from '../lib/review-brief';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { asMainBeforeGst3562 } from './helpers/gst3562-replay';
|
||||
import { asMainBeforeGst4140 } from './helpers/gst4140-replay';
|
||||
|
||||
const ROOT = path.join(import.meta.dir, '..');
|
||||
const none = scanNumbers({});
|
||||
@@ -183,6 +184,11 @@ const R51_CASES = 28;
|
||||
* step was a fix-check are histories gstack-review-plan no longer accepts (GST-3562 part 4) and read back as main's plan.
|
||||
*/
|
||||
const GST3562_967_CASES = { a: 20, d: 10, e: 60, h: 480 };
|
||||
/**
|
||||
* GST-4140 adds readers and drops none (test/helpers/gst4140-replay.ts): after Step 11 ran, a full pass at standard or full depth
|
||||
* on code or gate class lists the outside voice again, and the read-only final review lists the native adversarial again too.
|
||||
*/
|
||||
const GST4140_967_CASES = { 'gate:outside': 38, 'light:outside': 28, 'standard:outside': 38 };
|
||||
const MAIN_SECTIONS = '0608589f33d7cc47f27ccf98538d1c76edc1a475075b419de12c76ba9c433518';
|
||||
describe('GST-967 dispatch-superset no-loss check', () => {
|
||||
// Value: protects=the no-loss rule for review-depth changes: GST-967 drops, renames and re-efforts no reviewer main dispatches on any grid case, changes no brief body, and GST-3562 A changes only the kinds its replay allows; fails_when=a non-stop plan changes outside those kinds, a voices step appears off gate class or after Step 11, it dispatches anything but the three voices, or a brief body moves;
|
||||
@@ -201,11 +207,14 @@ describe('GST-967 dispatch-superset no-loss check', () => {
|
||||
let r51 = 0;
|
||||
const gst3187: Record<string, number> = {};
|
||||
const gst3562: Record<string, number> = {};
|
||||
const gst4140: Record<string, number> = {};
|
||||
for (const [name, f] of Object.entries(fixtures)) for (const fullPasses of [0, 1, 2]) for (const last of ['none', 'full', 'fix-check'] as const) for (let bits = 0; bits < 16; bits++) for (const adversarialRan of [false, true]) {
|
||||
const history = { fullPasses, last, fixedBlocking: !!(bits & 1), fixedBelow: !!(bits & 2), blockingOpen: !!(bits & 4), touchedGate: !!(bits & 8) };
|
||||
const input = { ...f, numbers: none, history, adversarialRan } as PlanInput;
|
||||
const { plan: main0408128, kind } = asMainBeforeGst3562(input, planReview(input));
|
||||
const { plan: branch, kind } = asMainBeforeGst3562(input, planReview(input));
|
||||
if (kind) gst3562[kind] = (gst3562[kind] ?? 0) + 1;
|
||||
const { plan: main0408128, kind: added } = asMainBeforeGst4140(input, branch);
|
||||
if (added) gst4140[`${name}:${added}`] = (gst4140[`${name}:${added}`] ?? 0) + 1;
|
||||
const { plan: p, changed } = asMainBeforeGst3187(input, main0408128);
|
||||
if (changed) gst3187[`${name}:${changed}`] = (gst3187[`${name}:${changed}`] ?? 0) + 1;
|
||||
let { step, reason } = p.next;
|
||||
@@ -224,6 +233,7 @@ describe('GST-967 dispatch-superset no-loss check', () => {
|
||||
'docs:full': 4, 'docs:stop': 2, 'gate:full': 4, 'gate:stop': 1, 'gate:voices': 1, 'light:full': 4, 'light:stop': 2, 'standard:full': 4, 'standard:stop': 2, 'tests:full': 4, 'tests:stop': 2,
|
||||
});
|
||||
expect(gst3562).toEqual(GST3562_967_CASES);
|
||||
expect(gst4140).toEqual(GST4140_967_CASES);
|
||||
expect(sha(sectionTexts(ROOT))).toBe(MAIN_SECTIONS);
|
||||
});
|
||||
});
|
||||
@@ -279,13 +289,16 @@ describe('GST-972 follow-up no-loss check', () => {
|
||||
pin: [['scripts/harness-pins/scripts/lib/paid-plan.ts.json'], ['scripts/lib/paid-plan.ts.json'], {}],
|
||||
};
|
||||
const gst3562: Record<string, number> = {};
|
||||
const gst4140: Record<string, number> = {};
|
||||
const grid = (pick: 0 | 1) => {
|
||||
const rows: { name: string; fullPasses: number; last: string; bits: number; adversarialRan: boolean; class: string; depth: string; step: string; dispatches: { role: string; name: string; effort: string; checklists: string[] }[] }[] = [];
|
||||
for (const [name, c] of Object.entries(cases)) for (const fullPasses of [0, 1, 2]) for (const last of ['none', 'full', 'fix-check'] as const) for (let bits = 0; bits < 16; bits++) for (const adversarialRan of [false, true]) {
|
||||
const history = { fullPasses, last, fixedBlocking: !!(bits & 1), fixedBelow: !!(bits & 2), blockingOpen: !!(bits & 4), touchedGate: !!(bits & 8) };
|
||||
const input = { paths: c[pick], scope: c[2], gateTagged: 0, diffLines: 40, consumed: [], numbers: none, history, adversarialRan } as PlanInput;
|
||||
const { plan: main0408128, kind } = asMainBeforeGst3562(input, planReview(input));
|
||||
const { plan: branch, kind } = asMainBeforeGst3562(input, planReview(input));
|
||||
if (kind) gst3562[`${pick}:${kind}`] = (gst3562[`${pick}:${kind}`] ?? 0) + 1;
|
||||
const { plan: main0408128, kind: added } = asMainBeforeGst4140(input, branch);
|
||||
if (added) gst4140[`${pick}:${added}`] = (gst4140[`${pick}:${added}`] ?? 0) + 1;
|
||||
const p = pick ? asMainBeforeGst3187(input, main0408128).plan : main0408128;
|
||||
rows.push({ name, fullPasses, last, bits, adversarialRan, class: p.class, depth: p.depth, step: p.next.step, dispatches: (pick ? asMainBeforeR51(p).dispatches : p.dispatches).map(d => ({ role: d.role, name: d.name, effort: d.effort, checklists: d.checklists ?? [] })) });
|
||||
}
|
||||
@@ -314,6 +327,7 @@ describe('GST-972 follow-up no-loss check', () => {
|
||||
'review-exclude: code/light -> gate/full': 288, 'default-base: code/light -> gate/full': 288, 'helper+pin: tests/light -> code/light': 288, 'pin: docs/light -> code/light': 288,
|
||||
}]);
|
||||
expect(gst3562).toEqual(GST3562_972_CASES);
|
||||
expect(gst4140).toEqual({ '0:outside': 132, '1:outside': 56 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -412,10 +426,39 @@ describe('planReview', () => {
|
||||
expect(gated.skipped).toContain('state-machines (gated by hit rate)');
|
||||
expect(planReview(base({ diffLines: 20 })).dispatches.filter(d => d.role === 'specialist').map(d => d.name)).toEqual(['batched']);
|
||||
});
|
||||
test('pass 2 reruns the army on the range but not the adversarial or outside voice once Step 11 ran', () => {
|
||||
// Value: protects=R51's second-model read of the final head (GST-4140): code that fixes changed after Step 11 ran is read again
|
||||
// by the outside voice; fails_when=a code or gate full pass 2 or read-only final review drops the outside voice after
|
||||
// --adversarial-ran, the read-only review drops the native adversarial, or a light docs or tests diff without numbers gains one; seam=planReview
|
||||
test('pass 2 reruns the army on the range and the outside voice, but not the native adversarial, once Step 11 ran (GST-4140)', () => {
|
||||
const p = planReview(base({ adversarialRan: true, history: { fullPasses: 1, last: 'full', fixedBlocking: true } }));
|
||||
expect(p.next.step).toBe('full');
|
||||
expect(roles(p).some(r => r.startsWith('outside-voice') || r.startsWith('adversarial'))).toBe(false);
|
||||
expect([p.next.step, p.stepDepth, p.class]).toEqual(['full', 'standard', 'code']);
|
||||
expect(roles(p).filter(r => r.startsWith('outside-voice') || r.startsWith('adversarial'))).toEqual(['outside-voice:outside-voice:host']);
|
||||
expect(p.skipped).toContain('adversarial-native (run once per invocation)');
|
||||
expect(p.skipped.some(s => s.includes('outside-voice'))).toBe(false);
|
||||
});
|
||||
test('a gate-class pass 2 lists the outside voice again after Step 11 ran (GST-4140)', () => {
|
||||
const p = planReview(base({ gateTagged: 1, adversarialRan: true, history: { fullPasses: 1, last: 'full', fixedBelow: true } }));
|
||||
expect([p.next.step, p.class]).toEqual(['full', 'gate']);
|
||||
expect(roles(p)).toContain('outside-voice:outside-voice:host');
|
||||
});
|
||||
test('the read-only final review of a code or gate diff lists both voices again after Step 11 ran (GST-4140)', () => {
|
||||
for (const o of [{}, { gateTagged: 1 }]) {
|
||||
const p = planReview(base({ ...o, adversarialRan: true, history: { fullPasses: 2, last: 'full', fixedBlocking: true } }));
|
||||
expect([p.next.step, p.next.readOnly]).toEqual(['full', true]);
|
||||
expect(roles(p)).toEqual(expect.arrayContaining(['adversarial-native:adversarial:full', 'outside-voice:outside-voice:host']));
|
||||
expect(p.skipped.some(s => s.includes('run once per invocation'))).toBe(false);
|
||||
}
|
||||
const priorFull = planReview(base({ gateTagged: 1, adversarialRan: true, history: { fullPasses: 0, last: 'none', priorFull: 2 } }));
|
||||
expect([priorFull.next.readOnly, roles(priorFull)]).toEqual([true, expect.arrayContaining(['adversarial-native:adversarial:full', 'outside-voice:outside-voice:host'])]);
|
||||
});
|
||||
test('a pass 2 whose fix range changes no runtime lines keeps the earlier outside read; light docs and tests diffs without numbers never gain one (GST-4140)', () => {
|
||||
const quiet = planReview(base({ adversarialRan: true, history: { fullPasses: 1, last: 'full', fixedBlocking: true, touchedGate: true, rangeRuntimeLines: 0 } }));
|
||||
expect([quiet.next.step, roles(quiet).some(r => r.startsWith('outside-voice'))]).toEqual(['full', false]);
|
||||
expect(quiet.skipped).toContain('outside-voice (run once per invocation: the fix range changes no runtime lines)');
|
||||
for (const paths of [['docs/a.md'], ['test/a.test.ts']]) for (const history of [{ fullPasses: 1, last: 'full', fixedBelow: true }, { fullPasses: 2, last: 'full', fixedBlocking: true }] as const) {
|
||||
const p = planReview(base({ paths, scope: {}, diffLines: 30, adversarialRan: true, history }));
|
||||
expect([paths, history.fullPasses, roles(p).some(r => r.startsWith('outside-voice'))]).toEqual([paths, history.fullPasses, false]);
|
||||
}
|
||||
});
|
||||
test('a repeat that became code class keeps the adversarial pass Step 11 has not run yet', () => {
|
||||
const p = planReview(base({ history: { fullPasses: 1, last: 'full', fixedBlocking: true } }));
|
||||
@@ -644,7 +687,7 @@ describe('D6 retired: round 2 after a small blocking fix is a full pass, never a
|
||||
test('the #19 shape plans a full pass with the full-effort Red Team and the native adversarial again, never a fix-check', () => {
|
||||
const p = planReview(n19());
|
||||
expect(p.next).toMatchObject({ step: 'full', keepReader: true, rangeReaders: true, reason: expect.stringContaining('24 runtime lines in the fix range: full pass on the range, never a scoped pass') });
|
||||
expect(roles(p)).toEqual(['specialist:batched:medium', 'red-team:red-team:full', 'adversarial-native:adversarial:full']);
|
||||
expect(roles(p)).toEqual(['specialist:batched:medium', 'red-team:red-team:full', 'adversarial-native:adversarial:full', 'outside-voice:outside-voice:host']);
|
||||
expect(fixCheck(p)).toBe(false);
|
||||
expect(p.dispatches.some(d => d.role === 'red-team' && d.effort === 'full' && d.exclude.length === 0)).toBe(true);
|
||||
});
|
||||
@@ -667,7 +710,7 @@ describe('D6 retired: round 2 after a small blocking fix is a full pass, never a
|
||||
test('a force-included specialist and changed published numbers keep their reviewers', () => {
|
||||
expect(batch(planReview(n19({ force: ['security'] })))).toContain('security');
|
||||
const numbers = scanNumbers({ 'docs/bench.md': ['3x faster'] });
|
||||
expect(roles(planReview(n19({ numbers, reviewedNumbers: 'old' })))).toContain('outside-voice:outside-voice (numbers changed):host');
|
||||
expect(roles(planReview(n19({ numbers, reviewedNumbers: 'old' })))).toContain('outside-voice:outside-voice:host');
|
||||
expect(roles(planReview(n19({ numbers, reviewedNumbers: numbers.fingerprint })))).not.toContain('outside-voice:outside-voice (numbers changed):host');
|
||||
});
|
||||
// Value: protects=main's scoped pass dispatched a forced specialist on its own with no exclusion, so a forced checklist keeps reading the docs and outputs the batched reader would exclude; fails_when=a docs-only blocking fix with --force security plans a batched security reader that excludes the docs it should read;
|
||||
@@ -692,7 +735,7 @@ describe('D6 retired: round 2 after a small blocking fix is a full pass, never a
|
||||
test('a light diff with a fixed blocker gets the full pass at standard: the raise adds the Red Team', () => {
|
||||
const p = planReview(mixed({ perPath: per({ 'src/app.ts': 30 }), history: fixed(12), adversarialRan: true }));
|
||||
expect([p.next.step, p.stepDepth, fixCheck(p)]).toEqual(['full', 'standard', false]);
|
||||
expect(roles(p)).toEqual(['specialist:batched:medium', 'red-team:red-team:full', 'adversarial-native:adversarial:full']);
|
||||
expect(roles(p)).toEqual(['specialist:batched:medium', 'red-team:red-team:full', 'adversarial-native:adversarial:full', 'outside-voice:outside-voice:host']);
|
||||
});
|
||||
test('the full round 2 counts toward the cap: a fix after it gets the read-only full review, a blocker it leaves stops for the owner, and an old scoped row still counts as a round', () => {
|
||||
expect(nextStep(fixed(10, { fullPasses: FULL_PASS_CAP }), 'standard')).toMatchObject({ step: 'full', reason: expect.stringContaining('read-only final review (R51)') });
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('Capy pass program (fake host, real bins)', () => {
|
||||
expect(h.creates.find(c => c.title === 'ship x7p1 adversarial-native')!.model).toEqual(models['adversarial-native']);
|
||||
}, 240_000);
|
||||
|
||||
// Value: protects=Step 11's outside voice is never the native voice's or the lane's model family; fails_when=the STOP checks only that some model was given (lib/capy-review-pass.js before GSTA-167 PR B), so a Claude outside voice beside a Claude native voice runs as "outside";
|
||||
// Value: protects=Step 11's outside voice is never the native voice's or the lane's model family; fails_when=the STOP checks only that some model was given (lib/capy-review-pass.js before GSTA-167 PR B), so a Claude outside voice beside a Claude native voice runs as "outside", or an alias prefix collect reads as the same family (particle/ is deepseek) runs and is then refused at collect (Step 11 outside-voice#3 on #4886);
|
||||
// why_new=GSTA-167 plan R2 (autoplan-20261031135232); seam=none; no_claim=which family pairs find more
|
||||
test('a same-family explicit outside voice STOPs before either voice is created', async () => {
|
||||
const { dir, env } = repo();
|
||||
@@ -87,6 +87,8 @@ describe('Capy pass program (fake host, real bins)', () => {
|
||||
.toContain("STOP: the outside voice anthropic/claude-sonnet-5-5 is the anthropic family, the same as the lane model; Step 11 needs input.models['outside-voice'] from another family");
|
||||
expect(await runPass(h, { ...base, stage: 'voices', models: { 'outside-voice': { model_id: 'openai/gpt-6.2-sol', reasoning_mode: 'medium' }, 'adversarial-native': { model_id: 'openai/gpt-6-astra', reasoning_mode: 'high' } } }))
|
||||
.toContain('STOP: the outside voice openai/gpt-6.2-sol is the openai family, the same as the native voice');
|
||||
expect(await runPass(h, { ...base, stage: 'voices', laneModel: 'deepseek/deepseek-v4-pro', models: { 'outside-voice': { model_id: 'particle/particle-1' }, 'adversarial-native': { model_id: 'deepseek/deepseek-v4-pro' } } }))
|
||||
.toContain('STOP: the outside voice particle/particle-1 is the deepseek family, the same as the native voice');
|
||||
expect(h.creates.some(c => /^ship x14p1 (adversarial-native|outside-voice)$/.test(c.title))).toBe(false);
|
||||
}, 240_000);
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ describe('round 2 after a small blocker fix is a full pass in the manifest (GST-
|
||||
test('after Step 11 ran (--adversarial-ran), the driver\'s --diff-base RANGE_BASE stages every reader on the fix range, the native adversarial included', () => {
|
||||
const s = round2(['--adversarial-ran'], 'range');
|
||||
expect(s.m.diff_base).toBe(s.rangeBase);
|
||||
expect(s.m.readers.map(r => [r.reader, r.diff_base ?? null])).toEqual([['specialist-batched', null], ['red-team', null], ['adversarial-native', null], ['audit/plan', null]]);
|
||||
expect(s.m.readers.map(r => [r.reader, r.diff_base ?? null])).toEqual([['specialist-batched', null], ['red-team', null], ['adversarial-native', null], ['outside-voice', null], ['audit/plan', null]]);
|
||||
}, 120_000);
|
||||
|
||||
// Value: protects=an explicit --diff-base reaches every reader, the Red Team included; fails_when=a round 2 asked to read the whole branch still stages its Red Team on the fix range; why_new=GST-738 (outside voice); seam=none; no_claim=none
|
||||
|
||||
@@ -151,7 +151,7 @@ describe('gstack-review-plan', () => {
|
||||
expect(spawnSync(BIN, [], { encoding: 'utf8', timeout: 10_000 }).status).toBe(2);
|
||||
expect(run(repo({ 'a.md': 'x' }), ['--last', 'later']).status).toBe(2);
|
||||
});
|
||||
test('scratch under .gstack/tmp/ is ignored, a subdirectory run plans the whole repository, and --adversarial-ran drops the repeat adversarial pass', () => {
|
||||
test('scratch under .gstack/tmp/ is ignored, a subdirectory run plans the whole repository, and --adversarial-ran drops the repeat adversarial pass but keeps the outside voice on code (GST-4140)', () => {
|
||||
const r = repo({ 'docs/a.md': '# a\n' });
|
||||
fs.mkdirSync(path.join(r.dir, '.gstack', 'tmp'), { recursive: true });
|
||||
fs.writeFileSync(path.join(r.dir, '.gstack', 'tmp', 'fix-check-list.ts'), 'export const x = 1;\n');
|
||||
@@ -165,7 +165,8 @@ describe('gstack-review-plan', () => {
|
||||
expect(run(code, repeat).stdout).toContain('DISPATCH: adversarial-native adversarial effort=full');
|
||||
const ran = run(code, [...repeat, '--adversarial-ran']).stdout;
|
||||
expect(ran).not.toContain('DISPATCH: adversarial-native');
|
||||
expect(ran).toContain('SKIP: adversarial-native and outside-voice (run once per invocation)');
|
||||
expect(ran).toContain('SKIP: adversarial-native (run once per invocation)');
|
||||
expect(ran).toContain('DISPATCH: outside-voice outside-voice effort=host');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -228,10 +229,11 @@ describe('gstack-review-plan: the full round 2 on a small fix range (GSTA-152 D6
|
||||
}
|
||||
const pass2 = ['--pass', '1', '--last', 'full', '--fixed-blocking', '--adversarial-ran', '--pass1-depth', 'standard'];
|
||||
const full1 = ['--pass', '1', '--last', 'full', '--fixed-blocking', '--adversarial-ran', '--pass1-depth', 'full'];
|
||||
test('--range-base with a small fix range plans a full pass 2 with the batched specialist, the Red Team and the native adversarial, and no fix-check', () => {
|
||||
test('--range-base with a small fix range plans a full pass 2 with the batched specialist, the Red Team, the native adversarial and the outside voice, and no fix-check', () => {
|
||||
const { r, rangeBase } = fixed(24);
|
||||
const out = run(r, [...pass2, '--range-base', rangeBase]).stdout;
|
||||
expect(out).toMatch(/^REVIEW_PLAN: class=code pass=2 next=full dispatches=3 /m);
|
||||
expect(out).toMatch(/^REVIEW_PLAN: class=code pass=2 next=full dispatches=4 /m);
|
||||
expect(out).toContain('DISPATCH: outside-voice outside-voice effort=host');
|
||||
expect(out).toContain(`FIX_RANGE: runtime_lines=24 base=${rangeBase}`);
|
||||
expect(out).toMatch(/^NEXT: full \(a blocking finding was fixed on a light diff with 24 runtime lines in the fix range: full pass on the range, never a scoped pass, so every reader is in the pass record \(GST-3562\)\)$/m);
|
||||
expect(out).not.toContain('DISPATCH: fix-check');
|
||||
|
||||
@@ -15,6 +15,7 @@ import { depthOfCommitInput, isGatePath, planReview, ROLE_EFFORT, scanNumbers }
|
||||
import { matchRisk, secretPath } from '../lib/review-risk';
|
||||
import { targetedClasses } from '../lib/review-targeted';
|
||||
import { asMainBeforeGst3562 } from './helpers/gst3562-replay';
|
||||
import { asMainBeforeGst4140 } from './helpers/gst4140-replay';
|
||||
|
||||
const GODOT_TOKENS = ['class_name UIToken', 'extends RefCounted', 'const COLOR_PRIMARY := Color("#ff6a00")', 'const SPACING_MD := 12', 'const LABEL_PLAY := "Play"'];
|
||||
const BENIGN: Record<string, string[]> = {
|
||||
@@ -158,6 +159,7 @@ describe('GST-1350 no-loss check', () => {
|
||||
'tokens-db': ['cache/tokens.db', 'cache/tokens.db', []],
|
||||
};
|
||||
const gst3562: Record<string, number> = {};
|
||||
const gst4140: Record<string, number> = {};
|
||||
type Row = { name: string; fullPasses: number; last: string; bits: number; adversarialRan: boolean; targeted: string[]; class: string; depth: string; step: string; dispatches: { role: string; name: string; effort: string; checklists: string[] }[] };
|
||||
const grid = (pick: 0 | 1) => {
|
||||
const rows: Row[] = [];
|
||||
@@ -170,7 +172,9 @@ describe('GST-1350 no-loss check', () => {
|
||||
const input = { paths, added, removed: {}, scope: {}, gateTagged: 0, diffLines: 40, consumed: [], numbers: none, history, adversarialRan, targeted: { classes: t } };
|
||||
const replay = asMainBeforeGst3562(input, planReview(input));
|
||||
if (replay.kind) gst3562[`${pick}:${replay.kind}`] = (gst3562[`${pick}:${replay.kind}`] ?? 0) + 1;
|
||||
let p = replay.plan;
|
||||
const back = asMainBeforeGst4140(input, replay.plan);
|
||||
if (back.kind) gst4140[`${pick}:${back.kind}`] = (gst4140[`${pick}:${back.kind}`] ?? 0) + 1;
|
||||
let p = back.plan;
|
||||
if (pick && last === 'full' && bits === 8) {
|
||||
expect(['full', 'stop', 'voices']).toContain(p.next.step);
|
||||
p = planReview({ ...input, history: { ...history, touchedGate: false } });
|
||||
@@ -209,5 +213,6 @@ describe('GST-1350 no-loss check', () => {
|
||||
'token-json: gate/full -> gate/full': 288, 'tokens-db: gate/full -> gate/full': 288,
|
||||
}]);
|
||||
expect(gst3562).toEqual(GST3562_1350_CASES);
|
||||
expect(gst4140).toEqual({ '0:outside': 398, '1:outside': 388 });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user