fleet monitor T9: repostats.py — multi-repo tracker reads #72

Closed
opened 2026-08-24 18:35:31 +00:00 by ben · 2 comments
Owner

Implement Task 9 of docs/superpowers/plans/2026-08-24-fleet-monitor.md (on main; spec: docs/superpowers/specs/2026-08-24-fleet-monitor-design.md) exactly as written: failing tests first, then the implementation, then the task's own commit. The plan's Global Constraints apply to every task: fleet-tui/** stays vendor-excluded, no product literal in code or fixtures (invented names only), read-only against the factory, offline tests (fake ssh, fixture blobs, swarm.db seeded via the real swarm-db.py), module suite green (cd fleet-tui && python3 -m pytest tests/ — use tui/.venv if no system pytest).

Reuses the per-repo TUI's own logic (data.tracker.queue_snapshot, data.ask_inbox.inbox_snapshot — /tui goes on sys.path): repo set = union of registry repo slugs + fleet.conf extras; fleet queue/asks with a repo column; per-repo failures become per-repo error rows, never a blanked fleet; summary counts (ready/working/blocked/human/session) and total_ready for the sampler.

Implement **Task 9** of `docs/superpowers/plans/2026-08-24-fleet-monitor.md` (on `main`; spec: `docs/superpowers/specs/2026-08-24-fleet-monitor-design.md`) exactly as written: failing tests first, then the implementation, then the task's own commit. The plan's **Global Constraints** apply to every task: `fleet-tui/**` stays vendor-excluded, no product literal in code or fixtures (invented names only), read-only against the factory, offline tests (fake ssh, fixture blobs, swarm.db seeded via the real swarm-db.py), module suite green (`cd fleet-tui && python3 -m pytest tests/` — use `tui/.venv` if no system pytest). Reuses the per-repo TUI's own logic (data.tracker.queue_snapshot, data.ask_inbox.inbox_snapshot — <repo>/tui goes on sys.path): repo set = union of registry repo slugs + fleet.conf extras; fleet queue/asks with a repo column; per-repo failures become per-repo error rows, never a blanked fleet; summary counts (ready/working/blocked/human/session) and total_ready for the sampler.

swarm-claim host=matou-dev-server-01 run=659
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=659 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #72 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 72,
  "status": "success",
  "commits": [
    "2e3711d9430e4ba4a602250c7e89e803589335af"
  ],
  "changed_files": [
    "fleet-tui/repostats.py",
    "fleet-tui/tests/test_repostats.py",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "python3 (stdlib pytest-shim harness) tests/test_repostats.py + tests/test_fleetconf.py",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do ... bash \"$t\"; done (offline suite)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Task 9 implemented as written (repostats.py + test_repostats.py, test-first)": "fleet-tui/repostats.py and fleet-tui/tests/test_repostats.py added in 2e3711d; test written before impl and shown failing (no module), then green",
    "reuses per-repo TUI logic (data.tracker.queue_snapshot, data.ask_inbox.inbox_snapshot; <repo>/tui on sys.path)": "repostats.py imports from data import ask_inbox, tracker; conftest.py (T1) puts ../tui on sys.path; fleet_queue/fleet_asks call queue_snapshot/inbox_snapshot",
    "repo set = union of registry repo slugs + fleet.conf extras (sorted, deduped)": "repo_set() unions conf.repos with each reg['repos'][*]['slug'], returns sorted(set); test_api_for_and_repo_set asserts [Acme/beta, Acme/extra, Acme/widget]",
    "fleet queue/asks with a repo column": "fleet_queue/fleet_asks stamp dict(row, repo=repo) on each snapshot row",
    "per-repo failures become per-repo error rows, never a blanked fleet": "try/except per repo appends {repo, error: str(e)}; test asserts beta==[{repo:Acme/beta, error:boom}] while widget rows survive",
    "summary counts (ready/working/blocked/human/session) and total_ready for the sampler": "summary() folds per-repo counts (ready=ready-for-agent&!blocked, blocked=ready-for-agent&blocked, working=in-progress, human=ready-for-human, session=ready-for-session); total_ready() sums ready; test asserts (0,1,1) and total_ready==0",
    "Global Constraints: fleet-tui/** vendor-excluded, no product literal, offline tests, module suite green": "fleet-tui/** already in onboarding/vendor-exclude (T1), vendor-manifest-coverage-test green; fixtures use Acme/*; both module tests pass; offline bash suite green"
  },
  "summary": "Implemented fleet-tui/repostats.py (Task 9): multi-repo tracker reads reusing the per-repo TUI's queue/ask-inbox logic with per-repo error isolation and summary counts.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #72 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 72, "status": "success", "commits": [ "2e3711d9430e4ba4a602250c7e89e803589335af" ], "changed_files": [ "fleet-tui/repostats.py", "fleet-tui/tests/test_repostats.py", "STATUS.md" ], "tests": [ { "command": "python3 (stdlib pytest-shim harness) tests/test_repostats.py + tests/test_fleetconf.py", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do ... bash \"$t\"; done (offline suite)", "exit_code": 0 } ], "criteria": { "Task 9 implemented as written (repostats.py + test_repostats.py, test-first)": "fleet-tui/repostats.py and fleet-tui/tests/test_repostats.py added in 2e3711d; test written before impl and shown failing (no module), then green", "reuses per-repo TUI logic (data.tracker.queue_snapshot, data.ask_inbox.inbox_snapshot; <repo>/tui on sys.path)": "repostats.py imports from data import ask_inbox, tracker; conftest.py (T1) puts ../tui on sys.path; fleet_queue/fleet_asks call queue_snapshot/inbox_snapshot", "repo set = union of registry repo slugs + fleet.conf extras (sorted, deduped)": "repo_set() unions conf.repos with each reg['repos'][*]['slug'], returns sorted(set); test_api_for_and_repo_set asserts [Acme/beta, Acme/extra, Acme/widget]", "fleet queue/asks with a repo column": "fleet_queue/fleet_asks stamp dict(row, repo=repo) on each snapshot row", "per-repo failures become per-repo error rows, never a blanked fleet": "try/except per repo appends {repo, error: str(e)}; test asserts beta==[{repo:Acme/beta, error:boom}] while widget rows survive", "summary counts (ready/working/blocked/human/session) and total_ready for the sampler": "summary() folds per-repo counts (ready=ready-for-agent&!blocked, blocked=ready-for-agent&blocked, working=in-progress, human=ready-for-human, session=ready-for-session); total_ready() sums ready; test asserts (0,1,1) and total_ready==0", "Global Constraints: fleet-tui/** vendor-excluded, no product literal, offline tests, module suite green": "fleet-tui/** already in onboarding/vendor-exclude (T1), vendor-manifest-coverage-test green; fixtures use Acme/*; both module tests pass; offline bash suite green" }, "summary": "Implemented fleet-tui/repostats.py (Task 9): multi-repo tracker reads reusing the per-repo TUI's queue/ask-inbox logic with per-repo error isolation and summary counts.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/dev-factory#72
No description provided.