Skip to content

Commit d7e5d0e

Browse files
committed
fix(parity): guard empty --langs, capture headBefore/headAfter in step 4.6
- Guard against --langs with no value: an empty langsFilter array is truthy so filtering produces zero fixtures and exits 0 — a false pass. Now exits 2 with an explicit error message. - Add headBefore capture to step 4.6b and headAfter capture to step 4.6e so the commit-audit command in 4.6e has concrete variables to expand.
1 parent 14f5232 commit d7e5d0e

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.claude/skills/titan-run/SKILL.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,10 @@ test -f .claude/skills/parity/SKILL.md && echo "PARITY SKILL FOUND" || echo "NO
763763
764764
Record `phaseTimestamps.parity.startedAt`.
765765
766+
```bash
767+
headBefore=$(git rev-parse HEAD)
768+
```
769+
766770
### 4.6c. Run Pre-Agent Gate (G1-G4)
767771
768772
### 4.6d. Dispatch sub-agent
@@ -780,8 +784,13 @@ Agent → "Run /parity. Read .claude/skills/parity/SKILL.md and follow it exactl
780784
### 4.6e. Post-phase validation
781785
782786
After the agent returns:
787+
788+
```bash
789+
headAfter=$(git rev-parse HEAD)
790+
```
791+
783792
- `git status --short` → the working tree must be clean. The sub-agent commits its fixes; uncommitted changes mean it stopped mid-fix → **stop** and report.
784-
- If the agent fixed divergences, run V16-style commit audit: `git log --oneline <headBefore>..<headAfter>` and print the parity-fix commits.
793+
- If the agent fixed divergences, run V16-style commit audit: `git log --oneline $headBefore..$headAfter` and print the parity-fix commits.
785794
- If the agent reports divergences introduced by THIS run that it could not fix → **stop**: "PARITY failed — this run introduced implementation drift. Fix before CLOSE or revert the offending commits." Pre-existing divergences filed as issues are not blockers; print the issue URLs.
786795
787796
Print: `"PARITY complete: <clean | N divergences fixed | N pre-existing filed as issues>"`

scripts/parity-compare.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ const allFixtures = readdirSync(fixturesRoot)
110110

111111
let fixtures = allFixtures;
112112
if (langsFilter) {
113+
if (langsFilter.length === 0) {
114+
console.error('parity-compare: --langs requires at least one fixture name.');
115+
process.exit(2);
116+
}
113117
const unknown = langsFilter.filter((l) => !allFixtures.includes(l));
114118
if (unknown.length > 0) {
115119
console.error(

0 commit comments

Comments
 (0)