feat(sdk): emit CASE_MISMATCH reason for non-canonical pass casing (#3184)
Cycle 10 of ~15: a captured 'result:' value that lowercases to 'pass' but isn't literally 'pass' now produces a CASE_MISMATCH reason rather than a generic NON_PASS_RESULT — so operators can distinguish a real non-pass from a likely typo.
This commit is contained in:
@@ -272,4 +272,34 @@ expected: thing
|
||||
await rm(localTmp, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it("emits CASE_MISMATCH reason when result value is \"PASS\" (uppercase variant of pass)", async () => {
|
||||
const localTmp = await mkdtemp(join(tmpdir(), 'gsd-uat-c10-'));
|
||||
try {
|
||||
const phaseDir = join(localTmp, '.planning', 'phases', '05-case-mismatch');
|
||||
await mkdir(phaseDir, { recursive: true });
|
||||
const content = `---
|
||||
status: complete
|
||||
phase: 5
|
||||
source: roadmap
|
||||
started: 2026-05-18T00:00:00Z
|
||||
updated: 2026-05-18T00:00:00Z
|
||||
---
|
||||
|
||||
### 1. Uppercase pass item
|
||||
expected: thing happens
|
||||
result: PASS
|
||||
`;
|
||||
await writeFile(join(phaseDir, '05-HUMAN-UAT.md'), content);
|
||||
|
||||
const result = await isPhaseUatPassed(localTmp, '5');
|
||||
expect(result.passed).toBe(false);
|
||||
expect(result.items.length).toBe(1);
|
||||
expect(result.reasons.length).toBe(1);
|
||||
expect(result.reasons[0].code).toBe(REASON_CODE.CASE_MISMATCH);
|
||||
expect(result.reasons[0].capturedValue).toBe('PASS');
|
||||
} finally {
|
||||
await rm(localTmp, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user