fleet-tui sampler: read fp-keyed limit markers + account_fp (follow-up to #200) #224

Closed
opened 2026-10-15 05:59:48 +00:00 by matou-build-agent · 2 comments

Spun out of #200 (fp-keyed Claude account attribution).

Symptom

#200 keyed the Claude limit markers by token fingerprint (<base>-<fp>) and added an additive spend.account_fp column + fp-grouped limit-lost. The in-repo factory TUI was updated (tui/data/limits.py globs the fingerprinted siblings; swarm-db.py's limit-lost groups by fp). The fleet monitor sampler (fleet-tui/probe.py, shipped over ssh by hostpoll.py) was NOT updated:

  • _marker(path, now) stats ONE path, so a fp-keyed park (<base>-<fp>) reads as "not parked"; and
  • hostpoll.py's DEFAULT_LIMIT_MARKER/DEFAULT_ACTIVE_MARKER are still the pre-#205 /tmp/matou-swarm-claude-* literals, so the sampler is ALSO already blind to #205's state-dir move — the two need reconciling together.
  • The spend sections group by account/model but not account_fp.

Proposed change

  • _marker (or a new helper) globs <base>-* fingerprinted siblings and reports parked iff any is fresh, mirroring tui/data/limits.py.
  • Reconcile the marker-path default with #205 (derive from the host state dir, not /tmp).
  • Optionally surface account_fp alongside account in the probe's spend rollup.

Out of scope

The in-repo tui/ reader + swarm-db.py query (landed in #200).

Spun out of #200 (fp-keyed Claude account attribution). ## Symptom #200 keyed the Claude limit markers by token fingerprint (`<base>-<fp>`) and added an additive `spend.account_fp` column + fp-grouped `limit-lost`. The in-repo factory TUI was updated (`tui/data/limits.py` globs the fingerprinted siblings; `swarm-db.py`'s `limit-lost` groups by fp). The **fleet monitor sampler** (`fleet-tui/probe.py`, shipped over ssh by `hostpoll.py`) was NOT updated: - `_marker(path, now)` stats ONE path, so a fp-keyed park (`<base>-<fp>`) reads as "not parked"; and - `hostpoll.py`'s `DEFAULT_LIMIT_MARKER`/`DEFAULT_ACTIVE_MARKER` are still the pre-#205 `/tmp/matou-swarm-claude-*` literals, so the sampler is ALSO already blind to #205's state-dir move — the two need reconciling together. - The spend sections group by `account`/`model` but not `account_fp`. ## Proposed change - `_marker` (or a new helper) globs `<base>-*` fingerprinted siblings and reports parked iff any is fresh, mirroring `tui/data/limits.py`. - Reconcile the marker-path default with #205 (derive from the host state dir, not `/tmp`). - Optionally surface `account_fp` alongside `account` in the probe's spend rollup. ## Out of scope The in-repo `tui/` reader + `swarm-db.py` query (landed in #200).
Author
Member

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

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

close-report for #224 — status success

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

envelope
{
  "issue": 224,
  "status": "success",
  "commits": [
    "16782e6474aa788b64b8d00f28d184dd1209e297"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/journal/2026-10-15-224.md",
    "fleet-tui/hostpoll.py",
    "fleet-tui/probe.py",
    "fleet-tui/tests/test_hostpoll.py",
    "fleet-tui/tests/test_probe.py",
    "tests/fleet-tui-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/fleet-tui-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/docs-budget-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do bash \"$t\"; done (full offline suite)",
      "exit_code": 0
    },
    {
      "command": "python3 -I /tmp/verify_probe.py (drives probe.py as a subprocess: fp-glob-freshest, bare-base, absent, fp active-content, account_fp fallback+present)",
      "exit_code": 0
    },
    {
      "command": "python3 fleet-tui/hostpoll.probe_args (asserts marker paths derive from {home}/state, no /tmp)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "_marker globs <base>-* fingerprinted siblings and reports parked iff any is fresh, mirroring tui/data/limits.py": "fleet-tui/probe.py _marker now globs glob(path)+glob(path+'-*') and returns the freshest (min age); test_probe.py test_limit_marker_reports_freshest_of_base_and_fp_siblings (stale base + fresh fp sibling -> parked, age<3600). Active marker reads the freshest sibling's content: test_active_marker_reads_a_fingerprint_keyed_siblings_content.",
    "Reconcile the marker-path default with #205 (derive from the host state dir, not /tmp)": "fleet-tui/hostpoll.py: DEFAULT_*_MARKER /tmp literals replaced by LIMIT_MARKER_NAME/ACTIVE_MARKER_NAME base names; probe_args emits {home}/state/<name> (same convention as --db/--drive-log). test_hostpoll.py test_probe_args_defaults_and_registry_killswitch asserts /h/swarm/state/... and no /tmp.",
    "Optionally surface account_fp alongside account in the probe's spend rollup": "fleet-tui/probe.py spend_daily groups by account_fp via a nested fallback (fp+account+model -> account+model -> bare), preserving #96 grouping on pre-#200 dbs; test_probe.py test_spend_daily_surfaces_account_fp_when_the_column_is_present + the full-probe test asserting account_fp=None on a seeded (no-column) db.",
    "Out of scope: the in-repo tui/ reader + swarm-db.py limit-lost query (landed in #200)": "Untouched; no changes under tui/ or swarm-db.py."
  },
  "summary": "The fleet-tui sampler now reads fp-keyed Claude markers (glob siblings, freshest wins), derives marker paths from the #205 host state dir instead of /tmp, and surfaces account_fp in the spend rollup — all forward-compatible with the not-yet-landed #200.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #224 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 224, "status": "success", "commits": [ "16782e6474aa788b64b8d00f28d184dd1209e297" ], "changed_files": [ "STATUS.md", "docs/journal/2026-10-15-224.md", "fleet-tui/hostpoll.py", "fleet-tui/probe.py", "fleet-tui/tests/test_hostpoll.py", "fleet-tui/tests/test_probe.py", "tests/fleet-tui-test.sh" ], "tests": [ { "command": "bash tests/fleet-tui-test.sh", "exit_code": 0 }, { "command": "bash tests/docs-budget-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do bash \"$t\"; done (full offline suite)", "exit_code": 0 }, { "command": "python3 -I /tmp/verify_probe.py (drives probe.py as a subprocess: fp-glob-freshest, bare-base, absent, fp active-content, account_fp fallback+present)", "exit_code": 0 }, { "command": "python3 fleet-tui/hostpoll.probe_args (asserts marker paths derive from {home}/state, no /tmp)", "exit_code": 0 } ], "criteria": { "_marker globs <base>-* fingerprinted siblings and reports parked iff any is fresh, mirroring tui/data/limits.py": "fleet-tui/probe.py _marker now globs glob(path)+glob(path+'-*') and returns the freshest (min age); test_probe.py test_limit_marker_reports_freshest_of_base_and_fp_siblings (stale base + fresh fp sibling -> parked, age<3600). Active marker reads the freshest sibling's content: test_active_marker_reads_a_fingerprint_keyed_siblings_content.", "Reconcile the marker-path default with #205 (derive from the host state dir, not /tmp)": "fleet-tui/hostpoll.py: DEFAULT_*_MARKER /tmp literals replaced by LIMIT_MARKER_NAME/ACTIVE_MARKER_NAME base names; probe_args emits {home}/state/<name> (same convention as --db/--drive-log). test_hostpoll.py test_probe_args_defaults_and_registry_killswitch asserts /h/swarm/state/... and no /tmp.", "Optionally surface account_fp alongside account in the probe's spend rollup": "fleet-tui/probe.py spend_daily groups by account_fp via a nested fallback (fp+account+model -> account+model -> bare), preserving #96 grouping on pre-#200 dbs; test_probe.py test_spend_daily_surfaces_account_fp_when_the_column_is_present + the full-probe test asserting account_fp=None on a seeded (no-column) db.", "Out of scope: the in-repo tui/ reader + swarm-db.py limit-lost query (landed in #200)": "Untouched; no changes under tui/ or swarm-db.py." }, "summary": "The fleet-tui sampler now reads fp-keyed Claude markers (glob siblings, freshest wins), derives marker paths from the #205 host state dir instead of /tmp, and surfaces account_fp in the spend rollup — all forward-compatible with the not-yet-landed #200.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#224
No description provided.