Repository navigation
feat(agent-question): the store-and-forward inbox of the person an agent asks - RFC-0014 step 3 - #70
Merged
Merged
Conversation
…ent asks - RFC-0014 step 3 A standalone application on the package and the first channel of the ask-a-person design: the intake upserts a wait and appends an advice, in memory or PostgreSQL; the page, the replay by change sequence, the stream with Last-Event-ID as its cursor, the automated click to the link's reply endpoint under the app's bearer, and seen for an advice. 30 shared vectors, 48 tests, the schema, the purge and the development scripts. 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
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/agent-question/agent_question.py, a standalone application on the package and the first channel of RFC-0014's Part II: a store-and-forward inbox for the person an agent asks, standing beside a chat, a mail server or a topic as one channel among equals. The main flow (person.ask, step 1) knows nothing of it and sends it the message event like any route.agent.question.inboxis the intake: a wait is upserted on(graph_id, correlation_id, turn)- a re-advice for the same turn updates the card rather than adding one - and an advice is appended; one instance orders a process's writes, and the row is committed before any push. Two inboxes behind one protocol: memory (development, the reference semantics) and PostgreSQL (psycopg 3 with the audit store's connection keys, statement timeout and failure logging by type and SQLSTATE;schema/postgres.sqlwith the change sequencequestion_inbox_seqand the partial unique index that makes waits upsert and advices append;purge.sqlthe installation's retention;dev/schema-apply.shfor the helper's development database).Platform.add_routes:GET /questions/app(the page, cards grouped by transaction),GET /questions?since=<seq>(the replay a reconnecting device calls first - every row that changed since its cursor, with the cursor to continue from),GET /questions/events(the stream a connected device holds;Last-Event-IDis the same cursor; keep-alive comments from the host's setting),POST /questions/{id}/decide(the automated click:{ticket, decisions, decided_by}to the link's own base under the app's bearer, the outcome recorded and broadcast; accepted →answered, nothing waiting →expired, refused or unreachable →openwith the outcome shown) andPOST /questions/{id}/seenfor an advice. A sweeper and every replay expire open waits past their expiry. Identityquestion.auth:none,proxy,oauth2, as the main flow's.tests/vectors/agent-question-vectors.json(30 cases: the row a message becomes, the state an outcome leaves, the click's request, the reference inbox on a scripted sequence with its ids and change sequence), shared with the Node twin;tests/test_agent_question.py(48 tests: the vectors, the intake on the bus, the replay and the stream with keep-alives, a decision forwarded to a fake reply endpoint and broadcast, an advice seen, expiry, the proxy mode, the PostgreSQL statements on a recording fake and the record mapping, the hooks and the boot; a live PostgreSQL gated onAGENT_QUESTION_TEST_URL). README,resources/application.yml, CHANGELOG Unreleased/Added 6, a continuity fact and the session log.Why
RFC-0014 (mercury-composable #653), build plan step 3, after the main flow (#68) and the Playground's hold path (mercury-composable #654). The person who must decide uses a device that is not always connected: the message is committed before any push, a reconnecting device replays everything open since its cursor and chooses which card to answer, and the engine stays the authority on an answer - a second device on the same card gets
nothing waiting.Defaults set without a ruling, for the review: the inbox defaults to memory with a boot warning (PostgreSQL for a deployment); the connection keys follow the audit store rather than one URL; the app keeps no retention key -
purge.sqlcarries the installation's interval; a re-advice updates the row in place, so the spec'ssupersededstate is not needed (states: open, answered, expired, seen); a refused decision leaves the row open with the outcome shown, since the graph re-notifies with the reason;timeout.msis milliseconds by its name, the durations seconds.Gates: ruff OK, basedpyright 0 errors, pytest 751 passed and 75 skipped; a smoke with the two pack applications chained and no engine behind them (a wait and an advice delivered, replayed with the link, the click reaching the reply endpoint and recording the absent engine's 502 with the wait left open, the stream and the page served).
🤖 Generated with Claude Code