Skip to content

Fleet observability: certify shift completion from queue state, not run self-report (uncertified runs) #1131

Closed

Description

@dezren39

Problem

Fleet shift runs keep ending "uncertified": a tool call or tool result inside the run never returns a success/failure status, so the run's own final report cannot confirm completion — even when every task it touched reached a verified terminal state. On 2026-10-26 this happened at least four times:

Today the recovery pattern is manual: the parent re-verifies merges, closures, and queue counts from GitHub/Supabase after the fact and reports what actually happened. That works, but it costs a verification pass on every affected shift and leaves a window where nobody knows whether work landed.

Proposal

Certify shift completion from durable state, not from the run's self-report:

  • A shift's completion record is the queue itself: per-task terminal states (complete/park/block with timestamps), the signal refresh, and the lane-lock release. A lightweight post-shift checker (the fleet monitor already reconciles queue ↔ GitHub hourly) compares the shift's claimed task set against terminal states and produces the certified summary line.
  • When a run ends uncertified, the delivery automatically falls back to the state-derived summary ("uncertified run — outcomes verified from queue/GitHub state: …") instead of a bare failure, so the report Drew reads is always grounded.
  • Track the uncertified-run rate per job as a fleet health metric; if it exceeds a threshold (say 2 in 24h for one job), the monitor flags it as an infrastructure problem in its summary rather than per-run noise.

Acceptance criteria

  • A shift that ends with an unconfirmed tool result still produces a delivery whose every claim is derived from queue/GitHub state (no parent improvisation needed).
  • The fleet monitor's summary includes, per shift job, runs completed vs uncertified for the last 24h.
  • No shift outcome is reported as simply "failed" when its tasks verifiably reached terminal states.

Filed by Muse (operator) 2026-10-26 at Drew's direction to keep improving the process.

Activity

  1. added
    kind/debtTechnical debt worth paying down deliberately
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  3. added
    area/infraInfrastructure, deployment, and operations
    effort/sSmall: expected under 2 hours of work
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    More instances, same evening (2026-10-26, after this issue was filed):

    That's six uncertified or undelivered shift reports in one day. In every case the work was verifiable from durable state (queue, sweep.log, GitHub) — which is precisely the certification source this issue proposes making automatic.

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 31, 2026
  6. 2 remaining items

  7. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  8. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

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

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Lane F
    • Session / ID: queue task 4644
    • Found via: queue claim
    • Task: Implement Fleet observability: certify shift completion from queue state, not run self-report (uncertified runs) #1131 — certify shift completion from queue state
    • Expectation: done. All three acceptance criteria now have a working mechanism:
    • Checker: hidden_files/tools/shift-certifier.py (goal keep-the-four-repos-healthy) compares each lane's §8 handoff snapshot against live queue task states (batch PostgREST read via repo-queue.py) plus PR states via gh, and emits one CERTIFIED/UNCERTIFIED line per lane. Dry-run 2026-11-01T14:20Z against the six current lane snapshots: all six CERTIFIED (lanes a–f), including progressed-since-snapshot annotations (e.g. lane e task 1829 since re-claimed; lane d in-flight 4021/5591 since done).
    • Fallback delivery: for any uncertified snapshot the certifier prints uncertified run — outcomes verified from queue/GitHub state: … with per-task queue/PR states — no parent improvisation needed; fleet monitor Duty 6 (added today via cron.update to repo-fleet-monitor, verified in the job definition) instructs the monitor to use that text verbatim and never report a shift as simply "failed" when its tasks reached terminal states.
    • Metric: the certifier appends to hidden_files/shift-certifications.jsonl and prints per-shift-job completed vs uncertified for the last 24h (dry-run: shift-a..f each completed=1 uncertified=0); >2 uncertified/24h for one job raises an INFRA FLAG line, and Duty 6 requires it in the monitor summary.
    • Tests: full dry-run in ~5s after batching the queue read (first per-task version timed out at 120s — fixed and re-verified); --summary-only mode verified; GH-enabled run on lane f verified PR states joined (PR 3696/3712 MERGED, others OPEN as recorded).
    • Links: epic epic(fleet): queue fleet reliability — lane workers for every queue, certified shift reporting #1233; script + ledger in goal hidden_files (autocommitted with the hatch-personal tree)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/infraInfrastructure, deployment, and operationseffort/sSmall: expected under 2 hours of workkind/debtTechnical debt worth paying down deliberatelypriority/normalOrdinary priority (the default)status:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions