@contractspec/example.learning-journey-duo-drills 3.7.19 → 4.0.1

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.
@@ -1,34 +1,35 @@
1
- $ contractspec-bun-build prebuild
2
- $ bun run build:bundle && bun run build:types
3
- $ contractspec-bun-build transpile
4
- [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
5
- Bundled 6 modules in 27ms
6
-
7
- docs/duo-drills.docblock.js 1.30 KB (entry point)
8
- ./index.js 3.74 KB (entry point)
9
- docs/index.js 1.30 KB (entry point)
10
- ./example.js 0.73 KB (entry point)
11
- ./learning-journey-duo-drills.feature.js 461 bytes (entry point)
12
- ./track.js 1.30 KB (entry point)
13
-
14
- [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
15
- Bundled 6 modules in 31ms
16
-
17
- docs/duo-drills.docblock.js 1.28 KB (entry point)
18
- ./index.js 3.72 KB (entry point)
19
- docs/index.js 1.28 KB (entry point)
20
- ./example.js 0.72 KB (entry point)
21
- ./learning-journey-duo-drills.feature.js 453 bytes (entry point)
22
- ./track.js 1.29 KB (entry point)
23
-
24
- [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
25
- Bundled 6 modules in 23ms
26
-
27
- docs/duo-drills.docblock.js 1.28 KB (entry point)
28
- ./index.js 3.72 KB (entry point)
29
- docs/index.js 1.28 KB (entry point)
30
- ./example.js 0.72 KB (entry point)
31
- ./learning-journey-duo-drills.feature.js 453 bytes (entry point)
32
- ./track.js 1.29 KB (entry point)
33
-
34
- $ contractspec-bun-build types
1
+
2
+ $ contractspec-bun-build prebuild
3
+ $ bun run build:bundle && bun run build:types
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
6
+ Bundled 6 modules in 14ms
7
+
8
+ docs/duo-drills.docblock.js 1.30 KB (entry point)
9
+ ./index.js 4.27 KB (entry point)
10
+ docs/index.js 1.30 KB (entry point)
11
+ ./example.js 0.71 KB (entry point)
12
+ ./learning-journey-duo-drills.feature.js 470 bytes (entry point)
13
+ ./track.js 1.83 KB (entry point)
14
+
15
+ [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
16
+ Bundled 6 modules in 12ms
17
+
18
+ docs/duo-drills.docblock.js 1.28 KB (entry point)
19
+ ./index.js 4.25 KB (entry point)
20
+ docs/index.js 1.28 KB (entry point)
21
+ ./example.js 0.70 KB (entry point)
22
+ ./learning-journey-duo-drills.feature.js 462 bytes (entry point)
23
+ ./track.js 1.82 KB (entry point)
24
+
25
+ [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
26
+ Bundled 6 modules in 12ms
27
+
28
+ docs/duo-drills.docblock.js 1.28 KB (entry point)
29
+ ./index.js 4.25 KB (entry point)
30
+ docs/index.js 1.28 KB (entry point)
31
+ ./example.js 0.70 KB (entry point)
32
+ ./learning-journey-duo-drills.feature.js 462 bytes (entry point)
33
+ ./track.js 1.82 KB (entry point)
34
+
35
+ $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @contractspec/example.learning-journey-duo-drills
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: auto-bump internal dependents
8
+ - Updated dependencies because of chore: auto-bump internal dependents
9
+ - Updated dependencies because of Add FormSpec layout hints, semantic field rendering, and portable text/textarea input-group addons.
10
+ - Updated dependencies because of Add ThemeSpec light/dark modes and a design-system Tailwind bridge for CSS variables, presets, CSS text, and OKLCH color pass-through.
11
+ - Updated dependencies because of Add a canonical typed result system for ContractSpec success and failure propagation across operations, workflows, jobs, server adapters, MCP, GraphQL, and React clients.
12
+ - @contractspec/module.learning-journey@4.0.1
13
+ - @contractspec/lib.contracts-spec@5.5.0
14
+
15
+ ## 4.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
20
+ - Packages: @contractspec/module.learning-journey (major), @contractspec/module.examples (patch), @contractspec/example.learning-journey-ambient-coach (major), @contractspec/example.learning-journey-crm-onboarding (major), @contractspec/example.learning-journey-duo-drills (major), @contractspec/example.learning-journey-platform-tour (major), @contractspec/example.learning-journey-quest-challenges (major), @contractspec/example.learning-journey-registry (major), @contractspec/example.learning-journey-studio-onboarding (major), @contractspec/example.learning-journey-ui-coaching (major), @contractspec/example.learning-journey-ui-gamified (major), @contractspec/example.learning-journey-ui-onboarding (major), @contractspec/example.learning-journey-ui-shared (major), @contractspec/example.learning-patterns (major)
21
+ - Migration: Replace the old onboarding-centric learning contracts and local example progress logic with the canonical adaptive `learning.journey.*` runtime.; Use the shared learning registry mapping/data helpers so supported learning sandbox templates resolve the shared presentation set consistently.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies because of Add a family-aware ContractSpec Adoption Engine, expand contract authoring targets across CLI and VS Code tooling, and refresh release-facing schema and policy artifacts for downstream workspaces.
26
+ - Updated dependencies because of Improve app-config, theme, and feature authoring with explicit validation APIs, first-class theme discovery and scaffolding, and key-based app-config generation across contracts, workspace tooling, and the CLI.
27
+ - Updated dependencies because of Refresh root, package, website, and LLM-facing docs so Connect, Builder, release capsules, and the current contracts-spec export surface stay aligned.
28
+ - Updated dependencies because of Persist canonical knowledge payload text during indexing and align the retrieval/query docs with the corrected behavior.
29
+ - Updated dependencies because of Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
30
+ - @contractspec/lib.contracts-spec@5.4.0
31
+ - @contractspec/module.learning-journey@4.0.0
32
+
3
33
  ## 3.7.19
4
34
 
5
35
  ### Patch Changes
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
1
+ import{defineExample as b}from"@contractspec/lib.contracts-spec/examples";var c=b({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),h=c;export{h as default,c as ExamplesLearningJourneyDuoDrillsExample};
@@ -1 +1 @@
1
- import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var i=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey — Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` → event `drill.session.completed`\n2) `reach_accuracy_threshold` → count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` → SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(i);import{defineExample as s}from"@contractspec/lib.contracts-spec";var a=s({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),r=a;import{defineFeature as t}from"@contractspec/lib.contracts-spec";var u=t({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var l={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},g=[l];export{r as example,l as drillsLanguageBasicsTrack,g as drillTracks,u as LearningJourneyDuoDrillsFeature};
1
+ import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var t=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey — Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` → event `drill.session.completed`\n2) `reach_accuracy_threshold` → count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` → SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(t);import{defineExample as i}from"@contractspec/lib.contracts-spec/examples";var s=i({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),r=s;import{defineFeature as a}from"@contractspec/lib.contracts-spec/features";var m=a({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var c={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},k=[c];export{r as example,c as drillsLanguageBasicsTrack,k as drillTracks,m as LearningJourneyDuoDrillsFeature,s as ExamplesLearningJourneyDuoDrillsExample};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
@@ -1 +1 @@
1
- var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
1
+ var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
package/dist/example.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- declare const example: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
- export default example;
1
+ declare const ExamplesLearningJourneyDuoDrillsExample: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
+ export default ExamplesLearningJourneyDuoDrillsExample;
3
+ export { ExamplesLearningJourneyDuoDrillsExample };
package/dist/example.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey \u2014 Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
2
+ import{defineExample as b}from"@contractspec/lib.contracts-spec/examples";var c=b({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),h=c;export{h as default,c as ExamplesLearningJourneyDuoDrillsExample};
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { default as example } from './example';
2
2
  export * from './learning-journey-duo-drills.feature';
3
3
  export * from './track';
4
4
  import './docs';
5
+ export * from './example';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var i=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey \u2014 Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` \u2192 event `drill.session.completed`\n2) `reach_accuracy_threshold` \u2192 count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` \u2192 SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(i);import{defineExample as s}from"@contractspec/lib.contracts-spec";var a=s({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey \u2014 Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),r=a;import{defineFeature as t}from"@contractspec/lib.contracts-spec";var u=t({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var l={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},g=[l];export{r as example,l as drillsLanguageBasicsTrack,g as drillTracks,u as LearningJourneyDuoDrillsFeature};
2
+ import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var t=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey \u2014 Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` \u2192 event `drill.session.completed`\n2) `reach_accuracy_threshold` \u2192 count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` \u2192 SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(t);import{defineExample as i}from"@contractspec/lib.contracts-spec/examples";var s=i({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),r=s;import{defineFeature as a}from"@contractspec/lib.contracts-spec/features";var m=a({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var c={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},k=[c];export{r as example,c as drillsLanguageBasicsTrack,k as drillTracks,m as LearningJourneyDuoDrillsFeature,s as ExamplesLearningJourneyDuoDrillsExample};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
2
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
1
+ import{defineExample as b}from"@contractspec/lib.contracts-spec/examples";var c=b({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),h=c;export{h as default,c as ExamplesLearningJourneyDuoDrillsExample};
@@ -1 +1 @@
1
- import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var i=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey — Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` → event `drill.session.completed`\n2) `reach_accuracy_threshold` → count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` → SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(i);import{defineExample as s}from"@contractspec/lib.contracts-spec";var a=s({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","drills","srs","xp"]},docs:{rootDocId:"docs.learning-journey.duo-drills"},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),r=a;import{defineFeature as t}from"@contractspec/lib.contracts-spec";var u=t({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var l={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},g=[l];export{r as example,l as drillsLanguageBasicsTrack,g as drillTracks,u as LearningJourneyDuoDrillsFeature};
1
+ import{registerDocBlocks as e}from"@contractspec/lib.contracts-spec/docs";var t=[{id:"docs.learning-journey.duo-drills",title:"Learning Journey — Duo Drills",summary:"Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.",kind:"reference",visibility:"public",route:"/docs/learning-journey/duo-drills",tags:["learning","drills","srs","xp"],body:'## Track\n- **Key**: `drills_language_basics`\n- **Persona**: learner running quick drills (language/finance/spec concepts)\n- **Goal**: complete first session, maintain high-accuracy sessions, master cards in the first skill\n\n## Steps & Conditions\n1) `complete_first_session` → event `drill.session.completed`\n2) `reach_accuracy_threshold` → count 3 sessions with payload `accuracyBucket: "high"` (within default window)\n3) `unlock_new_skill` → SRS mastery: `drill.card.mastered` events with `mastery >= 0.8`, count 5 cards\n\nXP: 20 + 30 + 40. Streak: daily session completion can be used to drive streak rewards.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-duo-drills/track`.\n- Use registry helper `recordEvent` to advance steps from drill/session events.\n- SRS mastery events should include payload: `{ skillId, mastery }`.'}];e(t);import{defineExample as i}from"@contractspec/lib.contracts-spec/examples";var s=i({meta:{key:"examples.learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey Duo Drills",description:"Drill-based learning journey example with SRS, XP, and streak hooks.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-duo-drills"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-duo-drills"}}),r=s;import{defineFeature as a}from"@contractspec/lib.contracts-spec/features";var m=a({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});var c={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},k=[c];export{r as example,c as drillsLanguageBasicsTrack,k as drillTracks,m as LearningJourneyDuoDrillsFeature,s as ExamplesLearningJourneyDuoDrillsExample};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"learning-journey-duo-drills",version:"1.0.0",title:"Learning Journey: Duo Drills",description:"Drill-based learning with spaced repetition, XP, and streaks",domain:"learning-journey",owners:["@examples"],tags:["learning","drills","srs","gamification"],stability:"experimental"},docs:["docs.learning-journey.duo-drills"]});export{j as LearningJourneyDuoDrillsFeature};
@@ -1 +1 @@
1
- var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
1
+ var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
package/dist/track.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
- export declare const drillsLanguageBasicsTrack: LearningJourneyTrackSpec;
3
- export declare const drillTracks: LearningJourneyTrackSpec[];
1
+ import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
+ export declare const drillsLanguageBasicsTrack: JourneyTrackSpec;
3
+ export declare const drillTracks: JourneyTrackSpec[];
package/dist/track.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xpBonus:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,completion:{kind:"srs_mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
2
+ var e={id:"drills_language_basics",name:"Language Basics Drills",description:"Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",targetUserSegment:"learner",targetRole:"individual",totalXp:50,completionRewards:{xp:25},steps:[{id:"complete_first_session",title:"Complete first drill session",description:"Finish a drill session to get started.",order:1,completion:{kind:"event",eventName:"drill.session.completed"},branches:[{key:"fast_track",when:{kind:"event",eventName:"drill.session.completed",payloadFilter:{accuracyBucket:"high"}},blockStepIds:["reach_accuracy_threshold"],reward:{xp:10}},{key:"guided_practice",when:{kind:"event",eventName:"drill.session.completed"}}],xpReward:20,metadata:{surface:"drills"}},{id:"reach_accuracy_threshold",title:"Hit high accuracy in sessions",description:"Achieve three high-accuracy sessions to build confidence.",order:2,prerequisites:[{kind:"branch_selected",stepId:"complete_first_session",branchKey:"guided_practice"}],completion:{kind:"count",eventName:"drill.session.completed",atLeast:3,payloadFilter:{accuracyBucket:"high"}},xpReward:30,metadata:{metric:"accuracy",target:">=85%"}},{id:"unlock_new_skill",title:"Master core cards in first skill",description:"Reach mastery on at least five cards in the first skill to unlock the next one.",order:3,prerequisiteMode:"any",prerequisites:[{kind:"step_completed",stepId:"reach_accuracy_threshold"},{kind:"branch_selected",stepId:"complete_first_session",branchKey:"fast_track"}],completion:{kind:"mastery",eventName:"drill.card.mastered",minimumMastery:0.8,requiredCount:5,skillIdField:"skillId",masteryField:"mastery",payloadFilter:{skillId:"language_basics"}},xpReward:40,metadata:{surface:"srs",skill:"language_basics"}}]},s=[e];export{e as drillsLanguageBasicsTrack,s as drillTracks};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.learning-journey-duo-drills",
3
- "version": "3.7.19",
3
+ "version": "4.0.1",
4
4
  "description": "Drill-based learning journey example with SRS, XP, and streak hooks.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -64,13 +64,13 @@
64
64
  "typecheck": "tsc --noEmit"
65
65
  },
66
66
  "dependencies": {
67
- "@contractspec/module.learning-journey": "3.7.18",
68
- "@contractspec/lib.contracts-spec": "5.3.0"
67
+ "@contractspec/module.learning-journey": "4.0.1",
68
+ "@contractspec/lib.contracts-spec": "5.5.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@contractspec/tool.typescript": "3.7.13",
72
72
  "typescript": "^5.9.3",
73
- "@contractspec/tool.bun": "3.7.14"
73
+ "@contractspec/tool.bun": "3.7.15"
74
74
  },
75
75
  "publishConfig": {
76
76
  "exports": {
package/src/example.ts CHANGED
@@ -1,31 +1,28 @@
1
- import { defineExample } from '@contractspec/lib.contracts-spec';
1
+ import { defineExample } from '@contractspec/lib.contracts-spec/examples';
2
2
 
3
- const example = defineExample({
3
+ const ExamplesLearningJourneyDuoDrillsExample = defineExample({
4
4
  meta: {
5
- key: 'learning-journey-duo-drills',
5
+ key: 'examples.learning-journey-duo-drills',
6
6
  version: '1.0.0',
7
- title: 'Learning Journey Duo Drills',
7
+ title: 'Learning Journey Duo Drills',
8
8
  description:
9
- 'Short drill/SRS example with XP and streak hooks for language, finance, or ContractSpec concept drills.',
9
+ 'Drill-based learning journey example with SRS, XP, and streak hooks.',
10
10
  kind: 'template',
11
- visibility: 'public',
11
+ visibility: 'experimental',
12
12
  stability: 'experimental',
13
- owners: ['@platform.core'],
14
- tags: ['learning', 'drills', 'srs', 'xp'],
13
+ owners: ['@contractspec-core'],
14
+ tags: ['package', 'examples', 'learning-journey-duo-drills'],
15
15
  },
16
- docs: {
17
- rootDocId: 'docs.learning-journey.duo-drills',
16
+ surfaces: {
17
+ templates: true,
18
+ sandbox: { enabled: true, modes: ['playground', 'specs'] },
19
+ studio: { enabled: false, installable: false },
20
+ mcp: { enabled: false },
18
21
  },
19
22
  entrypoints: {
20
23
  packageName: '@contractspec/example.learning-journey-duo-drills',
21
- docs: './docs',
22
- },
23
- surfaces: {
24
- templates: true,
25
- sandbox: { enabled: true, modes: ['playground', 'markdown'] },
26
- studio: { enabled: true, installable: true },
27
- mcp: { enabled: true },
28
24
  },
29
25
  });
30
26
 
31
- export default example;
27
+ export default ExamplesLearningJourneyDuoDrillsExample;
28
+ export { ExamplesLearningJourneyDuoDrillsExample };
package/src/index.ts CHANGED
@@ -2,3 +2,5 @@ export { default as example } from './example';
2
2
  export * from './learning-journey-duo-drills.feature';
3
3
  export * from './track';
4
4
  import './docs';
5
+
6
+ export * from './example';
@@ -1,4 +1,4 @@
1
- import { defineFeature } from '@contractspec/lib.contracts-spec';
1
+ import { defineFeature } from '@contractspec/lib.contracts-spec/features';
2
2
 
3
3
  export const LearningJourneyDuoDrillsFeature = defineFeature({
4
4
  meta: {
package/src/track.test.ts CHANGED
@@ -1,106 +1,37 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
-
2
+ import {
3
+ createJourneyProgressState,
4
+ projectJourneyProgress,
5
+ recordJourneyEvent,
6
+ } from '@contractspec/module.learning-journey/runtime';
3
7
  import { drillsLanguageBasicsTrack } from './track';
4
8
 
5
- interface TestEvent {
6
- name: string;
7
- payload?: Record<string, unknown>;
8
- occurredAt?: Date;
9
- }
10
-
11
- const matchesFilter = (
12
- filter: Record<string, unknown> | undefined,
13
- payload: Record<string, unknown> | undefined
14
- ) => {
15
- if (!filter) return true;
16
- if (!payload) return false;
17
- return Object.entries(filter).every(([key, value]) => payload[key] === value);
18
- };
19
-
20
- interface StepState {
21
- id: string;
22
- status: 'PENDING' | 'COMPLETED';
23
- occurrences: number;
24
- masteryCount: number;
25
- }
26
-
27
9
  describe('duo drills track', () => {
28
- it('advances on session completion, accuracy counts, and SRS mastery', () => {
29
- const events: TestEvent[] = [
30
- {
31
- name: 'drill.session.completed',
32
- payload: { accuracyBucket: 'high' },
33
- },
34
- {
35
- name: 'drill.session.completed',
36
- payload: { accuracyBucket: 'high' },
37
- },
38
- {
39
- name: 'drill.session.completed',
40
- payload: { accuracyBucket: 'high' },
41
- },
42
- ...Array.from({ length: 5 }).map<TestEvent>(() => ({
10
+ it('supports both the fast-track branch and mastery completion', () => {
11
+ let state = createJourneyProgressState(drillsLanguageBasicsTrack);
12
+ state = recordJourneyEvent(drillsLanguageBasicsTrack, state, {
13
+ name: 'drill.session.completed',
14
+ payload: { accuracyBucket: 'high' },
15
+ });
16
+
17
+ const afterDiagnostic = projectJourneyProgress(
18
+ drillsLanguageBasicsTrack,
19
+ state
20
+ );
21
+ expect(afterDiagnostic.blockedStepIds).toEqual([
22
+ 'reach_accuracy_threshold',
23
+ ]);
24
+ expect(afterDiagnostic.currentStepId).toBe('unlock_new_skill');
25
+
26
+ for (let index = 0; index < 5; index++) {
27
+ state = recordJourneyEvent(drillsLanguageBasicsTrack, state, {
43
28
  name: 'drill.card.mastered',
44
29
  payload: { skillId: 'language_basics', mastery: 0.9 },
45
- })),
46
- ];
47
-
48
- const progress: StepState[] =
49
- drillsLanguageBasicsTrack.steps.map<StepState>((step) => ({
50
- id: step.id,
51
- status: 'PENDING',
52
- occurrences: 0,
53
- masteryCount: 0,
54
- }));
55
-
56
- events.forEach((event) => {
57
- drillsLanguageBasicsTrack.steps.forEach((stepSpec, index) => {
58
- const step = progress[index];
59
- if (!step || step.status === 'COMPLETED') return;
60
- const completion = stepSpec.completion;
61
- if ((completion.kind ?? 'event') === 'event') {
62
- if (completion.eventName !== event.name) return;
63
- if (
64
- matchesFilter(
65
- completion.payloadFilter,
66
- event.payload as Record<string, unknown> | undefined
67
- )
68
- ) {
69
- step.status = 'COMPLETED';
70
- }
71
- return;
72
- }
73
- if (completion.kind === 'count') {
74
- if (
75
- completion.eventName === event.name &&
76
- matchesFilter(
77
- completion.payloadFilter,
78
- event.payload as Record<string, unknown> | undefined
79
- )
80
- ) {
81
- step.occurrences = step.occurrences + 1;
82
- if (step.occurrences >= completion.atLeast) {
83
- step.status = 'COMPLETED';
84
- }
85
- }
86
- return;
87
- }
88
- if (completion.kind === 'srs_mastery') {
89
- if (completion.eventName !== event.name) return;
90
- if (!matchesFilter(completion.payloadFilter, event.payload)) return;
91
- const masteryValue = (
92
- event.payload as Record<string, unknown> | undefined
93
- )?.[completion.masteryField ?? 'mastery'];
94
- if (typeof masteryValue !== 'number') return;
95
- if (masteryValue < completion.minimumMastery) return;
96
- step.masteryCount = step.masteryCount + 1;
97
- if (step.masteryCount >= (completion.requiredCount ?? 1)) {
98
- step.status = 'COMPLETED';
99
- }
100
- }
101
30
  });
102
- });
31
+ }
103
32
 
104
- expect(progress.every((s) => s.status === 'COMPLETED')).toBeTrue();
33
+ expect(
34
+ projectJourneyProgress(drillsLanguageBasicsTrack, state).isCompleted
35
+ ).toBeTrue();
105
36
  });
106
37
  });
package/src/track.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
1
+ import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
2
 
3
- export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
3
+ export const drillsLanguageBasicsTrack: JourneyTrackSpec = {
4
4
  id: 'drills_language_basics',
5
5
  name: 'Language Basics Drills',
6
6
  description:
@@ -8,7 +8,7 @@ export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
8
8
  targetUserSegment: 'learner',
9
9
  targetRole: 'individual',
10
10
  totalXp: 50,
11
- completionRewards: { xpBonus: 25 },
11
+ completionRewards: { xp: 25 },
12
12
  steps: [
13
13
  {
14
14
  id: 'complete_first_session',
@@ -19,6 +19,25 @@ export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
19
19
  kind: 'event',
20
20
  eventName: 'drill.session.completed',
21
21
  },
22
+ branches: [
23
+ {
24
+ key: 'fast_track',
25
+ when: {
26
+ kind: 'event',
27
+ eventName: 'drill.session.completed',
28
+ payloadFilter: { accuracyBucket: 'high' },
29
+ },
30
+ blockStepIds: ['reach_accuracy_threshold'],
31
+ reward: { xp: 10 },
32
+ },
33
+ {
34
+ key: 'guided_practice',
35
+ when: {
36
+ kind: 'event',
37
+ eventName: 'drill.session.completed',
38
+ },
39
+ },
40
+ ],
22
41
  xpReward: 20,
23
42
  metadata: { surface: 'drills' },
24
43
  },
@@ -27,6 +46,13 @@ export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
27
46
  title: 'Hit high accuracy in sessions',
28
47
  description: 'Achieve three high-accuracy sessions to build confidence.',
29
48
  order: 2,
49
+ prerequisites: [
50
+ {
51
+ kind: 'branch_selected',
52
+ stepId: 'complete_first_session',
53
+ branchKey: 'guided_practice',
54
+ },
55
+ ],
30
56
  completion: {
31
57
  kind: 'count',
32
58
  eventName: 'drill.session.completed',
@@ -42,8 +68,20 @@ export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
42
68
  description:
43
69
  'Reach mastery on at least five cards in the first skill to unlock the next one.',
44
70
  order: 3,
71
+ prerequisiteMode: 'any',
72
+ prerequisites: [
73
+ {
74
+ kind: 'step_completed',
75
+ stepId: 'reach_accuracy_threshold',
76
+ },
77
+ {
78
+ kind: 'branch_selected',
79
+ stepId: 'complete_first_session',
80
+ branchKey: 'fast_track',
81
+ },
82
+ ],
45
83
  completion: {
46
- kind: 'srs_mastery',
84
+ kind: 'mastery',
47
85
  eventName: 'drill.card.mastered',
48
86
  minimumMastery: 0.8,
49
87
  requiredCount: 5,
@@ -57,6 +95,4 @@ export const drillsLanguageBasicsTrack: LearningJourneyTrackSpec = {
57
95
  ],
58
96
  };
59
97
 
60
- export const drillTracks: LearningJourneyTrackSpec[] = [
61
- drillsLanguageBasicsTrack,
62
- ];
98
+ export const drillTracks: JourneyTrackSpec[] = [drillsLanguageBasicsTrack];