8000 fix: lesson starter code that gave wrong answers or errors by adityamukho · Pull Request #46 · project-minigraf/minigraf-playground · GitHub
[go: up one dir, main page]

Skip to content

fix: lesson starter code that gave wrong answers or errors - #46

Merged
adityamukho merged 1 commit into
mainfrom
fix/lesson-audit
Oct 16, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/lesson-audit

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Found by an audit that ran every lesson step on Minigraf v2.x (main 28f4a4eb) and v3 (e078e46b) and compared the answers with expectedResult.

Step Problem Fix
basic-datalog l1-s1, l1-s2 Alice's two :friend facts in one transact: v2.x reads them back as one value (project-minigraf/minigraf#371), so l1-s2 returned [] instead of :bob today on 2.0.6 separate transacts, as l1-s3 already does
org-chart o2-s1–o2-s4, o3-s4 {:valid-to "2025-03-31"} without :valid-from starts at the transaction time: an empty window on v2.x; rejected with API-019 by v3.0.0, which would make the whole step error {:valid-from "2023-03-01" :valid-to "2025-04-01"} (hire date to the raise)
sports-league sl3-s4 (transfer-chain ?club :rovers) fails with INT-022 on every release (project-minigraf/minigraf#608) (transfer-chain ?club ?dest) [(= ?dest :rovers)] until #608 is fixed; hint updated
tutor system prompt said pseudo-attributes without :any-valid-time see only currently valid facts; they fail with INT-026 wording

New tests in __tests__/lib/lessons.test.ts check every lesson for the first two classes (one entity/attribute twice in a transact; a :valid-to map without :valid-from), plus a prompt test for INT-026. Each failed before the fix. npm test: 232 passed.

After the change, every step runs without error on both v2.x and v3, and each step with an expectedResult matches it on both.

v3-only prompt changes (pseudo-attribute source rule / PRS-081, unknown aggregates as QRY-010/QRY-011) wait for the playground's upgrade to @minigraf/browser 3.x.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR

- basic-datalog l1-s1/l1-s2: Alice's two :friend facts were written in one
  transact, which Minigraf v2.x reads back as one value (known issue
  project-minigraf/minigraf#371), so l1-s2 returned no rows instead of :bob.
  They go in separate transacts, as l1-s3 already does.
- org-chart: Eve's salary correction {:valid-to "2025-03-31"} had no
  :valid-from, so its window started at the transaction time: empty on v2.x,
  rejected with API-019 by v3.0.0. It now runs from her hire date
  (2023-03-01) to 2025-04-01, the day the raise applies.
- sports-league sl3-s4: (transfer-chain ?club :rovers) fails with INT-022 on
  every Minigraf release (project-minigraf/minigraf#608). The step binds the
  destination with a predicate instead until that is fixed.
- system prompt: per-fact pseudo-attributes without :any-valid-time fail with
  INT-026; they do not fall back to currently valid facts.

Tests guard the first two classes for every lesson.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
@vercel
vercel Bot commented Oct 15, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
minigraf-playground Ready Ready Preview Oct 15, 2026 7:48am UTC

This branch was successfully deployed

1 active deployment
Preview — 040a062c Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0