From bad04176c2c2035c993ea5283f86241eee440f82 Mon Sep 17 00:00:00 2001 From: chaodu-agent <274062505+chaodu-agent@users.noreply.github.com> Date: Sun, 22 Nov 2026 18:11:56 -0500 Subject: [PATCH 1/2] docs(runbook): asynchronous polling for the Muse route --- docs/runbooks/muse-stage2.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/runbooks/muse-stage2.md b/docs/runbooks/muse-stage2.md index 73b3964..0763eb5 100644 --- a/docs/runbooks/muse-stage2.md +++ b/docs/runbooks/muse-stage2.md @@ -179,6 +179,39 @@ Muse may retry. The retry is a new request, the owner can approve it, and it wil is not claimed. A `forward_started` audit record with no `completed` marks the requests where this can have happened. +## Asynchronous polling for the Muse route + +Off by default. Enable it per route on the `[[route]]` table; other routes stay blocking: + +```toml +[[route]] +name = "discord" +mode = "passthrough" +hold_mode = "async" # default "blocking" +async_hold_secs = 120 # optional, 5..=600, default 120 +``` + +Load validation refuses the policy unless the route is `mode = "passthrough"` and a `decision = "hold"` +grant exists on that same route. `[passthrough].hold_secs` is not used on an async route. The helper +timeout rule in section 5 for blocking mode no longer applies there: the POST returns at once. + +| Step | Contract | +|---|---| +| POST (same URL as before) | `202` with `status` (`pending`), `request_id`, `poll_token`. Non-202 answers (for example 503 `cooldown`) are unchanged. | +| Poll | `GET https:///poll/?wait=N` at the listener root, no credentials. `wait` missing is 0, above 25 is 25, invalid is 400 `bad_wait`. | +| Final statuses | `approved_and_sent` (adds `discord_status`, `body`, `truncated`), `denied`, `expired`, `dropped`, `send_failed`, `send_unknown`. `pending` means keep polling. | +| 404 `not_found` | Unknown token, more than 60 s after the final status, or gate restarted. Uniform, reveals nothing. | + +Client rules: + +- Poll until a final status, for at most about `async_hold_secs` + 330 s after the POST. Running out of time means outcome unknown. +- Never retry a POST blindly: a retry is a second pending request and a second approval prompt. +- `send_unknown`, or a 404 after the request was approved, means outcome unknown. Check the channel or ask the owner before sending again. +- A deny starts the identity cooldown (default 60 s), so a quick new POST can get 503 `cooldown`. +- Never log the poll token. + +Verified on p1 (2026-11-22): `approved_and_sent` with Discord 200, `denied`, and `expired`. + ## 8. Not claimed - Protection from the Muse platform or anything that holds the real token. From 25d228dc9b91d9c39ccfc99678460b33d57e72af Mon Sep 17 00:00:00 2001 From: chaodu-agent <274062505+chaodu-agent@users.noreply.github.com> Date: Sun, 22 Nov 2026 18:28:49 -0500 Subject: [PATCH 2/2] docs(runbook): address PR #46 review findings - remove real tailnet host name and the "Verified on" production claim - cooldown: a deny or an expiry starts it (HoldTable::deny/expire call start_cooldown, origin/main hold/mod.rs lines 442, 472) Greps on docs/runbooks/muse-stage2.md, all empty (exit 1): grep -n 'p1'; grep -n 'ts\.net'; grep -nE '[0-9]{1,3}(\.[0-9]{1,3}){3}'; grep -nE '[0-9a-fA-F]{32}'; grep -nE '[0-9]{15,}|request_id: [0-9a-f]{8}'; grep -n 'Verified' --- docs/runbooks/muse-stage2.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/runbooks/muse-stage2.md b/docs/runbooks/muse-stage2.md index 0763eb5..7630c0a 100644 --- a/docs/runbooks/muse-stage2.md +++ b/docs/runbooks/muse-stage2.md @@ -207,11 +207,9 @@ Client rules: - Poll until a final status, for at most about `async_hold_secs` + 330 s after the POST. Running out of time means outcome unknown. - Never retry a POST blindly: a retry is a second pending request and a second approval prompt. - `send_unknown`, or a 404 after the request was approved, means outcome unknown. Check the channel or ask the owner before sending again. -- A deny starts the identity cooldown (default 60 s), so a quick new POST can get 503 `cooldown`. +- A deny or an expiry starts the per-identity cooldown (default 60 s, `[passthrough] cooldown_secs`), so a quick new POST can get 503 `cooldown`. - Never log the poll token. -Verified on p1 (2026-11-22): `approved_and_sent` with Discord 200, `denied`, and `expired`. - ## 8. Not claimed - Protection from the Muse platform or anything that holds the real token.