feat(gates): error-taxonomy ratchet + finish lopi-git anyhow migration - #185
feat(gates): error-taxonomy ratchet + finish lopi-git anyhow migration#185konjoinfinity wants to merge 8 commits into
Conversation
Sprint S13R migrated lopi-core and part of lopi-git off anyhow:: onto typed errors but shipped no gate holding that migration in place. A single workspace-wide ratchet (the shape indexing-floor/function-length-ceiling use) can't tell "regression in an already-migrated crate" apart from "no change in a still-unmigrated one", so this ratchet is per-crate: one anyhow::-file- count floor per crate in .konjo/error-taxonomy.txt, seeded from a real measurement (lopi-core: 1, lopi-git: 3, lopi-memory: 30, plus all other crates including ones already at 0). Wired hard into konjo-gate.yml and registered in .konjo/profile.yml's gates: with a rejects_test kill-test (KT-C.1), proven against both a planted regression in an already-migrated crate (rejected) and an unchanged unmigrated crate (accepted) in the same run. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NLdTtZgWyLWu2gE9CohWwa
Converts manager.rs, rebase.rs, and worktree.rs off anyhow:: onto typed
errors, matching the thiserror pattern diff.rs and lopi-core's already-
migrated modules established. GitManagerError (manager.rs, shared by
rebase.rs) and WorktreeError (worktree.rs) cover git2 failures, spawn_blocking
join failures, subprocess spawn/exit failures, and the DiffScopeError path.
Both exported from lopi_git's crate root. anyhow dependency dropped from
lopi-git's Cargo.toml -- no source file in the crate references it anymore.
No behavior change: same fallible surface, same error text at every call
site (callers already treat these as opaque, Display-formatted errors via
`?`, `.ok()`, or `{e}`).
lopi-git's error-taxonomy floor lowered 3 -> 0 in .konjo/error-taxonomy.txt.
cargo build --workspace, cargo clippy --workspace --all-targets -D warnings,
and cargo test --workspace all green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLdTtZgWyLWu2gE9CohWwa
worktree.rs hit 505 lines after the anyhow migration, one over the file-size-500 gate's hard limit (caught by the local pre-commit hook's warning on the prior commit). Extracts WorktreeError into its own worktree/error.rs submodule, the same file-splitting convention already used for worktree/tests.rs. No behavior change -- re-exported at the same path (crate::worktree::WorktreeError) via `pub use error::WorktreeError`. cargo build/clippy/test -p lopi-git all green; cargo fmt --check clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NLdTtZgWyLWu2gE9CohWwa
Version bump (0.39.0 -> 0.40.0) for Track C: the per-crate error-taxonomy ratchet and the completed lopi-git anyhow migration. - CHANGELOG.md: new [0.40.0] entry. - LEDGER.md: "Track C" entry recording the per-crate-vs-workspace-total ratchet decision (kill-tested, KT-C.1), the file-count-not-occurrence and comment-stripping method choice, and keeping the new gate G4/repo-native. - NEXT_SESSION_PROMPT.md: new entry pointing at lopi-memory (0 of 30 files migrated, deferred per this track's own brief) as the carried-forward item, plus what's already done so it isn't re-derived. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NLdTtZgWyLWu2gE9CohWwa
anyhow:: usage) contained an unquoted "::" immediately followed by a
space, which YAML's scanner reads as a nested mapping key ("mapping
values are not allowed here"). This broke the whole workflow file --
GitHub Actions couldn't parse it at all, so the run failed with zero
jobs created instead of running any gate. Quote the step name.
…350401) konjo-gates' real CI run flags test_error_taxonomy_killtest.sh's rm -rf "$TMP" "$CORE_FIXTURE" cleanup trap as diff:destructive-shell -- same benign mktemp-scoped teardown idiom test_coverage_floor_killtest.sh already uses. Needs a human-run konjo-oneway confirm (the session's safety classifier correctly blocks an agent from completing that flow autonomously); everything else in the run passed, including can_fail confirming KT-C.1's rejects_test registration is real.
|
Status update: the previous CI run had actually failed with zero jobs created — a YAML syntax error in The real gate run after that fix ( One gate remains blocked pending a human: To clear it, from this branch: and add the resulting Generated by Claude Code |
Konjo-Acknowledged-Oneway: 28173e350401
Track C's own acknowledgment commit (e930642) tipped LOOP_ENGINEERING_ROADMAP.md, PANIC_AUDIT.md, and EGRESS_SURFACE.md from right-at-cap to 21 commits behind their verified-against stamp -- the same repeat pattern each doc's own banner history already documents (commit-volume churn, not content going stale). PANIC_AUDIT.md and EGRESS_SURFACE.md: none of their cited files changed in Track C's diff (scoped to crates/lopi-git/, .konjo/, root docs); zero-unwrap claim reconfirmed against this PR's own clean repo:clippy CI run instead of re-running the command blind. Stamps bumped, no line citations touched. LOOP_ENGINEERING_ROADMAP.md is different: Track C's anyhow -> thiserror migration did touch a cited file for real (crates/lopi-git/src/worktree.rs, split to extract worktree/error.rs for the file-size gate). Re-derived every worktree.rs/rebase.rs citation against this branch's actual current line numbers rather than assuming they still held. Architecture and every DONE verdict unchanged.
Summary
Sprint S13R migrated
lopi-coreand part oflopi-gitoffanyhow::onto typed (thiserror) errors, but shipped no gate holding that migration in place. This PR (Track C) closes that gap and finishes thelopi-gitpiece..konjo/error-taxonomy.txt(oneanyhow::-file-count floor row per crate undercrates/) +.konjo/scripts/error_taxonomy_check.py, matching the shape of the existingindexing_floor_check.py/function_length_check.pyratchets (same test-path exclusion, comment-line stripping). Deliberately per-crate, not workspace-total — a single shared total can't tell "regression in an already-migrated crate" apart from "no change in a still-unmigrated one." Wired hard intokonjo-gate.ymland registered in.konjo/profile.yml'sgates:with arejects_testkill-test.lopi-git's error-taxonomy migration:manager.rs,rebase.rs,worktree.rsconverted offanyhow::onto typed errors (GitManagerError,WorktreeError), matching thethiserrorpatterndiff.rsandlopi-corealready established.lopi-git'sanyhowdependency dropped. No behavior change — same fallible surface, same error text at every call site.lopi-git's error-taxonomy floor lowered 3 → 0.Real measured
anyhow::counts (non-test files per crate, before → after)Per the brief's own instruction ("if a number here disagrees with what you measure, the measurement wins"):
lopi-coremeasures 1, not the brief's carried-forward 2.sqlite_pool.rs's onlyanyhow::text is inside a doc comment (correctly excluded by comment-line stripping);models.rs's only occurrence is inside a#[cfg(test)] mod tests { ... }block, which still counts under this script's file-path-only test exclusion (the same simplificationindexing_floor_check.pyalready makes).lopi-git(3) andlopi-memory(30) reproduce exactly.Kill-test KT-C.1 result: PASS
Both required cases proven in the same run (
.konjo/scripts/test_error_taxonomy_killtest.sh):The checker distinguishes "regression in a migrated crate" from "steady-state in an unmigrated crate" in the same invocation — the failure mode a single workspace-wide total would have collapsed.
What shipped
.konjo/error-taxonomy.txt,.konjo/scripts/error_taxonomy_check.py,.konjo/scripts/test_error_taxonomy_killtest.shkonjo-gate.ymlstep +.konjo/profile.ymlcontract_gates/gates:entrieslopi-git'smanager.rs/rebase.rs/worktree.rsfully migrated (GitManagerError,WorktreeError),worktree.rssplit intoworktree/error.rsto stay under the 500-line file-size gateCHANGELOG.md,LEDGER.md,NEXT_SESSION_PROMPT.mdupdated; version bumped 0.39.0 → 0.40.0What's deferred
lopi-memory's error taxonomy (0 of 30 files converted) — explicitly optional per this track's brief ("the ratchet itself is the deliverable, migration progress is a bonus"). Floor row unchanged at 30. Next-session guidance inNEXT_SESSION_PROMPT.md.gate_polarity's one filed defect — unchanged, carried forward from S13R, out of scope here.Verification
cargo build --workspace: greencargo clippy --workspace --all-targets -- -D warnings: cleancargo test --workspace: 54/54 test binaries green, zero failures (one unrelated pre-existing flaky test insrc/task_commands.rs, confirmed to pass in isolation and confirmed green on retry — not touched by this PR)cargo fmt --all -- --check: cleanGenerated by Claude Code