@plasius/learning 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/course-suggestions-CBs5swU6.d.ts +17 -0
- package/dist/course-suggestions-mK2MPB7e.d.cts +17 -0
- package/dist/courses/vibe-bug-detective.cjs +416 -0
- package/dist/courses/vibe-bug-detective.cjs.map +1 -0
- package/dist/courses/vibe-bug-detective.d.cts +8 -0
- package/dist/courses/vibe-bug-detective.d.ts +8 -0
- package/dist/courses/vibe-bug-detective.js +221 -0
- package/dist/courses/vibe-bug-detective.js.map +1 -0
- package/dist/courses/vibe-game-remix-lab.cjs +424 -0
- package/dist/courses/vibe-game-remix-lab.cjs.map +1 -0
- package/dist/courses/vibe-game-remix-lab.d.cts +8 -0
- package/dist/courses/vibe-game-remix-lab.d.ts +8 -0
- package/dist/courses/vibe-game-remix-lab.js +229 -0
- package/dist/courses/vibe-game-remix-lab.js.map +1 -0
- package/dist/courses/vibe-idea-studio.cjs +386 -0
- package/dist/courses/vibe-idea-studio.cjs.map +1 -0
- package/dist/courses/vibe-idea-studio.d.cts +8 -0
- package/dist/courses/vibe-idea-studio.d.ts +8 -0
- package/dist/courses/vibe-idea-studio.js +191 -0
- package/dist/courses/vibe-idea-studio.js.map +1 -0
- package/dist/index.cjs +41 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { L as LearningCourseV1, C as CoursePracticeQuestion } from '../course-authoring-DImvrK5r.cjs';
|
|
2
|
+
import { L as LearningCourseSuggestionV1 } from '../course-suggestions-mK2MPB7e.cjs';
|
|
3
|
+
|
|
4
|
+
declare const course: LearningCourseV1;
|
|
5
|
+
declare const practice: CoursePracticeQuestion[];
|
|
6
|
+
declare const suggestions: LearningCourseSuggestionV1[];
|
|
7
|
+
|
|
8
|
+
export { course, practice, suggestions };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { L as LearningCourseV1, C as CoursePracticeQuestion } from '../course-authoring-DImvrK5r.js';
|
|
2
|
+
import { L as LearningCourseSuggestionV1 } from '../course-suggestions-CBs5swU6.js';
|
|
3
|
+
|
|
4
|
+
declare const course: LearningCourseV1;
|
|
5
|
+
declare const practice: CoursePracticeQuestion[];
|
|
6
|
+
declare const suggestions: LearningCourseSuggestionV1[];
|
|
7
|
+
|
|
8
|
+
export { course, practice, suggestions };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import {
|
|
2
|
+
authorCourse
|
|
3
|
+
} from "../chunk-2UIOBMJZ.js";
|
|
4
|
+
import "../chunk-OXWMIHYI.js";
|
|
5
|
+
|
|
6
|
+
// src/courses/vibe-idea-studio.ts
|
|
7
|
+
var { course, practice } = authorCourse({
|
|
8
|
+
slug: "vibe-idea-studio",
|
|
9
|
+
title: "Vibe Idea Studio",
|
|
10
|
+
category: "vibe",
|
|
11
|
+
summary: "Turn a fictional audience's idea into an interactive mission board with a thirty-minute planning budget. Write executable success cases before completing the prototype, then add reversible completion, filtering and clear feedback. Finish a working private showcase with evidence for your design choices. Authored review examples make live AI unnecessary.",
|
|
12
|
+
projectFiles: [{ path: "app.js", language: "javascript", maximumCharacters: 32e3 }, { path: "brief.json", language: "json", maximumCharacters: 6e3 }],
|
|
13
|
+
starterProject: { files: [{ path: "app.js", source: `function initialState() {
|
|
14
|
+
return { title: "Rescue Mission Board", cards: [
|
|
15
|
+
{ id: "scout", title: "Scout the path", minutes: 5, done: false },
|
|
16
|
+
{ id: "signal", title: "Send a beacon", minutes: 10, done: false },
|
|
17
|
+
{ id: "rescue", title: "Bring the team home", minutes: 15, done: false }
|
|
18
|
+
], selectedId: null, remaining: 30, spent: 0, history: [], filter: "all", message: "Choose a mission." };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function update(state, input) {
|
|
22
|
+
if (input.type === "reset") return initialState();
|
|
23
|
+
return JSON.parse(JSON.stringify(state));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function view(state) { return {}; }
|
|
27
|
+
function acceptanceCases() { return []; }
|
|
28
|
+
` }, { path: "brief.json", source: '{\n "audience": "",\n "goal": "",\n "constraints": []\n}\n' }] },
|
|
29
|
+
reference: [
|
|
30
|
+
{ name: "initialState", signature: "initialState() \u2192 mission board", description: "A fresh board has an authored title of 3\u201360 characters, three to five uniquely identified fictional cards, no selection or history, 30 remaining minutes, zero spent, all filter and a useful message. Each card has id, title, integer minutes 1\u201330 and done=false. IDs use lowercase letters, digits and hyphens, 1\u201332 characters; titles use 3\u201360 characters.", example: '{ id: "scout", title: "Scout the path", minutes: 5, done: false }' },
|
|
31
|
+
{ name: "update", signature: "update(state, input) \u2192 detached next state", description: "Actions are select with id, complete, undo, filter with value all/open/done, and reset. Unknown actions, unknown IDs and selection of a currently hidden card preserve values. Complete requires a selected visible unfinished card whose minutes fit remaining time; success marks it done, accounts minutes, records a receipt and clears selection. Feedback messages are nonempty text up to 200 characters.", example: 'update(state, { type: "select", id: "scout" });' },
|
|
32
|
+
{ name: "time budget", signature: "remaining + spent === 30", description: "Completion subtracts the selected card's minutes from remaining and adds exactly that amount to spent. Missing selection, already-done cards and insufficient time change only the feedback message. Keep both counters within 0\u201330. A repeated complete cannot charge twice.", example: 'if (card.minutes > next.remaining) { next.message = "Not enough time remains."; return next; }' },
|
|
33
|
+
{ name: "undo", signature: "history: [{ cardId, minutes }]", description: "Each successful completion appends a receipt with that card's ID and charged minutes, at most five entries. Undo removes the newest receipt, marks only that card unfinished, refunds its exact minutes and clears selection. Empty undo changes only feedback. Reset creates fresh cards, counters, selection and history.", example: "const receipt = next.history.pop(); next.remaining += receipt.minutes; next.spent -= receipt.minutes;" },
|
|
34
|
+
{ name: "filter", signature: 'input: { type: "filter", value: "all" | "open" | "done" }', description: "A valid filter action records the filter and clears selection. Filtering changes no card, time counter or history entry. Unknown filters preserve state. view projects the appropriate cards while reporting counts from the complete card list.", example: 'const visible = state.cards.filter(card => state.filter === "all" || (state.filter === "done" ? card.done : !card.done));' },
|
|
35
|
+
{ name: "view", signature: "view(state) \u2192 safe display data", description: "Return title, visibleCards [{id,title,minutes,done,selected}], completedCount, totalCount, remaining, spent, canComplete, canUndo and message. canComplete requires the selected visible unfinished card to fit the budget; canUndo means history is nonempty. Compute data without mutation. The host renders semantic controls and text; learner source has no DOM or network access.", example: "const completedCount = state.cards.filter(card => card.done).length;" },
|
|
36
|
+
{ name: "brief.json", signature: "{ audience, goal, constraints }", description: "Write fictional audience and goal text, each 10\u2013160 characters, plus three to six constraints of 10\u2013160 characters. State the planning purpose, finite time budget, understandable feedback and ability to revise a choice. Labels can express your theme while the interaction contract remains testable.", example: '{ "audience": "A fictional rescue planning team", "goal": "Choose useful missions within thirty minutes", "constraints": ["Never spend more than the available time", "Make completed choices reversible", "Explain why an action cannot proceed"] }' },
|
|
37
|
+
{ name: "acceptanceCases", signature: "acceptanceCases() \u2192 4\u20138 named replay cases", description: "Each case has name (3\u201360 characters), actions (1\u201340 documented actions) and expected {remaining,spent,doneIds,selectedId,historyCount,filter}. Start from initialState; doneIds follows card order. Include successful completion, repeated completion, undo and reset; add a filter case when implementing filters. During the test-first mission, the host verifies expected cases against the documented reference behaviour before the learner prototype implements it.", example: '{ name: "Complete scout", actions: [{type:"select",id:"scout"},{type:"complete"}], expected: {remaining:25,spent:5,doneIds:["scout"],selectedId:null,historyCount:1,filter:"all"} }' }
|
|
38
|
+
]
|
|
39
|
+
}, [
|
|
40
|
+
{
|
|
41
|
+
title: "Give the idea an audience",
|
|
42
|
+
concepts: ["Audience", "Purpose", "State and presentation"],
|
|
43
|
+
goals: ["Write a bounded fictional planning brief and a useful initial board.", "Expose truthful display data with labels and counts derived from state."],
|
|
44
|
+
extension: "Describe a second audience who could use the same interaction rules. Change the fictional labels in a separate version and explain what stayed reusable.",
|
|
45
|
+
activities: {
|
|
46
|
+
learn: ["An idea becomes actionable when you can name who it helps and what they need to do. This prototype helps a fictional team choose missions within thirty minutes. Start with a clear title, three to five labelled cards and truthful counts before adding completion controls.", "The starter's three cards offer a concrete beginning; your brief and labels can give the same bounded interaction an original theme."],
|
|
47
|
+
predict: ["Predict the initial completed count, remaining time and available actions. Compare canComplete with canUndo when there is no selection and no history, even though useful mission cards are visible.", "Visible opportunities do not automatically mean a particular action currently has valid prerequisites."],
|
|
48
|
+
build: ["Complete brief.json with an audience, goal and specific constraints. Author the board title and card labels, keeping valid unique IDs and bounded minutes. Implement view to return the documented data from state, with all cards initially visible and both action permissions false.", "A display projection reads state; it must not mark a card complete or alter the planning budget."],
|
|
49
|
+
run: ["Open the private board and inspect its title, cards, time and counts. Compare visible text with view output and restart from initialState. Check the labels with keyboard navigation and without relying on decoration.", "This is an interactive prototype in progress; later missions make its controls perform the planned actions."],
|
|
50
|
+
assess: ["Check initial card bounds and identities, fresh state, authored brief and truthful view projection. Confirm reading view changes no state and that counts describe the complete card list.", "A renamed title alone does not satisfy the data and accessibility requirements of a useful initial board."],
|
|
51
|
+
inspect: ["If counts disagree, inspect their source arrays. If action buttons appear enabled before selection or history exists, inspect their prerequisites. If one card replaces another, inspect duplicate IDs before blaming the display.", "Stable identities let later events refer to the intended card without depending on its label or position."],
|
|
52
|
+
fix: ["Repair the projection or initial data and compare fresh boards again. Keep your brief within the agreed scope and make sure every displayed action has an understandable label and state.", "Use fictional examples instead of adding personal details that the project does not need."],
|
|
53
|
+
explain: ["Choose the brief that names an observable user goal and explain how one display field supports it. Distinguish the idea's theme from the interaction rules that make it usable.", "The audience and goal help you decide which changes matter, rather than collecting unrelated features."],
|
|
54
|
+
reward: ["Save Defined audience. Your prototype now has a purpose and an honest initial view. Next you will write executable success cases before filling in its main interaction logic.", "Keep the initial board as a baseline for your later design decisions."]
|
|
55
|
+
},
|
|
56
|
+
questions: {
|
|
57
|
+
learn: { question: "Which statement defines a useful bounded prototype goal?", choices: ["Help a fictional team choose missions within thirty minutes", "Add every possible feature", "Make an unspecified audience impressed"], correctChoice: 0, feedback: "The statement identifies an audience, a concrete task and a finite resource that can guide implementation and tests." },
|
|
58
|
+
predict: { question: "With no selected card and empty history, which actions should be enabled?", choices: ["Complete and undo", "Neither complete nor undo", "Undo only"], correctChoice: 1, feedback: "Completion needs an eligible selection and undo needs a receipt, so neither has its prerequisite in the fresh board." },
|
|
59
|
+
explain: { question: "Why do cards need stable unique IDs as well as labels?", choices: ["To hide their titles", "To prevent any future edits", "So actions can identify the intended card reliably"], correctChoice: 2, feedback: "An identity lets selection and completion target the right record even when a label or displayed order changes." }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: "Make success executable",
|
|
64
|
+
concepts: ["Test-first design", "Acceptance cases", "Independent expectations"],
|
|
65
|
+
goals: ["Translate the brief into bounded executable input sequences and predicted results.", "Distinguish a valid test of future behaviour from a currently implemented feature."],
|
|
66
|
+
extension: "Write a case for an unaffordable mission using a later depleted budget. Explain which state fields must remain unchanged when the action is refused.",
|
|
67
|
+
activities: {
|
|
68
|
+
learn: ["A success case describes actions and an expected result from a fresh board. Complete one card, repeat a completion, undo and reset are useful cases. Write four to eight bounded cases before implementing these behaviours. The host checks the predictions against the course contract separately from the unfinished prototype.", "An expected failure against unfinished code is visible progress in test-first work, not evidence that the behaviour already works."],
|
|
69
|
+
predict: ["For the starter cards, select scout and complete it. Predict remaining=25, spent=5, doneIds=[scout], no selection and one history receipt. Then predict the effect of another complete without selecting a card.", "The repeated action may explain its refusal but must not charge another five minutes."],
|
|
70
|
+
build: ["Implement acceptanceCases with complete expected projections and short action sequences. Use your current card IDs and minute values. Include completion, a repeated request, undo and reset without calling update to calculate the expected answers.", "Computing expectations from the same implementation being tested would make its defects agree with themselves."],
|
|
71
|
+
run: ["Run the cases in the test-first view. Inspect the reference-contract result alongside the current prototype result and identify which behaviours are still unimplemented. Confirm that deliberately wrong expected arithmetic is rejected.", "The lesson assessment checks the quality of these executable predictions; it does not claim that unfinished controls passed gameplay checks."],
|
|
72
|
+
assess: ["Validate bounded names, actions and exact expected projections against the documented contract. Check meaningful completion, repeat, undo and reset scenarios with independent expected values.", "A case title alone is insufficient; its action sequence must actually exercise the claimed behaviour."],
|
|
73
|
+
inspect: ["If a predicted case fails the contract, trace its arithmetic and selection state by hand. If only the unfinished prototype fails, identify the missing behaviour instead of changing a correct expectation to match empty logic.", "Separate test errors from implementation gaps before making a repair."],
|
|
74
|
+
fix: ["Correct any mistaken case and rerun the contract comparison. Retain correct cases that currently fail against the prototype; those become the concrete implementation targets for the next mission.", "Passing this mission means your bounded specifications are correct, not that the whole application is finished."],
|
|
75
|
+
explain: ["Choose why independent expected results matter and explain one currently failing prototype case. Describe what new behaviour would make that case pass without weakening its requirement.", "A test is useful because it can disagree with the programme when the programme is wrong or incomplete."],
|
|
76
|
+
reward: ["Save Executable success. Your idea now has specific checks that can challenge an implementation. Next you will build the smallest useful selection-and-completion loop that makes those examples real.", "Keep the expected results fixed unless the written contract or your original reasoning was demonstrably wrong."]
|
|
77
|
+
},
|
|
78
|
+
questions: {
|
|
79
|
+
learn: { question: "How should expected results be produced for acceptance cases?", choices: ["By copying the unfinished update output", "From the documented rule and independent reasoning", "By choosing whichever value currently passes"], correctChoice: 1, feedback: "Independent expectations can reveal an implementation defect instead of simply reproducing the same incorrect calculation." },
|
|
80
|
+
predict: { question: "Complete a five-minute scout from thirty minutes; how much remains?", choices: ["Thirty minutes", "Five minutes", "Twenty-five minutes"], correctChoice: 2, feedback: "The completed card consumes exactly five minutes, leaving twenty-five and recording five as spent." },
|
|
81
|
+
explain: { question: "What does a correct case failing against unfinished code tell you?", choices: ["Which documented behaviour still needs implementation", "That the correct requirement must be removed", "That the whole project is already complete"], correctChoice: 0, feedback: "A valid failing case names an implementation gap and supplies a concrete target for the next development step." }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: "Build the smallest useful board",
|
|
86
|
+
concepts: ["Events", "Preconditions", "Conservation"],
|
|
87
|
+
goals: ["Select and complete an eligible mission through real state transitions.", "Preserve the finite time budget and explain refused actions without hidden changes."],
|
|
88
|
+
extension: "Compare a small mission and a larger mission from the same remaining budget. Explain how eligibility can change without changing either card's identity or title.",
|
|
89
|
+
activities: {
|
|
90
|
+
learn: ["Selection records an existing card ID. Complete succeeds only for a selected unfinished card whose minutes fit the remaining budget. Mark it done, subtract and add the same minutes to the two counters, append a receipt and clear selection. Refused actions change only a useful message.", "The invariant remaining+spent=30 connects visible time to actual completed choices."],
|
|
91
|
+
predict: ["Select scout, complete it and press complete again. Predict cards, counters, selection and history after both actions. Then select an already-completed card and consider why its presence does not make it eligible again.", "Action availability should be derived from current state, not from whether a button was once enabled."],
|
|
92
|
+
build: ["Implement select and complete in update using a detached copy. Validate the selected record, done state and available time before effects. On success record {cardId,minutes}, clear selection and set a clear message. Derive canComplete and canUndo from the resulting state.", "Use one successful completion path so accounting, card state and the receipt cannot disagree."],
|
|
93
|
+
run: ["Complete several missions with keyboard and onscreen controls. Try no selection, an unknown ID, a done card and an unaffordable card. Compare the explanatory message with unchanged data on refused actions.", "A disabled or refused action should explain what prerequisite is missing rather than appear silently broken."],
|
|
94
|
+
assess: ["Check selection, exact-budget completion, repeat requests, insufficient time, unknown IDs, receipt bounds and input immutability. The completion-related acceptance cases should now pass against your prototype itself.", "The independent checks also exercise states beyond the default three-card example."],
|
|
95
|
+
inspect: ["If time is charged twice, inspect selection clearing and the done guard. If counters drift apart, inspect whether both use the same card minutes. If refusal alters cards or receipts, inspect effects placed before validation.", "Compare the whole transition, not only the message that claims it succeeded or failed."],
|
|
96
|
+
fix: ["Repair the responsible guard or accounting step and rerun successful, repeated and refused completions. Check view after each result so displayed permissions and counts follow actual state.", "Do not set counters to favourable constants; conserve the exact amount charged by each real completion."],
|
|
97
|
+
explain: ["Choose why preconditions come before effects and explain how a receipt records the completed change. Describe how your smallest useful board now serves the goal in the brief.", "A useful prototype completes one coherent user task before adding unrelated features."],
|
|
98
|
+
reward: ["Save Useful board. Your prototype can now turn a selection into a correctly accounted choice. Next you will make that choice reversible and review a proposed simplification that would break the refund rule.", "Keep the repeated-complete case as protection for future interaction changes."]
|
|
99
|
+
},
|
|
100
|
+
questions: {
|
|
101
|
+
learn: { question: "What must hold before a card can complete?", choices: ["Its label is the longest", "Any card was selected sometime earlier", "It is currently selected, unfinished and affordable"], correctChoice: 2, feedback: "Completion depends on the current selected record and its live eligibility, not on a past button state or presentation detail." },
|
|
102
|
+
predict: { question: "What should repeated complete without a fresh selection do to time counters?", choices: ["Leave them unchanged", "Charge the last card again", "Restore all thirty minutes"], correctChoice: 0, feedback: "The first success clears selection, so the repeated request fails its prerequisite and cannot change accounting." },
|
|
103
|
+
explain: { question: "Why validate before changing cards and counters?", choices: ["To make useful actions impossible", "So a refused action cannot leave partial effects", "To hide all feedback"], correctChoice: 1, feedback: "Checking prerequisites first keeps refused transitions from partially altering data before discovering that completion was invalid." }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: "Review a reversible change",
|
|
108
|
+
concepts: ["Undo", "Receipts", "Source review"],
|
|
109
|
+
goals: ["Undo only the latest completion and refund its exact charged time.", "Reject a source shortcut that would erase earlier accounting."],
|
|
110
|
+
extension: "Complete two differently sized cards and undo them in reverse order. Explain why last-in-first-out receipts identify the correct card and refund at each step.",
|
|
111
|
+
activities: {
|
|
112
|
+
learn: ["Undo pops the newest completion receipt, marks that card unfinished, refunds its recorded minutes and clears selection. Earlier receipts and completed cards remain. An authored suggestion replaces the exact refund with remaining=30; inspect its effect after more than one completion.", "Reversibility needs enough information about the actual change, not a guess based on the current display."],
|
|
113
|
+
predict: ["Complete scout for five minutes and signal for ten. Predict remaining and spent after undoing signal. Compare the documented refund with the proposed reset to thirty while scout remains complete.", "The correct result retains five spent minutes: remaining is twenty-five, not thirty."],
|
|
114
|
+
build: ["Implement undo with the latest receipt and exact refund, preserving all earlier work. Review and reject the refund-everything diff with the two-card counterexample. Handle empty history with an explanatory message and no data change; keep reset as the separate full restart.", "Undo and reset are different actions. Sharing a label or shortcut must not make their effects indistinguishable."],
|
|
115
|
+
run: ["Complete two cards, undo once, undo again and try an empty undo. Compare counters, done states, history length and selected card after each action. Run the authored proposal comparison against the same sequence.", "The actual removed and added source lines should support the review decision, not just the proposal's intent text."],
|
|
116
|
+
assess: ["Check last-in-first-out reversal, exact refunds, preservation of earlier completions, selection clearing, empty history and repeatable re-completion. Verify the rejected proposal's reasoning and current-source undo cases.", "An accepted or rejected review choice alone cannot substitute for correct executable state transitions."],
|
|
117
|
+
inspect: ["If all time returns after one undo, inspect the actual refund expression. If the wrong card reopens, inspect the popped cardId. If previous completions disappear, inspect whether the code resets instead of reversing one receipt.", "Compare one receipt with its original effect to identify exactly what must be reversed."],
|
|
118
|
+
fix: ["Repair undo and replay two completions followed by one undo. Recheck repeated completion and a full reset so reversal does not weaken the earlier accounting or fresh-state rules.", "Do not alter the expected result merely to accommodate the rejected constant-refund shortcut."],
|
|
119
|
+
explain: ["Choose why an exact receipt is useful and explain the difference between reversing one action and starting over. Describe the concrete evidence that made the proposed simplification unacceptable.", "A small code change can break a conservation rule across several previously completed actions."],
|
|
120
|
+
reward: ["Save Reversible choices. Your prototype now lets a user revise one decision predictably. Next you will explore filtering and presentation trade-offs while preserving that underlying state.", "Keep the two-card undo case as a regression for all future budget changes."]
|
|
121
|
+
},
|
|
122
|
+
questions: {
|
|
123
|
+
learn: { question: "Which completion should undo reverse?", choices: ["The newest remaining receipt", "Every completed card at once", "Whichever card is currently first onscreen"], correctChoice: 0, feedback: "The receipt stack records completed actions in order, so undo reverses the most recent one still present." },
|
|
124
|
+
predict: { question: "After spending five and ten minutes, undo the ten-minute card; how much remains?", choices: ["Thirty minutes", "Twenty-five minutes", "Fifteen minutes"], correctChoice: 1, feedback: "Only ten minutes are refunded, leaving the earlier five-minute completion intact and twenty-five minutes available." },
|
|
125
|
+
explain: { question: "Why is setting remaining to thirty an incorrect undo shortcut?", choices: ["Because no action can ever restore time", "Because card titles must change too", "Because it refunds earlier completions that were not undone"], correctChoice: 2, feedback: "A constant reset loses the relationship between the latest receipt and the specific amount that action consumed." }
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: "Explore the trade-offs",
|
|
130
|
+
concepts: ["Filtering", "Derived views", "Accessible feedback"],
|
|
131
|
+
goals: ["Add all, open and done views without changing the underlying plan.", "Keep actions, counts and feedback understandable when the visible set changes."],
|
|
132
|
+
extension: "Compare an all-cards view with an open-only view for your audience. Explain what each makes easier to notice and which global information must remain visible in both.",
|
|
133
|
+
activities: {
|
|
134
|
+
learn: ["A filter changes the view, not the plan. Valid all/open/done actions clear selection but preserve cards, counters and history. Compute visibleCards from the filter while completedCount and totalCount use every card. Ignore attempts to select a hidden ID and derive action permissions from visible state.", "A smaller display should not silently erase work or leave an unseen card selected for completion."],
|
|
135
|
+
predict: ["Complete scout and switch to done. Predict visible cards, total count, completed count and remaining time. Switch to open and consider a select request for the now-hidden scout ID.", "The complete card list is unchanged even when the visible list becomes smaller."],
|
|
136
|
+
build: ["Implement filter actions, selection clearing and hidden-card refusal. Update view to return correct visible cards, selection markers and permissions. Add a filter acceptance case and keep useful messages for empty results and refused actions without altering accounting.", "Keep labels and status text meaningful; colour and animation can supplement the information but must not carry it alone."],
|
|
137
|
+
run: ["Use keyboard and onscreen controls to switch filters before and after completion and undo. Try an empty done view, a hidden ID and a filter change with a selection. Compare the board in narrow and reduced-motion views.", "The shared host provides semantic controls; your projection must supply accurate names, counts and enabled states."],
|
|
138
|
+
assess: ["Check all filter values, unknown filters, hidden selection, selection clearing and global counts. Ensure filtering changes neither budget nor history and undo remains correct regardless of the active view.", "Tests compare data before and after a view change to catch accidental destructive filtering."],
|
|
139
|
+
inspect: ["If completed cards disappear permanently, inspect whether filter rewrites state.cards. If totalCount changes with the view, inspect its source list. If an invisible selection remains actionable, inspect filter transitions and eligibility together.", "Distinguish changing what is shown from changing what exists in the user's plan."],
|
|
140
|
+
fix: ["Repair the projection or transition and replay complete, filter, undo and reset. Verify the same underlying plan returns when all is selected, and recheck earlier completion and refund cases.", "A visual improvement must preserve the working behaviour that makes the prototype useful."],
|
|
141
|
+
explain: ["Choose which data filtering should preserve and describe a trade-off between showing everything and reducing visible detail. Explain how truthful global counts help a user understand the hidden portion.", "A design choice can improve one task while making another less obvious; name the trade-off instead of claiming one view is always best."],
|
|
142
|
+
reward: ["Save Understandable views. Your board can show focused information without losing work. The final mission connects the brief, interactions, reversal and view choices into a working showcase.", "Keep the filter-after-undo case because it crosses both data and presentation behaviour."]
|
|
143
|
+
},
|
|
144
|
+
questions: {
|
|
145
|
+
learn: { question: "What should a filter action preserve?", choices: ["Only the title", "Cards, time counters and completion history", "An invisible active selection"], correctChoice: 1, feedback: "Filtering changes presentation while retaining the underlying plan and accounting; clearing selection prevents hidden actions." },
|
|
146
|
+
predict: { question: "One of three cards is done and the done filter is active; what is totalCount?", choices: ["One", "Zero", "Three"], correctChoice: 2, feedback: "totalCount describes the full plan, so it remains three even though only one card is currently visible." },
|
|
147
|
+
explain: { question: "Why avoid assigning filtered results back to state.cards?", choices: ["It would delete hidden records rather than merely hide them", "It would make the title longer", "Filters must never read card state"], correctChoice: 0, feedback: "A projection should leave the source records intact so changing the filter can reveal them again without losing work." }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: "Show the working idea",
|
|
152
|
+
concepts: ["Showcase", "Evidence", "Scope and iteration"],
|
|
153
|
+
goals: ["Deliver a coherent private mission-board prototype that serves the written brief.", "Demonstrate normal and refused actions with current-source evidence and explain design trade-offs."],
|
|
154
|
+
extension: "Propose a new interaction in a separate save. State its audience benefit, budget and undo implications, and acceptance cases before changing the completed prototype.",
|
|
155
|
+
activities: {
|
|
156
|
+
learn: ["A working showcase demonstrates a user task and its limits. Your board has truthful initial data, selection, affordable completion, exact undo, filtering and reset. Connect these behaviours to the audience and goal, then show both successful actions and useful explanations when an action cannot proceed.", "An original theme is valuable when it supports a coherent interaction, not when it replaces the working prototype with static decoration."],
|
|
157
|
+
predict: ["Plan a demonstration that selects two cards, completes them, changes filter, undoes the latest choice and resets. Predict each budget, count and selection transition before presenting the result.", "Include at least one refused action so the demonstration covers more than the easiest successful path."],
|
|
158
|
+
build: ["Complete the authored title, fictional labels, brief and acceptance cases. Review update and view for one consistent set of rules, remove abandoned experiments and keep the exact refund and filter-preservation constraints visible in your explanation.", "The final prototype should fit the original bounded goal; save additional ideas for a separate iteration."],
|
|
159
|
+
run: ["Perform the demonstration with keyboard and onscreen controls. Check narrow layouts, reduced motion and readable text feedback. Save, reload and repeat the same input sequence to compare the current source's results.", "A completed simulator session and an earned course result are different records; reset affects the prototype without erasing learning progress."],
|
|
160
|
+
assess: ["Run final checks for initial bounds, selection eligibility, time conservation, refusal without partial effects, receipt order, exact undo, filtering, view truthfulness, input immutability and fresh reset. All implemented acceptance cases must now pass against the prototype itself.", "The earlier test-first milestone accepted correct predictions; the final milestone requires the promised behaviour to exist and work."],
|
|
161
|
+
inspect: ["Compare a failure with the brief and identify its first incorrect transition. Decide whether it comes from data, permission, accounting, undo or projection, using a small reproduction to avoid unrelated edits.", "A pleasant-looking final card cannot prove that earlier counters or receipts stayed correct."],
|
|
162
|
+
fix: ["Repair the responsible rule, replay its focused case and rerun the complete demonstration. Save a named final project and obtain a fresh assessment for that source before finishing.", "An assessment from a previous version cannot establish the correctness of a later source change."],
|
|
163
|
+
explain: ["Choose the evidence that establishes a working prototype and describe one trade-off in your interface. Explain why you rejected the refund shortcut and what another iteration would need to test before expanding the idea.", "Be precise about what the prototype demonstrates, including actions it intentionally refuses and features outside its scope."],
|
|
164
|
+
reward: ["Save Working idea and finish the final assessment. You have taken an audience need through executable success criteria, implementation, review and a usable private prototype. Replay a mission or explore another idea while retaining earned completion.", "Keep the tested version as a reference; authored material and account-bound saving support the course without a live AI service."]
|
|
165
|
+
},
|
|
166
|
+
questions: {
|
|
167
|
+
learn: { question: "What makes the final showcase a working prototype?", choices: ["Only an attractive title", "A confident idea with no actions", "Implemented interactions supported by verified scenarios"], correctChoice: 2, feedback: "A prototype demonstrates real behaviour through actions and evidence, rather than merely presenting an idea's appearance." },
|
|
168
|
+
predict: { question: "Which acceptance cases must pass against the learner's source at the final milestone?", choices: ["All of the implemented documented cases", "Only cases that never change state", "None, because earlier predictions were correct"], correctChoice: 0, feedback: "Correct test-first predictions become obligations for the completed implementation, so the final source must now satisfy them." },
|
|
169
|
+
explain: { question: "What should guide the next iteration after this bounded prototype?", choices: ["Adding unrelated features without tests", "A clear audience benefit, constraints and new acceptance evidence", "Removing useful failure feedback"], correctChoice: 1, feedback: "Another iteration should connect a defined benefit to scoped implementation and evidence, just as the current prototype does." }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
]);
|
|
173
|
+
var suggestions = [{ stageId: "vibe-idea-studio.m4.build", proposal: {
|
|
174
|
+
id: "idea-refund-everything",
|
|
175
|
+
source: "authored-fallback",
|
|
176
|
+
intent: "Simplify restoring time when undoing the latest completed mission.",
|
|
177
|
+
constraints: ["Undo refunds only the latest receipt's charged minutes.", "Earlier completed missions and their spent time remain intact."],
|
|
178
|
+
permittedArtifactId: "app.js",
|
|
179
|
+
originalSnippet: "next.remaining += receipt.minutes;",
|
|
180
|
+
replacementSnippet: "next.remaining = 30;",
|
|
181
|
+
explanationPrompt: "After completing scout and signal, does this change preserve the five minutes still spent on scout?",
|
|
182
|
+
aiOptional: false,
|
|
183
|
+
learnerApprovalRequired: true,
|
|
184
|
+
alternatives: ["accept", "reject"]
|
|
185
|
+
} }];
|
|
186
|
+
export {
|
|
187
|
+
course,
|
|
188
|
+
practice,
|
|
189
|
+
suggestions
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=vibe-idea-studio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/courses/vibe-idea-studio.ts"],"sourcesContent":["import { authorCourse } from \"./course-authoring.js\";\nimport type { LearningCourseSuggestionV1 } from \"../course-suggestions.js\";\n\nexport const { course, practice } = authorCourse({\n slug: \"vibe-idea-studio\", title: \"Vibe Idea Studio\", category: \"vibe\",\n summary: \"Turn a fictional audience's idea into an interactive mission board with a thirty-minute planning budget. Write executable success cases before completing the prototype, then add reversible completion, filtering and clear feedback. Finish a working private showcase with evidence for your design choices. Authored review examples make live AI unnecessary.\",\n projectFiles: [{ path: \"app.js\", language: \"javascript\", maximumCharacters: 32000 }, { path: \"brief.json\", language: \"json\", maximumCharacters: 6000 }],\n starterProject: { files: [{ path: \"app.js\", source: `function initialState() {\n return { title: \"Rescue Mission Board\", cards: [\n { id: \"scout\", title: \"Scout the path\", minutes: 5, done: false },\n { id: \"signal\", title: \"Send a beacon\", minutes: 10, done: false },\n { id: \"rescue\", title: \"Bring the team home\", minutes: 15, done: false }\n ], selectedId: null, remaining: 30, spent: 0, history: [], filter: \"all\", message: \"Choose a mission.\" };\n}\n\nfunction update(state, input) {\n if (input.type === \"reset\") return initialState();\n return JSON.parse(JSON.stringify(state));\n}\n\nfunction view(state) { return {}; }\nfunction acceptanceCases() { return []; }\n` }, { path: \"brief.json\", source: '{\\n \"audience\": \"\",\\n \"goal\": \"\",\\n \"constraints\": []\\n}\\n' }] },\n reference: [\n { name: \"initialState\", signature: \"initialState() → mission board\", description: \"A fresh board has an authored title of 3–60 characters, three to five uniquely identified fictional cards, no selection or history, 30 remaining minutes, zero spent, all filter and a useful message. Each card has id, title, integer minutes 1–30 and done=false. IDs use lowercase letters, digits and hyphens, 1–32 characters; titles use 3–60 characters.\", example: '{ id: \"scout\", title: \"Scout the path\", minutes: 5, done: false }' },\n { name: \"update\", signature: \"update(state, input) → detached next state\", description: \"Actions are select with id, complete, undo, filter with value all/open/done, and reset. Unknown actions, unknown IDs and selection of a currently hidden card preserve values. Complete requires a selected visible unfinished card whose minutes fit remaining time; success marks it done, accounts minutes, records a receipt and clears selection. Feedback messages are nonempty text up to 200 characters.\", example: 'update(state, { type: \"select\", id: \"scout\" });' },\n { name: \"time budget\", signature: \"remaining + spent === 30\", description: \"Completion subtracts the selected card's minutes from remaining and adds exactly that amount to spent. Missing selection, already-done cards and insufficient time change only the feedback message. Keep both counters within 0–30. A repeated complete cannot charge twice.\", example: 'if (card.minutes > next.remaining) { next.message = \"Not enough time remains.\"; return next; }' },\n { name: \"undo\", signature: \"history: [{ cardId, minutes }]\", description: \"Each successful completion appends a receipt with that card's ID and charged minutes, at most five entries. Undo removes the newest receipt, marks only that card unfinished, refunds its exact minutes and clears selection. Empty undo changes only feedback. Reset creates fresh cards, counters, selection and history.\", example: \"const receipt = next.history.pop(); next.remaining += receipt.minutes; next.spent -= receipt.minutes;\" },\n { name: \"filter\", signature: 'input: { type: \"filter\", value: \"all\" | \"open\" | \"done\" }', description: \"A valid filter action records the filter and clears selection. Filtering changes no card, time counter or history entry. Unknown filters preserve state. view projects the appropriate cards while reporting counts from the complete card list.\", example: 'const visible = state.cards.filter(card => state.filter === \"all\" || (state.filter === \"done\" ? card.done : !card.done));' },\n { name: \"view\", signature: \"view(state) → safe display data\", description: \"Return title, visibleCards [{id,title,minutes,done,selected}], completedCount, totalCount, remaining, spent, canComplete, canUndo and message. canComplete requires the selected visible unfinished card to fit the budget; canUndo means history is nonempty. Compute data without mutation. The host renders semantic controls and text; learner source has no DOM or network access.\", example: \"const completedCount = state.cards.filter(card => card.done).length;\" },\n { name: \"brief.json\", signature: \"{ audience, goal, constraints }\", description: \"Write fictional audience and goal text, each 10–160 characters, plus three to six constraints of 10–160 characters. State the planning purpose, finite time budget, understandable feedback and ability to revise a choice. Labels can express your theme while the interaction contract remains testable.\", example: '{ \"audience\": \"A fictional rescue planning team\", \"goal\": \"Choose useful missions within thirty minutes\", \"constraints\": [\"Never spend more than the available time\", \"Make completed choices reversible\", \"Explain why an action cannot proceed\"] }' },\n { name: \"acceptanceCases\", signature: \"acceptanceCases() → 4–8 named replay cases\", description: \"Each case has name (3–60 characters), actions (1–40 documented actions) and expected {remaining,spent,doneIds,selectedId,historyCount,filter}. Start from initialState; doneIds follows card order. Include successful completion, repeated completion, undo and reset; add a filter case when implementing filters. During the test-first mission, the host verifies expected cases against the documented reference behaviour before the learner prototype implements it.\", example: '{ name: \"Complete scout\", actions: [{type:\"select\",id:\"scout\"},{type:\"complete\"}], expected: {remaining:25,spent:5,doneIds:[\"scout\"],selectedId:null,historyCount:1,filter:\"all\"} }' },\n ],\n}, [\n {\n title: \"Give the idea an audience\", concepts: [\"Audience\", \"Purpose\", \"State and presentation\"],\n goals: [\"Write a bounded fictional planning brief and a useful initial board.\", \"Expose truthful display data with labels and counts derived from state.\"],\n extension: \"Describe a second audience who could use the same interaction rules. Change the fictional labels in a separate version and explain what stayed reusable.\",\n activities: {\n learn: [\"An idea becomes actionable when you can name who it helps and what they need to do. This prototype helps a fictional team choose missions within thirty minutes. Start with a clear title, three to five labelled cards and truthful counts before adding completion controls.\", \"The starter's three cards offer a concrete beginning; your brief and labels can give the same bounded interaction an original theme.\"],\n predict: [\"Predict the initial completed count, remaining time and available actions. Compare canComplete with canUndo when there is no selection and no history, even though useful mission cards are visible.\", \"Visible opportunities do not automatically mean a particular action currently has valid prerequisites.\"],\n build: [\"Complete brief.json with an audience, goal and specific constraints. Author the board title and card labels, keeping valid unique IDs and bounded minutes. Implement view to return the documented data from state, with all cards initially visible and both action permissions false.\", \"A display projection reads state; it must not mark a card complete or alter the planning budget.\"],\n run: [\"Open the private board and inspect its title, cards, time and counts. Compare visible text with view output and restart from initialState. Check the labels with keyboard navigation and without relying on decoration.\", \"This is an interactive prototype in progress; later missions make its controls perform the planned actions.\"],\n assess: [\"Check initial card bounds and identities, fresh state, authored brief and truthful view projection. Confirm reading view changes no state and that counts describe the complete card list.\", \"A renamed title alone does not satisfy the data and accessibility requirements of a useful initial board.\"],\n inspect: [\"If counts disagree, inspect their source arrays. If action buttons appear enabled before selection or history exists, inspect their prerequisites. If one card replaces another, inspect duplicate IDs before blaming the display.\", \"Stable identities let later events refer to the intended card without depending on its label or position.\"],\n fix: [\"Repair the projection or initial data and compare fresh boards again. Keep your brief within the agreed scope and make sure every displayed action has an understandable label and state.\", \"Use fictional examples instead of adding personal details that the project does not need.\"],\n explain: [\"Choose the brief that names an observable user goal and explain how one display field supports it. Distinguish the idea's theme from the interaction rules that make it usable.\", \"The audience and goal help you decide which changes matter, rather than collecting unrelated features.\"],\n reward: [\"Save Defined audience. Your prototype now has a purpose and an honest initial view. Next you will write executable success cases before filling in its main interaction logic.\", \"Keep the initial board as a baseline for your later design decisions.\"],\n },\n questions: {\n learn: { question: \"Which statement defines a useful bounded prototype goal?\", choices: [\"Help a fictional team choose missions within thirty minutes\", \"Add every possible feature\", \"Make an unspecified audience impressed\"], correctChoice: 0, feedback: \"The statement identifies an audience, a concrete task and a finite resource that can guide implementation and tests.\" },\n predict: { question: \"With no selected card and empty history, which actions should be enabled?\", choices: [\"Complete and undo\", \"Neither complete nor undo\", \"Undo only\"], correctChoice: 1, feedback: \"Completion needs an eligible selection and undo needs a receipt, so neither has its prerequisite in the fresh board.\" },\n explain: { question: \"Why do cards need stable unique IDs as well as labels?\", choices: [\"To hide their titles\", \"To prevent any future edits\", \"So actions can identify the intended card reliably\"], correctChoice: 2, feedback: \"An identity lets selection and completion target the right record even when a label or displayed order changes.\" },\n },\n },\n {\n title: \"Make success executable\", concepts: [\"Test-first design\", \"Acceptance cases\", \"Independent expectations\"],\n goals: [\"Translate the brief into bounded executable input sequences and predicted results.\", \"Distinguish a valid test of future behaviour from a currently implemented feature.\"],\n extension: \"Write a case for an unaffordable mission using a later depleted budget. Explain which state fields must remain unchanged when the action is refused.\",\n activities: {\n learn: [\"A success case describes actions and an expected result from a fresh board. Complete one card, repeat a completion, undo and reset are useful cases. Write four to eight bounded cases before implementing these behaviours. The host checks the predictions against the course contract separately from the unfinished prototype.\", \"An expected failure against unfinished code is visible progress in test-first work, not evidence that the behaviour already works.\"],\n predict: [\"For the starter cards, select scout and complete it. Predict remaining=25, spent=5, doneIds=[scout], no selection and one history receipt. Then predict the effect of another complete without selecting a card.\", \"The repeated action may explain its refusal but must not charge another five minutes.\"],\n build: [\"Implement acceptanceCases with complete expected projections and short action sequences. Use your current card IDs and minute values. Include completion, a repeated request, undo and reset without calling update to calculate the expected answers.\", \"Computing expectations from the same implementation being tested would make its defects agree with themselves.\"],\n run: [\"Run the cases in the test-first view. Inspect the reference-contract result alongside the current prototype result and identify which behaviours are still unimplemented. Confirm that deliberately wrong expected arithmetic is rejected.\", \"The lesson assessment checks the quality of these executable predictions; it does not claim that unfinished controls passed gameplay checks.\"],\n assess: [\"Validate bounded names, actions and exact expected projections against the documented contract. Check meaningful completion, repeat, undo and reset scenarios with independent expected values.\", \"A case title alone is insufficient; its action sequence must actually exercise the claimed behaviour.\"],\n inspect: [\"If a predicted case fails the contract, trace its arithmetic and selection state by hand. If only the unfinished prototype fails, identify the missing behaviour instead of changing a correct expectation to match empty logic.\", \"Separate test errors from implementation gaps before making a repair.\"],\n fix: [\"Correct any mistaken case and rerun the contract comparison. Retain correct cases that currently fail against the prototype; those become the concrete implementation targets for the next mission.\", \"Passing this mission means your bounded specifications are correct, not that the whole application is finished.\"],\n explain: [\"Choose why independent expected results matter and explain one currently failing prototype case. Describe what new behaviour would make that case pass without weakening its requirement.\", \"A test is useful because it can disagree with the programme when the programme is wrong or incomplete.\"],\n reward: [\"Save Executable success. Your idea now has specific checks that can challenge an implementation. Next you will build the smallest useful selection-and-completion loop that makes those examples real.\", \"Keep the expected results fixed unless the written contract or your original reasoning was demonstrably wrong.\"],\n },\n questions: {\n learn: { question: \"How should expected results be produced for acceptance cases?\", choices: [\"By copying the unfinished update output\", \"From the documented rule and independent reasoning\", \"By choosing whichever value currently passes\"], correctChoice: 1, feedback: \"Independent expectations can reveal an implementation defect instead of simply reproducing the same incorrect calculation.\" },\n predict: { question: \"Complete a five-minute scout from thirty minutes; how much remains?\", choices: [\"Thirty minutes\", \"Five minutes\", \"Twenty-five minutes\"], correctChoice: 2, feedback: \"The completed card consumes exactly five minutes, leaving twenty-five and recording five as spent.\" },\n explain: { question: \"What does a correct case failing against unfinished code tell you?\", choices: [\"Which documented behaviour still needs implementation\", \"That the correct requirement must be removed\", \"That the whole project is already complete\"], correctChoice: 0, feedback: \"A valid failing case names an implementation gap and supplies a concrete target for the next development step.\" },\n },\n },\n {\n title: \"Build the smallest useful board\", concepts: [\"Events\", \"Preconditions\", \"Conservation\"],\n goals: [\"Select and complete an eligible mission through real state transitions.\", \"Preserve the finite time budget and explain refused actions without hidden changes.\"],\n extension: \"Compare a small mission and a larger mission from the same remaining budget. Explain how eligibility can change without changing either card's identity or title.\",\n activities: {\n learn: [\"Selection records an existing card ID. Complete succeeds only for a selected unfinished card whose minutes fit the remaining budget. Mark it done, subtract and add the same minutes to the two counters, append a receipt and clear selection. Refused actions change only a useful message.\", \"The invariant remaining+spent=30 connects visible time to actual completed choices.\"],\n predict: [\"Select scout, complete it and press complete again. Predict cards, counters, selection and history after both actions. Then select an already-completed card and consider why its presence does not make it eligible again.\", \"Action availability should be derived from current state, not from whether a button was once enabled.\"],\n build: [\"Implement select and complete in update using a detached copy. Validate the selected record, done state and available time before effects. On success record {cardId,minutes}, clear selection and set a clear message. Derive canComplete and canUndo from the resulting state.\", \"Use one successful completion path so accounting, card state and the receipt cannot disagree.\"],\n run: [\"Complete several missions with keyboard and onscreen controls. Try no selection, an unknown ID, a done card and an unaffordable card. Compare the explanatory message with unchanged data on refused actions.\", \"A disabled or refused action should explain what prerequisite is missing rather than appear silently broken.\"],\n assess: [\"Check selection, exact-budget completion, repeat requests, insufficient time, unknown IDs, receipt bounds and input immutability. The completion-related acceptance cases should now pass against your prototype itself.\", \"The independent checks also exercise states beyond the default three-card example.\"],\n inspect: [\"If time is charged twice, inspect selection clearing and the done guard. If counters drift apart, inspect whether both use the same card minutes. If refusal alters cards or receipts, inspect effects placed before validation.\", \"Compare the whole transition, not only the message that claims it succeeded or failed.\"],\n fix: [\"Repair the responsible guard or accounting step and rerun successful, repeated and refused completions. Check view after each result so displayed permissions and counts follow actual state.\", \"Do not set counters to favourable constants; conserve the exact amount charged by each real completion.\"],\n explain: [\"Choose why preconditions come before effects and explain how a receipt records the completed change. Describe how your smallest useful board now serves the goal in the brief.\", \"A useful prototype completes one coherent user task before adding unrelated features.\"],\n reward: [\"Save Useful board. Your prototype can now turn a selection into a correctly accounted choice. Next you will make that choice reversible and review a proposed simplification that would break the refund rule.\", \"Keep the repeated-complete case as protection for future interaction changes.\"],\n },\n questions: {\n learn: { question: \"What must hold before a card can complete?\", choices: [\"Its label is the longest\", \"Any card was selected sometime earlier\", \"It is currently selected, unfinished and affordable\"], correctChoice: 2, feedback: \"Completion depends on the current selected record and its live eligibility, not on a past button state or presentation detail.\" },\n predict: { question: \"What should repeated complete without a fresh selection do to time counters?\", choices: [\"Leave them unchanged\", \"Charge the last card again\", \"Restore all thirty minutes\"], correctChoice: 0, feedback: \"The first success clears selection, so the repeated request fails its prerequisite and cannot change accounting.\" },\n explain: { question: \"Why validate before changing cards and counters?\", choices: [\"To make useful actions impossible\", \"So a refused action cannot leave partial effects\", \"To hide all feedback\"], correctChoice: 1, feedback: \"Checking prerequisites first keeps refused transitions from partially altering data before discovering that completion was invalid.\" },\n },\n },\n {\n title: \"Review a reversible change\", concepts: [\"Undo\", \"Receipts\", \"Source review\"],\n goals: [\"Undo only the latest completion and refund its exact charged time.\", \"Reject a source shortcut that would erase earlier accounting.\"],\n extension: \"Complete two differently sized cards and undo them in reverse order. Explain why last-in-first-out receipts identify the correct card and refund at each step.\",\n activities: {\n learn: [\"Undo pops the newest completion receipt, marks that card unfinished, refunds its recorded minutes and clears selection. Earlier receipts and completed cards remain. An authored suggestion replaces the exact refund with remaining=30; inspect its effect after more than one completion.\", \"Reversibility needs enough information about the actual change, not a guess based on the current display.\"],\n predict: [\"Complete scout for five minutes and signal for ten. Predict remaining and spent after undoing signal. Compare the documented refund with the proposed reset to thirty while scout remains complete.\", \"The correct result retains five spent minutes: remaining is twenty-five, not thirty.\"],\n build: [\"Implement undo with the latest receipt and exact refund, preserving all earlier work. Review and reject the refund-everything diff with the two-card counterexample. Handle empty history with an explanatory message and no data change; keep reset as the separate full restart.\", \"Undo and reset are different actions. Sharing a label or shortcut must not make their effects indistinguishable.\"],\n run: [\"Complete two cards, undo once, undo again and try an empty undo. Compare counters, done states, history length and selected card after each action. Run the authored proposal comparison against the same sequence.\", \"The actual removed and added source lines should support the review decision, not just the proposal's intent text.\"],\n assess: [\"Check last-in-first-out reversal, exact refunds, preservation of earlier completions, selection clearing, empty history and repeatable re-completion. Verify the rejected proposal's reasoning and current-source undo cases.\", \"An accepted or rejected review choice alone cannot substitute for correct executable state transitions.\"],\n inspect: [\"If all time returns after one undo, inspect the actual refund expression. If the wrong card reopens, inspect the popped cardId. If previous completions disappear, inspect whether the code resets instead of reversing one receipt.\", \"Compare one receipt with its original effect to identify exactly what must be reversed.\"],\n fix: [\"Repair undo and replay two completions followed by one undo. Recheck repeated completion and a full reset so reversal does not weaken the earlier accounting or fresh-state rules.\", \"Do not alter the expected result merely to accommodate the rejected constant-refund shortcut.\"],\n explain: [\"Choose why an exact receipt is useful and explain the difference between reversing one action and starting over. Describe the concrete evidence that made the proposed simplification unacceptable.\", \"A small code change can break a conservation rule across several previously completed actions.\"],\n reward: [\"Save Reversible choices. Your prototype now lets a user revise one decision predictably. Next you will explore filtering and presentation trade-offs while preserving that underlying state.\", \"Keep the two-card undo case as a regression for all future budget changes.\"],\n },\n questions: {\n learn: { question: \"Which completion should undo reverse?\", choices: [\"The newest remaining receipt\", \"Every completed card at once\", \"Whichever card is currently first onscreen\"], correctChoice: 0, feedback: \"The receipt stack records completed actions in order, so undo reverses the most recent one still present.\" },\n predict: { question: \"After spending five and ten minutes, undo the ten-minute card; how much remains?\", choices: [\"Thirty minutes\", \"Twenty-five minutes\", \"Fifteen minutes\"], correctChoice: 1, feedback: \"Only ten minutes are refunded, leaving the earlier five-minute completion intact and twenty-five minutes available.\" },\n explain: { question: \"Why is setting remaining to thirty an incorrect undo shortcut?\", choices: [\"Because no action can ever restore time\", \"Because card titles must change too\", \"Because it refunds earlier completions that were not undone\"], correctChoice: 2, feedback: \"A constant reset loses the relationship between the latest receipt and the specific amount that action consumed.\" },\n },\n },\n {\n title: \"Explore the trade-offs\", concepts: [\"Filtering\", \"Derived views\", \"Accessible feedback\"],\n goals: [\"Add all, open and done views without changing the underlying plan.\", \"Keep actions, counts and feedback understandable when the visible set changes.\"],\n extension: \"Compare an all-cards view with an open-only view for your audience. Explain what each makes easier to notice and which global information must remain visible in both.\",\n activities: {\n learn: [\"A filter changes the view, not the plan. Valid all/open/done actions clear selection but preserve cards, counters and history. Compute visibleCards from the filter while completedCount and totalCount use every card. Ignore attempts to select a hidden ID and derive action permissions from visible state.\", \"A smaller display should not silently erase work or leave an unseen card selected for completion.\"],\n predict: [\"Complete scout and switch to done. Predict visible cards, total count, completed count and remaining time. Switch to open and consider a select request for the now-hidden scout ID.\", \"The complete card list is unchanged even when the visible list becomes smaller.\"],\n build: [\"Implement filter actions, selection clearing and hidden-card refusal. Update view to return correct visible cards, selection markers and permissions. Add a filter acceptance case and keep useful messages for empty results and refused actions without altering accounting.\", \"Keep labels and status text meaningful; colour and animation can supplement the information but must not carry it alone.\"],\n run: [\"Use keyboard and onscreen controls to switch filters before and after completion and undo. Try an empty done view, a hidden ID and a filter change with a selection. Compare the board in narrow and reduced-motion views.\", \"The shared host provides semantic controls; your projection must supply accurate names, counts and enabled states.\"],\n assess: [\"Check all filter values, unknown filters, hidden selection, selection clearing and global counts. Ensure filtering changes neither budget nor history and undo remains correct regardless of the active view.\", \"Tests compare data before and after a view change to catch accidental destructive filtering.\"],\n inspect: [\"If completed cards disappear permanently, inspect whether filter rewrites state.cards. If totalCount changes with the view, inspect its source list. If an invisible selection remains actionable, inspect filter transitions and eligibility together.\", \"Distinguish changing what is shown from changing what exists in the user's plan.\"],\n fix: [\"Repair the projection or transition and replay complete, filter, undo and reset. Verify the same underlying plan returns when all is selected, and recheck earlier completion and refund cases.\", \"A visual improvement must preserve the working behaviour that makes the prototype useful.\"],\n explain: [\"Choose which data filtering should preserve and describe a trade-off between showing everything and reducing visible detail. Explain how truthful global counts help a user understand the hidden portion.\", \"A design choice can improve one task while making another less obvious; name the trade-off instead of claiming one view is always best.\"],\n reward: [\"Save Understandable views. Your board can show focused information without losing work. The final mission connects the brief, interactions, reversal and view choices into a working showcase.\", \"Keep the filter-after-undo case because it crosses both data and presentation behaviour.\"],\n },\n questions: {\n learn: { question: \"What should a filter action preserve?\", choices: [\"Only the title\", \"Cards, time counters and completion history\", \"An invisible active selection\"], correctChoice: 1, feedback: \"Filtering changes presentation while retaining the underlying plan and accounting; clearing selection prevents hidden actions.\" },\n predict: { question: \"One of three cards is done and the done filter is active; what is totalCount?\", choices: [\"One\", \"Zero\", \"Three\"], correctChoice: 2, feedback: \"totalCount describes the full plan, so it remains three even though only one card is currently visible.\" },\n explain: { question: \"Why avoid assigning filtered results back to state.cards?\", choices: [\"It would delete hidden records rather than merely hide them\", \"It would make the title longer\", \"Filters must never read card state\"], correctChoice: 0, feedback: \"A projection should leave the source records intact so changing the filter can reveal them again without losing work.\" },\n },\n },\n {\n title: \"Show the working idea\", concepts: [\"Showcase\", \"Evidence\", \"Scope and iteration\"],\n goals: [\"Deliver a coherent private mission-board prototype that serves the written brief.\", \"Demonstrate normal and refused actions with current-source evidence and explain design trade-offs.\"],\n extension: \"Propose a new interaction in a separate save. State its audience benefit, budget and undo implications, and acceptance cases before changing the completed prototype.\",\n activities: {\n learn: [\"A working showcase demonstrates a user task and its limits. Your board has truthful initial data, selection, affordable completion, exact undo, filtering and reset. Connect these behaviours to the audience and goal, then show both successful actions and useful explanations when an action cannot proceed.\", \"An original theme is valuable when it supports a coherent interaction, not when it replaces the working prototype with static decoration.\"],\n predict: [\"Plan a demonstration that selects two cards, completes them, changes filter, undoes the latest choice and resets. Predict each budget, count and selection transition before presenting the result.\", \"Include at least one refused action so the demonstration covers more than the easiest successful path.\"],\n build: [\"Complete the authored title, fictional labels, brief and acceptance cases. Review update and view for one consistent set of rules, remove abandoned experiments and keep the exact refund and filter-preservation constraints visible in your explanation.\", \"The final prototype should fit the original bounded goal; save additional ideas for a separate iteration.\"],\n run: [\"Perform the demonstration with keyboard and onscreen controls. Check narrow layouts, reduced motion and readable text feedback. Save, reload and repeat the same input sequence to compare the current source's results.\", \"A completed simulator session and an earned course result are different records; reset affects the prototype without erasing learning progress.\"],\n assess: [\"Run final checks for initial bounds, selection eligibility, time conservation, refusal without partial effects, receipt order, exact undo, filtering, view truthfulness, input immutability and fresh reset. All implemented acceptance cases must now pass against the prototype itself.\", \"The earlier test-first milestone accepted correct predictions; the final milestone requires the promised behaviour to exist and work.\"],\n inspect: [\"Compare a failure with the brief and identify its first incorrect transition. Decide whether it comes from data, permission, accounting, undo or projection, using a small reproduction to avoid unrelated edits.\", \"A pleasant-looking final card cannot prove that earlier counters or receipts stayed correct.\"],\n fix: [\"Repair the responsible rule, replay its focused case and rerun the complete demonstration. Save a named final project and obtain a fresh assessment for that source before finishing.\", \"An assessment from a previous version cannot establish the correctness of a later source change.\"],\n explain: [\"Choose the evidence that establishes a working prototype and describe one trade-off in your interface. Explain why you rejected the refund shortcut and what another iteration would need to test before expanding the idea.\", \"Be precise about what the prototype demonstrates, including actions it intentionally refuses and features outside its scope.\"],\n reward: [\"Save Working idea and finish the final assessment. You have taken an audience need through executable success criteria, implementation, review and a usable private prototype. Replay a mission or explore another idea while retaining earned completion.\", \"Keep the tested version as a reference; authored material and account-bound saving support the course without a live AI service.\"],\n },\n questions: {\n learn: { question: \"What makes the final showcase a working prototype?\", choices: [\"Only an attractive title\", \"A confident idea with no actions\", \"Implemented interactions supported by verified scenarios\"], correctChoice: 2, feedback: \"A prototype demonstrates real behaviour through actions and evidence, rather than merely presenting an idea's appearance.\" },\n predict: { question: \"Which acceptance cases must pass against the learner's source at the final milestone?\", choices: [\"All of the implemented documented cases\", \"Only cases that never change state\", \"None, because earlier predictions were correct\"], correctChoice: 0, feedback: \"Correct test-first predictions become obligations for the completed implementation, so the final source must now satisfy them.\" },\n explain: { question: \"What should guide the next iteration after this bounded prototype?\", choices: [\"Adding unrelated features without tests\", \"A clear audience benefit, constraints and new acceptance evidence\", \"Removing useful failure feedback\"], correctChoice: 1, feedback: \"Another iteration should connect a defined benefit to scoped implementation and evidence, just as the current prototype does.\" },\n },\n },\n]);\n\nexport const suggestions: LearningCourseSuggestionV1[] = [{ stageId: \"vibe-idea-studio.m4.build\", proposal: {\n id: \"idea-refund-everything\", source: \"authored-fallback\", intent: \"Simplify restoring time when undoing the latest completed mission.\",\n constraints: [\"Undo refunds only the latest receipt's charged minutes.\", \"Earlier completed missions and their spent time remain intact.\"],\n permittedArtifactId: \"app.js\", originalSnippet: \"next.remaining += receipt.minutes;\", replacementSnippet: \"next.remaining = 30;\",\n explanationPrompt: \"After completing scout and signal, does this change preserve the five minutes still spent on scout?\",\n aiOptional: false, learnerApprovalRequired: true, alternatives: [\"accept\", \"reject\"],\n} }];\n"],"mappings":";;;;;;AAGO,IAAM,EAAE,QAAQ,SAAS,IAAI,aAAa;AAAA,EAC/C,MAAM;AAAA,EAAoB,OAAO;AAAA,EAAoB,UAAU;AAAA,EAC/D,SAAS;AAAA,EACT,cAAc,CAAC,EAAE,MAAM,UAAU,UAAU,cAAc,mBAAmB,KAAM,GAAG,EAAE,MAAM,cAAc,UAAU,QAAQ,mBAAmB,IAAK,CAAC;AAAA,EACtJ,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,UAAU,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAepD,GAAG,EAAE,MAAM,cAAc,QAAQ,gEAAgE,CAAC,EAAE;AAAA,EACpG,WAAW;AAAA,IACT,EAAE,MAAM,gBAAgB,WAAW,uCAAkC,aAAa,wXAAoW,SAAS,oEAAoE;AAAA,IACngB,EAAE,MAAM,UAAU,WAAW,mDAA8C,aAAa,oZAAoZ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AA,EAAO,yBAAyB;AAAA,EAAM,cAAc,CAAC,UAAU,QAAQ;AACrF,EAAE,CAAC;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1: () => VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1,
|
|
69
69
|
VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1: () => VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1,
|
|
70
70
|
VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1: () => VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1,
|
|
71
|
+
applyLearningCourseSuggestion: () => applyLearningCourseSuggestion,
|
|
71
72
|
assertValidCanonicalSpokenHelpDescriptor: () => assertValidCanonicalSpokenHelpDescriptor,
|
|
72
73
|
assertValidContextualHelpIdentifier: () => assertValidContextualHelpIdentifier,
|
|
73
74
|
assertValidContextualVoiceQuestionMetadata: () => assertValidContextualVoiceQuestionMetadata,
|
|
@@ -86,6 +87,7 @@ __export(index_exports, {
|
|
|
86
87
|
parseLearningCourse: () => parseLearningCourse,
|
|
87
88
|
parseLearningCourseDraft: () => parseLearningCourseDraft,
|
|
88
89
|
parseLearningCourseProgress: () => parseLearningCourseProgress,
|
|
90
|
+
parseLearningCourseSuggestion: () => parseLearningCourseSuggestion,
|
|
89
91
|
parseLearningProject: () => parseLearningProject,
|
|
90
92
|
parseLearningSaveSlotId: () => parseLearningSaveSlotId,
|
|
91
93
|
recordLearningCourseAssessment: () => recordLearningCourseAssessment,
|
|
@@ -6868,7 +6870,7 @@ var record = (value) => typeof value === "object" && value !== null && !Array.is
|
|
|
6868
6870
|
var text = (value, minimum = 1, maximum = 8e3) => typeof value === "string" && value.trim().length >= minimum && value.length <= maximum;
|
|
6869
6871
|
var id = (value) => typeof value === "string" && ID.test(value);
|
|
6870
6872
|
var integer = (value, minimum, maximum) => typeof value === "number" && Number.isSafeInteger(value) && value >= minimum && value <= maximum;
|
|
6871
|
-
var exactKeys = (value,
|
|
6873
|
+
var exactKeys = (value, keys3) => Object.keys(value).length === keys3.length && keys3.every((key) => Object.hasOwn(value, key));
|
|
6872
6874
|
var LearningCourseInputError = class extends Error {
|
|
6873
6875
|
constructor() {
|
|
6874
6876
|
super("Invalid learning course input.");
|
|
@@ -7082,6 +7084,42 @@ function completeVerifiedLearningActivity(course, progress, proof) {
|
|
|
7082
7084
|
return next;
|
|
7083
7085
|
}
|
|
7084
7086
|
|
|
7087
|
+
// src/course-suggestions.ts
|
|
7088
|
+
var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7089
|
+
var keys2 = (value, expected) => Object.keys(value).length === expected.length && expected.every((key) => Object.hasOwn(value, key));
|
|
7090
|
+
var text2 = (value, maximum) => typeof value === "string" && value.trim().length > 0 && value.length <= maximum && !value.includes("\0");
|
|
7091
|
+
function parseLearningCourseSuggestion(course, value) {
|
|
7092
|
+
if (!record3(value) || !keys2(value, ["stageId", "proposal"]) || !text2(value.stageId, 128) || !course.missions.some((mission2) => mission2.stages.some((stage) => stage.id === value.stageId)) || !record3(value.proposal)) {
|
|
7093
|
+
throw new Error("Invalid course suggestion.");
|
|
7094
|
+
}
|
|
7095
|
+
const proposal = value.proposal;
|
|
7096
|
+
if (!keys2(proposal, [
|
|
7097
|
+
"id",
|
|
7098
|
+
"source",
|
|
7099
|
+
"intent",
|
|
7100
|
+
"constraints",
|
|
7101
|
+
"permittedArtifactId",
|
|
7102
|
+
"originalSnippet",
|
|
7103
|
+
"replacementSnippet",
|
|
7104
|
+
"explanationPrompt",
|
|
7105
|
+
"aiOptional",
|
|
7106
|
+
"learnerApprovalRequired",
|
|
7107
|
+
"alternatives"
|
|
7108
|
+
]) || !text2(proposal.id, 128) || proposal.source !== "authored-fallback" || !text2(proposal.intent, 1e3) || !Array.isArray(proposal.constraints) || proposal.constraints.length < 1 || proposal.constraints.length > 8 || !proposal.constraints.every((constraint) => text2(constraint, 400)) || !course.projectFiles.some((file) => file.path === proposal.permittedArtifactId) || !text2(proposal.originalSnippet, 8e3) || !text2(proposal.replacementSnippet, 8e3) || proposal.originalSnippet === proposal.replacementSnippet || !text2(proposal.explanationPrompt, 1e3) || proposal.aiOptional !== false || proposal.learnerApprovalRequired !== true || !Array.isArray(proposal.alternatives) || proposal.alternatives.length !== 2 || proposal.alternatives[0] !== "accept" || proposal.alternatives[1] !== "reject") throw new Error("Invalid course suggestion.");
|
|
7109
|
+
return structuredClone(value);
|
|
7110
|
+
}
|
|
7111
|
+
function applyLearningCourseSuggestion(course, project, suggestion) {
|
|
7112
|
+
const parsed = parseLearningProject(course, project);
|
|
7113
|
+
const { proposal } = parseLearningCourseSuggestion(course, suggestion);
|
|
7114
|
+
const file = parsed.files.find((candidate) => candidate.path === proposal.permittedArtifactId);
|
|
7115
|
+
const start = file.source.indexOf(proposal.originalSnippet);
|
|
7116
|
+
if (start < 0 || file.source.indexOf(proposal.originalSnippet, start + 1) >= 0) {
|
|
7117
|
+
throw new Error("Suggestion does not match exactly one source location.");
|
|
7118
|
+
}
|
|
7119
|
+
file.source = file.source.slice(0, start) + proposal.replacementSnippet + file.source.slice(start + proposal.originalSnippet.length);
|
|
7120
|
+
return parseLearningProject(course, parsed);
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7085
7123
|
// src/contextual-help.ts
|
|
7086
7124
|
var CONTEXTUAL_HELP_CONTRACT_VERSION_V1 = "1.0.0";
|
|
7087
7125
|
var CONTEXTUAL_HELP_KINDS_V1 = Object.freeze([
|
|
@@ -7596,6 +7634,7 @@ ${summary}`);
|
|
|
7596
7634
|
VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1,
|
|
7597
7635
|
VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1,
|
|
7598
7636
|
VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1,
|
|
7637
|
+
applyLearningCourseSuggestion,
|
|
7599
7638
|
assertValidCanonicalSpokenHelpDescriptor,
|
|
7600
7639
|
assertValidContextualHelpIdentifier,
|
|
7601
7640
|
assertValidContextualVoiceQuestionMetadata,
|
|
@@ -7614,6 +7653,7 @@ ${summary}`);
|
|
|
7614
7653
|
parseLearningCourse,
|
|
7615
7654
|
parseLearningCourseDraft,
|
|
7616
7655
|
parseLearningCourseProgress,
|
|
7656
|
+
parseLearningCourseSuggestion,
|
|
7617
7657
|
parseLearningProject,
|
|
7618
7658
|
parseLearningSaveSlotId,
|
|
7619
7659
|
recordLearningCourseAssessment,
|