Skip to content

feat: draw, reshape, remove and relabel grid lines (T01.2) - #417

Merged
Blogbotana merged 3 commits into
Apibim-com:masterfrom
axisrow:feat/t01-2-drawn-grids
Oct 26, 2026
Merged

Blogbotana merged 3 commits into
Apibim-com:masterfrom
axisrow:feat/t01-2-drawn-grids

Conversation

@axisrow

@axisrow axisrow commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Adds T01.2 on top of #416: drawn grid lines can be created from world XY points, reshaped, removed and relabelled through the engine and the real CLI, with one atomic revision per command.

  • Add draw-grid-line, reshape-grid-line, remove-grid-line and relabel-grid-line.
  • Allow the first drawn line during create-grid, so a fully drawn grid is reachable while every stored grid still has at least one line.
  • Keep AxisIds and geometry stable on relabel; preserve untouched lines during reshape/remove.
  • Reject regular/drawn mode conversion, degenerate lines, duplicate identities/labels, the last-line removal and referenced-line removal.
  • Use immutable operation evidence for exact replay; a retry does not resurrect a later-removed line.
  • Author family attributes through one validated Change::Grid; the frame and family modes stay unchanged.

Stack: depends on #416 and the contract proposal #415. The T01.2-only comparison is fork base → this branch. Rebase after the preceding PRs land. Current upstream master and open PRs were checked for duplicates.

How you verified it

  • Formatting and diff whitespace checks.
  • Scoped Clippy for model, engine, layer-engine and CLI, all targets: passed.
  • 5 actual-binary drawn-line cases and the 10 T01.1 regression cases passed, including separate undo/redo units, rotated world points, fixed family modes and replay after removal.
  • 2 engine tests passed for reference refusal, input immutability and frame conversion.
  • Full cross-platform GitHub CI passed for 29f90d5 (run 40321285071), including all platform tests, formatting, Clippy, WASM and dependency checks.

Never-crash and provenance

Bounded line/label counts and finite world/local coordinates; stored arrays remain checked by T01-V01. No new production unwrap/expect/panic, input-derived indexing, unsafe, dependencies or assets. Contributor-original MPL-2.0.

Review points

Keep draft for the preceding dependencies. Incoming references conservatively block line removal until axis-specific stored view references enter with W01. The historical AxisId lifetime policy across deletion/history compaction remains the review point described in #416; current collision checks use the complete pinned live graph. This PR does not claim the T01 parent acceptance gate.

@axisrow
axisrow requested a review from Blogbotana October 26, 2026 12:17
@axisrow
axisrow marked this pull request as ready for review October 26, 2026 13:05

@axisrow axisrow left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T01.2: drawn grid lines and relabelling

Verdict: approved. No changes requested.

Reviewed the delta over #416 (13 files, +1264): the typed GridLineEditRequest model with versioned fingerprints, the pure engine edit decisions, the Change::Grid authoring/validation path, the four CLI commands, the initial drawn line at creation, and the E2E suite.

What checked out:

  • Atomicity and guards. Each operation validates the complete replacement record; frame, grid name and family modes are verified unchanged by the change validator (mode conversion refused with GRID_FAMILY_MODE), identities and geometry survive relabel, the last line cannot be removed, and a line named by an incoming reference is DEPENDENCY_CONFLICT. The engine never mutates its input; the footprint (reads of target lifecycle/shape/placement plus the fresh axis absence, one shape-input write) matches the validator declared groups, and check_footprint ties them together.
  • Geometry. World points convert through the pinned frame with the exact inverse rotation, then re-validate against the local 1e6 cap and 1 mm floor; degenerate and colliding identities refuse without writes. The rotated-frame E2E pins the conversion.
  • Replay. Fingerprints are independent of source state, so an exact retry replays from operation evidence without resurrecting a later-removed line — covered end to end, including undo/redo units.
  • Creation reachability. create-grid --u-from/--u-to/--u-label makes a drawn family with one line reachable at creation without storing an invalid empty grid — this also unblocks the GR-P14 shape of test case against the amended contract proposed in #415; the contract text (section 8.1 drawn-empty) should pick that up there.
  • Documentation. The design note states the conservative reference blocking (grid-level until axis-specific stored references arrive with W01), the replay rule and the unclaimed parent gate.

Minor observations, no change needed: a non-grid target reports UnsupportedProperty where NotFound might read better; the conservative removal guard refuses any line removal while the grid itself is referenced (safe over-refusal, already documented as a W01 follow-up); the relabel-family CLI counts labels only to satisfy the parser, the real count check lives in the engine where it belongs.

Tests, fmt and clippy were not run in this review; CI covers them.

@Blogbotana
Blogbotana merged commit 65728b0 into Apibim-com:master Oct 26, 2026
34 checks passed
@axisrow axisrow added this to the M0: grids milestone Oct 27, 2026
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.

2 participants