Commit Graph

3 Commits

Author SHA1 Message Date
Levi Neuwirth fb14dc9ec3 test(isolation): migrate the corpus off the ambient roots
The mechanical half, riding on the census in the previous commit.

* 342 in-process construction sites in 65 files now take
  `new_with_roots` / `open_with_roots` with `iso::roots()`. The isolated
  base is a pure function of `CARGO_TARGET_TMPDIR` — no counter, no
  `OnceLock` — so two copies of the module in one binary agree instead of
  racing, and the tree lives somewhere `cargo clean` owns rather than
  leaking into `/tmp` once per run. It is shared deliberately:
  materialization is content-gated and idempotent, so a per-test
  directory would repeat it ~330 times per run for a byte-identical
  result.

* `journey_acceptance` keeps the ambient `EditorState::open`, because
  proving the production entry point has a caller is the whole of what
  that ratchet is for. Rev 2's "isolated by the environment its binary is
  launched with" was not a mechanism — cargo launches each test binary
  with the caller's environment, and a binary cannot re-point its own
  roots before its tests run. Each test is now a thin parent that
  re-execs this binary for its own name with controlled roots, and the
  child runs the body against production's call. Two pins guard it: the
  child asserts all four roots resolve inside the controlled base, and
  the suite asserts against its own source that it has not quietly taken
  the seam. The parent also asserts the child ran `1 passed` — a stale
  `--exact` filter would otherwise hollow the whole thing out silently.

* The shared spawners take all five storage variables.
  `spawn_daemon_process_with_env` set `HOME` and `XDG_CONFIG_HOME` only;
  `HOME` is a FALLBACK, so it isolates a root only while the matching
  `XDG_*` is unset — the harness's apparent adequacy was a property of
  one developer's environment. The PTY spawner backfills whichever of the
  five its caller did not pin. The 10 direct `Command::new` daemon and
  attach spawns get the same treatment.

Three suites had `mod common;` behind `#[cfg(feature = "crdt")]`;
`common::iso` is needed in every build, so those are ungated. Files that
already pull in `common` reach `iso` through a `use` rather than a second
`#[path]` declaration — loading one file as two modules is
`clippy::duplicate_mod`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lv428Fth9LRtffwJSsqH7T
2026-07-31 18:48:45 -04:00
Levi Neuwirth 2dd30ec730 Implement session-scoped GPU initial targets
Add protocol-v20 semantic bootstrap and readiness result framing so
`pmacs --gpu FILE` opens the requested path before the GPU window becomes
ready. Keep target identity scoped to the authenticated frontend, preserve
legacy/no-target attach behavior, and publish fresh buffers coherently to
existing replicas.

Carry Unix path bytes and launcher cwd through the root broker, resolve paths
lexically in the daemon, reuse or create buffers without ambient-view state,
and preserve the managed daemon lifecycle from #141. Add focused parser,
wire, lifecycle, hook, isolation, and real-connector acceptance coverage.
2026-07-23 19:03:25 -04:00
Levi Neuwirth 2ca011c368 M11.5: semantic frontend<->instance glue (SemanticClient + e2e)
Completes the M11 arc with the consumer side. pmacs has no GUI
toolkit, so per the design note's testability strategy the
deliverable is the bounded testable glue, not a GPU renderer.

- src/semantic_client.rs (crdt-gated): headless SemanticClient
  composing the BufferMirror rope replica (M10.10) with a tile-based
  SemanticModel that reconstructs styling/decorations from the full +
  dirty-segment deltas (M11.4). Emits FrontendEvent::Viewport;
  read-back accessors (text / effective_style_at /
  decoration_kinds_at / tile ranges). The M11.4 contract (segments
  carry every current item intersecting their range) makes tiles
  self-contained → incremental apply is per-tile replacement with
  edge-clipping, no cross-span surgery. 7 unit tests.
- tests/m11_5_semantic_acceptance.rs: (a) reconstruction-equivalence
  — incrementally-driven client asserted byte-for-byte identical to
  a fresh full projection across a scripted viewport/edit/selection
  sequence incl. a viewport jump (golden discipline, no snapshot
  crate); (b) end-to-end — a real daemon routes StyleSpans/
  Decorations to a semantic session (after it declares a Viewport)
  and never to a grid session, CellDelta vice versa, validating the
  M11.2 per-session projection through the socket.

Lib (1404 crdt / 1242 non-crdt) + integration green on both feature
flavors; clippy -D warnings clean on both.

M11 arc complete (M11.1–M11.5). Inline/Block/Fold/ResourceOffer
remain honest stubs pending their source features.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:24:36 -04:00