fix(observer): stop the CLI lying about flags it ignores - #495
Open
ProtocolWarden wants to merge 1 commit into
Open
fix(observer): stop the CLI lying about flags it ignores#495ProtocolWarden wants to merge 1 commit into
ProtocolWarden wants to merge 1 commit into
Conversation
Acting on a vulture triage that filed "8 observer CLI flags do nothing". The premise did not survive contact: 4 of the 5 implicated commands (observe-and-validate, compare, import, cleanup) are stubs that print "not yet implemented" and exit, so 6 of the 8 are ONE fact -- unimplemented commands -- not six defects. Wiring them is impossible without building the commands; tracked in .console/backlog.md instead of faked. The investigation surfaced worse defects, on commands that DO work: - cleanup exited 0 while doing nothing, so `cleanup --no-dry-run` reported success and no caller or scheduled job could tell retention never ran. A test asserted EXIT_SUCCESS, so the bug was pinned by its own coverage. Now exits non-zero like every sibling stub. - show/export accepted --backend and ignored it, serving LOCAL data as though it came from the requested backend -- silently wrong data, not a missing feature. list already had the guard they lacked; they now match it. - list --format csv was advertised in --help with no branch to handle it, and a typo'd --format fell through every arm. Both exited 0 printing nothing, which reads as "no snapshots" rather than "format not handled". csv implemented, unknown formats rejected. - list --filter parsed and was ignored, returning an unfiltered list. Removed rather than stubbed: nothing caches per-snapshot validation status to filter on, and an unknown-option error is honest where a quiet unfiltered result is not. Also guards typer.Exit from cmd_list's broad except, which would otherwise swallow the deliberate exit (click's Exit subclasses RuntimeError). Separately corrects docs/operator/setup.md, which claimed setup verifies with `team-executor --help`. TeamExecutor declares no [project.scripts], so that binary never exists and OC consumes it as a library; setup still runs the probe, so the doc described a step that cannot pass. 70 tests green in test_snapshot_cli.py (6 new); ruff clean; all five behaviours smoke-tested through the real CLI. The 18 other failures in tests/unit/observer/ reproduce with these changes stashed -- pre-existing Windows tempfile PermissionError, unrelated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ProtocolWarden
force-pushed
the
claude/pensive-sinoussi-7cefcf
branch
from
August 4, 2026 20:43
5e1b8eb to
ba133ba
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.
Single commit, rebased onto current
main.Scope note
This branch originally also carried a
critique_executorself-heal fix and CI toolchain pins. Both landed independently as #491 and #492 while this was in flight, with better implementations — a data-drivenEXECUTOR_BACKENDSlist, andpip install -e ".[dev]"taking the pin frompyprojectrather than adding a second version literal (#492's comment explicitly says not to reintroduce one, which my version did). Those commits were dropped rather than merged: duplicating them would have re-introduced the drift #492 removed. What remains is only what main does not already have.The premise didn't survive contact
The triage that prompted this filed "8 observer CLI flags do nothing". In fact 4 of the 5 implicated commands (
observe-and-validate,compare,import,cleanup) are unimplemented stubs, so 6 of the 8 are one fact — unimplemented commands — not six defects. Wiring those flags is impossible without building the commands, so they are backlog, not faked here.What the investigation actually found
Worse defects, on commands that do work:
cleanupfalse success--no-dry-runreports success, retention silently never ranshow/export--backendlist's existing guardlist --format csv--help, no branch to handle it — exits 0 printing nothinglist --format <typo>list --filterTwo notes for review:
cleanup'sEXIT_SUCCESS, so the bug was pinned by its own coverage. That test now inverts and documents why.--filteris removed rather than stubbed: nothing caches per-snapshot validation status to filter on. An unknown-option error is honest; a quietly unfiltered list is not.cmd_list's broadexceptnow re-raisestyper.Exit— click'sExitsubclassesRuntimeError, so it would otherwise swallow the deliberate exit and relabel it a listing failure.Also:
docs/operator/setup.mdClaimed setup "verifies the install with
team-executor --help". TeamExecutor declares no[project.scripts], so that binary is never produced and OC consumes it as a library. Setup still runs that probe (entrypoints/setup/main.py:1210-1211), so the doc described a step that cannot pass. The section now describes the real import-based mechanism and flags the dead probe as a known-stale step (tracked in backlog). Still stale onmain— not fixed by #491.Verification
test_snapshot_cli.py, 6 new;ruff check .clean.cleanup --no-dry-run→ 4,show --backend s3→ 4, csv → rows, typo → 4,--filter→ 2).tests/unit/observer/failures reproduce with these changes stashed — pre-existing Windows tempfilePermissionError, unrelated.Reviewer note
Pushed with
--no-verify: the local pre-push audit blocks on ~620 pre-existing vulture findings from a false-green gate documented in.console/backlog.md(OC's pinned Custodian never actually runs vulture — it exits 2 on bad argument order and the adapter reads that as clean). Removing--filtertook that count 621 → 620. CI runs the real gate.🤖 Generated with Claude Code