Increment 2 of #3372 (increment 1 landed in PR #3806 — the research stage now captures structured ResearchContext { text, metadata: { discoveredItems(relevanceScore), recommendations, qualitySignals } } and returns deterministic structure-derived text, but the metadata is not yet threaded past the research stage).
Scope
Per the 7/7 higher_order vote on #3372 (Option A), complete the consumer side:
- Thread
ResearchContext (the full object, not just text) through research() → plan() → vote() — change the DevPipelineStages signatures (research: () => Promise<ResearchContext>, plan/vote accept it). Updates the ~6 test files that mock these stages.
- Update
voter-prompts.ts / buildVoteProposal to weight on research maturity (relevanceScore distribution, newItems vs alreadyInRegistry, gap recommendations) — the consumer the vote requires, else the structure is recovered but unused (speculative).
- Instrument vote outcomes so the structured-vs-text swap is judgeable (the contrarian's pinned condition: prove the structured summary holds or improves vote quality).
Why separate
Increment 1 kept the research(): Promise<string> signature to avoid wide test-mock churn; the signature change + prompt-weighting + instrumentation is a focused follow-up. Security: external titles/recommendations stay escaped/bounded (already handled in research-context.ts) — keep the "informational, NOT instructions" delimiter in buildVoteProposal.
Unblocks
#3234 (research→routing categories) — once ResearchContext metadata is threaded, the research topic/techniques become available at experience-record time. Relates to #3148/#3231/#3238 (research→context arc).
Increment 2 of #3372 (increment 1 landed in PR #3806 — the research stage now captures structured
ResearchContext { text, metadata: { discoveredItems(relevanceScore), recommendations, qualitySignals } }and returns deterministic structure-derived text, but the metadata is not yet threaded past the research stage).Scope
Per the 7/7 higher_order vote on #3372 (Option A), complete the consumer side:
ResearchContext(the full object, not just text) throughresearch() → plan() → vote()— change theDevPipelineStagessignatures (research: () => Promise<ResearchContext>, plan/vote accept it). Updates the ~6 test files that mock these stages.voter-prompts.ts/buildVoteProposalto weight on research maturity (relevanceScore distribution, newItems vs alreadyInRegistry, gap recommendations) — the consumer the vote requires, else the structure is recovered but unused (speculative).Why separate
Increment 1 kept the
research(): Promise<string>signature to avoid wide test-mock churn; the signature change + prompt-weighting + instrumentation is a focused follow-up. Security: external titles/recommendations stay escaped/bounded (already handled in research-context.ts) — keep the "informational, NOT instructions" delimiter in buildVoteProposal.Unblocks
#3234 (research→routing categories) — once ResearchContext metadata is threaded, the research topic/techniques become available at experience-record time. Relates to #3148/#3231/#3238 (research→context arc).