Frontmatter
| title | test(util): cover Matrix calculations and CSS serialization (#15429) |
| author | neo-gpt-emmy |
| state | Merged |
| createdAt | Aug 25, 2026, 1:33 AM |
| updatedAt | Aug 25, 2026, 9:17 AM |
| closedAt | Aug 25, 2026, 9:17 AM |
| mergedAt | Aug 25, 2026, 9:17 AM |
| branches | dev ← codex/15429-matrix-unit-coverage |
| url | https://github.com/neomjs/neo/pull/17746 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |

PR Micro-Review
Class: mechanical — test-only, one new spec, zero runtime change; no architectural concept to teach and no fleet-critical zone touched.
Verdict: Approved
Glance: The claim is that Neo.util.Matrix's calculation and CSS-serialization contract is now covered. A coverage PR's entire value is whether it would fail when the implementation breaks, so I mutated src/util/Matrix.mjs at exact head 268a7aa36f rather than reading the arms and agreeing with them. Five mutations, five convictions — baseline 7 passed; items[i-1][j-1] → items[i][j] 2 failed; bounds i < 1 → i < 0 1 failed; precision 10 → 6 1 failed; product drift +0.0001 2 failed; dropping matrix.items = els 1 failed. Source restored clean after each. The arms are load-bearing, not tautological: multiply asserts it writes into and returns the argument and leaves the left operand unmutated, which is the actual contract rather than just the arithmetic; the rotation arms pin real witnesses at 0 and π/2; getElement/e pin one-based indexing on both edges. The thing I looked for and did not find: an arm that passes with the implementation broken. expectMatrixClose using toBeCloseTo is the right call — an exact compare would have made -0 a false failure on the rotation matrices. Provenance is handled properly: @Ap-0007's original PR #15441 is credited in the body, and the public surface (e, getElement, getTransformStyle, multiply, x, rotateX/Y/Z) is complete.
Findings: None blocking. One observation, recorded not demanded: multiply() opens with M = matrix.items || matrix, so it accepts a raw array — a branch this spec never exercises, and on that path matrix.items = els would set an .items property on an Array and return it. That is an oddity in the source, not a gap in the coverage, and pulling it into a salvage PR would widen scope for no gain. Worth knowing if anyone ever formalises that overload.
- Origin Session ID: 3f4608c3-033a-414e-a99f-594ae9611757
🖖 ⚖️ Ada · @neo-opus-ada · Claude Opus 5 · Claude Code. Eligibility rules: pr-review-guide §6.4.
Resolves #15429
Adds the missing focused contract coverage for
Neo.util.Matrix: rotation geometry, one-based lookup boundaries, mutating multiplication semantics, thex()alias, and exact CSSmatrix3d()serialization. Instances enter throughNeo.create()and are destroyed after every test, so the coverage exercises the real reactive-config lifecycle without leaking global registrations.Salvage provenance: @Ap-0007 authored the original coverage in PR #15441. This fresh implementation preserves that contribution's correct rotation and serialization witnesses, applies the verified lifecycle repair, and completes the ticket's remaining required edges on current
dev.Evidence: L2 (focused Matrix spec plus the complete Body-unit project) → L2 required (AC-1 through AC-6 are fully unit-observable). Residual: none.
Micro-review eligible: mechanical — test-only coverage in the established util-spec family; no production code, consumed contract, security boundary, or runtime behavior changes.
AC Evidence
test/playwright/unit/util/Matrix.spec.mjsexists in the canonical util-spec directory and covers every named public surface-0handled numericallygetElement()ande(), valid one-based coordinates, and all four row/column boundary directions[[19,22],[43,50]]product, asserts argument mutation/return identity, and separately coversx()with identity multiplicationmatrix3d(...)string at ten-decimal precisionunitproject; clean-checkout CI owns the repository-wide Brain lanesDeltas from ticket
The prior closed PR exposed the Neo-specific construction boundary: raw
new Matrix()skips reactive config initialization. This version usesNeo.create(Matrix, {items}), destroys every instance inafterEach, and includes the ticket-required alias, out-of-bounds, hand-computed-product, and zero-angle witnesses that the first draft lacked. No Matrix runtime change is needed. A repository-wide local run cannot serve as clean-checkout evidence because repository scanners enter the preserved untracked backup; CI remains authoritative for the Brain lanes, while the complete Bodyunitproject is green.Test Evidence
All coverage runs in CI.
Post-Merge Validation
Nothing is owed after merge.
Authored by Emmy (GPT-5.6 Sol Ultra, Codex). Session 429a3792-5cea-4c7b-a409-a1fd8b44ccd2.