harness: stamp the active account into swarm.db spend rows #75

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

Additive nullable account column in swarm-db.py; record-run-result.sh records claude_active_account (the unbranded letter) with each spend row; tests updated in the same commit (blast-radius rules apply — schema is owned here, every consumer inherits it at its next pin bump). Unblocks per-account attribution in the fleet monitor's Usage/Loss tabs (docs/superpowers/specs/2026-08-24-fleet-monitor-design.md, Companion tickets). Until it lands the monitor shows unattributed, and Loss's parked-window detection stays a fleet-wide approximation.

Additive nullable `account` column in `swarm-db.py`; `record-run-result.sh` records `claude_active_account` (the unbranded letter) with each spend row; tests updated in the same commit (blast-radius rules apply — schema is owned here, every consumer inherits it at its next pin bump). Unblocks per-account attribution in the fleet monitor's Usage/Loss tabs (`docs/superpowers/specs/2026-08-24-fleet-monitor-design.md`, Companion tickets). Until it lands the monitor shows `unattributed`, and Loss's parked-window detection stays a fleet-wide approximation.

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

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

close-report for #75 — status success

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

envelope
{
  "issue": 75,
  "status": "success",
  "commits": [
    "e2d629e"
  ],
  "changed_files": [
    "STATUS.md",
    "record-run-result.sh",
    "swarm-db.py",
    "tests/record-run-result-test.sh",
    "tests/swarm-db-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/swarm-db-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/record-run-result-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Additive nullable `account` column in swarm-db.py": "swarm-db.py: `account TEXT` added to spend SCHEMA (fresh tables) plus idempotent `_add_missing_columns`/ADDITIVE_COLUMNS ALTER TABLE in migrate() for pre-existing dbs; proven by tests/swarm-db-test.sh #75 groups (verbatim stamp + NULL default + pre-existing-db migration)",
    "record-run-result.sh records claude_active_account (the unbranded letter) with each spend row": "record-run-result.sh sources limit-lib.sh, reads claude_active_account once, passes --account to both spend writes (issue-scoped + issue-NULL); proven by tests/record-run-result-test.sh default-A and fresh-B stamp groups",
    "tests updated in the same commit": "tests/swarm-db-test.sh and tests/record-run-result-test.sh updated in commit e2d629e (blast-radius rule); full offline suite green"
  },
  "summary": "swarm.db spend rows now carry a nullable account column stamped from the host active-account marker, unblocking per-account attribution in the fleet monitor.",
  "blockers": []
}
**close-report** for #75 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 75, "status": "success", "commits": [ "e2d629e" ], "changed_files": [ "STATUS.md", "record-run-result.sh", "swarm-db.py", "tests/record-run-result-test.sh", "tests/swarm-db-test.sh" ], "tests": [ { "command": "bash tests/swarm-db-test.sh", "exit_code": 0 }, { "command": "bash tests/record-run-result-test.sh", "exit_code": 0 } ], "criteria": { "Additive nullable `account` column in swarm-db.py": "swarm-db.py: `account TEXT` added to spend SCHEMA (fresh tables) plus idempotent `_add_missing_columns`/ADDITIVE_COLUMNS ALTER TABLE in migrate() for pre-existing dbs; proven by tests/swarm-db-test.sh #75 groups (verbatim stamp + NULL default + pre-existing-db migration)", "record-run-result.sh records claude_active_account (the unbranded letter) with each spend row": "record-run-result.sh sources limit-lib.sh, reads claude_active_account once, passes --account to both spend writes (issue-scoped + issue-NULL); proven by tests/record-run-result-test.sh default-A and fresh-B stamp groups", "tests updated in the same commit": "tests/swarm-db-test.sh and tests/record-run-result-test.sh updated in commit e2d629e (blast-radius rule); full offline suite green" }, "summary": "swarm.db spend rows now carry a nullable account column stamped from the host active-account marker, unblocking per-account attribution in the fleet monitor.", "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.

Dependencies

No dependencies set.

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