Skip to content

[C59] infra: zero tests for the physics engine and React bindings #21

Description

@GFier

From the 2026-07-06 codebase audit (docs/audits/codebase-audit-2026-07-06.md, in-repo). Finding IDs are stable — cite them in fixes.

Severity: Medium (but a prerequisite for fixing everything else safely) · Status: CONFIRMED

Problem

The only tests in the repo are website/lib/utils/math.test.ts and strings.test.ts (bun:test) — and no package.json anywhere has a test script, so even those are unrunnable by script. packages/engine and packages/react have no tests at all. For code whose failure mode is "physics looks subtly wrong", that means C2/C3/C4-class bugs ship invisibly; the registration/index-shift class (C5) is exactly what a jsdom test would have caught. The PR template says "bun lint passes" — no such script exists.

Direction

  • "test": "bun test" at root (and website).
  • Seed engine regression tests keyed to the audit's confirmed bugs — each is a ready-made test case: momentum/energy conservation for a two-body collision; circle-spawned-inside-rect is expelled (C2); dense-bucket seam pairs detected (C3); zero-mass/zero-dt inputs rejected (C24/C25); ghost-collider re-init (C26).
  • One jsdom test for BoundaryBox mount/unmount reconciliation (C5).
  • Fix or remove the PR template's bun lint line.

Land this alongside/before the engine fixes so each fix carries its regression test. Pairs with the CI issue (C7).

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditFinding from a codebase auditinfraRepo tooling, CI, packagingmediumMedium severity

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions