You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of epic #1725. Depends on #1738, Phase 2 complete. Phase 3 — Premium synthesis + review.
Objective
Introduce the strategy abstraction that lets the screen render the right synthesis experience without knowing the user's tier or flag state. This card delivers the interface and the free implementation; #3.3 and Phase 4 add the premium implementations.
This card delivers freeStrategy only. The other two are stubs that throw new Error('not implemented') and are filled in by their respective cards.
freeStrategy implementation
Mode-shaped recap. Reads captured and mode from plan. Returns SynthesisOutputBlock[]:
// Pseudocodeconstblocks: SynthesisOutputBlock[]=[];for(constsectionofrecapSectionsForMode(plan.mode,captured)){blocks.push({type: 'recap_section',label: section.label,content: section.content});}blocks.push({type: 'cta_button',label: 'Copy to clipboard',action: 'copy'});blocks.push({type: 'cta_button',label: 'Share',action: 'share'});blocks.push({type: 'footer_note',text: 'Companion+ saves this for spaced review and brings it back when it matters.',});return{kind: 'free',output: blocks,artifact: null};
recapSectionsForMode lives in freeStrategy.ts and uses the same mode→sections mapping from #2.7's SynthesisFreeRecap. Refactor #2.7 so SynthesisFreeRecap consumes SynthesisOutputBlock[] rather than computing recap shape inline. This unifies the two paths.
Screen wiring
In StudySessionScreen.tsx synthesize step:
constaccess=useAmicusAccess();conststrategy=useMemo(()=>chooseStrategy({
isPremium,amicusFlagEnabled: isFlagEnabled('GUIDED_STUDY_AMICUS_SYNTHESIS'),amicusCanUse: access.canUse,}),[isPremium,access.canUse]);// Run when synthesis fields are populated enough; render result.output.
Acceptance
freeStrategy produces correct SynthesisOutputBlock[] for each mode.
Part of epic #1725. Depends on #1738, Phase 2 complete. Phase 3 — Premium synthesis + review.
Objective
Introduce the strategy abstraction that lets the screen render the right synthesis experience without knowing the user's tier or flag state. This card delivers the interface and the free implementation; #3.3 and Phase 4 add the premium implementations.
Files
Create
app/src/services/guidedStudy/synthesis/strategy.ts— interface + factoryapp/src/services/guidedStudy/synthesis/freeStrategy.tsapp/src/services/guidedStudy/synthesis/__tests__/strategy.test.tsModify
app/src/screens/StudySessionScreen.tsx— call factory, render strategy outputStrategy contract
chooseStrategylogic:isPremium === false→freeStrategyisPremium && amicusFlagEnabled && amicusCanUse→premiumAmicusStrategy(Phase 4)premiumStructuredStrategy(Merge pull request #2 from CraigBuckmaster/master #3.3)This card delivers
freeStrategyonly. The other two are stubs that thrownew Error('not implemented')and are filled in by their respective cards.freeStrategy implementation
Mode-shaped recap. Reads
capturedandmodefromplan. ReturnsSynthesisOutputBlock[]:recapSectionsForModelives infreeStrategy.tsand uses the same mode→sections mapping from #2.7'sSynthesisFreeRecap. Refactor #2.7 soSynthesisFreeRecapconsumesSynthesisOutputBlock[]rather than computing recap shape inline. This unifies the two paths.Screen wiring
In
StudySessionScreen.tsxsynthesize step:Acceptance
freeStrategyproduces correctSynthesisOutputBlock[]for each mode.SynthesisFreeRecapfrom Merge pull request #1 from CraigBuckmaster/codex/review-recent-master… #2.7 is refactored to consume blocks.chooseStrategyreturnsfreeStrategyfor non-premium; throws "not implemented" for premium paths until Merge pull request #2 from CraigBuckmaster/master #3.3 lands.tsc,lint,testclean.Out of scope