8000 cleanup: revert lesson workarounds once minigraf#287, #297, and #298 are fixed · Issue #40 · project-minigraf/minigraf-playground · GitHub
[go: up one dir, main page]

Skip to content

cleanup: revert lesson workarounds once minigraf#287, #297, and #298 are fixed #40

Open

Description

@adityamukho

Background

Three bugs in `@minigraf/browser` 1.2.0 required workarounds in the lesson `starterCode` and e2e test helper (commit `4d9730f`):

  1. bug: EavtKey and AevtKey missing value bytes causes silent data loss when batching multi-valued facts minigraf#287 — batch transact with same entity+attribute loses all but one fact.

    • Workaround in `l1-s3`: split `[:alice :friend :bob]` and `[:alice :friend :carol]` into separate `(transact ...)` calls.
  2. bug: literal keyword bound in rule call resolves as entity UUID, silently mismatches keyword values in rule body minigraf#298 — literal keyword bound at rule call site resolves as entity UUID, silently mismatches `Value::Keyword` facts in value-position rule body patterns → empty results.

    • Workaround in `o3-s2`, `o3-s3`: look up the target entity via a fact pattern (e.g., `[?alice :employee/title "CEO"]`) and pass the bound variable into the rule instead of a literal keyword.
  3. bug: magic sets rewriting rejects intermediate variables when first rule arg is bound by literal keyword minigraf#297 — magic sets rewriting flags intermediate variable `?mid` as "Unbound variable in rule head" when the first rule arg is bound by a literal keyword, causing errors/panics in recursive rules that call other user-defined rules.

    • Workaround in `sl3-s3`, `t3-s3`: same pattern-bind approach as above (e.g., `[?united :club/name "FC United"]`).

Also, `tests/e2e/steps.test.ts` had to be updated to use the renamed WASM file (`minigraf_wasm_bg.wasm` instead of `minigraf_bg.wasm`). This is a 1.2.0 packaging change and does not need reverting.

Action required

Once all three upstream bugs are fixed and a patch release ships:

  1. Revert `l1-s3` `starterCode` to use a single batch transact with all three facts (fixes #287).
  2. Revert `o3-s2` and `o3-s3` to use literal keyword bindings in rule calls (e.g., `(reports-to ?emp :alice)`) (fixes #298).
  3. Revert `sl3-s3` and `t3-s3` to use literal keyword bindings in rule calls (e.g., `(transfer-chain :united ?club)`) (fixes #297).
  4. Bump `@minigraf/browser` to the patched version and run CI to confirm.

Activity

  1. changed the title [-]cleanup: revert lesson workarounds once minigraf#297 and minigraf#287 are fixed[/-] [+]cleanup: revert lesson workarounds once minigraf#287, #297, and #298 are fixed[/+] on Jun 26, 2026
  2. adityamukho commented on Sep 26, 2026

    @adityamukho
    CollaboratorAuthor

    Reopening. #43 only did part of this issue.

    Status after #43 (@minigraf/browser 2.0.1)

    Upstream bug Steps Status
    project-minigraf/minigraf#298 o3-s2, o3-s3 Done. Fixed in 2.0.1. The workaround is reverted, and the steps use (reports-to ?emp :alice) and (reports-to ?emp :bob) again.
    project-minigraf/minigraf#297 sl3-s3, t3-s3 Fixed upstream, not yet released. 2.0.1 still gives Unbound variable in rule head: ?mid when a recursive rule calls another user-defined rule (transfer-link, same-line). project-minigraf/minigraf#409 fixes this and is merged. It is in the v2.0.2 milestone. The pattern-bind workaround stays until 2.0.2 is on npm.
    project-minigraf/minigraf#287 l1-s3 Still blocked. The fix needs file format v8 and is planned for minigraf v3.0.0. The split transacts stay.

    Step 4 (upgrade the dependency) is done. The app is on 2.0.1.

    Left to do

    1. When @minigraf/browser 2.0.2 ships, upgrade to it. Then revert sl3-s3 and t3-s3 to (transfer-chain :united ?club) and (reachable :north ?station), and run the e2e step tests to confirm.
    2. When minigraf v3.0.0 ships with the #287 fix, upgrade again and revert l1-s3 to one batch transact.

    Edited: minigraf#297 is now fixed upstream by minigraf#409 (v2.0.2 milestone).


    Generated by Claude Code

  3. adityamukho commented on Oct 14, 2026

    @adityamukho
    CollaboratorAuthor

    Reopening. #44 auto-closed this, but it only covered the minigraf#297 part (sl3-s3, t3-s3 reverted; app now on @minigraf/browser 2.0.6).

    Left to do: minigraf#287 is still a known issue in 2.0.6. Its fix needs file format v8 and ships in minigraf v3.0.0. When v3.0.0 is on npm, upgrade and revert l1-s3 to one batch transact.


    Generated by Claude Code

  4. adityamukho commented on Oct 24, 2026

    @adityamukho
    CollaboratorAuthor

    Status 2026-10-24, with #47 and #48:


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0