Files
road-compiler/.trellis/tasks/archive/2026-09/09-08-complex-junction-editing/research/implementation-audit.md
T

3.0 KiB

Implementation evidence (2026-09-08)

Baseline: bba3ebe, branch feat/direct-edit-documents. This is a source review; historical test results are not new verification results.

Evidence Current behavior Required consequence
src/compile/direct-edit-solver.js:1159 Cluster effective plans flatten member approaches and merge corner dictionaries; readOnly: true at line 1213. Build authoritative external-arm/corner identities before permitting writes. Do not broadcast a node constraint across a cluster.
src/compile/complex-junction.js:36 Geometry discovers external approaches, groups carriageways by heading, and classifies shape. Reuse/extract this topology for the editor and compiler; avoid a second frontend topology algorithm.
src/compile/junction-projection.js:40 Projection takes the first complex core and an endpoint-derived node, and makes corners from road array order. Explicit junction scope, geometric adjacency, and deterministic identities are prerequisites.
src/compile/junction-structure.js:32 Normalization only retains declared arm fields. Explicitly preserve provenance/capabilities; adding fields only to the projection input will lose them.
workbench/server.js:323 Selection parser supports segment and junction, without an explicit cluster branch. Add unambiguous cluster selection while preserving existing node requests.
workbench/server.js:334 Edit-state solver context lacks cluster configuration; structure projection is not selection scoped. State, preview, save, rebase and formal compile need the same cluster context.
workbench/server.js:366 Preview compiles geometry and returns compiled plus solver diagnostics. Use the same candidate evaluation for save.
workbench/server.js:436 Save rejects solver errors but does not compile candidate geometry before persistence. Reject compiled geometry errors before any candidate document write.
workbench/client/src/junction/workspace.ts:49 Only editable node descriptors pass canEditJunction. Gate cluster editing on backend capability after the complete path exists.
workbench/client/src/hooks/useDirectEditSession.ts:39 Selection uses a node junction ID. Carry explicit JunctionRef through request/response and session scoping.
src/compile/complex-junction.js:94 Complex core, crossing and stop-line placement use cluster geometry rules. Node plan updates alone do not prove complex geometry consumption.

Existing reusable assets: v2 document and EditSession, gesture history, numeric parameter input, handle/ghost/preview layers, version conflict protection, cluster membership UI, compiler shape classification and reference layer. Existing structure/facility display is not evidence that those objects are writable.

Research boundaries: no new editor engine; no automatic inference of shape from node count; no claim of full geometric validity based solely on unit tests. Runtime geometry and geographic fixtures must be checked in implementation.