Apply 4-layer ResourceId decoupling to Cloze activity#201
Merged
davidortinau merged 2 commits intomainfrom May 3, 2026
Merged
Conversation
Implements full vocabulary-driven mode for Cloze when launched from Today's Plan, matching the established pattern from VocabQuiz and VocabMatching fixes. Layer 1 - DeterministicPlanBuilder: Set ResourceId=null for Cloze planned activities Layer 2 - PlanConverter: Add Cloze branch with DueOnly=true, skip ResourceId Layer 3 - Index.razor: Extend guard to prevent ResourceId leak from persisted plans Layer 4 - Cloze.razor + ClozureService: - Add DueOnly query parameter to Cloze.razor - Add GetSentencesFromDueWords() method that loads due vocab globally - Add GenerateSentencesFromWords() helper to eliminate code duplication - When DueOnly=true, generate sentences from full user vocab pool - When DueOnly=false, preserve existing resource-filtered behavior No database migration needed - persisted DailyPlan rows with old ResourceId are masked by Layer 3 guard at the UI boundary. Closes #200 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Fenster's history and decision documentation for issue #200: - Create .squad/agents/fenster/history.md with learnings from Cloze fix - Create .squad/decisions/inbox/fenster-200-shipped.md documenting what shipped - Update .squad/skills/resource-id-decoupling/SKILL.md with Cloze examples for all 4 layers (builder, converter, Index guard, page defense) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Closes #200
Summary
Implements full vocabulary-driven mode for Cloze when launched from Today's Plan, matching the established pattern from VocabQuiz (#190 fix) and VocabMatching fixes.
The 4 Layers
Layer 1 - DeterministicPlanBuilder.cs (~line 505):
Set
ResourceId = outputActivity == "Cloze" ? null : resource.Idwhen stamping the planned activity.Layer 2 - PlanConverter.cs (~line 140):
Add Cloze branch that sets
DueOnly = trueand passes SkillId but NOT ResourceId.Layer 3 - Index.razor (~line 986):
Extend the existing exclusion list to include
PlanActivityType.Clozeso persisted plan items can't leak a stale ResourceId.Layer 4 - Cloze.razor + ClozureService:
DueOnlyquery parameter to Cloze.razorGetSentencesFromDueWords()method that loads due vocab globallyGenerateSentencesFromWords()helper to eliminate code duplicationImplementation Details
Testing
✅ Build passes (0 errors, 397 warnings - all pre-existing)
✅ E2E smoke test via webapp:
References
.squad/decisions/inbox/keaton-200-cloze-resourceid-decoupling.md.squad/skills/resource-id-decoupling/SKILL.md