Experiment with measured multiline label layout on bounded witness

This commit is contained in:
2026-10-01 19:21:24 -07:00
parent 6ea7518e7b
commit d8ccd6ed49
13 changed files with 5590 additions and 20 deletions
@@ -0,0 +1 @@
fixture/** -text whitespace=-blank-at-eol,-blank-at-eof,cr-at-eol
@@ -0,0 +1,70 @@
# Issue 38: bounded label-generator alternatives
Local-only feasibility study; root owns synthesis. Source baseline is the original saved full twelve-relation geometry in `.local/native-reading/manual/geometry-before.json`, not a simplified view. The existing-generator feasibility result is separately confirmed by the Rust probe at source `70cf` and published in packet `45bfb63b`; this note does not rerun or replace that evidence. Candidate B's fresh native evaluation is still independent and its outcome is not assumed here.
Only this report was written. No production/probe changes, compiler, native GUI, or Gitea actions. All alternative results below are read-only JavaScript double-precision rectangle/orthogonal-segment arithmetic over the saved JSON. They are feasible geometric witnesses, not fresh reading passes or production implementation recommendations.
## Fixed requirements and arithmetic
Keep all twelve paths, cards, semantic identities/endpoints/ports, other displayed labels, and authored fields exact. Change only the automatic conversation label's derived position and, for explicitly identified alternatives, its visual line wrapping. The semantic string remains `Technician service conversation` throughout. The conversation ID is `63009b5f-539e-5914-b630-ec6b7fefb4d5`.
Use full flat card rectangles inflated by 12, other nonempty label rectangles inflated by 4, and candidate label rectangle inflated by 3 for stroke intersection checks. Own/foreign clearances below are shortest distances from the **uninflated** label rectangle to the respective routes. Foreign routes retain semantic identity, including coincident portions. These conventions match the bounded probe's geometry assumptions; they do not establish a perceptual threshold.
The original label is 233 x 24, centered (1296.5,274.5). It intersects foreign allocation `sa_repair_allocation` at x1312.5, y179..325. Its own vertical route is x1162, y89.5..316.5. Other foreign verticals at x1065 and x1071 bound the space to its left. The foreign allocation also runs horizontally at y325, which matters for taller labels.
For multiline witnesses only, assume unchanged font size 13, line advance 16, and padding consistent with the existing 24-high one-line box: height = 8 + 16 * line_count; width = 16 + 7 * longest_line_character_count. These are explicit experimental dimensions. Production typography must use actual rendered line metrics and then recheck geometry; replacing exact semantic text with a shortened name is excluded.
## Actual witnesses
Every row below has **zero node, foreign-stroke, and other-label collisions** under the declared margins. All boxes stay inside the original whole-scene node extents, so their union cannot enlarge Fit bounds. Whole-scene Fit would remain geometrically unchanged under these fixed paths and cards.
| Alternative | Center; size | Own stroke intersections | Own / foreign clearance | Center displacement from baseline |
| --- | --- | ---: | ---: | ---: |
| D. Dynamic single-line corridor placement, permit own backing | (1191.75,274.5); 233 x 24 | 1 | 0 / 4.25 | 104.75 |
| E. Two lines centered on own route, permit own backing | (1162,274.5); 142 x 40 | 1 | 0 / 20 | 134.5 |
| F. Three lines beside own route, keep every stroke clear | (1230,254.2); 100 x 56 | 0 | 18 / 32.5 | about 69.53 |
D bounds: x1075.25..1308.25, y262.5..286.5. Own vertical x1162 passes through the box. The nearest foreign lines are x1071 and x1312.5, 4.25 units away on either side. A minimum-movement variant centered at (1193,274.5) moves 103.5 units but leaves only 3 units to the allocation. D's balanced witness maximizes horizontal clearance within this narrow corridor; its 4.25-unit clearance is only about **2.2 pixels at Fit**. Collision freedom therefore does not imply good association or legibility. A grid enumeration at 0.5-unit steps over x950..1470/y180..340 found the minimum-movement variant above, but this bounded grid is not a global optimum proof and is not a suggested production algorithm.
E wraps as `Technician service` / `conversation`; longest line is 18 characters, yielding width 142. Bounds are x1091..1233, y254.5..294.5. Own stroke is centered beneath the opaque backing; the closest foreign stroke is x1071, 20 units away. The box intentionally hides a 40-unit own-route interval, about 20.6 screen pixels at Fit. This may create clear line-label association through aligned entering/exiting segments, or may make the path look broken. Geometry cannot decide which. It moves farther than D but gains substantial foreign clearance and uses only two text lines.
F wraps as `Technician` / `service` / `conversation`; longest line is 12 characters, yielding width 100. Bounds are x1180..1280, y226.2..282.2. Its own anchor can use the **already-existing fraction .55**, which is approximately (1162,254.2); the existing right-offset formula for the narrower box gives +68. The label is 18 units right of its own vertical path, 32.5 units left of the allocation vertical, and 42.8 above the allocation horizontal. It adds no strokes and obscures no route. It does increase label height from 24 to 56 (about 12.4 to 28.9 screen pixels at Fit), at the same small font size. The geometric own-versus-foreign clearance margin is 14.5 units, about 7.5 pixels; it is an evaluator observation, not a validated scoring threshold.
F at the original .5 fraction is also collision-free: center (1230,274.5), same width/height, displacement 66.5. However, its bottom lies 22.5 units above the allocation horizontal, leaving only 4.5 units of own-versus-foreign distance advantage. Thus a first-zero-collision chooser can still pick a perceptually weaker candidate even after wrapping. The .55 witness improves that geometry without introducing a new fraction generator.
## Materially different definitions
**D: dynamic free-interval generation, unchanged text shape, changed own-stroke objective.** For a bounded set of existing route fractions, take candidate label y positions from the existing offsets. Subtract forbidden horizontal center intervals induced by padded nodes, other labels, and foreign strokes that meet the candidate's vertical extent. Generate at most the nearest feasible center to the old center plus an interval midpoint; do not raster-scan the canvas. Permit covering the owning stroke only where one unique straight own segment enters and exits opposite box sides and no foreign semantic owner occupies that segment. This is a new generator and a new collision objective, not a tie-break patch. Keep node/other-label/foreign collisions hard exclusions. Use limited candidates and charged comparisons before considering any reusable spatial index.
D demonstrates that a single line can avoid the wrong allocation under a changed objective, but its narrow foreign margins weaken it as the next visual experiment. Reject the tempting minimum-movement variant as a preferred witness: it optimizes movement by hugging the wrong stroke at the collision margin. Also reject unconstrained own-stroke occlusion at turns or shared runs.
**E: bounded wrapping plus on-route placement.** Derive one-, two-, and three-line layouts from legal word boundaries, preserve the complete string, and measure them at the same font size. Include placement centered on a unique straight own segment as an explicit alternative. Keep all foreign strokes/cards/other labels excluded while permitting the defined own-route backing interval. Limit line count and candidate count; if a long unbreakable token cannot fit, fail this fallback rather than shrink text indefinitely or change the name. E is the smallest actual witness with materially comfortable foreign clearance and only two lines, but its intentional route interruption needs direct comparison.
**F: bounded wrapping with the existing side-placement family and improved ownership comparison.** For each permitted line layout, recompute its real width/height, then apply existing fractions and side-offset construction. Maintain exclusion of **all** strokes, including own strokes. Among feasible candidates, compare own/foreign association with displacement and wrapping cost; report these dimensions separately before accepting any scalar weighting. Prefer one-line layouts only when they also meet the experiment's association gate, not merely because they are collision-free. F is the strongest current geometric comparison if B fails: it keeps all routes visibly continuous, moves less than D/E, and has a clear own/foreign separation margin. Its tradeoff is a taller and less quickly scanned name. It requires matching multiline layout, hit/backing bounds, and SVG output; simply inserting a newline in the existing string/size formula is incorrect.
No one of D/E/F is accepted for production. A useful next native comparison would be **E versus F versus baseline**, using these frozen witnesses, after B's current result. D need not consume a native run unless the narrower alternatives prove unreadable or typography invalidates their feasibility.
## Rejected or deferred alternatives
- **Same fixed candidates with another weight:** already falsified for collision-preserving A. The new widths/objectives above are explicit departures.
- **A long horizontal-own-segment preference alone:** own horizontal segments are 18, 143, 18 units. No segment accommodates the original 233-wide label. The 143-unit segment is crossed by foreign corridors at 1065/1071 and sits next to the system/repair cards. Merely moving the old label above that segment reproduces foreign/corner crowding. It can remain one candidate family, not a solution claim.
- **Move the original full-width box just outside the allocation and add a leader:** local rightward placements require the leader to cross that foreign vertical; guarded B would properly suppress it. Large exterior placements add displacement and potential Fit costs. A short guard cannot repair arbitrary distant placement.
- **Minimal movement as the first objective:** D's 3-unit foreign margin is the counterexample. Use movement to break ties only after meaningful ownership/clearance evidence.
- **Shorter semantic text, hidden relations, or smaller font:** these evade the intended full-scene reading task. Multiline display must preserve the entire name and font size.
- **Global packing/rerouting or a new general layout API:** not justified by three concrete label-only witnesses. Keep exploratory geometry separate until a reader establishes an improvement.
## Policy boundaries before any whole-scene implementation
These witnesses concern one automatic label in an unnested scene. A whole-scene policy must treat authored label offsets/fractions as authoritative and must not silently wrap or move authored labels as collateral changes. All other automatic-label settlement must be inventoried, not hidden behind identical serialized fields.
Include association-end text and every visible label as obstacles. Nested/folded views require their actual label/card/header visibility rules; the flat-node arithmetic must reject or separately handle them, not silently reuse traversable route obstacles for text. Shared/partially coincident paths retain all semantic owners; an apparently own-only segment with another owner is foreign for the guard. Segment indices are zero-based windows over original points, independent of collision deduplication.
Separate fixed-path label-order permutations from full UUID-remapped reroutes, because the latter changes the evidence under the label. Keep existing gesture baseline caching; do not recompute wrap/interval packing on unchanged pointer hover. Charge extra interval/candidate scoring work and bound it on geometry rebuilds. A target label drag must commit once, preserve authored shape/anchor semantics, and remain stable across Undo/Redo, reopen, and canvas/SVG rendering. A layout policy depending continuously on zoom can cause label jumps; use zoom for evaluation first, not an automatic per-frame generator.
## Explicit gates and stop rule
Before implementation, render the measured typography for E/F in an isolated experiment with frozen scene/viewport. Recheck the reported bounds and all collisions. Reject a witness if actual text exceeds the assumed box, any node/foreign/other-label collision appears, endpoints disappear from Fit, or any semantic/path/authored state changes.
Then use a reader without prior endpoint exposure: first unselected path and port-owner identification, no Inspector answer beforehand. Require the conversation's original wrong allocation association to disappear without new wrong turns on Request/Report or the port mappings; record font readability and multiline scan cost separately. For E, explicitly ask whether the path remains traceable across the label backing; for F, whether stacked words associate with the left conversation route rather than the lower/right allocation. Any need to explain the intended attachment first is a failure of this experiment, not a pass after coaching.
A positive isolated result permits considering a small production rule and its regression/latency tests; it does not close the broader full-view shared-corridor readability issue. If E/F both fail first reading, stop tuning weights around this fixture and record the failed hypotheses before choosing a different approach.
@@ -0,0 +1,81 @@
# E/F measured-label experiment implementation handoff
Local uncommitted implementation against `6ea7518e7be5b5f17d5fbc5d667da8b388058af4`.
No compiler, GUI, Gitea, commit or push run by this worker. Root owns all gates.
`rustfmt --edition 2024 --config skip_children=true` completed for the six
explicitly owned/authorized Rust files. This establishes formatting only.
## Changed implementation
- New private `crates/oa-desktop/src/diagram/label_layout_experiment.rs` contains
read-once external E/F/Baseline profile, one-target identity guards, measured
typography cache, shared Layout, fixed placements, collision guards, Canvas
line records, explicit SVG line export and five focused tests.
- `diagram.rs`: Scene stores the shared Layout, profile and font-system version;
both ordinary and work-preview scenes apply it before geometry consumers.
Existing cache additionally keys profile/font version. Drawing and SVG consume
the same ordered line positions. Derived target label bounds feed existing hit
and route-drag start code. The private adapter applies to already-routed data.
- Parent-authorized thin calls: `app.rs` Fit, `diagram_usage.rs` whole/edge bounds,
and `diagram/work_drag.rs` dirty-input shield. No second routing call introduced.
- `diagram/attachment_tests.rs`: existing manual Scene literal gains default fields.
- Parent supplied the pinned `harness/experiments/wrapped-label-20261001/fixture/eight-card.json`;
it is referenced with include_bytes, not rewritten by this worker.
No changes to core, schema, source formats, canonical label.text/Name, Project,
port/card/path state, or B's cue. The fixture and diagram are identified exactly;
other labels return untouched. Baseline returns the complete routed value unchanged.
Automatic guard failure leaves baseline rather than painting an invalid narrower
shape over an old hitbox. Nested/collapsed scenes are excluded from this witness.
## Measurement and scope
Pinned Iced 0.14 graphics Paragraph is accessible through
`iced::advanced::graphics::text::Paragraph`; the same implementation is used by
Canvas Text. Each fixed line is shaped at font 13 with absolute line height 16,
Basic ASCII shaping and no wrap. Width comes from Paragraph min_width; baseline
and resolved face family come from actual cosmic-text runs. A single face per
line is required; mixed fallback or unsupported metrics reject the trial.
Cached measurements are keyed by profile and Iced font-system version; ordinary
hover, selection and camera changes reuse the entire Scene. No character-count
width heuristic is used.
SVG writes explicit per-line x and shaped baseline y with the resolved family,
not browser wrapping or generic sans-serif. It does not embed the font: native
export rendering and font availability on another machine remain a validation
boundary, not proven glyph parity. Tests compare generated text/geometry records,
not raster output or browser appearance.
Automatic E permits exactly one straight own segment crossing both padded sides;
all foreign strokes, cards and labels (including association-end labels) are
excluded. Automatic F clears all strokes. Guards use measured boxes, card margin
12, other-label margin 4 and stroke margin 3. Fixed F's own-is-closer width margin
is explicitly asserted by its fixture test rather than accepted as a general
placement scoring rule.
Authored target labels keep the externally selected line shape and honor actual
fraction/offset. They deliberately retain that shape when a user moves into a
collision, reporting Layout.clear=false; silently unwrapping/resetting would
violate the trial boundary. Conservative whole-scene bounds retain prior bounds
and include moved authored boxes. No ordinary save/reopen formatting contract,
general typesetter, placement winner, or production policy is claimed.
## Parent gates
Suggested targeted test selector:
```powershell
cargo test --locked -p oa-desktop label_layout_experiment -- --test-threads=1 --nocapture
```
Five tests cover full unchanged baseline and all 12 point arrays/other labels,
actual measured dimensions and guard result, matching Canvas/SVG/picking/focus
geometry records, foreign-stroke/card rejection without mutation, authored
fraction/offset/shape retention during real route-preview construction, and
actual Scene/measurement cache reuse plus profile/revision invalidation.
The first test prints measured line/family/bounds records for parent capture.
Compilation, strict lint, fixture guard feasibility on this font installation,
native rendering, actual edit lifecycle, performance, independent fresh-reader
trial, and integration/publication remain pending. Preserve first failures and
revise at the responsible layer; no successful test/native outcome is asserted.
@@ -0,0 +1,59 @@
# Independent adversarial review: next #38 label experiment
Recommend a bounded measured F prototype, with E retained as the materially different comparison. Defer D. F has enough geometric advantage to justify a real Rust/Iced test, but neither F nor E is an accepted remedy. Candidate B's source correctness and passing gates do not reverse its unsuccessful fresh-reading result: correct participants with a plausible foreign-allocation alternative is not reliable label ownership.
Read the alternatives note, immutable full baseline geometry/Project, prior native/cue caveats, and current derived-label, picking, drag and SVG consumers. Independently recomputed rectangle/orthogonal-segment clearances and card/other-label exclusions from actual baseline data. No broad external research was needed to distinguish these local hypotheses. No code, compiler, GUI, Gitea or commit action; this report is the only new artifact.
## Comparison and recommendation
Independent arithmetic reproduces the witnesses: D own/foreign clearance 0/4.25, E 0/20, F 18/32.5. None overlaps padded visible cards or the other two nonempty labels. The full scene retains eight cards, twelve semantic routes and the independently recorded 37 distinct stroke geometries. These are backing-box distances, not measured glyph or perceptual clearances.
D keeps one-line scanning but requires a new free-interval generator and hides its own route while leaving only about 2.2 pixels to foreign routes at Fit. That is weak separation for considerable algorithmic change. It should not consume the next native trial unless measured typography invalidates both narrower alternatives.
E has only two lines and directly aligns its label with a uniquely owned straight segment. This can be an effective conventional line-label cue, but it intentionally obscures about 40 world units of the path and moves farther. A reader must reconnect the entering/exiting stroke across text; in this already congested scene that may recreate a branch ambiguity. E is a useful comparator precisely because it tests association by on-line interruption rather than proximity.
F preserves every visible route, has the least displacement, separates the foreign stroke from the label backing, and uses an existing route fraction/side-placement family. Unlike B it removes the foreign stroke through the text rather than adding a faint secondary cue. This is a meaningful improvement in the hypothesis, not merely another weight. The cost is three-line scanning at the same tiny Fit font. F may still look associated with the nearby allocation, or require zoom for words. The three-line box is only about 29 pixels high at Fit; each character remains about 6.7 pixels at nominal font size 13. Neither geometry nor extra height establishes legibility.
Prototype the frozen measured F .55 witness first, retaining E .5 for a separate fresh comparison. Do not immediately implement a general winner-selection algorithm. A fixed-witness experiment can falsify the visual premise before spending effort on candidate objectives, global ordering or persistence schema.
## Blocking conceptual issues before production/parity claims
1. **Authored layout transition is unspecified.** EdgeLabel currently persists fraction and offset only. The note requires automatic wrapping and also says authored labels must not silently wrap. Dragging automatic F makes it authored; a naive implementation then unwraps it, changes its box and may put the foreign stroke back through the label. Saving/reopening loses any transient remembered wrapping. Decide explicitly whether wrapping is derived independently of authored position, an opt-in display policy, or persisted authored presentation before claiming drag/Undo/Redo/reopen parity. Do not add a serialized field solely to rescue an unvalidated visual witness.
2. **Measured text and consumed geometry must be the same layout.** Inserting newlines into text while retaining old dimensions, or painting narrower text over the old label hitbox, invalidates the experiment. Actual font, font size, shaping, advance, line height, baseline, alignment and padding must determine one geometry object. The whole name stays canonical; derived line breaks are presentation. SVG must consume the same measured line positions/bounds rather than relying on browser auto-wrap or a different generic font. A screenshot-only drawing patch cannot establish edit/export/spec parity.
3. **A production placement objective remains undecided.** F .5 is already collision-free but weaker than .55. Existing first-zero exit will choose it. The next experiment must not claim an implemented general rule merely because a manually chosen .55 screenshot looks better. Keep the witness explicitly fixed, then use observed readability to decide a separate ordering/association criterion. Do not silently elevate minimum displacement or nearest-box margin into a validated human metric.
These issues do not block a clearly isolated visual experiment. They block general product or persisted-label acceptance.
## Feasible implementation boundary
Use an isolated experiment profile, explicitly selecting the target relation and frozen E/F line split/anchor policy. Derive a transient LabelLayout containing the original display text, ordered line strings and measured positions, anchor/fraction, union backing/hit bounds and font identity/metrics. Preserve Project, canonical Name, source text, all routed point arrays and authored fields. Apply that layout to the derived scene before any consumer uses it, not only in the final paint call.
Canvas painting, label hit testing, label drag start/offset calculation, focus/navigation bounds, overall scene bounds and SVG export must read that same derived layout. Existing semantic relation identity remains the hit result; no new relation or leader target is introduced. Both preview and committed scenes need the same transformation. A test-only/external experiment profile can preserve the target's chosen layout through the controlled editing trial, but then save/reopen evidence must explicitly say it requires that experiment profile and does not prove the ordinary product's persisted formatting contract. Alternatively postpone edit/reopen acceptance until the authored-layout decision is resolved.
Keep the old one-line layout as the default for all unrelated labels. For the first fixed-path experiment, freeze and inventory those other derived labels rather than allowing an unnoticed re-settlement. This is a deliberately scoped witness, not yet a whole-scene policy. If the witness passes, define the shared derived-layout interface and documentation at the appropriate layer before promoting it into production routing or export. Avoid a general typesetting/layout framework until there is positive evidence.
## Finite assumptions to falsify early
- Re-measure before native reading. With F's left side fixed 18 units from x1162, nearest foreign vertical x1312.5 gives clearance 132.5 minus measured width. F retains the claimed own-is-closer advantage only below width 114.5, and its 3-unit foreign exclusion only below width 129.5 (strict-border details must follow the scorer). The predicted width100 has useful but finite slack. Actual glyph extents and antialiasing are distinct from backing bounds.
- At F center y254.2, the foreign horizontal y325 yields clearance 70.8 minus half the measured height. Recheck all actual card/label/stroke constraints, not just that one line. For E, recheck the enlarged backing against the entire unique straight own segment, both margins and all foreign segments.
- E's permitted own crossing must be one uniquely owned straight interval entering and leaving opposite sides. Reject bends, endpoint/port-symbol coverage, shared or partially coincident foreign runs, unrelated strokes just beyond a rectangle boundary, and other label/node interception. Ownership lists must retain all IDs rather than deduplicating to one owner.
- F must keep all strokes clear after measurement, including its own; do not add an explanatory cue when the comparison is supposed to isolate wrapping/placement.
- Names with Unicode, long unbreakable tokens, punctuation or explicit whitespace need declared non-destructive line-breaking rules. A failure to fit must fail this experimental fallback rather than shrink font, truncate semantic Name or insert source newlines. This one English name does not validate general wrapping.
## Reading experiment and causal controls
Predeclare fixed F and E geometry after measurement. Hold complete model, paths, cards, viewport, zoom, font and other labels identical. Disable B cues in these comparisons. Record actual pixel and world bounds, rather than assuming unchanged Fit because the old arithmetic fit inside node extents.
First reading must precede Inspector/selection/highlighting or explanation of the intended owning path. A reader who has already identified this conversation in B or baseline is not fresh. Showing the same participant names in baseline before F also teaches the answer. Prefer fresh readers per arm; if constrained, use separately declared isomorphic, relabeled scenes with counterbalanced presentation and report that limitation. Do not present repeated same-scene exposure as independent accuracy.
Record the first path chosen and participant/port-owner answer, confidence, wrong alternatives, tracing time, pan/zoom and word-reading difficulty. Correct participants with persistent plausible allocation ownership remains failure. Ask an unleading trace task first; ask whether E looks broken or F appears attached to the allocation only afterward. Verify Request/Report and the two port mappings so improvement does not come at their expense. A correct click after highlighting proves selectability, not unselected association. Stop if coaching is needed, target words become hard to scan, another relationship becomes harder, or full-scene endpoint context is lost.
## Later integration gates
After a positive visual witness, compare full Project and every computed route/port/node/label record. Any other automatic label movement must be listed. Exercise target hitbox at each line and padding, drag start/preview/commit, Undo/Redo, cancellation, save/export/reopen under the declared layout policy, and canvas/SVG parity. Preserve authored offsets/fractions and unrelated authored labels exactly.
For a generalized rule, separately test fixed-path label-order permutations and consistent UUID-remapped reroutes. Do not conflate the latter with a label-only change. Charge every new measurement/candidate/foreign-segment comparison, retain a bounded budget and deterministic fallback, and measure actual scene rebuild and active preview costs on the representative scene plus the existing dense control. Cache font/layout for unchanged text/style; hover, selection and camera changes must not reshape or rescore. Do not add an index or optimizer before measurements justify it.
A successful first F reading would justify the next bounded implementation decision. It would not close shared-corridor ambiguity, broad accessibility, arbitrary names, nested/folded views, full OA/SA usability, or production release acceptance. If both measured E and F fail, record the hypotheses as rejected and change approach instead of tuning around this one scene.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
{
"source_commit": "45bfb63b4fb90683c7ed769565698f04f808a36a",
"source_path": "harness/experiments/diagram-readability-20261001/native-reading/working/eight-card.json",
"sha256": "9db1015369f450d5810c96a01fddb8a009d57f6aafbda5182703f15ded23d9c8",
"bytes": 138661,
"scope": "Complete representative reconstructed8card12relationshipProject; not recovereduser model."
}
@@ -0,0 +1,38 @@
# Bounded E/F label experiment intent (before implementation)
Base: `6ea7518e7be5b5f17d5fbc5d667da8b388058af4`; local branch
`codex/wrapped-label-experiment-01a0d717-20261001`. Parent owns compilation,
native trials, integration and publication. This worker owns only private
`diagram/label_layout_experiment.rs`, minimal `diagram.rs` wiring and necessary
Scene-literal test adjustments. No implementation files changed at this point.
Predeclared target: diagram `00000000-0038-4000-8000-000000000001`, relation
`63009b5f-539e-5914-b630-ec6b7fefb4d5`, canonical text
`Technician service conversation`. Read-once external `ARCADIA_LABEL_EXPERIMENT`
selects E or F; absence/unknown value leaves exact Baseline behavior. Never
persist this profile or alter Project, canonical text, routes, ports, cards,
other labels or authored state. No candidate-B cue.
E: `Technician service` / `conversation`, fraction .5 centered on own route.
F: `Technician` / `service` / `conversation`, fraction .55, backing left at
anchor x + 18. Font 13, line advance 16, measured maximum glyph advance + 16
horizontal padding; height 8 + 16 * line count. Shared derived layout must own
ordered lines/positions, canonical text, anchor/fraction and backing/hit bounds.
Measured geometry must pass flat-card +12, other-label +4, and foreign-stroke
+3 guards. E additionally needs one unique straight own crossing; F clears own
strokes. Authored target labels keep the profile's shape but use actual authored
fraction/offset. Ordinary save/reopen formatting contract remains unresolved.
Evidence required before acceptance: unchanged baseline Project/RoutedView;
full unchanged path and unrelated-label records; actual Iced measurement;
matching Canvas/SVG line and picking geometry; authored offset preservation;
real Scene cache reuse/invalidation. Parent runs tests and all native gates.
Initial API findings: pinned iced_graphics 0.14.0 exposes Paragraph::with_text,
its cosmic-text buffer and shaped advances through iced::advanced::graphics.
Canvas Text uses that same Paragraph implementation. Measurement is feasible
without a new dependency or character-count heuristic. However, focus and Fit
currently call core routing directly outside this ownership boundary:
`diagram_usage.rs` and `app.rs`. Work-preview scenes also consume externally
prepared RoutedView. These must be reconciled before any paint-only experiment
can claim shared-consumer parity. Report concrete scope conflicts to parent.