docs(ai): contract requests; dev fake provider returns a draft file

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-30 04:39:58 +01:00
co-authored by Claude Opus 5.5
parent a47e6e0971
commit 1f111b80db
2 changed files with 65 additions and 0 deletions
+4
View File
@@ -19,6 +19,10 @@ const fake: AiProvider = {
id: "fake",
async *chat(messages) {
const sys = messages[0]?.content ?? "";
if (sys.includes("=== FILE:")) {
yield { text: "=== FILE: questions/adding-many-numbers.md ===\n# Check your understanding: adding many numbers\n\n1. Predict: what does `sum([])` return?\n2. What would break if `sum` used `a - b`?\n=== END FILE ===\n" };
return;
}
const mentor = sys.includes("## Course mentor rules");
const answer = mentor
? "Before I explain: what does the failing test give as input, and what did you expect `add` to return?\n\nThe lesson's nudge asks **which operator combines two numbers**. Try it, run the tests, and tell me what happens. [lessons/04-exercise.md · Adding numbers]"