fleet monitor T7: samples.py — the monitor's one write #70

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

Implement Task 7 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).

Operator-local fleet-monitor.db (~/.config/dev-factory/): host_samples(ts,host,free_slots,reachable,killswitch) + backlog_samples(ts,repo,ready), WAL, record/load. Exists solely because nothing in the factory records backlog over time; deleting it only resets Loss history.

Implement **Task 7** 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). Operator-local fleet-monitor.db (~/.config/dev-factory/): host_samples(ts,host,free_slots,reachable,killswitch) + backlog_samples(ts,repo,ready), WAL, record/load. Exists solely because nothing in the factory records backlog over time; deleting it only resets Loss history.

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 #70 — status success

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

envelope
{
  "issue": 70,
  "status": "success",
  "commits": [
    "be789dd"
  ],
  "changed_files": [
    "fleet-tui/samples.py",
    "fleet-tui/tests/test_samples.py",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "cd fleet-tui && python3 -c 'import tests.test_samples as t; ...' (standalone harness emulating pytest tmp_path)",
      "exit_code": 0
    },
    {
      "command": "bash onboarding/tests/vendor-manifest-coverage-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "samples.py created per plan Task 7 (DEFAULT_PATH, connect, record, load; schema + ts index; WAL)": "fleet-tui/samples.py in be789dd, byte-for-byte the plan's Step 3 code",
    "test-first: failing test then implementation (roundtrip + since_ts filter)": "fleet-tui/tests/test_samples.py in be789dd, matches plan Step 1; passes via standalone harness",
    "operator-local fleet-monitor.db in ~/.config/dev-factory/, WAL": "DEFAULT_PATH=os.path.expanduser('~/.config/dev-factory/fleet-monitor.db'); connect sets PRAGMA journal_mode=WAL",
    "host_samples(ts,host,free_slots,reachable,killswitch) + backlog_samples(ts,repo,ready)": "_SCHEMA in samples.py",
    "record/load implemented; load ordered by ts and since_ts-filtered": "record()/load() in samples.py; load SELECTs WHERE ts >= ? ORDER BY ts",
    "fleet-tui/** stays vendor-excluded (new files classified)": "onboarding/vendor-exclude:27 fleet-tui/**; vendor-manifest-coverage-test PASS",
    "no product literal in code/fixtures (invented names only)": "test uses box-a / Acme/widget invented names; module has none",
    "read-only against the factory": "samples.py only writes the operator-local db; no factory reads/writes",
    "module suite green (cd fleet-tui && python3 -m pytest tests/)": "new test passes via standalone harness; pytest unavailable in sandbox (no pip/ensurepip) so run under CI. Pre-existing tui-test.sh red is the same missing-pytest env limit, unrelated to this change (no tui/ files touched)",
    "STATUS.md updated same commit": "header line + milestone log entry for #70 in be789dd"
  },
  "summary": "Added fleet-tui/samples.py (the fleet-monitor's one write: operator-local WAL sample log) with its test, per plan Task 7.",
  "blockers": []
}
**close-report** for #70 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 70, "status": "success", "commits": [ "be789dd" ], "changed_files": [ "fleet-tui/samples.py", "fleet-tui/tests/test_samples.py", "STATUS.md" ], "tests": [ { "command": "cd fleet-tui && python3 -c 'import tests.test_samples as t; ...' (standalone harness emulating pytest tmp_path)", "exit_code": 0 }, { "command": "bash onboarding/tests/vendor-manifest-coverage-test.sh", "exit_code": 0 } ], "criteria": { "samples.py created per plan Task 7 (DEFAULT_PATH, connect, record, load; schema + ts index; WAL)": "fleet-tui/samples.py in be789dd, byte-for-byte the plan's Step 3 code", "test-first: failing test then implementation (roundtrip + since_ts filter)": "fleet-tui/tests/test_samples.py in be789dd, matches plan Step 1; passes via standalone harness", "operator-local fleet-monitor.db in ~/.config/dev-factory/, WAL": "DEFAULT_PATH=os.path.expanduser('~/.config/dev-factory/fleet-monitor.db'); connect sets PRAGMA journal_mode=WAL", "host_samples(ts,host,free_slots,reachable,killswitch) + backlog_samples(ts,repo,ready)": "_SCHEMA in samples.py", "record/load implemented; load ordered by ts and since_ts-filtered": "record()/load() in samples.py; load SELECTs WHERE ts >= ? ORDER BY ts", "fleet-tui/** stays vendor-excluded (new files classified)": "onboarding/vendor-exclude:27 fleet-tui/**; vendor-manifest-coverage-test PASS", "no product literal in code/fixtures (invented names only)": "test uses box-a / Acme/widget invented names; module has none", "read-only against the factory": "samples.py only writes the operator-local db; no factory reads/writes", "module suite green (cd fleet-tui && python3 -m pytest tests/)": "new test passes via standalone harness; pytest unavailable in sandbox (no pip/ensurepip) so run under CI. Pre-existing tui-test.sh red is the same missing-pytest env limit, unrelated to this change (no tui/ files touched)", "STATUS.md updated same commit": "header line + milestone log entry for #70 in be789dd" }, "summary": "Added fleet-tui/samples.py (the fleet-monitor's one write: operator-local WAL sample log) with its test, per plan Task 7.", "blockers": [] } ``` </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#70
No description provided.