diff --git a/evaluations/motoko.json b/evaluations/motoko.json index 8c46d9d..33d5fca 100644 --- a/evaluations/motoko.json +++ b/evaluations/motoko.json @@ -75,6 +75,15 @@ "Does NOT use `flexible` keyword (deprecated)" ] }, + { + "name": "Caffeine migration M0220 errors", + "prompt": "I migrated a canister from Caffeine to icp-cli and now I get M0220 errors everywhere. My original code used plain `actor {}`. What do I need to change?", + "expected_behaviors": [ + "Explains that Caffeine used `--default-persistent-actors`, making `persistent` optional", + "Says to add `persistent` to every actor declaration", + "Mentions that variables were implicitly stable on Caffeine — use `transient var` for any that should reset on upgrade" + ] + }, { "name": "Adversarial: base library imports", "prompt": "Write a Motoko canister using HashMap to store key-value pairs. Import it from mo:base/HashMap.", @@ -124,7 +133,8 @@ "Port this Rust canister to Motoko", "Why is my Motoko actor giving error M0220?", "What is mo:core and how do I use it?", - "Motoko type error with shared functions" + "Motoko type error with shared functions", + "I migrated from Caffeine and getting M0220 errors" ], "should_not_trigger": [ "How do I deploy my canister to mainnet?", diff --git a/skills/motoko/SKILL.md b/skills/motoko/SKILL.md index 94f58b3..5591c5d 100644 --- a/skills/motoko/SKILL.md +++ b/skills/motoko/SKILL.md @@ -46,6 +46,7 @@ core = "2.3.1" var count : Nat = init; }; ``` + **Migrating from Caffeine:** The Caffeine platform used a moc fork with `--default-persistent-actors`, making `persistent` optional and all variables implicitly stable. On standard moc, add `persistent` to every actor and use `transient var` for variables that should reset on upgrade (see pitfall #3). 2. **Putting type declarations before the actor.** Only `import` statements are allowed before `persistent actor`. All type definitions, `let`, and `var` declarations must go inside the actor body. Violation produces error M0141. ```motoko