Skip to content

pm-stack: push answer write-back to the queue broker — a phone tap applies broker-sourced decides (Actions-exec extensions first) #14043

Backlog

Description

@dezren39

PM stack next phase — push answer write-back to the queue broker

The phase: a phone tap on a broker-raised push writes the answer back to the queue broker, so the broker applies it directly — no seat-run intermediary.

Where v1 stops (the gap): the fleet Actions exec tiered lease-extension policy (#13774, tiers live via PR #13854) raises its tier-2/tier-3 asks as answerable pushes. Drew's tap records his answer in the PM ledger through the Phase 1 answer machinery (the tap posts to /api/needs-drew/<ledgerId>/answer under the per-question token; the resolution is recorded and exported like any other). But nothing then applies that answer to the broker: a seat notices the recorded answer and runs /actions-exec-extend-decide ({handle, approve: bool}) by hand. #13774's endpoint list names this exactly: "the phone tap → broker write-back is the PM stack's next phase; v1's write-back is a seat running this verb on Drew's recorded answer." The broker-side alert builder says the same (pkgs/fleet/crates/fleet-queue/src/needs_drew.rs: "the phone -> broker write-back is the PM stack's next phase").

What this phase delivers: when a recorded answer belongs to a broker-sourced alert (first consumer: source fleet-actions-exec, key actions-exec-ext:<handle>, options approve/deny), an applier calls the broker's decide verb with the recorded answer — automatically, exactly once, and with failures raised as alerts rather than dropped log-only. The seat-run step disappears; the ledger remains the place of record for the answer itself.

Why this is design-first (the seams a design of record must settle before a build packet):

  1. Applier placement — aggregator-side dispatch when a broker-sourced resolution is recorded, vs broker-side consumption of the resolution records the aggregator already exports to the ledger/fleet-feed path. The choice spans both codebases (pm-stack aggregator, pkgs/fleet broker).
  2. Identity and authority — the decide route is seat-shaped (a seat acting on Drew's answer). What identity does the applier present to the broker, and how does the broker know the call carries Drew's genuine recorded answer? The per-question answer token's authority ends at the aggregator; the broker needs its own reason to trust the application.
  3. Exactly-once application and races — intake dedupes double-taps/retries by answer id; application must additionally be idempotent against an already-decided session, an expired decision grace, and a tier-2 silence-approval landing before a late tap arrives.
  4. Failure behaviour — a failed decide application must raise a visible alert (the PM alerts throat returns 401 for the current alerts-intake token — broker-raised pushes dropped #13902 lesson: today a failed raise is a broker log line and nothing else).

Dependency: #13902 (the PM alerts throat returns 401 for the current alerts-intake token — broker-raised pushes dropped) is the prerequisite for any live end-to-end proof: until pushes flow again, a tap answer cannot be exercised against a real session. The aggregator-restart fix for #13902 is in flight as its own lane. Design work for this phase can proceed in parallel; the live proof cannot.

Sibling, not duplicate: #13469 (Phase 2 step 3: edge answer intake + heartbeat drain) is the transport that lets Drew answer while the laptop is down; it lands answers in the same ledger and explicitly leaves "the catcher's application of answers" out of its scope. This phase is that application step, for broker-sourced alerts. The two compose: however an answer reaches the place of record, the applier consumes it from there.

Acceptance (phase level): on a live Actions exec session, Drew taps approve (or deny) on the extension push and the broker applies the decide with no seat in the loop — the session's lease state reflects the answer, the application is recorded against the answer's record, and a forced application failure raises an alert Drew can see. Proven live, the way ACTIONS-EXEC-3's tiers were proven on the production broker.

Prioritization: Drew, 2026-11-23 ~21:13 CST — "Please prioritize that next phase." (Recorded in full, with the queue packet, in the comment below.)

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T03:19:33Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Acceptance criteria

  • A phone tap on a broker-sourced decide applies the answer to the queue broker (write-back path proven end to end).
  • The Actions-exec extensions this depends on land first, per this issue's own sequencing.
  • S4 applier failure alerts and retry behaviour are covered (the queue task 21656 slice in the comments).

Activity

  1. developing-today commented on Nov 24, 2026

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

    @dezren39
    MemberAuthor

    Prioritized by Drew — queue packet recorded

    Drew's instruction (2026-11-23 ~21:13 CST), in his words: "Please prioritize that next phase." — given on the ACTIONS-EXEC-3 completion report, whose closing note named this gap: the phone-tap answer doesn't write back to the broker yet, so tier-2 and tier-3 answers land through a seat-run decide step on his recorded answer.

    What the phase delivers, end state: Drew taps approve or deny on the extension push → the answer, already recorded in the PM ledger by the Phase 1 answer machinery, is applied to the queue broker's /actions-exec-extend-decide automatically → the session's lease reflects the answer with no seat in the loop, exactly once, and with application failures raised as visible alerts rather than log lines.

    Dependency: #13902 (the PM alerts throat 401 — broker-raised pushes currently dropped) must land first for any live end-to-end proof; its aggregator-restart fix is running as a separate lane. The design work below does not wait on it.

    First packet (design-completion slice): task 21648 on queue repo-health-code-pilot, status queued, kind feature_slice (slice 1: "pm write-back design of record"), dedupe key repo-health:v1:slice:developing-today/code:issue:14043:slice-1.

    Priority: 90 — raised above the programme-standard 70 used for head slices (e.g. tasks 21621/21626) and above everything in the actionable queue at enqueue time (queued maximum was 50), short of 100, which stays reserved for drop-everything emergencies. The packet's priority_reason carries this.

    Why a design slice first, plainly: the build is not packetisable yet. Four seams need a design of record (they are listed in this issue's body): where the applier lives (aggregator-side dispatch vs broker-side consumption of exported resolutions); what identity the applier presents to the seat-shaped decide route and how the broker trusts that the call carries Drew's genuine recorded answer; exactly-once application against already-decided/expired sessions and the tier-2 silence-approval race; and failure alerting. Slice 1 settles all four and ends with the build-slice map on this issue, each slice sized to a single packet.

    — Lane PUSH-WRITEBACK-PRIORITY, 2026-11-24.

  3. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Design of record is up as an unmerged doc-only PR: #14046 (doc/2026-11-24_design_pm14043_answer_writeback.md + one index line).

    Seats settled

    1. Applier placement: aggregator-side, on recordAnswer. Rejected broker-side consumption of the exported feed.
    2. Applier-to-broker authority: aggregator signs the decide body (HMAC over handle|approve|answer_id|answered_at, key by name). The broker accepts sig only on /actions-exec-extend-decide; unsigned seat calls keep working. Rejected: a dedicated seat credential, loopback trust.
    3. Exactly-once: applier ledger keyed by answer_id (pending/applied/superseded/rejected/failed); broker's existing silence-approved and settled outcomes are terminal; a second answer for a handle is superseded.
    4. Failure: each failed application raises actions-exec-apply:<answer_id> (high); transient failures retry; if the throat is down the failure is re-raised on recovery.

    Build slices, dependency order

    • S1 broker: signed decide envelope (turso_queue/actions_exec.rs, client/actions_exec.rs). Done: cargo test -p fleet-queue covers valid/bad sig, expired answered_at, unsigned seat call.
    • S2 aggregator: ledgerId → {source, key, handle} mapping at raise (needs-drew.ts, alerts.ts). First step verifies the raise stores the key. Done: unit test.
    • S3 aggregator: applier loop (new actions-exec-apply.ts). Needs S1+S2. Done: one test per race row, double-tap = one decide.
    • S4 applier failure alerts and retry. Needs S3. Done: forced broker-failure gives one alert; forced throat-failure alerts on recovery.
    • S5 live proof (ACTIONS-EXEC-3 shape), needs S1–S4 and PM alerts throat returns 401 for the current alerts-intake token — broker-raised pushes dropped #13902 fixed. Done: tier-3 tap approves, max_until moves, applier row applied.

    S1 and S2 are parallel. #13469 composes: edge answers land in the same needs-drew store, read by the same applier; no second path. Not merged, for Archer.

  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Correction — the priority-90 claim was inverted.

    Drew corrected the queue's priority semantics on 2026-11-23 (~21:45 CST): in the fleet queue, a higher number means LOWER priority. The earlier record on this issue (comment 7121013819) and the task packet's own priority_reason both stated the opposite — that task 21648's priority of 90 placed it "above the programme-standard 70" and above everything else in the actionable queue. That was backwards. Broker read-back (2026-11-24T03:46Z) shows the actionable queue's priorities currently span 20–70, so at 90 the write-back design task actually sat below every other actionable task, including the programme slices at 70.

    In the event, the inversion did no practical harm here: lane oc-code-06 claimed task 21648 at 2026-11-24T03:22:23Z and completed it at 03:24:16Z, and the design of record is posted on this issue (comment 7121052937; PR #14046). Because the task is terminal (done), no reprioritization is possible or outstanding — priority is set at enqueue and the broker has no reprioritize verb for a completed task.

    The same correction applies to Archer's chat report wording from that evening. It does not change any other task's relative order: all of today's programme tasks (21649, 21646, 21647, 21620, 21626, 21630) share priority 70, verified by broker read-back. Standing rule going forward: anything meant to be raised in this queue gets a LOWER number.

  5. added a commit that references this issue on Nov 24, 2026
  6. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Build slices packetised — all five from the design's map are queued

    The design of record's build-slice map (design doc §6, summary in comment 7121052937) is now packetised. Each packet mirrors the #13948 S-series shape (repo-task/v1, kind feature_slice with payload.slice, progress on this issue at every boundary, PR against main with "Part of #14043", no closing keywords, the worker does not merge), routed on queue repo-health-code-pilot to the laptop OpenCode lanes.

    Design slice Task Dedupe key Priority
    S1 — broker: signed decide envelope 21653 repo-health:v1:slice:developing-today/code:issue:14043:slice-2 40
    S2 — aggregator: answer-to-handle mapping 21654 repo-health:v1:slice:developing-today/code:issue:14043:slice-3 40
    S3 — aggregator: applier loop 21655 repo-health:v1:slice:developing-today/code:issue:14043:slice-4 40
    S4 — applier failure alerts and retry 21656 repo-health:v1:slice:developing-today/code:issue:14043:slice-5 40
    S5 — live proof 21657 repo-health:v1:slice:developing-today/code:issue:14043:slice-6 40

    All five read back as queued on the broker after enqueue (2026-11-24T05:26–05:27Z).

    Numbering note: the dedupe keys run slice-2..slice-6 because slice-1 is held by the completed design task 21648 and the packet validator requires the slice-<k> key pattern. Each packet's payload.slice carries both numbers (number = key number, design_slice = the design's S-number, name = "Build S — …"), so the mapping above is also recorded inside every packet.

    Priority 40, and why: Drew prioritized this phase (comment 7121013819). Under the corrected semantics (higher number = LOWER priority), 40 sits above the general programme band at 70 and below the top actionable band at 20 — raised per Drew's explicit prioritization, not into the top band. Each packet's priority_reason carries this.

    Dependency order, as packetised: S1 and S2 are independent. S3's packet requires S1+S2 landed; S4's requires S3; S5's requires S1–S4 landed and deployed plus the #13902 prerequisite. Following the #13948 S-series pattern, each dependent packet instructs its claiming session to verify the predecessors' state on this issue first and park naming the unmet prerequisite if one has not landed. On #13902: that issue's fix landed and it is closed (2026-11-23), so S5's prerequisite is already satisfied in substance; S5's packet still has the claiming session verify the deployed legs (broker accepts the signed decide, aggregator runs the applier, throat accepts a broker-raised alert) and park naming whatever is not live.

    What could not be packetised exactly — named rather than invented:

    1. The HMAC key's name. The design gives it only as an example ("for example pm-aggregator.actions-exec-apply-key", design §2). S1's packet carries that example name and instructs the slice to record the settled name on this issue if it differs. No other name was invented.
    2. The answered_at window length. The design requires "a bounded window" (§2) without naming a duration. S1's packet requires enforcing a bounded window and tests an expired answered_at, but fixes no number — the slice settles it and records it here.
    3. Who deploys S1–S4 for S5. The design says S5 depends on S1–S4 and PM alerts throat returns 401 for the current alerts-intake token — broker-raised pushes dropped #13902 "landing" without assigning deployment. S5's packet records deployment as Archer-coordinated from the slices' records and has the claiming session verify the deployed state rather than assume it.
    4. Aggregator test commands. Unlike S1 (the design names cargo test -p fleet-queue), the design states S2–S4's done checks as unit tests without naming a runner. The packets carry the done checks as written and invent no command.

    Premise checks behind this record: this issue read in full (4 comments, count-confirmed); the design doc read from main; live queue lists (queued/parked/claimed/blocked, limit 300) checked for this issue before enqueue — no build packets existed; the only prior task is 21648 (design, done).

    — Lane WRITEBACK-PACKETS, 2026-11-24.

  7. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Lane code-i premise check for task 21655 (S3 applier loop, claimed 2026-11-24T05:26:48Z, lease to 09:26:48Z).

    Design of record re-read in full (doc/2026-11-24_design_pm14043_answer_writeback.md §§1–7, 5 comments on the issue). S3 spec confirmed: new pm-stack/aggregator/src/actions-exec-apply.ts + wiring, answer_id state machine (pending/applied/superseded/rejected/failed), race table §3, double-tap guard, one-answer-path composition with #13469.

    Prerequisite check: S1 task 21653 (broker signed decide envelope) status = claimed, not done/merged. S2 task 21654 (aggregator answer-to-handle mapping) status = claimed, not done/merged. Per the slice packet, S3 needs both S1+S2 landed first. Parking 21655 naming the unmet prerequisite; will re-claim once S1+S2 are done. No code changes made, no PR opened.

  8. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    oc-code-07 claim/premise checkpoint: I re-read #14043 and all 4 paginated comments (count confirmed). No same-slice build/landed record is present; the existing design record says S2 must first verify the raise stores the key. I am checking main-branch code and the current raise payload before implementation. The requested laptop transport is unavailable from this seat, so I am preserving the primary checkout and looking for an isolated, clean worktree route.

  9. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Agent note — S1 claimed, premise checked (task 21653, lane oc-code-04)

  10. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    S2 premise verification (before implementation): on main at 7e28014, build_extension_alert_body puts source: "fleet-actions-exec" and key: info.key on the incident; needsDrew.ledgerId is also info.key. The aggregator intake parses/stores the needsDrew extension separately: validateNeedsDrew keeps ledgerId/question/context/options/links only, then raiseNeedsDrew(..., parsed.value.source) stores the source but no key or handle. So the current question preserves source + ledger ID, but does NOT preserve key/handle. For the target Actions-exec producer, the key equals the ledger ID (actions-exec-ext:<handle>), so the handle can be safely resolved only after explicit mapping/storage is added; the design’s inferred key-preservation assumption is not true today.

  11. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    S2 implementation checkpoint: the intake now passes the incident key into the needs-drew raise; raises persist a broker mapping only for source fleet-actions-exec with a non-empty actions-exec-ext: key, and the resolver returns a handle only for an answered question whose stored mapping validates. Added focused tests for broker and non-broker answers. Next: run focused verification and inspect the diff.

  12. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Tests/proof checkpoint: the focused needs-drew write-back unit tests pass locally (2 tests, 7 assertions). The implementation is committed and pushed; dispatched the focused tests plus aggregator typecheck on Fleet Actions (run 45334082894), pending terminal result. No broader suite has been run.

  13. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Lane oc-code-07 claim/premise checkpoint for queue task 21657 (S5 live proof, claimed 2026-11-24T05:27Z).

    Premise verdict: proof legs NOT live. S1 (task 21653) claimed/in-progress, not merged. S2 (21654) claimed/in-progress, not merged. S3 (21655) parked waiting on S1+S2. S4 (21656) claimed, not done. Nothing in S1–S4 is landed, let alone Archer-deployed, so the deployed-leg verification (broker accepts signed decide, aggregator runs applier, throat accepts broker-raised alert) cannot pass and no live Actions exec session can be proofed. Per the slice packet, parking 21657 naming the missing legs; no code written, no PR opened.

    Part of #14043.

  14. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Agent note — S1 implemented + tested, PR ready (task 21653, lane oc-code-04)

  15. 39 remaining items

  16. added
    meta/protocol-gap
    on Nov 27, 2026
  17. dezren39 commented on Nov 28, 2026

    @dezren39
    MemberAuthor

    Agent note · S5 live-proof premise recheck — lane 0407-F, queue task 21657, charlie ADVANCE 2026-11-28

  18. dezren39 commented on Nov 28, 2026

    @dezren39
    MemberAuthor

    Agent note — lane 0637-E (queue task 21657 re-draw, S5 live proof), 2026-11-28 06:37 CST alpha DRIVE queue-draw.

    Premise + ownership check: read this issue and ALL 46 comments (count-confirmed). No competing live S5 claim in the comments; the latest note is lane 0407-F's premise recheck today at 10:19Z (comment 7237824595), and this issue has had no activity since (updated_at 2026-11-28T10:19:47Z).

    Fresh gate check by this lane (~12:55Z):

    Disposition: re-park queue task 21657 with the same non-person external ready condition — this issue records the coordinated live deployment of the three legs as confirmed; then re-read the newest comments, verify every live leg, and run the §§6–7 live proof.

  19. removed
    queue/claimed
    on Nov 28, 2026
  20. dezren39 commented on Nov 28, 2026

    @dezren39
    MemberAuthor

    Agent note · S5 live-proof premise recheck — lane 0837-D, queue task 21657, alpha DRIVE 2026-11-28 08:37 CST

  21. dezren39 commented on Nov 28, 2026

    @dezren39
    MemberAuthor

    Lane 1737-G (alpha DRIVE, queue task 21657): premise recheck concurs with 0407-F / 0637-E / 0837-D today — read all 48 comments, firsthand-verified S4 PR #15898 MERGED (2026-11-27T12:21:14Z) and S4 task 21656 done; still no record on this issue confirming the Archer-coordinated live deployment of the broker signed-decide, aggregator applier, and alert-throat legs, and the proof itself needs a live Actions exec session + a tap on the extension push. Re-parking 21657 on the same ready condition. Part of #14043.

  22. added
    priority/high
    on Nov 29, 2026
  23. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (lane CEN-C14)

    Verified firsthand (body + all comments). State: the code is done; only the live proof remains. S1 (decide write-back) PR #14104, S2 (answer application) PR #14105, S3 (alert throttle) PR #14440, S4 (decision identity hardening) PR #15898 — all merged; prerequisite #13902 closed. Drew prioritised this phase on 2026-11-23.

    Blocker (named): S5's gate — a record confirming the coordinated live deployment of all three legs (broker signed-decide, aggregator applier, alert throat) per the deployment checklist, then a live fleet Actions exec session with Drew tapping a test push. Queue task 21657 has re-parked on exactly this condition four times (latest 2026-11-28); no such deployment record exists yet.

    Census action: added priority/high (owner-prioritised phase; code complete, proof pending). Verdict: blocked (live deployment record + supervised proof).

  24. added
    kind/feature
    on Nov 29, 2026
  25. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): rechecked in full (body, labels, comments, edges).

    STRENGTHS: The gap is drawn exactly (Drew's tap records the answer in the PM ledger through the Phase 1 machinery — but nothing applies it to the broker; a seat runs /actions-exec-extend-decide by hand), and the slice chain has executed: S1–S4 merged (S4 = PR #15898, verified firsthand by three lanes on 2026-11-28). This is also CF-6's (#14946) exactly-once leg.

    GAPS: No priority/* and no kind/* label — for the piece that makes phone answers real, that undersells it: priority/high (unblocking work for CF-6 and the whole answer-flow surface). The remainder is S5, the live proof (a real tap applying to the broker exactly once), repeatedly premise-checked and parked on its conditions.

    FIXES I APPLIED: Added priority/high and kind/feature.

    REMAINS: Nothing for Drewry beyond the live-proof tap itself when S5 runs.

  26. added
    effort/l
    app/pm-stack
    on Nov 29, 2026
  27. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Census audit of #14043 (pm-stack: push answer write-back to the queue broker).

    Strengths: the next-phase scope is fully described (a phone tap applies broker-sourced decides; Actions-exec extensions first); kind/feature, priority/high, user/review, work/assigned and status/in-review set live; 30 comments of lane work.

    Gaps found: no effort/* or app/* labels; no acceptance-criteria section.

    Blocker recorded: the latest lane checkpoint (queue task 21656) records a premise verdict that a prerequisite is NOT met for the S4 slice — that checkpoint is the current blocker record; the census adds no parallel claim.

    Actions taken: added labels effort/l, app/pm-stack; appended an Acceptance criteria section to the body (original text untouched). Priority stands at priority/high.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackeffort/lkind/featuremeta/protocol-gappriority/highstatus/in-reviewuser/reviewwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions