Skip to content

Slim repo-fleet-monitor: snapshot/SQL-first state fetch + 2h cadence (target ≤3M/run) #2134

Open

Description

@dezren39

repo-fleet-monitor's function is load-bearing (queue↔GitHub reconciliation: claim/label divergence repair, dead-in-queue alerts, PR↔queue binding — the duty that ended the duplicate-PR class of failure). Its cost is not: 7.2M input per run, hourly (108M per 15h at check-in #5), because it re-derives state from GitHub lists and the queue helper every run.

Rebuild the fetch on the fleet-watchdog template (its 2026-10-28 rewrite cut state fetch to two SQL queries): precompute a compact state snapshot (queues, claims, labels, open PRs) deterministically, let the agent judge only the divergences, and move cadence 1h → 2h. No duty may be dropped. Target ≤3M input/run measured over the following three check-ins.

Activity

  1. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    Progress 2026-10-29 ~01:2x CDT: the cadence half is LIVE — repo-fleet-monitor now runs every 2h (definition edited in the git copy + posted as a replacement job; scheduler verified interval@2h, next run 03:12 CDT). Remaining on this issue: the snapshot/SQL-first state-fetch rewrite (the larger half of the saving, target ≤3M/run). Issue stays open for that work.

  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    TOP PRIORITY (Drew, 2026-10-29 01:23 CDT): Batch 3 fleet consolidation — pick this up in the next runs, ahead of routine work. Being enqueued to repo-health-code-pilot at top priority now.

  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 29, 2026
  5. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict — premise CONFIRMED with one correction, design decided, implementation routed

    Premise check (live state, 2026-10-29):

    • ✅ Cadence half is already done: repo-fleet-monitor is enabled at 2h in the live scheduler — the 1h → 2h move in this issue's text already happened, so the remaining work is the fetch rewrite only.
    • ✅ The cost mechanism is as described: the monitor re-derives state from GitHub lists + the queue helper each run (7.2M input/run at check-in Bump build/buck/preludes/buck2-prelude from 3a02ea3 to 370cd4d #5).
    • ⚠️ Correction to the "rebuild from scratch" framing: snapshot prototypes already exist in the goal workspace (hidden_files/monitor-fetch.py, monitor-query.py — PostgREST pulls of live queue tasks), but they are not wired into the monitor's run, and their saved outputs (monitor-gh-snapshot.json, monitor-tasks-snapshot.json) are stale from 2026-10-28. The implementation extends and wires these prototypes; it does not start from zero, and it must never judge from those stale files.

    Design (fetch rewrite)

    1. Deterministic precompute at run start. A script extends the prototypes above and emits ONE compact digest: live tasks from all four pilot queues (one PostgREST query per queue, live statuses only), joined against a bounded GitHub pull — only issues carrying queue/*/work/* labels and PRs bound to live tasks. Divergences are pre-flagged mechanically (claimed-but-unlabelled, labelled-but-no-live-task, expired lease still claimed, expired park, PR merged/closed but task open, issue closed but task open, dead-in-queue at max_attempts).
    2. The agent judges only the digest. Full lists stay out of context; a flagged item gets a targeted single-item fetch. Intake enrichment stays bounded/newest-first but draws candidates from the digest.
    3. Freshness is binding (the watchdog's rule, applied here): the digest is generated inside the run; a snapshot older than the run is not evidence.
    4. No duty dropped — duty → digest field mapping: reconciliation/auto-repair → divergence flags; dead-in-queue alerts → attempts flag; intake enrichment → unenriched-issue list; in-progress tracker → claimed-task/label join; protocol checks → work/* items whose latest agent note is stale or missing.
    5. Guardrail metric: success is ≤3M input/run over the following three daily check-ins and divergence-repair counts at or above the pre-rewrite run average — a cheaper run that quietly repairs less is a failure, not a saving.

    Routing

    Implementation filed as #2154 (instruction rewrite to the digest flow, script wiring, one evidenced full run, three-check-in measurement) and enqueued as a follow-on queue task in this same pass. Role note: repo-fleet-monitor stays Tend in the #2131 map; this rewrite is its slimming child in everything but name.

  7. added
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  8. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7296 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  9. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: triaged
    task: 7296 (triage, repo-health-code-pilot; repo-worker-code; OpenChamber scheduled lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc)
    session: ses_e5e5b5b8e50ffeShFhVywaC0NL
    state: triaged at current repository state; #2134 remains OPEN. No source or live job was changed.
    evidence:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions