fix(3323): keep human-needed verification pending (#3339)

* fix: keep human-needed verification pending

* chore: add changeset for human verification gating

* docs: align ship verification status wording
This commit is contained in:
Tom Boucher
2026-05-09 23:28:25 -04:00
committed by GitHub
parent d49e8872b5
commit dc003610e2
7 changed files with 111 additions and 16 deletions

View File

@@ -74,4 +74,38 @@ describe('checkShipReady', () => {
// Per spec: gh_authenticated is advisory — skip actual auth check to avoid slow network call
expect(d.gh_authenticated).toBe(false);
});
it('blocks shipping when VERIFICATION.md is missing', async () => {
await mkdir(join(projectDir, '.planning', 'phases', '01-foundation'), { recursive: true });
const { data } = await checkShipReady(['1'], projectDir);
const d = data as Record<string, unknown>;
expect(d.verification_passed).toBe(false);
expect(d.ready).toBe(false);
expect(d.blockers).toContain('verification status is not passed');
});
it('blocks shipping when verification status is human_needed', async () => {
const phaseDir = join(projectDir, '.planning', 'phases', '02-core');
await mkdir(phaseDir, { recursive: true });
await writeFile(
join(phaseDir, 'VERIFICATION.md'),
[
'---',
'status: human_needed',
'---',
'',
'# Verification',
].join('\n'),
'utf-8',
);
const { data } = await checkShipReady(['2'], projectDir);
const d = data as Record<string, unknown>;
expect(d.verification_passed).toBe(false);
expect(d.ready).toBe(false);
expect(d.blockers).toContain('verification status is not passed');
});
});

View File

@@ -73,13 +73,14 @@ export const checkShipReady: QueryHandler = async (args, projectDir) => {
try {
const verRes = await checkVerificationStatus([raw], projectDir);
const vdata = verRes.data as Record<string, unknown>;
verification_passed = vdata.status !== 'fail';
const status = String(vdata.status ?? '').toLowerCase();
verification_passed = status === 'pass' || status === 'passed';
} catch {
verification_passed = false;
}
// Collect blockers
if (!verification_passed) blockers.push('verification status is fail or missing');
if (!verification_passed) blockers.push('verification status is not passed');
if (!clean_tree) blockers.push('working tree is not clean (uncommitted changes)');
if (!on_feature_branch) blockers.push('not on a feature branch (currently on main/master or unknown)');
if (!remote_configured) blockers.push('no git remote configured');