Skip to content

pstack W8: descendant questions (R8.2, R8.3) #73

Closed

Description

@ibetitsmike

Xum created this issue on behalf of @ibetitsmike.

Part of #4. Moved here from W2's brief (#8, item 6) when the UI wave started.

W8 · Descendant questions · mike/descendant-questions

Task. R8.2: any descendant chat (child, grandchild) can ask the user a structured question, and the question surfaces in the root chat's UI. R8.3: a question can ask for a secret answer that never lands in chat history.

Background (verified on main e155b42 by W2).

  • R8.1 is upstream: turn_environment.go:724-730 offers ask_user_question on root UI chats, async outside plan mode and blocking in plan mode. Answers are ordinary user messages whose first line names the call (askUserQuestionState.ts).
  • Descendants never get the tool: turn_environment.go:2059 returns isRootChat.
  • askuserquestion.go has no secret field.

Decisions (lead, 2026-11-09).

  • A descendant question blocks the child: the child's turn stops until answered, and the parent's wait_agent reports that the child needs input.
  • W8 owns both server and UI.
  • R8.3 store: a dbcrypt-encrypted, single-use chatd row, consumed and deleted by the child's next turn, delivered as an ephemeral prompt message. History records only "answer delivered (secret)". Send the lead a short design note before writing R8.3 code: data flow, what is persisted where, behavior when dbcrypt is not configured, and multi-replica delivery.

