ralph-prd 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/package.json +1 -1
- package/ralph/ralph-claude.mjs +34 -1
package/README.md
CHANGED
|
@@ -181,6 +181,10 @@ Ralph validates the plan structure before execution and checks off criteria as p
|
|
|
181
181
|
- **macOS notifications** — get notified when phases complete or fail
|
|
182
182
|
- **Safety** — optional `blocked-commands.txt` and `blocked-paths.txt` restrict what Claude can do
|
|
183
183
|
|
|
184
|
+
## Acknowledgments
|
|
185
|
+
|
|
186
|
+
Three of the skills in this repo — [`/grill-me`](https://skills.sh/mattpocock/skills/grill-me), [`/write-a-prd`](https://skills.sh/mattpocock/skills/write-a-prd), and [`/prd-to-plan`](https://skills.sh/mattpocock/skills/prd-to-plan) — are based on [Matt Pocock](https://github.com/mattpocock)'s work. Matt generously gave his blessing to include them here. If you find these useful, go check out his cohort and give him a star.
|
|
187
|
+
|
|
184
188
|
## License
|
|
185
189
|
|
|
186
190
|
MIT
|
package/package.json
CHANGED
package/ralph/ralph-claude.mjs
CHANGED
|
@@ -572,7 +572,40 @@ async function main() {
|
|
|
572
572
|
if (resumeAfter === 'commit') {
|
|
573
573
|
console.log(` [${ts()}] commit… skipped (checkpoint)`);
|
|
574
574
|
} else if (!iDidThis) {
|
|
575
|
-
|
|
575
|
+
// Claude was asked to self-commit during implementation.
|
|
576
|
+
// Verify it actually happened — if uncommitted changes remain, fall back
|
|
577
|
+
// to the structured commit step so work is never silently lost.
|
|
578
|
+
const uncommitted = await scanChangedRepos(repos);
|
|
579
|
+
if (uncommitted.length === 0) {
|
|
580
|
+
console.log(` [${ts()}] commit… done by Claude`);
|
|
581
|
+
} else {
|
|
582
|
+
console.log(` [${ts()}] commit… Claude did not commit, falling back to structured commit`);
|
|
583
|
+
try {
|
|
584
|
+
const { nextTaskNum, anyCommitted } = await runCommitStep({
|
|
585
|
+
phase,
|
|
586
|
+
repos,
|
|
587
|
+
safetyHeader,
|
|
588
|
+
logWriter,
|
|
589
|
+
phaseNum,
|
|
590
|
+
taskNum,
|
|
591
|
+
send,
|
|
592
|
+
});
|
|
593
|
+
taskNum = nextTaskNum;
|
|
594
|
+
if (anyCommitted) {
|
|
595
|
+
console.log(` [${ts()}] fallback commit… ok`);
|
|
596
|
+
} else {
|
|
597
|
+
console.log(` [${ts()}] fallback commit… skipped (no changes)`);
|
|
598
|
+
}
|
|
599
|
+
} catch (err) {
|
|
600
|
+
const msg = err instanceof CommitError
|
|
601
|
+
? `Phase "${err.phaseName}" fallback commit failed: ${err.message}`
|
|
602
|
+
: `Unexpected error during fallback commit: ${err.message}`;
|
|
603
|
+
console.error(`\n${msg}`);
|
|
604
|
+
console.error(`Logs: ${logsDir}`);
|
|
605
|
+
notify('Ralph — failed', msg);
|
|
606
|
+
process.exit(1);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
576
609
|
} else {
|
|
577
610
|
if (waitForIt) {
|
|
578
611
|
await waitForUser(`\n [wait-for-it] Phase ${phaseNum} ready to commit. Press Enter to proceed… `);
|