Ratchet supervise coverage to >=90% (ADR 0004) #300

Open
didericis-claude wants to merge 1 commits from ratchet-supervise-90 into ratchet-manifest-90
Collaborator

Stacked on #299 (base = ratchet-manifest-90). Sixth per-module ratchet under ADR 0004.

Summary

Covers the supervise queue/audit error + fallback branches:

  • path helpers (bot_bottle_root, queue_dir_for_slug, _id_from_proposal_filename non-match)
  • read_proposal / read_response reject non-object JSON
  • list_pending_proposals skips unreadable / non-dict / incomplete proposals and ones with a response already present
  • wait_for_response tolerates a malformed or incomplete response file and times out at the deadline
  • read_audit_entries returns [] for a missing log and skips blank / non-JSON / non-dict / missing-field lines
  • the fcntl flock helpers swallow OSError on a bad fd

Coverage

Module Before After
supervise.py 89% 99%

The one remaining line is an unreachable continue (the glob already guarantees the .proposal.json suffix). 12 new tests; full suite (1490) passes; pyright clean; pylint 9.62.

Stacked on #299 (base = `ratchet-manifest-90`). Sixth per-module ratchet under ADR 0004. ## Summary Covers the supervise queue/audit error + fallback branches: - path helpers (`bot_bottle_root`, `queue_dir_for_slug`, `_id_from_proposal_filename` non-match) - `read_proposal` / `read_response` reject non-object JSON - `list_pending_proposals` skips unreadable / non-dict / incomplete proposals and ones with a response already present - `wait_for_response` tolerates a malformed or incomplete response file and times out at the deadline - `read_audit_entries` returns `[]` for a missing log and skips blank / non-JSON / non-dict / missing-field lines - the `fcntl` flock helpers swallow `OSError` on a bad fd ## Coverage | Module | Before | After | |---|---|---| | `supervise.py` | 89% | **99%** | The one remaining line is an unreachable `continue` (the glob already guarantees the `.proposal.json` suffix). 12 new tests; full suite (1490) passes; pyright clean; pylint 9.62.
didericis-claude added 1 commit 2026-06-25 22:19:41 -04:00
test(supervise): ratchet supervise coverage to >=90%
test / unit (pull_request) Successful in 46s
test / integration (pull_request) Successful in 17s
test / coverage (pull_request) Successful in 58s
lint / lint (push) Successful in 1m54s
8caa79ee76
Sixth per-module ratchet under ADR 0004. Cover the queue/audit
malformed-input and fallback branches:

- path helpers (bot_bottle_root, queue_dir_for_slug,
  _id_from_proposal_filename non-match)
- read_proposal / read_response reject non-object JSON
- list_pending_proposals skips unreadable/non-dict/incomplete
  proposals and ones with a response already present
- wait_for_response tolerates a malformed or incomplete response file
  and then times out at the deadline
- read_audit_entries returns [] for a missing log and skips blank /
  non-JSON / non-dict / missing-field lines
- the fcntl flock helpers swallow OSError on a bad fd

supervise.py: 89% -> 99%. The one remaining line is an unreachable
`continue` (glob already guarantees the .proposal.json suffix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkwFXLFff9PYPy4wgVBJp9
Some checks are pending
test / unit (pull_request) Successful in 46s
test / integration (pull_request) Successful in 17s
test / coverage (pull_request) Successful in 58s
lint / lint (push) Successful in 1m54s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ratchet-supervise-90:ratchet-supervise-90
git checkout ratchet-supervise-90
Sign in to join this conversation.