Scope.

  1. Server: a fork question tool on descendants through appendForkTools; a forkdb record of pending descendant questions; a fork route that lists a family's pending questions; the answer goes to the child through the existing send-message API as the async answer message; wait_agent reports needs-input.
  2. UI: a "Question from " card docked in the root chat (reuse upstream's question dock and QuestionStep), naming the asking chat and linking to it; answering resumes the child.
  3. R8.3 server: secret flag on the question, the single-use encrypted row, consumption on the next turn, redaction everywhere (chat messages, read_chat_transcript, logs, audit).
  4. R8.3 UI: masked input in QuestionStep for secret questions, and a "secret delivered" history entry.

Acceptance.

  • A grandchild asks; the root UI shows the card with the asking chat; the user answers; the grandchild resumes with the answer and finishes; meanwhile the coordinator's wait_agent showed needs-input.
  • A secret answer never appears in chat_messages, read_chat_transcript, server logs or the UI history; only "answer delivered (secret)" does.
  • With the experiment off, descendants have no question tool and the UI matches upstream.

Constraints. Experiment fork-nested-subagents. Masking the model's own later output is out of scope.

Activity

  1. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: opened #86 (PR1, the chatd descendant ask_user_question), head bca159a. Codex review and fork-ci are pending.

    Xum posted this on behalf of @ibetitsmike.

  2. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8: sent READY for #86 at 01f9c60dbf (fork-ci green, 0 unresolved threads, UAT PASS). Two ARCHITECTURE.md TODO lines need the owner.

    Xum posted this comment on behalf of @ibetitsmike.

  3. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #86 (descendant ask_user_question tool + wait_agent needs_input) is READY again at 97834de11f. Main is merged in, and Codex r5 raised two findings, both fixed: a replaced question now ends the wait at the next poll, and clearing a chat retires its pending question. Codex r6 is clean, fork-ci is green, and 0 threads are open. Next: PR2 (pending-questions list route) opens after #86 merges. PR3 (question dock UI) is in implementation.

    Xum posted this comment on behalf of @ibetitsmike.

  4. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #86 is READY at a81edc7fdc. Main is merged in (the #82 conflicts were registration-only), and a focused UAT on the fixed head passed: evidence. Codex r7 is clean, fork-ci is green, and 0 threads are open. PR2 opens after #86 merges.

    Xum posted this comment on behalf of @ibetitsmike.

  5. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #86 merged as 96d44ec463 (head a81edc7fdc). PR2, the family question list route, opens next against main 6ae89b1c7f.

    Xum posted this comment on behalf of @ibetitsmike.

  6. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: PR2 is open as #114 (family question list route), at 8b0b2ebea2 on main 6ae89b1c7f. Codex and fork-ci are running, and a UAT follows.

    Xum posted this comment on behalf of @ibetitsmike.

  7. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #114 is READY at ce5e02182d. CI run 42770424752 passed, Codex found no issues on this head, no review threads are open, and UAT round 2 passed (see the UAT comment on #114). The next PR, the root-page question dock, has passed UAT on all 5 scenarios and opens once #114 merges.

    Xum posted this comment on behalf of @ibetitsmike.

  8. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    PR3 (the root-chat question dock) is open as #118, head d1cad80384, with base main. UAT on 76d3d0752f passed S1-S5, and the head only merges main into it. Codex review requested.

    Xum posted this comment on behalf of @ibetitsmike.

  9. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    PR4 of R8.3 (secret answers: storage, the secret-answer route, and the guard on the normal answer path; secret stays out of the model schema) is open as #119, head 41126c17d3. Codex review requested; dev-build UAT follows when ops gives a FULL slot.

    Xum posted this comment on behalf of @ibetitsmike.

  10. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    The rest of R8.3's server side is open as two stacked PRs. They are split to stay under about 500 lines each:

    The masked input in the root dock, which turns the flag on, is now PR7. Targeted tests and negative controls pass on both heads. fork-ci runs only on PRs into main, so CI runs after the PRs below them merge. Codex reviews them on open. UAT for #126 follows in a server UAT slot.

    Xum posted this comment on behalf of @ibetitsmike.

  11. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    #118 (R8 PR3, the root-page dock for descendant questions) is ready for review at 808a20572d. Codex's latest review of that commit found no issues, fork-ci is green, and every review thread is resolved.

    Xum posted this comment on behalf of @ibetitsmike.

  12. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    #118 (R8 PR3, the root-page dock for descendant questions) is merged into main as 8f7fdb0b23. #119 now targets main. I'm merging main into the #119/#125/#126 stack before pushing their review fixes.

    Xum posted this comment on behalf of @ibetitsmike.

  13. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    The R8.3 secret-answer hardening PR is open as #136, head 8cab4881e6, stacked between #126 and PR7. It refuses secret questions in computer-use chats, scrubs cut-off fragments of a value, withholds media from wrapped tools while answers are active, and passes the value to execute through a shell variable, so the shell never runs it as code. It also refuses message_agent and wake-ups to a child that waits for a secret answer. Tests pass, and each of 7 negative controls fails as expected. Codex review is requested. PR7 is not READY until #136 merges.

    Xum posted this comment on behalf of @ibetitsmike.

  14. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #119 is READY at c5b742296b.

    • fork-ci run 42807753155 passed on this head.
    • Codex found no major issues on this head (receipt at 11:32:45Z).
    • No review threads are open.
    • Server UAT passed at cbff12ee9c (see the PR body). The only change since then is the keyset paging in the dbcrypt recrypt. TestChatSecretAnswersKeyCommands covers that change, and it passes on this head.

    #125, #126 and #136 stack on #119 and are in Codex review.

    Xum posted this comment on behalf of @ibetitsmike.

  15. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #125 is READY at 9ab5356a2f. It stacks on #119.

    Xum posted this comment on behalf of @ibetitsmike.

  16. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #126 is READY at 308db86655. It stacks on #125.

    #136 is in Codex review.

    Xum posted this comment on behalf of @ibetitsmike.

  17. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #119 is merged into main as 3036142c68.

    Xum posted this comment on behalf of @ibetitsmike.

  18. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #125 is READY at a696b95118, now based on main after #119 merged.

    Xum posted this comment on behalf of @ibetitsmike.

  19. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #125 merged as ad1010782c. #126 is next. It now targets main and gets the forward merge, fork-ci and a Codex pass on its new head.

    Xum posted this comment on behalf of @ibetitsmike.

  20. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #126 is READY at a38ee99870, now based on main after #125 merged.

    Xum posted this comment on behalf of @ibetitsmike.

  21. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #126 merged as df22c722f3. #136 is next. It now targets main and gets the forward merge, fork-ci and a Codex pass on its new head.

    Xum posted this comment on behalf of @ibetitsmike.

  22. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: #136 is READY at 8f3752a9ca, based on main at df22c722f3 (#126 merged).

    Xum posted this comment on behalf of @ibetitsmike.

  23. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    #136 (secret answer hardening) is merged into main as af6e27501e. Next is PR7, which turns the secret flag of ask_user_question on. It opens against main, and its READY waits on a full secret flow UAT on a branch server.

    Xum posted this comment on behalf of @ibetitsmike.

  24. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    W8 status: PR7 is open as #153 against main. It turns on secret questions for descendant chats: the masked answer field in the root chat dock, and a secret question that only its answer message retires. Go tests pass on its head 4445019574. Next: the frontend review, Codex, fork-ci, and a full secret flow UAT on a branch server on 3200.

    Xum posted this comment on behalf of @ibetitsmike.

  25. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    Status: #153 (secret questions on) is READY at 4809559: fork-ci green, Codex clean, 0 unresolved threads, UAT PASS (5ed0bce, 23b0596), and tests cover the later commits.

    Xum posted this comment on behalf of @ibetitsmike.

  26. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    Status: #153 merged as dfc24a4. The W8 code stack is complete on main.

    Merged: #86 (descendant ask_user_question, wait_agent needs_input), #114 (family questions route), #118 (root question dock), #119 (secret answer route and store), #126 (secret substitution and scrub), #153 (secret questions end to end).

    Next:

    Xum posted this comment on behalf of @ibetitsmike.

  27. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    Closing. The paired #153 live check passed on daily at df1ef73ac6, which contains the #153 merge (#153 (comment)). A member user ran a root chat and a child chat.

    • The child chat showed only the notice, with no answer form.
    • A user message to the child returned 409 while the question was pending.
    • The root dock showed the password field and its helper text.
    • A 4-character value got the 8-byte alert.
    • Submitting removed the dock, and a second POST returned 409.
    • The child's message had only the {{secret:<id>}} instruction.
    • The value reached the workspace: the root reply's hash matched sha256 of the value.
    • The value was absent from server.log, from every database text column except chat_secret_answers.value, and from the page HTML and browser storage.

    The lead accepted these differences from the spec above:

    • A reusable 24-hour placeholder replaces the single-use row.
    • The value is stored as plain text when dbcrypt is not configured.
    • The history line wording differs.
    • Root chats have no secret questions. This is a product call.

    Follow-up: the check found that the root model may tell the user to paste the secret into the chat. A small PR will tighten the text the root model sees.

    Xum posted this comment on behalf of @ibetitsmike.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions