feat: codex-quality fallback robustness (partial-failure recovery, fuzz tracking, atomic writes)#8
Merged
Merged
Conversation
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/index.ts">
<violation number="1" location="src/index.ts:689">
P2: Failure output is always labeled as a partial failure, so full failures receive misleading recovery instructions.</violation>
<violation number="2" location="src/index.ts:761">
P1: `hasPartialSuccess` is computed from summaries, which can miss side effects from a failed move hunk after the destination write succeeds.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Comment on lines
+689
to
+695
| return [ | ||
| "apply_patch partially failed.", | ||
| `Failed: ${failedFiles.join(", ")}`, | ||
| `Recovery: MUST read ${failedFiles.join(" and ")} before retrying.`, | ||
| "Earlier file actions in this patch were already applied.", | ||
| "Recovery: MUST NOT reread other files from this patch unless a specific dependency requires it.", | ||
| ].join("\n"); |
There was a problem hiding this comment.
P2: Failure output is always labeled as a partial failure, so full failures receive misleading recovery instructions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/index.ts, line 689:
<comment>Failure output is always labeled as a partial failure, so full failures receive misleading recovery instructions.</comment>
<file context>
@@ -559,64 +654,122 @@ function replaceChunks(content: string, filePath: string, chunks: PatchChunk[]):
+ if (failedFiles.length === 0) {
+ return result.summaries.join("\n");
+ }
+ return [
+ "apply_patch partially failed.",
+ `Failed: ${failedFiles.join(", ")}`,
</file context>
Suggested change
| return [ | |
| "apply_patch partially failed.", | |
| `Failed: ${failedFiles.join(", ")}`, | |
| `Recovery: MUST read ${failedFiles.join(" and ")} before retrying.`, | |
| "Earlier file actions in this patch were already applied.", | |
| "Recovery: MUST NOT reread other files from this patch unless a specific dependency requires it.", | |
| ].join("\n"); | |
| if (!result.hasPartialSuccess) { | |
| return ["apply_patch failed.", `Failed: ${failedFiles.join(", ")}`].join("\n"); | |
| } | |
| return [ | |
| "apply_patch partially failed.", | |
| `Failed: ${failedFiles.join(", ")}`, | |
| `Recovery: MUST read ${failedFiles.join(" and ")} before retrying.`, | |
| "Earlier file actions in this patch were already applied.", | |
| "Recovery: MUST NOT reread other files from this patch unless a specific dependency requires it.", | |
| ].join("\n"); |
5c7f91f to
8615655
Compare
…ryInstructions types and ApplyPatchError class
…lure recovery message
8615655 to
fe29036
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Atomic TDD commits implementing runtime robustness in split steps:
Backward compatibility
applyPatch(cwd, patchText): Promise<string[]>signature unchangedapplyPatchretains fail-fast semantics: first hunk failure aborts processing, no later hunks attemptedapplyPatchDetailed(cwd, patchText): Promise<ApplyPatchResult>is additive and used for accumulation/recoveryCommits
Tests