fix(flaky): repair the five paid gate detectors and the judged review/plan-review prose (GSTA-128)

Daily flaky pass over the 2026-10-27 Open ledger entries, paid cases first.

- ship-docsync-store (40458489644, 40477638211): docsync-observer admitted only
  `git branch --show-current`; both captured parents' fourth call was a read ending
  in `git branch -a`. Operand-free branch listings are now part of the read grammar.
- ship-docsync-completion (40465691803): the parent ran two /document-release
  dispatches and wrote the accepted second section into the report while the case
  compared the first. The contract now follows the last foreground dispatch.
- ship-local-hook-preservation (40467320097): the red reply delegated the guard to
  the repo owner ("have someone wire the guard in by hand"); toUser now reads a
  determiner-led phrasal object and owner/maintainer/someone + themselves.
- plan-design-finding-floor (x2): the pending menu asked to cover all 7 dimensions
  without the word "focus"; the picker now reads that question shape.
- Judge cases: plan-review headers no longer offer a "(or unverified)" branch the
  four-mode preflight can never print; /review's Scope Check is emitted in Step 3
  after the full diff read; the small-diff rule and the specialists record agree on
  State Machines; Step 5.8.2 names which post-fix rerun rule governs. Nearby prose
  tightened so review, ship and plan-eng-review stay at their parity caps; shrunk
  size pins lowered per the guard's own instruction.

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-27 14:11:17 +00:00
1 parent 3e4240a76f
commit 79ac33c96e
29 files changed
+1176 -143

No files matched your search

+30
View File
@@ -564,3 +564,33 @@ test('Step 14.5 housekeeping commands and the docs record are declared exactly a
expect(gate.stdout.trim()).toBe('DOCS_CAP: none declared');
expect(gate.status).toBe(0);
});
// Gates 40458489644 and 40477638211 (ship-docsync-store, both red on the fourth call, both green on the in-run rerun): each
// parent oriented with one line of reads that ended in `git branch -a`, and the grammar admitted only `branch --show-current`.
// A branch listing reads refs, so every operand-free listing form is a Git read; an operand or any other option still writes.
test.skipIf(process.platform === 'win32')('the captured store orientations with git branch -a replay clean, and branch writes stay refused', () => {
const store = fixtureDocs('store');
try {
const captured = JSON.parse(fs.readFileSync(path.join(import.meta.dir, 'fixtures/docsync-branch-listing-public.json'), 'utf8')) as
{ runs: Array<{ sourceRun: string; calls: SkillTestResult['toolCalls'] }> };
const publish = path.join(store.home, 'fixture-publish.ts');
const fill = (text: string) => text.replaceAll('{home}', store.home).replaceAll('{shard}', path.dirname(path.dirname(store.home)));
expect(captured.runs).toHaveLength(2);
for (const run of captured.runs) {
const replayed = run.calls.map(call => ({ ...call, input: Object.fromEntries(Object.entries(call.input).map(([key, value]) =>
[key, typeof value === 'string' ? fill(value) : value])), output: fill(call.output) }));
const orientation = replayed.find(call => /;\s*git branch -a(?:;|$)/.test(String(call.input?.command ?? '')));
expect(orientation, run.sourceRun).toBeDefined();
expect(docsToolFailures({ toolCalls: replayed, exitReason: 'success' } as SkillTestResult, store, [publish], true), run.sourceRun).toEqual([]);
const narrowed = String(orientation!.input.command).replace(/git branch -a/, 'git branch --show-current');
expect(docsCommandAllowed(narrowed, store, [publish])).toBe(true);
}
for (const listing of ['git branch', 'git branch -a', 'git branch -avv', 'git branch -r', 'git branch --list', 'git branch --all --no-color', 'git status; git branch -a; git log --oneline -3'])
expect(docsCommandAllowed(listing, store, [publish]), listing).toBe(true);
for (const write of ['git branch feature', 'git branch -d feature', 'git branch -D feature', 'git branch -m old new', 'git branch -M main', 'git branch -f main HEAD~1',
'git branch --set-upstream-to=origin/main', 'git branch -u origin/main', 'git branch -c a b', 'git branch --edit-description', 'git branch --list "feat*"',
'git branch --contains HEAD', 'git branch -ad feature', 'git branch -a; rm -rf handbook'])
expect(docsCommandAllowed(write, store, [publish]), write).toBe(false);
expect(docsNativeInterface(store, [publish], false, true)).toContain('branch listings with no operand (--show-current, -a, -r, -v, --list)');
} finally { store.clean(); }
});