fleet monitor T2: registry.py — operator-side host-registry/capacity-env parsing #65

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

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

Tolerant reader of a host's self-declared host-registry.conf text (schema owned by onboarding/host-state-lib.sh; unknown directives skipped) plus KEY=VALUE capacity env. The probe ships these raw; this is the one place they are interpreted.

Implement **Task 2** 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). Tolerant reader of a host's self-declared `host-registry.conf` text (schema owned by onboarding/host-state-lib.sh; unknown directives skipped) plus KEY=VALUE capacity env. The probe ships these raw; this is the one place they are interpreted.

swarm-claim host=elitebook-distributed-server-03 run=750
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=750 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #65 — status success

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

envelope
{
  "issue": 65,
  "status": "success",
  "commits": [
    "3bc4b442848cfe0e04e1fcb2e76fc3a81fec3fca"
  ],
  "changed_files": [
    "fleet-tui/registry.py",
    "fleet-tui/tests/test_registry.py",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "cd fleet-tui && python3 (pytest-stub harness) tests/test_registry.py",
      "exit_code": 0
    },
    {
      "command": "cd fleet-tui && python3 (pytest-stub harness) full module suite (11 tests)",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do ... bash \"$t\"; done (offline suite)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "registry.py created as a tolerant reader of host-registry.conf (unknown directives skipped)": "fleet-tui/registry.py parse_registry: only known str/int/repo/status keys handled, everything else falls through and is skipped",
    "parse_registry produces the spec'd dict shape with correct defaults": "fleet-tui/registry.py _DEFAULTS (name None, heavy/light slots 2, killswitch None, home ~/swarm, status active, logdir None) + repos=[]; verified by test_defaults_when_directives_absent",
    "RegistryError raised only on a directive with no value / non-numeric slot": "fleet-tui/registry.py raises on empty value for known directive and non-numeric slot; verified by test_unknown_directives_tolerated_but_empty_value_refused",
    "parse_capacity_env reads KEY=VALUE, # comments ignored, values unquoted": "fleet-tui/registry.py parse_capacity_env; verified by test_capacity_env",
    "failing tests first, then implementation, then commit": "test_registry.py written first (would ModuleNotFoundError on absent registry.py), then registry.py; single commit 3bc4b44",
    "Global Constraints: fleet-tui/** vendor-excluded": "onboarding/vendor-exclude line 27 fleet-tui/** (from T1); onboarding/tests/vendor-manifest-coverage-test.sh green in offline suite",
    "Global Constraints: no product literal, invented names only": "registry.py and test_registry.py use only box-a/box-b/Acme/widget/Acme/beta and /home/agent paths, no idss/matou/ourcloud/git.matou.nz literal",
    "Global Constraints: read-only, offline tests": "pure text parsing, no I/O beyond the passed string; tests use inline fixture blobs, no network/docker",
    "Global Constraints: module suite green": "all 4 test_registry cases + 11-test full module suite pass under the stdlib pytest-stub harness (no system pytest/venv in sandbox; run under pytest in CI)"
  },
  "summary": "Added fleet-tui/registry.py (Task 2): tolerant operator-side parser of a host's host-registry.conf and capacity env, test-first.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #65 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 65, "status": "success", "commits": [ "3bc4b442848cfe0e04e1fcb2e76fc3a81fec3fca" ], "changed_files": [ "fleet-tui/registry.py", "fleet-tui/tests/test_registry.py", "STATUS.md" ], "tests": [ { "command": "cd fleet-tui && python3 (pytest-stub harness) tests/test_registry.py", "exit_code": 0 }, { "command": "cd fleet-tui && python3 (pytest-stub harness) full module suite (11 tests)", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do ... bash \"$t\"; done (offline suite)", "exit_code": 0 } ], "criteria": { "registry.py created as a tolerant reader of host-registry.conf (unknown directives skipped)": "fleet-tui/registry.py parse_registry: only known str/int/repo/status keys handled, everything else falls through and is skipped", "parse_registry produces the spec'd dict shape with correct defaults": "fleet-tui/registry.py _DEFAULTS (name None, heavy/light slots 2, killswitch None, home ~/swarm, status active, logdir None) + repos=[]; verified by test_defaults_when_directives_absent", "RegistryError raised only on a directive with no value / non-numeric slot": "fleet-tui/registry.py raises on empty value for known directive and non-numeric slot; verified by test_unknown_directives_tolerated_but_empty_value_refused", "parse_capacity_env reads KEY=VALUE, # comments ignored, values unquoted": "fleet-tui/registry.py parse_capacity_env; verified by test_capacity_env", "failing tests first, then implementation, then commit": "test_registry.py written first (would ModuleNotFoundError on absent registry.py), then registry.py; single commit 3bc4b44", "Global Constraints: fleet-tui/** vendor-excluded": "onboarding/vendor-exclude line 27 fleet-tui/** (from T1); onboarding/tests/vendor-manifest-coverage-test.sh green in offline suite", "Global Constraints: no product literal, invented names only": "registry.py and test_registry.py use only box-a/box-b/Acme/widget/Acme/beta and /home/agent paths, no idss/matou/ourcloud/git.matou.nz literal", "Global Constraints: read-only, offline tests": "pure text parsing, no I/O beyond the passed string; tests use inline fixture blobs, no network/docker", "Global Constraints: module suite green": "all 4 test_registry cases + 11-test full module suite pass under the stdlib pytest-stub harness (no system pytest/venv in sandbox; run under pytest in CI)" }, "summary": "Added fleet-tui/registry.py (Task 2): tolerant operator-side parser of a host's host-registry.conf and capacity env, test-first.", "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#65
No description provided.