Repository navigation
feat(ask-person): the main flow of RFC-0014 - person.ask, the ticket, the resume link and the reply page (step 1) - #68
Merged
Conversation
… the resume link and the reply page (step 1) A graph's hold path calls person.ask before it suspends for a person; the function issues a signed stateless ticket, builds the resume link and sends one message event to the configured channel routes, knowing none of them. The reply page shows the wait by the reference graph's re-advice and never resumes; the reply endpoint verifies, identifies (none, proxy, oauth2, a channel app's bearer), stamps who decided on each note and forwards the resume through the ask.graphs allowlist. Platform.add_routes mounts an extension's routes before the host's catch-all. 72 shared vectors, 100 tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Nov 19, 2026
…main Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
extensions/ask-person/ask_person.py:person.ask, the composable function a graph's hold path calls before it suspends for a person. The message names the graph (graph_id,description,node), the transaction (correlation_id,turn), the waitingcallsas the loop returned them and the suspension'sttl; the function issues a signed, stateless ticket (v1.<payload>.<mac>: the canonical JSON of{g, c, t, k, e}and its HMAC-SHA256 underask.ticket.key, base64url without padding, a previous key verifying after a rotation), builds the resume link and sends the whole message as one event to every route inask.channels, best effort and in parallel - a local route, or a peer over the endpoint listed for it - knowing nothing of what a route does with it.kind: advice(a status update, an acknowledgement) travels with no ticket and no link.GET /ask/{ticket}verifies the ticket, identifies the person, reads the current wait from the engine by the reference graph's re-advice ({turn}on the allowlisted entry with the correlation id) and renders the form - approve or refuse with a note, an answer with the options offered, a call that runs on resume - and never resumes;POST /ask/replywith{ticket, decisions}verifies, identifies, validates the decisions, prefixes[who at time]to each tool call's note, sends{turn, decisions}to the entry theask.graphsallowlist maps the graph id to, and passes the engine's status and body through; an expired ticket is a 410 without a call to the engine, a silent engine a 502. Identity byask.reply.auth:none(development),proxy(the gateway's trusted header, the installation's SSO),oauth2(PyJWT against the issuer's JWKS, discovered or given; the newaskextra), and a channel app's bearer withdecided_byin every mode.EventApiServer.create_app(routes)andPlatform.add_routes(mount)register an extension's own routes after the host's paths and before the catch-all.tests/vectors/ask-person-vectors.json(72 cases: the ticket issued, verified, tampered, expired and rotated; the message validated in its fixed order and the event built; the re-advice and the resume requests; the outcomes), generated from the module and cross-checked - the first ticket's MAC reproduced withopenssl dgst -hmacbyte for byte - so the Node twin can implement the ticket from the file alone.tests/test_ask_person.py(100 tests): the vectors; the function on the bus with channels that take, refuse and miss the event; the page and the endpoint against a fake engine; the three auth modes with a signed RS256 token; the hook's ordering; the boot's refusals by name; health;inspect.resources/application.yml, CHANGELOG Unreleased/Added 5, the root README's Scope paragraph, theaskextra (PyJWT[crypto]) in the extras and the dev extras.Why
RFC-0014 (mercury-composable #653, Eric's concept and rulings R1-R8 of 2026-11-19), build plan step 1. The loop can wait for a person - a marked write, the ask row of loop spec 7.3 - and the graph suspends durably, but nothing carried a waiting call to anyone or brought a decision back except a request a developer typed. The main flow built here knows no channel and keeps no store: the engine waits, the pack delivers and collects, one reply path - the resume link - serves every channel, a GET shows and only a submit resumes, and the engine's at-most-once resume stays the authority. The agent-question app (step 3) will receive the event and automate the click as one channel among chat, mail and a topic.
Decisions taken in the build, for the review: the allowlist and the channel endpoints are YAML lists of
{id, entry}/{route, url}maps ora=b,c=dtext for a-Dvalue (the flat configuration cannot enumerate a nested map); a bare number inttland the timeouts is seconds (the helper's grammar); a question's answer is never stamped (an ask row's decision has no note); a ticket part outside the base64url alphabet is a 400, never decoded leniently; only the current key issues, so a previous key cannot stand in for a missing one.Gates: ruff OK, basedpyright 0 errors, pytest 704 passed and 74 skipped (the gated live tests); a boot through
mercury-serveserved the page,/healthandinspect.🤖 Generated with Claude Code