Skip to content

fix: repair pre-existing watcher_pane tests#56

Merged
ProtocolWarden merged 1 commit into
mainfrom
fix/watcher-pane-tests
May 27, 2026
Merged

fix: repair pre-existing watcher_pane tests#56
ProtocolWarden merged 1 commit into
mainfrom
fix/watcher-pane-tests

Conversation

@ProtocolWarden
Copy link
Copy Markdown
Owner

Summary

Repairs 9 pre-existing failures in tests/test_watcher_pane.py, deciding per-failure whether the test was stale or the code regressed.

Stale tests (code was correct, tests updated)

  • Banner copy was intentionally title-cased / reworded: "All Systems Nominal", "SwitchBoard Offline", "Global Gate at Cap", "Queue Depth", "Stabilizing". Updated 5 assertions.
  • test_exec_budget_reads_usage never isolated _resource_gate(), which reads the real on-disk OC config; gate caps shadow the env caps the test sets. Added a monkeypatch stubbing the gate so the env-override path is exercised.
  • test_critical_sorts_before_warning_sorts_before_info had a premise that conflicts with the intentional "just started" INFO pinning (documented in code). Split into a pure severity-order test (started_at=0) and a test documenting the pinning.

Real code regression (code fixed)

  • _allocate_section_rows did no overflow scaling and over-allocated far past available_rows (42/31 vs a cap of 10). Added proportional down-scaling for expanded sections on overflow with a min(3, natural) per-section floor. Natural-fit, size_mult, collapsed, and empty paths preserved.

Test plan

  • tests/test_watcher_pane.py: 27 passed
  • Full suite: 132 passed, 3 failed (pre-existing cxrp schema_version 0.2-vs-0.3 mismatch in tests/test_cxrp_capture.py, unrelated)
  • Custodian: 0 findings | clean (pre-push hook passed)

Files touched: src/operator_console/watcher_status_pane.py, tests/test_watcher_pane.py, .console/log.md only. launcher.py / bootstrap.py untouched.

🤖 Generated with Claude Code

Eight banner-copy/budget assertions were stale (title-cased rewording,
gate-vs-env precedence, intentional just-started banner pinning); the
section allocator was genuinely over-allocating on overflow.

- Update stale banner/budget/sort tests to match intended behavior.
- Fix _allocate_section_rows to scale expanded sections down
  proportionally on overflow (min(3,natural) floor) so the row total
  honors available_rows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ProtocolWarden ProtocolWarden merged commit 0aff8df into main May 27, 2026
2 checks passed
@ProtocolWarden ProtocolWarden deleted the fix/watcher-pane-tests branch May 27, 2026 13:46
@ProtocolWarden ProtocolWarden restored the fix/watcher-pane-tests branch May 27, 2026 20:36
@ProtocolWarden ProtocolWarden deleted the fix/watcher-pane-tests branch May 27, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant