feat(inbox): ask Question rounds with the question tool and answer them in the Inbox #9

Merged babariviere.com
targeting main from inbox-question-rounds
Merged opened by babariviere.com
targeting main from inbox-question-rounds

Stacked on #10 (ast-grep, Biome and pnpm): it targets lint-tools, so merge #10 first.

Summary #

An agent asks the Owner a Question round with the question tool. The round waits in the Inbox, and the agent waits for the answers without a process, also across a Daemon restart. Ticket 07.

question({ questions })pilot_inbox row, then the call sleeps on the pilot.answers signalinboxChanged (notification, menu bar count)answerRound(item, answers)signal wakes the call, answers as its resultAgentDaemonAppAgentDaemonApp
 daemon/src/
   harness-host.ts   # question tool (parks on a signal), its guidelines in <rules>, the answers' text for the agent
+  inbox.ts          # pilot_inbox, keyed on the waiting task, so an id never comes back; checks the answers
+  skills/grilling.md
 app/
+  inbox.tsx         # focus queue: J/K, O list, L Later, C Chat, 1–3 pick, Return confirms
+  round-answers.ts  # the rules of an answer: pick, confirm, own answer needs text, ready, the answers sent
+  alerts.ts         # notifications and the menu bar count
 ui/
+  inbox.tsx         # QuestionCard, RoundReady, QuestionView (in the gallery)
   boxes.tsx         # ListRow, HeadlineSkeleton, PageTitle count and loading

The free Chat role gets the question tool and the grilling skill until ticket 17 moves them to the Shaping role. The Inbox shows only Question rounds in full for now.

Also from the retro:

  • A new ast-grep rule, sqlite-reused-id, refuses an SQLite INTEGER PRIMARY KEY that SQLite picks itself: a reused id made a new round show the answers of the round before it.
  • docs/agent-text.md says what goes in a tool's description, its parameters, its guidelines, a role prompt and a skill. CODING_STANDARDS rule 7 points to it.
  • just prompt prints the system prompt and the tools a free Chat's agent gets.
  • just scratch starts a seeded scratch Daemon and the App on it: the real Daemon with a fake GitHub and a scripted Claude, acme/api, and two Chats, one of which grills the Owner in two Question rounds (daemon/test/scratch-daemon.ts). just scratch-daemon starts it alone. The dev profile stays the place for a real model.
  • .agents/skills/pi-durable: where to find Pi Durable's docs and types, and the patterns Pilot uses.
  • docs/nsh.md: a streaming value restarts a spinner unless the choice goes through computed.

Evidence #

  • Before: a second round in the same Chat showed the first round's answers. The loader in a streaming Chat started over every second. After: both have a regression test that fails without the fix:
    • a round that follows an answered round is a new item, with an id no item had (Daemon)
    • a round sent leaves no answer behind: a new round with the same id starts unanswered (App)
  • New tests:
    • Daemon: a round waits in the Inbox and the agent goes on with the answers; it waits across a Daemon restart; another Chat keeps working; Later; removing a Chat closes its round.
    • App: answer with the keys alone; refused and closed rounds; a click answers; J/K/L/O; C opens the Chat; notification and menu bar count.
  • just check and just lint pass (Biome and ast-grep). just test: Daemon 44, App 33, gallery 16 tests pass.

Merge Danger #

Door: two-way

The new pilot_inbox table stays in the database after a revert, and nothing reads it then. A Chat that waits on a round at revert time stays waiting.

Blast Radius: Daemon

The free Chat's prompt changes (the question tool, the grilling skill and a <rules> section), so every new free Chat gets it.

Commits 1

feat(inbox): ask Question rounds with the question tool and answer them in the Inbox
Sign up or Sign in to add to the discussion.