Repository navigation
[AI] Issue #116: [FEATURE] Run progression checkpoints for interruption recovery - #117
Conversation
🔍 Automated Code Review✅ Summary
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f167cfb67c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const changedFiles = [ | ||
| ...new Set([...rawDiff.matchAll(/^diff --git a\/(.*?) b\//gm)].map((m) => m[1])), | ||
| ...new Set([ | ||
| ...rawDiff.matchAll(/^diff --git a/(.*?) b\//gm) |
There was a problem hiding this comment.
Escape slash in diff regex literal
This regex is malformed (/^diff --git a/(.*?) b\//gm), so Node cannot parse auto_fix_pr.mjs and the script fails before any auto-fix logic runs. In practice, every run of the Apply AI fixes step will crash at startup until the / in a/ is escaped (as it was previously).
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| log('Auto-fix complete', { prNumber, attempt: nextAttempt, paths: outputPaths.join(', ') }); | ||
| // Rest of the code remains the same... |
There was a problem hiding this comment.
Restore the removed post-LLM auto-fix flow
After parsing the model response, the script now only writes checkpoint.json and ends, so it no longer validates/writes changes, applies attempt labels, or exports fixed_paths/attempt_number to GITHUB_OUTPUT. Because .github/workflows/auto-fix-pr.yml gates commit/push on steps.fix.outputs.fixed_paths, this turns successful runs into no-ops even when the model returns valid fixes.
Useful? React with 👍 / 👎.
- Add ESM import for `node:crypto` (replaces broken `require('crypto')`)
- Restore AI output type validation after parseJsonResponse
- Restore validateAiOutput + writeGeneratedFiles calls
- Restore attempt label creation and application to the PR
- Restore GITHUB_OUTPUT writing (fixed_paths, attempt_number, summary)
- Restore auto-fix completion log
- Fix broken regex (escape `/` in diff --git pattern)
- Fix broken template literal in fileContentParts (escape backticks)
Keeps the checkpoint.json write introduced for interruption recovery.
https://claude.ai/code/session_01H4qhujiFDxW9dguAjheDy4
Prevents overwriting a previous checkpoint from an earlier interrupted run. https://claude.ai/code/session_01H4qhujiFDxW9dguAjheDy4
Prevents feedback loop where the auto-fixer rewrites its own source, causing truncated JSON output and cascading regressions. https://claude.ai/code/session_01H4qhujiFDxW9dguAjheDy4
🤖 Auto-Fix SkippedThis PR modifies |
- Per-attempt checkpoint file (checkpoint-attempt-N.json) avoids conflicts - Atomic writes via writeFile+rename to prevent corrupt state on crash - Three stages: ai-complete (summary + changes count), files-written (output paths), complete (full context) - Resume check at startup: skips the run if attempt N already completed with matching inputHash (idempotent on workflow re-run) https://claude.ai/code/session_01H4qhujiFDxW9dguAjheDy4
…ation guard - contracts.md: document new exit code 0 cases, self-modification guard behavior, checkpoint stages, and checkpoint file schema - runbook.md: add symptom rows for self-modification skip and checkpoint resume; add recovery actions for stale checkpoints https://claude.ai/code/session_01H4qhujiFDxW9dguAjheDy4
AI Generated Change
Add checkpointing to scripts/auto_fix_pr.mjs for interruption recovery
Closes #116