Skip to content

pm-stack/dispatch is a direct PostgREST producer bypassing the packet validator and the queue broker (Phase 4 disposition (b) of #6449) #9028

Closed

Description

@dezren39

agent-note:v1 — filed by queue task 15303 (lane any-c) as required disposition (b) of the Phase 4 closing inventory on #6449 (design #6448). Filed, not silently fixed, per that issue's acceptance criteria.

pm-stack/dispatch is a direct PostgREST producer that bypasses the packet validator and the queue broker (Phase 4 disposition (b) of #6449)

Finding

Design #6448 decision 2 left the SQL layer unchanged because every evidenced path into the queue passed through the validator or the broker. The Phase 4 inventory searched the repo and the claimant for direct producers and found one:

  • pm-stack/dispatch/src/queue.ts — QueueClient.rpc() POSTs directly to ${baseUrl}/rest/v1/rpc/${name} with the service-role key. enqueue() calls enqueue_repo_task / enqueue_repo_task_fleet forwarding p_title, p_body, p_payload, p_dedupe_key, p_priority, and p_max_attempts taken from packet.payload.max_attempts — with NO validate_packet pass: an unvalidated max_attempts, priority, not_before-class value, or mistyped payload field reaches the RPC exactly as the pre-Validate what you forward — one validation contract for the fleet queue's packets and verb values #6448 gap allowed.
  • The same client also PATCHes task rows directly (patchTask, rest/v1/tasks?id=eq.<id>) to "assign immediately" — a claim-equivalent write that bypasses claim_repo_task's eligibility predicate entirely.
  • It is wired live in code: pm-stack/dispatch/src/server.ts constructs QueueClient whenever a Supabase service-role key is configured (server.ts:51) and enqueues through it (server.ts:241, server.ts:503); launch_annotations.ts:53 uses patchTask.

The opencode claimant (pm-stack/opencode-claimant) was searched too: it has no Supabase/PostgREST/direct-RPC path — it reads and writes through the broker. No other direct producer was found in the repo (searches for the RPC names, rest/v1/rpc, rest/v1/tasks outside pkgs/fleet/crates/fleet-queue).

What this reopens

Per #6449 disposition (b): only a found direct producer reopens the SQL-guard question, and it is filed, not fixed in Phase 4. The open questions for this follow-up:

  1. Is pm-dispatch still deployed with a service-role key against a live queue store? The live queue backend is now Turso (the broker's PostgREST path is the legacy backend); if the dispatch server still runs against the old Supabase project, determine whether that store is live, read, or a zombie.
  2. If it is live: route its enqueue through the broker (or run validate_packet semantics before the RPC) and replace the claim-PATCH with a broker claim path; if the SQL layer becomes the only guard for a live path, the migration-guard question from Validate what you forward — one validation contract for the fleet queue's packets and verb values #6448 decision 2 is back on the table with this evidence.
  3. If it is retired: remove or quarantine the client so the next audit does not have to re-derive its liveness.

Evidence

Audit at code origin/main d7ad9d0, recorded in full on #6449 by task 15303. File:line — queue.ts rpc() (:72), enqueue() (:92), patchTask() (~:115); server.ts:51,241,503.

Activity

  1. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up + triaged

  3. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    status/triagedTriaged and routed (see agent note)
    on Nov 17, 2026
  4. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · in-progress (parked for capacity — resume state below)

    Verified fresh (2026-11-16):

    • pm-dispatch is running on the laptop (user service, active).
    • pm-stack/dispatch/src/queue.ts is exactly the filed defect: its header reads "Supabase queue client (PostgREST, agent schema)"; enqueue() POSTs rpc enqueue_repo_task / enqueue_repo_task_fleet (queue.ts:107) to the Supabase store; patchTask (queue.ts:129) PATCHes task rows directly. server.ts:51 constructs it whenever the service-role key is present: cfg.supabaseServiceRoleKey ? new QueueClient(...) : null. The live queue store is Turso (fleet queue health/claims resolve there), so these writes land in the legacy store where no lane claims — as filed by task 18812's triage.

    Why parked, and the resume plan:

    Issue #9028 stays open; task 20268 is parked (capacity) and will surface to a fresh full-budget shift.

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 17, 2026
  6. 152 remaining items

  7. added and removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 19, 2026
  8. dezren39 commented on Nov 19, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 20268
    issue: #9028
    lane: oc-code-05
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    stage: picked-up -> verified

    Claimed and checkpointed task 20268. Fresh GitHub checks confirm #9028/#6449 are CLOSED, PR #10986 is MERGED at bb02d18, and #6449 records the #6448 decision-2 disposition. Latest #9028 operator evidence remains the 2026-11-19T21:43:33Z note, which says the deployment gate is unresolved. Still required: NixOS switch/restart on the merged build, deployed-build health, absence of SUPABASE_* process-environment names (names only), and a dispatch enqueue visible in Turso. No deploy, secret-value inspection, production dispatch, source change, or protected-worktree access. I will preserve the existing branch/worktree and re-park pending verifiable operator evidence.

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

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 20268
    issue: #9028
    lane: oc-code-05
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    stage: verified -> parked

    Fresh GitHub verification confirms #9028/#6449 CLOSED and PR #10986 MERGED; #6449 records the #6448 decision-2 disposition. No operator evidence resolves the live deployment gate: NixOS switch/restart on the merged build, deployed-build health, absence of SUPABASE_* process-environment names (names only), and a dispatch enqueue visible in Turso. Task 20268 parked for 30 minutes. No deploy, secret-value inspection, production dispatch, source changes, or protected-worktree access. Preserve branch queue/20268-9028-deploy-verification and worktree /home/user/git/fleet/queue-20268-9028-deploy-verification. Resume only after verifiable operator evidence for all four checks, then revalidate. Sandbox bookkeeping deferred to fleet reconciliation.

  11. dezren39 commented on Nov 19, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 20268
    issue: #9028
    lane: oc-code-05
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    state: picked-up -> escalated-to-user (blocked)

    Fresh revalidation (2026-11-19T22:55Z, laptop-local, read-only): #9028 and #6449 remain CLOSED, PR #10986 MERGED at bb02d18, #6448 decision-2 disposition recorded on #6449. The live deployment gate is still unmet, verified directly: pm-dispatch.service active since Nov 16 18:24 CST on the pre-merge build (/health version 7d3dceb, not the merge commit), and its process environment still contains SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY (names only; values never read). No dispatch enqueue was exercised; no deploy, restart, secret-value inspection, or source change performed.

    Why blocking instead of re-parking: this task has cycled park→reclaim→park across five-plus lanes since 13:00Z today with no operator evidence arriving. The four outstanding checks (NixOS switch/restart on the merged build, deployed-build health, SUPABASE_* names absent, Turso-visible dispatch enqueue) all require a privileged live-service deploy on this laptop — a decision and action that is genuinely the operator's, per the fleet's standing no-unauthorized-deploy discipline.

    My read for Drew: the code outcome is done and merged (dispatch now talks only to the queue broker; the direct PostgREST producer is gone from source). Two ways to close this out:

    1. Operator performs (or explicitly authorizes a lane to perform) the recorded deploy sequence: amd switch from primary at origin/main → pm-stack/dispatch/install.sh env render + tree copy → systemctl --user restart pm-dispatch.service → verify /health commit, SUPABASE_* names absent, and a test enqueue visible in fleet queue list (Turso). Note lane any-x's 2026-11-17 attempt: switch attempt 1 failed on the mcpx reap-timing test under load (code#8900 family); retry past that stage was left running detached (~/.local/state/amd-switch-20268-retry.log) — check whether it ever completed before redoing it.
    2. Or decide the post-deploy verification is operator-owned follow-up, accept the merged code outcome as the task terminal, and this task closes with the deploy tracked as an operator action item.

    Task 20268 blocked (escalated-to-user) with this evidence; branch queue/20268-9028-deploy-verification and worktree /home/user/git/fleet/queue-20268-9028-deploy-verification preserved. Sandbox bookkeeping deferred to fleet reconciliation.

  12. added
    status/blockedQueue or user escalation state
    queue/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 19, 2026
  13. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 20268
    issue: #9028
    lane: oc-code-05
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    state: claimed -> hands-blocked

    The code change is already merged (#10986), while the remaining post-merge gate requires a live NixOS operator login and deployment action. Reclassified only that step as an interactive-login hands item; task 20268 is blocked in the queue, not waiting on a decision. Required evidence remains the merged-build switch/restart and health, absence of SUPABASE_* environment names (names only), and a Turso-visible dispatch enqueue. No deployment, secret-value inspection, production dispatch, or protected-worktree access was performed.

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

Metadata

Metadata

Assignees

Labels

effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivequeue/blockedQueue or user escalation statestatus/blockedQueue or user escalation statetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsuser/escalatedRequires a Drew decision or accesswork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions