Skip to content

VN35: validated paths to individual component instances - #13

Merged
laubsauger merged 3 commits into
mainfrom
review/pr5-validated-path-names
Oct 8, 2026
Merged

laubsauger merged 3 commits into
mainfrom
review/pr5-validated-path-names

Conversation

@laubsauger

Copy link
Copy Markdown
Owner

An outer Render or expression can now address a particular component copy by instance/node, and an internal reference can climb with ../node. This preserves drmbt's VN35 feature from #5 while retaining main's validated descendant writes and nested mesh support.

The three reproduced review defects are fixed:

  • Single-value camera/material paths resolve whole, including labels containing spaces; list-valued references retain token order.
  • Published expressions and parent-bound source strings retain the scope where their values were authored, including nested pages and compound channels.
  • Every graph-patch writer gets command-time reference-cycle validation through CommandContext. Root edits and definition sessions project hypothetical drafts using the same compiler function; parameter commands, rename, dry runs and unrelated repair are covered. Existing authored-graph cycle checks remain in place.

Also reconcile #5 with current main without restoring #4's unchecked writer or nested refusal, reject . path segments as documented, provide the GPU fixture's required flattened context, dispose its runtime, and add a CPU proof of the three-projector setup through real commands and compiler bindings.

Validation: focused compiler, command, component and mesh-loader tests pass; typecheck, full lint (four existing warnings), build and 290 first-import checks pass. The broader gates pass except the devices-only helper timeout reproduced on the unchanged baseline; the updated frame-path guard passes separately. Real Dawn pixel verification is unavailable in this sandbox (no adapter); the tests continue to fail explicitly when required GPU support is absent.

This replaces #5 because the connector cannot update drmbt's fork. The repair commit has the original VN35 commit and current main as parents, preserving contributor history and #6's ancestry. After merge, #5 will be closed with an explanatory link; #6 can be evaluated against this implementation without requiring #4 to merge as written.

All work was isolated from the separate mapping integration. No local Git history or mapping changes were altered.

drmbt and others added 3 commits October 6, 2026 19:27
The mesh loader wrote a file's measured facts (vertices, triangles, parts,
joints, clips, clipFrames, frameOrigin, bounds) onto the node it found with
getGraph().nodes[nodeId]. An inner node's id is flattened (instance/inner),
the document does not hold it, so the write never happened and the node
compiled as the one-vertex stand-in: it drew nothing.

The facts now land as that instance's overrides of the inner node
(state.componentOverrides, keyed internalParameterPath), which flattening
already applies over the definition. Each instance keeps its own size, two
instances can load different files, and the shared definition is untouched.

- setParameters gains an optional internalNodeId, on the precedent of
  setNodeChannelMask's: one op through the bus, so undo, audit and the
  revision check come with it. A non-instance and a nested path are refused
  by name (parameter.internal.notComponent / .nested).
- "Already sized" reads the flattened node (definition plus overrides).
- Ids are split and joined through domain/components/addressing.ts
  (enteredThrough, toInstance), per T1695b's gate.
- One level only: an override key is <node>/<key>, so a mesh inside a
  nested component is refused as mesh.unsizable. mesh.component is retired.

Tests: the literal bug on Dawn (the app's loader hook sizes two instances
of one component loading different files, and each Geometry renders only
its own instance's mesh); undo of the measure; the definition untouched;
the nested refusal. Red-verified against the old lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
COMP-model stage 1 (proposal 01 §4). B41 renumbers the names inside the
second and later instances of a component, so an outer reference could
reach in only by a bare name, and a bare name binds the first copy. Three
instances of a Projector component could not be bound by one Render.

- `op('instance/node')`, `../node`, and path-valued source references
  (every SOURCE_REFERENCE_PARAMETERS entry). Relative only. A segment is
  a node's name as written in its own graph. Parsing and the walk live in
  addressing.ts, the one joiner.
- Resolved once, at flatten (path-references.ts): each path is rewritten
  to its target's unique flat label, so synthesis, the op() reader,
  liveness and channels are unchanged. A path that reaches nothing stays
  as written and is refused by name.
- Bare names resolve as before. New warning compiler/reference-cross-scope
  when one reaches INTO an instance the referrer is not in, with the path
  to write and how many copies carry the name. Reading outward is silent.
  No shipped example raises it; stage-previz-8 raises 52.
- §V128: a rename moves the head of a path written in its graph. B41's
  uniquing does not touch paths.
- `/` is refused in labels at the exact doors (node.label.separator); the
  suggestion is TD's validName form (roleFromText). node.rename already
  converts it.

Gate (Dawn, projector-paths.gpu.test.ts): one Projector component placed
three times through the app's commands, each with its own aim and pure
colour; the outer Render binds all three by path and each third of the
stage is lit in its own colour only. Red-verified with the pass removed.
The bare name, the old way, lights the left third alone and now warns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge current main into VN35 without reinstating the superseded VN33 writer.
Keep authored scopes through parameter projection, resolve single source paths
whole, and validate draft reference cycles through the shared command context.
Cover parameter commands, definition sessions, rename, dry run and repair.
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