Skip to content

impl(pm-stack): quota watchdog escalation — fleet queue task + deduplicated incident issue for a browser-enabled agent #6033

Closed

Description

@dezren39

Implements rung 4 of the browser-dependent quota watchdog (design #6031; core in the sibling watchdog-core issue). Separable from the core: the core detects and repairs; this issue is how a failure the ladder cannot fix becomes work for a browser-enabled agent — and, when only Drew can unblock it, becomes visible to Drew without delay.

Mechanism (per the design)

On escalation for a source, deduplicated by (source, failure class) — one open incident per pair:

  1. Fleet queue task enqueued (agent.tasks via fleet queue) with the full context packet, in the fleet's standing packet shape:
    • outcome wanted: "source <id> produces a fresh latest.json with real quota windows again"
    • failure context: class + class history, consecutive failures, the watchdog's persisted repairLog (every rung tried, with outcomes), producer history.jsonl tail reference, state-file path, adapter file reference
    • required capability, named so the claiming lane can actually do it: browser-enabled agent; laptop Helium via CDP (:19222); adapter origins only
    • acceptance check: a fresh producer document lands and the watchdog auto-closes the incident (the fixer does not close anything by hand)
    • stop conditions: a human-only challenge (2FA / verify-it's-you / passkey) → stop, mark human-blocked, do not work around it; anything outside the adapter's origin allowlist → stop and report on the incident issue
  2. GitHub incident issue opened in the repo that owns the adapter (Mistral: developing-today-forks/openchamber), cross-linked to design(pm-stack): browser-dependent quota watchdog — CDP scrape producers that self-repair, escalate to a browser-enabled agent #6031, labeled as a watchdog incident. This is the durable record and the fixing agent's reporting surface (FILE THE ISSUE discipline) — the queue task is the trigger, the issue is the record.
  3. Auto-close on recovery: the watchdog watches for the next producer success; on success it comments the resolution on the incident issue, closes it, and marks the queue task done. No human bookkeeping for recovery.
  4. Human-blocked surfacing: incidents whose blocker is a human-only step carry the flag/label the orchestration pass and stewardship sweep already use for NEEDS DREW items, and they surface immediately (not at the 24 h threshold) — a 2FA prompt is a 30-second Drew unblock, and the 2026-10-25 lesson (a sign-in wait sat unreported ~30 min) is the failure this prevents. Non-human escalations surface to Drew only if still unresolved 24 h after escalation (design open question 1 in design(pm-stack): browser-dependent quota watchdog — CDP scrape producers that self-repair, escalate to a browser-enabled agent #6031; threshold lives in one named constant).

Tradeoffs recorded in the design (why not the alternatives)

  • Issue-only escalation: durable but waits for a sweep — too slow as the sole trigger.
  • A dedicated cron spawning a browser agent on a flag file: guaranteed attention, but a standing job burning quota to watch an almost-always-empty inbox — rejected as primary (efficiency rule); revisit only if queue claim latency for browser-class tasks proves bad in practice, and say so on this issue if that evidence appears.

Acceptance criteria

  • Escalating a fixture incident creates exactly one queue task and one incident issue; a second escalation for the same (source, class) while the incident is open creates neither (dedup demonstrated).
  • The queue task packet contains the full context listed above — a browser-enabled agent can start from the packet alone.
  • A subsequent producer success auto-comments + auto-closes the incident issue and completes the queue task, with the watchdog's state incident cleared.
  • A human-blocked fixture is flagged for NEEDS DREW surfacing in the same tick it is marked, with the reason stated in one line.
  • An escalation unresolved at the threshold (24 h default) earns its NEEDS DREW line via the normal sweep path; before the threshold, Drew hears nothing (quiet-while-repairing rule).

Related: #6031 (design), #1260 (escalation split — Drew vs NEEDS ORCHESTRATOR), #2155 (orchestration residue in stewardship).

Activity

  1. added
    kind/featureNew feature or capability request
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Addendum (design doc updated): for the NEEDS DREW surfacing mechanics — non-human escalations reach the orchestrator through the aggregator's existing #1148 watchdog tier items (watchdog:<input>, derived from input diagnoses) once the core (#6032) exposes the source state as a diagnosis; human-blocked promotion to Drew happens via the orchestrator's review of that item. The 24 h threshold and the queue-task + incident-issue mechanism are unchanged.

  4. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage — task 10399, issue #6033

    Verified fresh: issue #6033 OPEN, labels include kind/feature, app/pm-stack, status/needs-triage — no hard-stop labels. Design issue #6031 is OPEN, so the design this issue says it implements ("per the design", rung 4) is not yet a closed/recorded decision; its open question 1 (24h surfacing threshold) is explicitly referenced by issue #6033 as still in the design.

    Routing: implementation is well-scoped once the design + the sibling watchdog-core land — acceptance is fixture-testable (dedup by (source, failure class) creating exactly one task + one incident issue, packet completeness, auto-close on producer success, human-blocked immediate surfacing, 24h threshold in one named constant). Sequence: issue #6031 design recorded → watchdog-core sibling → this escalation rung. Do not implement ahead of the core: this rung consumes the core's repairLog / incident state, which do not exist yet. No small_fix enqueued; issue #6033 stays OPEN, ready to route as an implementation task after the core.

    Outcome for task 10399: triaged.

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  7. 119 remaining items

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/triagedTriaged and routed (see agent note)
    on Nov 17, 2026
  9. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — lane any-l · task 20118 · state: claimed / in-progress

    Picked up task 20118 (rung-4 escalation wiring remainder for #6033). Lane assignment: direct — this session does the work.

    Revalidated fresh this claim:

    Work area: laptop worktree ~/git/fleet/queue-20118-6033, branch queue/20118-6033-rung4-wiring from origin/main 557dd4fb54.

    Next: read the core's escalation rung and the escalation module's entry points, wire the invocation, add fixture acceptance tests (dedup per (source, failure class); producer success auto-closes; human-blocked surfaces NEEDS DREW immediately).

  10. added 2 commits that reference this issue on Nov 17, 2026
  11. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — lane any-l · task 20118 · state: done (fixed_merged)

    The rung-4 live path is wired, deployed, and demonstrated end-to-end. Closing #6033.

    What was actually missing. The #6032 core (PR #11243) already invoked the escalation module — but its production enqueueTask built a packet the fleet queue validator rejects on 13 fields (no payload.repo/problem/evidence/acceptance/tests/context_refs/scope/risk/timebox/dedupe, no payload identity, and a dedupe key matching no design pattern; proven with fleet queue validate before the fix). Since enqueue ran first, a live escalation would have created neither the queue task nor the incident issue.

    Fix — PR #11268 (merged, 6fe4d6dc7e25b5a46b755917a96b35caba2c3448), deployed to ~/pm-stack/exporters/ (verified identical to origin/main; timer active):

    • The hand-off now creates the incident issue first — a small_fix packet's fix-family dedupe key must name an existing issue — and applyEscalationActions stamps the confirmed issue number into the enqueue packet.
    • New pure buildQueueTaskWrapper translates the escalation packet into the validated repo-task/v1 envelope, with the full escalation context in payload.escalation_packet. The generated wrapper passes the real validator (packet valid (repo-task/v1)).
    • Recovery completion fixed after the first live cycle exposed it: complete requires holding a claim the watchdog never takes, so an untouched (never-claimed) escalation task is now cancelled with the recovery reason; a task with an owner is left to them.

    Acceptance, demonstrated live (production effectors, fixture adapter, 2026-11-17):

    1. Escalation created exactly one queue task + one incident issue per (source, class): cycle 1 → task 20753 + issue watchdog incident: fixture quota producer failing (unknown) #11269; cycle 2 → task 20754 + issue watchdog incident: fixture quota producer failing (unknown) #11271 (queue DB-verified dedupe keys repo-health:v1:fix:developing-today/code:issue:<n>). A second failing tick created neither (refs unchanged).
    2. Producer success auto-commented and auto-closed the incident issue and resolved the queue task with no human bookkeeping (cycle 2's task 20754 cancelled by the watchdog itself; cycle 1's task 20753 cancelled by hand with the same reason — it predated the fix).
    3. Human-blocked surfacing: covered at tick level — the entry-point test marks the incident human-blocked and emits the NEEDS DREW line the same tick (a live browser challenge cannot be fixtured without a browser; the deployed rung-3 produces that detail from real challenge markers).
    4. Packet completeness: the claimed task carries outcome, failure class + history, repair log, history/state/adapter refs, the browser-enabled capability, acceptance, and stop conditions (unit-tested + the live tasks above).

    Tests: exporters suite 39 pass / 0 fail. Codex review produced no findings (its runs failed on Codex usage limits; disposition recorded on PR #11268).

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

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codedesign/quota-planeDesign: quota-plane - all issues of this effort carry iteffort/lLarge: multi-day or open-ended; expect staged check-insepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions