Skip to content

feat(editor): add source-proven viewport picking - #117

Merged
DJAscendance merged 2 commits into
mainfrom
feature/wd2-d-source-proven-picking
Oct 7, 2026
Merged

DJAscendance merged 2 commits into
mainfrom
feature/wd2-d-source-proven-picking

Conversation

@DJAscendance

Copy link
Copy Markdown
Collaborator

Lane

WD2-D-I

Closes #30

Parent: #28

Independent QA: #31

Purpose

Add fail-closed source-proven viewport selection to the Model workspace.

A preview click selects the exact authored source node only when identity is proven. Ambiguous or unsupported identity refuses instead of guessing.

Architecture

  • exact source text remains canonical
  • one existing sceneSelection authority
  • X_ITE remains the renderer
  • private X_ITE access is isolated to one adapter
  • one module-private parser-hook coordinator
  • parse-local provenance capture
  • no heuristic fallback
  • no source instrumentation
  • no second selection store
  • no main-process or preload change

X_ITE

Pinned exactly to:

15.1.10

Supported picking

  • exact Shape identity
  • approved WD2-C simple-object Shape → Transform promotion
  • anonymous and repeated siblings
  • exact generation/source binding

Fail-closed cases

  • DEF/USE ambiguity
  • Inline/external document
  • PROTO
  • pointing-device sensors and Anchor
  • stale preview
  • unsupported preview modes
  • private API incompatibility

Independent QA

Final verdict:

WRLFORGE_WD2_D_INDEPENDENT_QA_RETEST_PASS

Results:

  • 12/12 mandatory conditions verified
  • full P1-P22 real-pointer matrix passed
  • P6 36/36
  • 80/80 coordinate picks
  • two clean Electron runs at 333/333 assertions each
  • 218 picks per run
  • WRONG = 0
  • focused tests 56/56
  • npm run check passed (2473 pass, 0 fail, 4 skipped, 299 syntax targets)

Security

No WD2-D change to:

  • main.js
  • preload.js
  • IPC
  • CSP
  • network policy
  • contextIsolation
  • nodeIntegration

Real-input automation is QA-only under qa/wd2-d-picking/.

Known fail-closed limitations

  • BOM input can fail closed with no generation
  • Mall Fit can refuse when bounds are unavailable even if the displayed content matches the document
  • QA CDP harness is Linux-only; this is not a product-platform restriction

Scope

No transform manipulation, multi-selection, PROTO editing, or UI-0 work is included.

WD2-D-I (#30), parent #28, independent QA #31.

A preview click in the Model workspace selects the exact authored source
node only when identity is proven; ambiguous or unsupported identity
refuses instead of guessing.

- private X_ITE access isolated to src/preview/xite-pick-adapter.js
  (single export createXitePickAdapter, seven-method surface, one
  module-private parser-hook coordinator)
- X_ITE-free resolver in src/editor/viewport-pick.js
- selection flows through the existing sceneSelection authority; Code
  workspace inert, no caret follow, no heuristic fallback
- x_ite pinned exactly to 15.1.10
- QA-only real-input harness under qa/wd2-d-picking/
- no main.js, preload.js, IPC, CSP or network-policy change

Independent QA: WRLFORGE_WD2_D_INDEPENDENT_QA_RETEST_PASS
(333/333 Electron assertions x2, 218 picks/run, WRONG = 0).

Signed-off-by: Ryan Bundy <ascendance@skate.fm>
G8 strips the module-private coordinator and the createXitePickAdapter
body with LF-anchored regexes before scanning for module-level state.
On the Windows CI checkout (CRLF) the strips did not match, so
function-local `new Map(` was misread as module-level state.

Normalize line endings inside the test-only code() helper before
comment removal, and add one regression assertion that LF, CRLF and CR
inputs scan identically. No G8 assertion is relaxed; no product or QA
evidence byte changes.

Signed-off-by: Ryan Bundy <ascendance@skate.fm>
@DJAscendance
DJAscendance merged commit f39c626 into main Oct 7, 2026
3 checks passed
DJAscendance added a commit that referenced this pull request Oct 7, 2026
CLAUDE.md and WD.md still described viewport picking as future work.
Record WD2-D source-proven Model-workspace viewport selection as merged
(PR #117, fail-closed on unprovable identity) and keep gizmos, hierarchy,
MF arrays, ROUTE/PROTO editing, appearance and behaviours as later lanes.

Documentation only. No product code changed.

Refs #32

Signed-off-by: Ryan Bundy <ascendance@skate.fm>
DJAscendance added a commit that referenced this pull request Oct 9, 2026
wrlforge_vrml::pick translates the WD2-D resolver (src/editor/viewport-pick.js,
PR #117) to Rust with the same steps, statuses and reason ids. It joins every
link of an X_ITE hit snapshot to exactly one AST node by exact provenance span
(shifted for a stripped BOM), checks node type and the containment chain by
identity, and refuses USE / several parents / PROTO bodies / Inline scenes /
sensors and Anchors / syntax errors / capped parses. A Shape promotes only to
its own simple-object Transform (Box, Sphere, Cylinder, Cone). No name, type,
index, offset-proximity or position fallback.

Tests cover one Box, two primitives, identical and nested twins, anonymous
nodes, DEF without and with USE, repeated USEs, PROTO, Inline, sensors,
detached nodes, inexact spans, type disagreement, chain disagreement, and
LF / CRLF / lone CR / BOM / Unicode / comments / repeated structures.

Signed-off-by: Ryan Bundy <ascendance@skate.fm>
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.

[WD2-D-I] Production viewport selection

1 participant