diff --git a/CLAUDE.md b/CLAUDE.md index 591e7d8..47d0b99 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -46,3 +46,9 @@ src/ - Ports & Adapters: interfaces in `domain/ports/`, implementations in `infrastructure/adapters/` - External libraries (clack, picocolors) only in `infrastructure/` - Exception: valibot in `domain/schemas/` (declarative type definitions) + +### Result handling + +- Every `Result` from a port call must be checked (`.success` / `Result.isOk` / `Result.isErr`) before the code moves on +- A deliberately discarded `Result` is marked with `// ignored: ` so review can tell intent from oversight +- Mechanical enforcement was considered and deferred: Biome 2.x GritQL has no type information, so a syntactic rule would need a hand-maintained list of ~42 port method names, and a second type-aware linter is disproportionate for a bug class with no live instances diff --git a/src/cli/commands/create.ts b/src/cli/commands/create.ts index 5e84715..a1927f5 100644 --- a/src/cli/commands/create.ts +++ b/src/cli/commands/create.ts @@ -127,6 +127,8 @@ export function createCommand(container: Container) { const cleanup = new CleanupHandle(); cleanup.register(async () => { + // ignored: best-effort rollback on an already-failing path — a failed cleanup + // has no useful handling and must not mask the original error await git.removeWorktree(createResult.data.worktree.path, { force: true }); });