Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/gentle-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7095,7 +7095,7 @@ function nativeOperationFailure(operation: ReviewControllerOperation | "gentle_r
const preservesNativeTargetStatusDiagnostic = nativeDiagnostics?.operation === NATIVE_REVIEW_OPERATION.STATUS;
const preservesAnswerConsentStartDiagnostic = operation === REVIEW_CONTROLLER_OPERATION.ANSWER_CONSENT && nativeDiagnostics?.operation === NATIVE_REVIEW_OPERATION.START;
const diagnostics = operation === REVIEW_CONTROLLER_OPERATION.START && error instanceof CandidateViewError && value.candidateViewPreNative === true
? error.diagnostics ?? { code: error.reason, message: "candidate view rejected before native START" }
? error.diagnostics ?? { code: error.reason, message: error.message }
: error instanceof CandidateViewError
? { code: error.reason, message: error.message }
: nativeDiagnostics?.operation === `review/${operation}` || preservesNativeTargetStatusDiagnostic || preservesAnswerConsentStartDiagnostic
Expand Down
28 changes: 28 additions & 0 deletions odd/tasks/fix-2376-candidate-owner-preparation-errno-diagnostic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Task Breakdown: Fix #2376 Candidate Owner Preparation Errno Diagnostic

**Feature:** `fix-2376-candidate-owner-preparation-errno-diagnostic`
**Issue:** #2376 (`gentle_review START: candidate-owner-preparation-failed drops the errno, leaving the failure undiagnosable`)
**Strategy:** Strict TDD, ODD workflow, Conventional Commits

---

## Tasks

### 1. Test (RED): Unit test for candidate owner preparation errno diagnostic
- [x] In `tests/gentle-ai.test.ts`:
- Update `ordinary START reports candidate-owner preparation failure as pre-native no mutation` to throw `new CandidateViewError("candidate view owner preparation failed (EACCES)", "candidate-owner-preparation-failed")`.
- Assert that `result.diagnostics` preserves `message: "candidate view owner preparation failed (EACCES)"`.
- Evidence: Red test failure `message: 'candidate view rejected before native START'` observed before fix.

### 2. Implementation (GREEN): Preserve CandidateViewError message
- [x] In `extensions/gentle-ai.ts`:
- In `nativeOperationFailure`, update the pre-native `CandidateViewError` fallback from `"candidate view rejected before native START"` to `error.message`.
- Evidence: 123/123 tests passing in `tests/gentle-ai.test.ts`.

### 3. Verification & Regressions
- [x] Run test suite: `node --experimental-strip-types --test tests/gentle-ai.test.ts`.
- [x] Run typecheck: `npm run typecheck` (0 diagnostics, 0 regressions).
- [x] Evidence: 0 regressions, all tests passing.

### 4. Work-Unit Commit
- [x] Create conventional commit: `fix(review): preserve candidate-owner preparation errno in diagnostic message (#2376)`.
4 changes: 2 additions & 2 deletions tests/gentle-ai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ test("ordinary START reports candidate-owner preparation failure as pre-native n
start: async () => { nativeStarts += 1; throw new Error("native START must not run"); },
} as unknown as NativeReviewCli;
const candidateViews = {
createOrReuse: () => { throw new CandidateViewError("candidate view owner preparation failed", "candidate-owner-preparation-failed"); },
createOrReuse: () => { throw new CandidateViewError("candidate view owner preparation failed (EACCES)", "candidate-owner-preparation-failed"); },
} as unknown as CandidateViewRegistry;
const result = await __testing.executeReviewControllerOperation(
{ operation: "start", input: JSON.stringify({ mode: "ordinary" }) },
Expand All @@ -1099,7 +1099,7 @@ test("ordinary START reports candidate-owner preparation failure as pre-native n
assert.equal(result.mutation_outcome, "none");
assert.deepEqual(result.diagnostics, {
code: "candidate-owner-preparation-failed",
message: "candidate view rejected before native START",
message: "candidate view owner preparation failed (EACCES)",
});

let materializationStatusCalls = 0;
Expand Down
Loading