Repository navigation
feat: question answers reach the agent — plan.answered, skill, PFM, archive, WebMCP (PR 3) - #1639
Merged
Merged
Conversation
… PFM, archive, WebMCP (PR 3) - plan.answered prompt (prompts.plan.answered, DEFAULT_PLAN_ANSWERED_PROMPT) selected by composePlanDeniedMessage when /api/deny carries answersOnly: true; wired through the Bun plan server, every hook output, the opencode-plan CLI JSON, OpenCode 1/2 (submit-plan-executor) and Pi. Ordinary denies are byte-identical. The client drops its interim framing paragraph (planDenyFeedbackFields). - plannotator skill: 'Asking the reviewer questions' is a byte copy of QUESTION_AUTHORING_GUIDE, guarded by plannotator-skill-reference.test.ts; the guide gains how answers come back. - PFM reminder: a static question-block paragraph + example. - Feedback archive: additive questionAnswer per annotation (validated); Pi vendors core/question-block. - WebMCP: read_document returns read-only questions; answer rows carry answersQuestion; external POST/PATCH drop questionAnswer (tested). - Docs: AGENTS.md 'Question blocks', marketing guide, custom-feedback, api-endpoints, webmcp-tools.
1 task
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.
PR 3 (agent side) of the approved question/answer components feature (
.product/approved/qa-components/: SPEC §8 PR 3, owner decisions in approval.md). Builds on #1637 and #1638. No publish, no release.What this adds
plan.answeredprompt. Send answers already posts/api/denywithanswersOnly: true. The agent now gets:It replaces "YOUR PLAN WAS NOT APPROVED".
prompts.plan.answered, with runtime overrides like the other keys. A customplan.denieddoes not replace it.composePlanDeniedMessage(packages/shared/prompts.ts, vendored to Pi):apps/hook/server/index.ts(Claude Code'smessage, Codex, Gemini, Copilot, Vibe)opencode-planCLI JSONsubmit-plan-executor.ts)index.tstrue. Without the flag, the message is byte-identical to before.planDenyFeedbackFields), so the framing is not said twice./plannotatorskill. A new section, "Asking the reviewer questions", is a byte copy ofQUESTION_AUTHORING_GUIDE.### Q2. …,Answer: …,(your recommendation),Other:, quoted free text,Skipped,Note:, and settled questions.plannotator-skill-reference.test.tsfails on any drift. Mutation-checked: changing "about 8" to "about 9" in the SKILL fails it.vendor.sh.PFM reminder. A short "Questions for the reviewer" paragraph and an example.
Feedback archive. A new additive field,
questionAnswer, on each annotation record. It is validated byparseQuestionAnswer, and malformed values are dropped.core/question-block.WebMCP (read-only).
read_documentreturnsquestions: number, key, kind, prompt, context, section, options (recommended/settled), status, the answer, and its annotation id. Orphaned answers haveq: null.annotationscarryanswersQuestion.POST/PATCHdropquestionAnswer(now tested).read_documentdescription and theincludeenum are updated.Docs.
/api/denyrow, and the pfmReminder note.guides/questions.md.custom-feedback.md(answeredrow and default),api-endpoints.md(answersOnly),webmcp-tools.md, and the HANDOFF line.Evidence
deniednot leakingpackages/server/plan-answered.test.ts) and the Pi server (apps/pi-extension/server/plan-answered.test.ts): a real/api/deny→ decision → message. A non-boolean flag is ignored.documentTools.questions.test.ts)bun test: 5612 pass, 0 fail.bun run typecheckpasses.DocBadges.test.tsx, which passes 8/8 when run alone. It is an order-dependent flake in my local ordering and unrelated to this PR.bun run build:review && build:hook && build:opencode && build:pisucceed.bun pm pack --dry-runinapps/pi-extensionincludesgenerated/question-block.ts,generated/prompts.tsand the updatedskills/plannotator/SKILL.md.--use-mock-keychain --password-store=basic) with a temp data dir. The plan had 3 questions (single with recommendation, multi, free text):apps/hook/server/index.tsran with a PermissionRequest on stdin. The primary read "Send answers". Hook stdout:YOUR PLAN WAS NOT APPROVED.\n\nYou MUST revise … ## 1. General feedback about the plan\n> Why 60s? ….apps/pi-extension/plannotator.htmlran onstartPlanReviewServer, and the message was composed exactly as Pi'sindex.tsdoes it. Send answers gaveanswersOnly: trueand the answered prompt, withplannotator_submit_planand the plan-file rule. The comment deny gave the unchanged denied prompt.Deviations
/api/approveand/api/denynever sent an annotations array (this predates this PR), so plan answers are archived only insidefeedback. Annotate surfaces carry the newquestionAnswerfield. Sending plan annotations to the archive would be a separate change.getPlanDeniedPrompt(also unit-tested) and by the client comment path being unchanged. I did not build a separatemainbinary for a side-by-side run.read_documentdescription was reworded to fit the 500-character budget with questions included.Release checklist
@plannotator/core0.25.8 (now with the guide bullet), then@plannotator/ui0.48.0 (unchanged pin). Both still come from feat(ui,core): in-document question blocks — core + ui (PR 1) #1637 and feat(editor): question answers — history, progress chip, Questions panel, Send answers (PR 2) #1638.prompts.plan.answeredkey.questions.questionAnswer.assets/qa-components-pr1andassets/qa-components-pr2. They are not deleted here.