GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fleet-queue: needs-drew alerts into the PM throat on escalated blocks (code#8568) by dezren39 · Pull Request #8598 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fleet (Rust) half of PM-stack notifications Phase 1 for #8568: the queue block path now raises a needs-drew event into the PM alert throat.

Wire contract (as fixed by the aggregator lane, unchanged): POST http://127.0.0.1:4870/api/alerts (env override FLEET_ALERTS_URL), Authorization: Bearer <token> where the token is the Bitwarden secret named pm-aggregator.alerts-intake-token resolved by name, body {"source": "fleet-queue", "key": "needs-drew:<ledgerId>", "severity": "warning", "title": <question>, "body": <context or blocker>, "needsDrew": {...}}. The throat dedupes by (source, key); the raise is idempotent.

What changed (pkgs/fleet/crates/fleet-queue):

  • src/needs_drew.rs (new): pure payload builder build_throat_body(&BlockNeedsDrew) -> serde_json::Value pinned by unit tests (exact key/title/needsDrew shape, optionals omitted when absent, blocker as body fallback); a minimal HTTP/1.1 JSON POST helper over std TcpStream (client.rs transport style); post_needs_drew(token, nd) returning the response's answerUrl when present; plus the snake_case needs_drew block-request parser both halves share.
  • src/client.rs (cmd_block): new optional flags --ledger-id, --question, --context, --options-json, --links-json. For escalated-to-user blocks with --ledger-id + --question: the /block body gains "needs_drew": {ledger_id, question, context?, options, links}, and "needs_drew": {"ledger_id": …} is merged into the progress object (preserving caller --progress content) so the current broker stamps the ledger id onto the task row with no broker change. After the block succeeds, the intake token is resolved by name in-process via fleet_secrets::Resolver::default_chain — the exact machinery behind the fleet secrets get verb (direct secrets-broker source on the laptop, session-proxy source in the sandbox, bws fallback; the queue CLI has no other named-secret resolver of its own) — and the alert posts. Emission failure prints repo-queue: WARNING: needs-drew throat post failed: <err> to stderr and still exits 0; success prints repo-queue: needs-drew raised for ledger item <id> to stderr; stdout keeps its current JSON shape exactly. Escalated blocks without the flags behave exactly as before.
  • src/queue_broker.rs (/block): after a successful block with reason_class == "escalated-to-user" and a needs_drew payload, the same POST fires from inside the broker process, fire-and-forget on a spawned thread, token resolved via the in-process secrets source (DirectSecrets — the colocated secrets broker, the same source every other broker credential uses); failures are logged to stderr only. The hook is applied on both the Postgres simple_rpc arm and the Turso dispatch branch (dispatch hands /block to the Turso backend before the match, so a Turso-backed broker would otherwise never see it).

Deployment, plainly: the CLI half is the live path once the CLI binary is replaced. The broker half cannot go live until the broker binary is replaced (the coordinated switch) — this PR does not replace any binary and does not restart queue-broker. The release fleet binary built from this branch is staged on the laptop at ~/tools/staging/fleet-8568/fleet (sha256 5735008dd51b85a11ee2412351e130dd416fab5155aca826b2ba691e683a0b90, 6,982,776 bytes) for that switch.

Tests: cargo test -p fleet-queue — 30 passed (default features); cargo test -p fleet-queue --all-features — 257 lib tests passed including the 7 new needs_drew tests, plus 2 broker_bin_args tests; 0 failures. cargo build --release -p fleet clean (pre-existing warnings only). Staged-binary smoke: new flags parse and bad --options-json/--links-json die with exit 2 before any broker contact. No live block was performed (that would block a real task and push Drew's phone).

Refs #8568.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fleet
fleet-queue: raise needs-drew alerts into the PM throat on escalated …
995161f
…blocks (code#8568)

Phase 1 of PM-stack notifications: the queue block path learns to speak to the aggregator alert throat (POST /api/alerts, source fleet-queue, key needs-drew:<ledgerId>, deduped by the throat so both halves may post safely).

- New needs_drew module: pure throat-body builder pinned by unit tests, a minimal std-TcpStream HTTP/1.1 POST helper, and the snake_case needs_drew block-request parser both halves share.
- CLI (cmd_block): --ledger-id/--question/--context/--options-json/--links-json on an escalated-to-user block add needs_drew to the /block body and merge needs_drew.ledger_id into progress (so the current broker stamps the ledger id onto the task row with no broker change); after the block lands, the intake token resolves by name via fleet-secrets Resolver::default_chain (the fleet secrets machinery) and the alert posts. Emission failure warns on stderr and still exits 0; stdout shape unchanged. Escalated blocks without the flags behave exactly as before.
- Broker (/block route): after a successful block with reason_class escalated-to-user and a needs_drew payload, the same post fires fire-and-forget on a spawned thread, token resolved via the in-process DirectSecrets secrets source; failures log to stderr only. Hooked on both the Postgres simple_rpc arm and the Turso dispatch branch.
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 07:37
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab97342e-0abd-4fb4-b14d-86972d2c6675
Commits

Reviewing files that changed from the base of the PR and between 1a06801 and 995161f.

Files selected for processing: 4

  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/lib.rs
  • pkgs/fleet/crates/fleet-queue/src/needs_drew.rs
  • pkgs/fleet/crates/fleet-queue/src/queue_broker.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T07:41:18.042992Z 995161f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39

dezren39 commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Merging over merely-QUEUED checks, per established practice: every check is still pending/queued (none red, none failed) and this change is verified locally on the laptop — cargo test -p fleet-queue --all-features: 257 lib tests passed (including the 7 new needs_drew tests) + 2 broker_bin_args, 0 failures; cargo test -p fleet-queue (default features): 30 passed; cargo build --release -p fleet clean. The change is additive and feature-contained in fleet-queue; no binary is deployed and queue-broker is not restarted by this merge — the staged binary at ~/tools/staging/fleet-8568/fleet awaits the coordinated switch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit ab15e73 into main Nov 11, 2026
1 of 11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/8568-notifications-phase1-fleet branch November 11, 2026 07:39
@dezren39 dezren39 mentioned this pull request Nov 11, 2026
pm-stack notifications Phase 1: wire the missing producers — queue escalations + stack-health into the throat, fix subscription class backfill, answerable needs-drew pushes #8568
Closed
5 tasks
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 11, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 995161fca4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/needs_drew.rs
Comment on lines +100 to +103
"severity": "warning",
"title": block.question,
"body": body,
"needsDrew": needs_drew,

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 11, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Coordinate the needs-drew receiver before enabling emission

Against the aggregator included in this commit, these POSTs succeed without notifying Drew or preserving the actionable question. The /api/alerts handler in pm-stack/aggregator/src/server.ts:2348–2357 passes the body through validateNewIncident, whose projection in alerts.ts:319–327 discards needsDrew, including its ledger ID, options, and links. Furthermore, pendingDeliveries in alerts.ts:570–577 selects only critical incidents, so this warning never generates a push. Land the matching receiver support before enabling this producer; otherwise both CLI and broker report successful raises while escalated tasks remain without the intended notification.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/queue_broker.rs
Comment on lines +838 to +840
if resp.get("ok").and_then(|v| v.as_bool()) != Some(true) {
return;
}

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 11, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require a transitioned task row before raising an alert

On the Postgres path, simple_rpc wraps any successful RPC response as ok: true, including a null row. The client explicitly treats that null row as an unsuccessful block in require_row (for example, when the task is no longer claimed by the requesting worker), but this hook checks only the envelope and still emits the question. Consequently a stale or repeated block request can raise an alert even though no task was blocked. Require a non-null response row before spawning the notification thread, matching the client's success criterion.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
pm-aggregator: subscription class backfill from #8568 gap 1 never landed (audit of PR #8597) #13940
Closed
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.