Commit Graph
394 Commits
Author SHA1 Message Date
jpmschweitzerandClaude 70c1bd3598 drop changelog gate's soft warning, keep 60-word hard cap
The 40-word warning never blocked a push, so eight bullets had drifted
over it. A warning the gate emits and the process ignores just
normalises drift, so it's gone — only the 60-word fail remains.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-18 08:59:42 +02:00
jpmschweitzerandClaude 18cbb4e47b re-flow contrast.dart per dart format
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Pre-push hook rewrote the two single-line `failingPairs` /
`failingExtendedPairs` getters; landing the formatter's choice.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-18 08:56:23 +02:00
jpmschweitzerandClaude cbbbc526f9 split contrast gate + ship -hc theme variants (T-114, T-118)
The expanded canonicalPairs from T-114 (muted text, status chips,
syntax tokens on the code-block surface, panel focus border) made the
four named themes fail WCAG-AA. Retuning their palettes to pass would
have changed the look users picked them for, so the gate is split
instead.

`canonicalPairs` shrinks back to the baseline every named theme passes;
the new `extendedPairs` carries the stricter set and only runs against
themes whose name ends `-hc` or `-cb`. Sibling files (`clide-hc`,
`midnight-hc`, `paper-hc`, `terminal-hc`) ship today; the policy lives
in D-69 with a back-ref from D-22.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-18 08:56:02 +02:00
jpmschweitzerandClaude Opus 4.7 d4f8f89016 code-quality batch (T-112)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m7s
Seven small consultant findings, one commit:

1. TreeSitterLib stores last dlopen error + path in static fields
   instead of swallowing them. Callers that observe a null instance
   can now read the diagnostic.

2. Drop the Cmsghdr alias in libc.dart — back-compat shim with no
   callers; CLAUDE.md forbids those in a solo repo.

3. Drop EditorController._events field + the unused_field
   suppression. The constructor still subscribes via `events.on<...>`
   for _eventSub; the field itself was speculative retention.

4. Replace inline hex / errno literals in native_pty.dart with
   PosixErrno.{eintr,ebadf,epipe} and new libc.{pollin, pollAnyErr,
   sighup, sigkill, sigwinch}. PosixErrno gains eintr.

5. ExtensionManager records activate/deactivate exceptions in a
   `_failed` map exposed as `failedExtensions` + `didFail(id)`.
   Listeners are notified on entry/exit; cleared on a clean
   activate. UI surfaces the degraded state instead of pretending
   everything is fine.

6. file_tree_view imports FileEntry via the clide.dart barrel
   instead of `package:clide/src/files/listing.dart` directly — the
   leak the consultant flagged (barrel already re-exports it).

7. test_app branch in main.dart wrapped in `if (kDebugMode)` so
   release tree-shaker elides the test harness from shipping
   binaries. Source import stays; tree-shake handles the rest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 22:11:23 +02:00
jpmschweitzerandClaude Opus 4.7 b66e8f6cc0 event-driven test waits, fail-loud on timeout (T-108)
Replaces the fixed Future.delayed sleeps the consultant flagged
with stream-based waits that complete when the awaited event
arrives. Timeout callbacks call fail() with a diagnostic instead
of `onTimeout: () {}` swallowing the signal — a never-producing
pty now reports "pty did not produce X within 5s" instead of an
unhelpful "Actual: ''".

session_test.dart:
  - _readUntil helper subscribes to s.output, completes when a
    marker substring appears (or onDone), fails on timeout.
  - _waitForBuffer polls a buffer the listener is already filling
    after a write; 25ms tick, 5s ceiling, fail-loud on miss.
  - Drops the 500ms settle + 50×100ms polling pattern in the write
    test; uses a "first-byte" completer for prompt-readiness.
  - retry: 2 restored on the four read-dependent forkpty tests
    (the underlying flutter-test-runner pty-output flake hasn't
    fully gone away; recovers cleanly on a fresh spawn).

watcher_test.dart:
  - "emits a created event" awaits stream.firstWhere instead of two
    fixed sleeps.
  - "filters ignored paths" uses pre + post sentinel markers to
    bracket the inotify-delivery window event-driven; the negative
    assertion only runs after the post marker is observed.

event_sink.dart:
  - RecordingEventSink gains a broadcast `stream` for the same
    event-await pattern. PaneRegistry's output test subscribes
    BEFORE spawn so first bytes aren't lost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 22:05:49 +02:00
jpmschweitzerandClaude Opus 4.7 7937da1734 panel-to-panel focus traversal via F6 / Shift+F6 (T-105)
Each SlotHost now owns a FocusScopeNode and registers it with
FocusTracker on mount. The render is wrapped in
FocusScope + FocusTraversalGroup so Tab stays within a panel and
slot-level focus is observable.

When a slot's scope gains focus, SlotHost pushes
(slot, activeContributionId) to FocusTracker — this collapses the
parallel-tracker model the consultant flagged. FocusTracker keeps
its setActive surface for explicit callers (palette, etc.) but
slot-scoped tab activation feeds it automatically.

Two new intents, two new bindings:
  FocusNextPanelIntent     → F6
  FocusPreviousPanelIntent → Shift+F6
(VS Code convention; preset YAML.)

The cycle skips slots without a registered scope, so a layout that
hides the context panel doesn't strand focus on a missing target.
Fewer than two registered → no-op.

SlotHost split into a stateful outer (scope + registry) and a
stateless `_SlotBody` (the existing slot-specific rendering),
keeping the build straightforward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:56:35 +02:00
jpmschweitzerandClaude Opus 4.7 12e0509fa3 keyboard-operable ClideTappable + palette nav (T-100)
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m5s
Plug widgets into the keymap layer landed in T-117.

ClideTappable:
  - Wrap in `Actions(ActivateIntent → onTap)` outside a `Focus` so
    dispatch from the focused context walks up and hits the action.
  - Add a focus ring via `tokens.globalFocus` (DecoratedBox foreground
    overlay, transparent border when unfocused, no layout shift).
  - Disabled (`onTap == null`) skips focus traversal and shows the
    forbidden cursor.

ClidePalette:
  - Register Actions for the four palette intents
    (selectNext / selectPrev / accept / dismiss).
  - Publish `palette.open` scope flag via `KeymapService.setScopeFlag`
    so when-clauses can scope future bindings to "palette only".
  - Highlight the selected row with `listItemSelectedBackground`;
    scroll it into view on nav.
  - `PaletteController` grows `selectedIndex` + `selectNext` /
    `selectPrevious` / `acceptSelected`; index resets on open /
    filter change.

Intents.dart drops the `ClideIntent` base — `ActivateIntent` and
`DismissIntent` come from Flutter; clide owns the palette and text-
scale and command-bridge subclasses. `parseIntentId('activate')` →
Flutter's class; same for dismiss. Widget code uses the canonical
Flutter Intent types where they fit.

App root grows a PaletteOpenIntent action that calls
`services.palette.open()`, completing the ctrl/cmd+shift+p path
end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:48:03 +02:00
jpmschweitzerandClaude Opus 4.7 798ba524f1 keystroke mapper layer — intents, presets, when-clauses (T-117)
Build the upstream of every keyboard-driven feature: widgets bind
to typed Intents, the keymap resolves chord+context to an Intent,
and Flutter's Actions dispatches. The widget never touches a key.

Layers (low → high precedence):
  1. preset YAML in assets/keymaps/<preset>.yaml
  2. extension-registered command bindings (via
     KeymapService.registerCommandBinding from ExtensionManager)
  3. user file at <appDir>/keybindings.yaml
  4. settings JSON overlay at app.keymap.overrides

The when-clause grammar is a tiny recursive-descent parser over
boolean expressions on a named context bag — VS-Code style
`palette.open && !textInputFocused`. Producing services publish
scope flags via setScopeFlag.

Keys reference LogicalKeyboardKey.keyId (stable across keyboard
layouts), not the locale-aware keyLabel the consultant flagged.

Ships:
  - lib/kernel/src/keymap/{key_chord, when_clause, intents, keymap,
    keymap_service}.dart
  - assets/keymaps/default.yaml (the baseline preset)
  - 90+ unit tests covering parser precedence, layering precedence,
    scope evaluation, register/unregister, settings overlay,
    malformed-input tolerance
  - app.dart root handler routes through KeymapService → Actions
  - ExtensionManager mirrors every legacy defaultBinding into the
    keymap as a contribution layer

KeybindingResolver kept temporarily as a back-compat shim for
callers we haven't migrated yet; safe to delete once the last
caller goes through Actions.

Closes T-110 (consultant: scoped Shortcuts/Actions; off keyLabel).
Annotates T-23 with what's left for T-100. Unblocks T-64 / T-65 /
T-66 (preset data tickets).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:40:02 +02:00
jpmschweitzerandClaude Opus 4.7 a8729db893 governance + docs quick-wins batch (T-113)
test / unit + widget + golden + a11y (push) Failing after 35s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m4s
- Amend D-66: floor lives at coverage_floor: in pubspec.yaml (single
  source of truth); coverage/floor.txt is no longer used; 95% target
  reached and is the current floor.
- Reconcile licenses.yaml with pubspec.yaml: drop the phantom lints
  5.0.0 entry (not a direct dep), bump test to 1.30.0 to match
  pubspec, tighten the purpose line.
- Triage Q-1/Q-2/Q-3/Q-25 with dated revisit notes: all still open,
  each pending a concrete trigger (T-99 for Q-1/Q-2, Tier-6 audit
  for Q-3, design call for Q-25).
- Drop --no-fatal-infos from ci/test.sh now that the import queue is
  clean.
- Add .claude/skills/README.md inventory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:19:45 +02:00
jpmschweitzerandClaude Opus 4.7 6e525c3250 add push-check-full gate + repair integration tests (T-103)
push-check stays fast (decisions / core / fast / a11y / coverage /
changelog gates, ~30s). push-check-full layers test-integration +
smoke-bundle on top for pre-release checks (~85s wall time).

Repair two integration tests in the process:
- app_starts_test: viewport too small for the welcome view's TIPS
  card, plus stale "Open project" / "disconnected" assertions; set
  a desktop-sized window and assert visible-on-boot strings.
- extension_lifecycle_test: same viewport fix; assert by widget type
  (ToolStatusItem) so the test doesn't depend on transient toolchain
  status strings.

theme_picker_test.dart hangs pumpAndSettle on theme.pick; skipped
in ci/test_integration.sh with a SKIPPED marker until T-116 fixes
the underlying loop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:19:36 +02:00
jpmschweitzerandClaude Opus 4.7 2768f11767 fix SchedulerService isolate-spawn race (T-106)
_startTicker fired Isolate.spawn(...).then((iso) => _isolate = iso)
and returned. If _stopTicker landed before the spawn future resolved,
_isolate was still null at kill time and the just-spawned isolate
(with its Timer.periodic) leaked forever.

Track the spawn as _isolateReady and have _stopTicker await it before
killing. Same shape as the NativePty fix from T-96.

dispose() is now async; the single caller in facade.dart already
sat inside an async dispose chain and just needed the await.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:19:20 +02:00
jpmschweitzerandClaude Opus 4.7 06b08b7388 reject symlinks pointing outside the workspace (T-102)
resolveUnderRoot already blocked path-layer traversal but explicitly
did NOT follow symlinks — a repo symlink config -> /etc/shadow
passed the containment check because the link path was under root.
clide would then read the target.

Add resolveUnderRootFollowingSymlinks: resolves any symlinks at the
target and re-verifies containment against the resolved real root.
The split keeps pure path math testable without filesystem access.
files.read and files.ls now route through it.

Tests cover: plain non-symlink passthrough, non-existent target
(returns path-layer result so caller surfaces not-found cleanly),
single-hop and chained symlinks whose targets escape the workspace,
and tolerance of symlinks in the root path itself (macOS /tmp).

Also adds the T-101 CHANGELOG entry that the docs commit missed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:01:56 +02:00
jpmschweitzerandClaude Opus 4.7 dd3b38ba85 fix onboarding docs to match current architecture (T-101)
Rewrite README's Architecture section: drop the `ptyc/` description
and `make ptyc-build` line, fix the broken `decisions/` link
(governance moved it), add pointers to current docs.

Banner docs/initial-plan.md as historical with a redirect to a new
docs/architecture.md that describes today's shape (single Flutter
package at the repo root; in-process IPC + dispatcher + subsystems;
PTY via Dart FFI posix_openpt + posix_spawn).

Also banner two ptyc-era forensic notes (docs/pty-proposition.md,
docs/macos-pty-problem.md) as historical so a contributor reading
them isn't misled into thinking the C helper still exists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:01:43 +02:00
jpmschweitzerandClaude Opus 4.7 70ce6c270e fix untrusted-workspace RCE in dugite git resolution (T-98)
Drop the workspaceRoot parameter from resolveToolchainPaths /
Toolchain.resolvePaths entirely. The old code resolved
\`<workspaceRoot>/native/dugite/bin/git\` as the git binary before
falling back to PATH — a malicious repo could commit an executable
at that path and clide would run it on the first auto-fired
git.status (which fires automatically on workspace open).

Dugite now resolves against trusted locations only:
1. CLIDE_DUGITE_DIR env var (dev override).
2. <exe-parent>/dugite/bin/git (production bundle).
3. <exe-parent>/lib/dugite/bin/git (alternate bundle layout).

Test plants `native/dugite/bin/git` in a temp workspace and asserts
the resolved git path is NOT inside the workspace.

Callers updated (8 sites): main.dart, backend_entry.dart twice,
test_app.dart three times (compute now wraps a no-arg call), plus
five test fixtures. backend.dart's now-vestigial hintRoot left in
the struct for cleanup under T-99.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:56:02 +02:00
jpmschweitzerandClaude Opus 4.7 8d1fcabb98 file 2026-05-14 consultant review backlog (T-97..T-114)
Epic T-97 + 17 children covering the consultant review findings:

- T-98..T-101: Critical (workspace RCE, IPC server, keyboard
  operability, onboarding docs).
- T-102..T-111: Major (symlink escape, push-check scope, IPC schema,
  focus traversal, scheduler race, terminal sweep, test sleeps, docs
  release, keybinding architecture, drag-resize parity).
- T-112..T-114: Quick-win batches (code quality, governance/docs
  reconciliation, a11y/contrast gate).

Each ticket cites the source section of consultants.md. Cross-deps
noted in body where they exist (e.g. T-105 depends on T-100).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:50:06 +02:00
jpmschweitzerandClaude Opus 4.7 6e0aa459d1 add 2026-05-14 consultant review
Six-reviewer independent assessment at commit 9030e56. Cross-cutting
themes: IPC server unimplemented (D-1/D-6/D-56 drift), keyboard
operability largely unbuilt, workspace-relative dugite path is a
real RCE, onboarding docs describe a dissolved architecture.

Followup tickets land alongside this commit (see pql backlog).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:46:22 +02:00
jpmschweitzerandClaude Opus 4.7 8391dd15c2 register D-68 + Q-32/Q-33 in the governance index
D-68 (dual integration surface — Bash CLI primary, MCP secondary)
landed in 8074bf4 inadvertently; this lands its index pointer in
README.md and the two open questions D-68 spawned.

- Q-32: tool surface — minimum /ide vs extended `mcp__clide__*`.
- Q-33: transport — SSE / WebSocket / stdio / all.

No behavior change. Governance bookkeeping only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:42:44 +02:00
jpmschweitzerandClaude Opus 4.7 d3b048523e re-tag PTY read-dependent tests as forkpty
Three session_test cases (echo-and-read, close, bare-command PATH)
intermittently fail under the flutter test runner when other suites
run in parallel — the pty master's reader-isolate output is empty
even though the spawn succeeded. posix_spawn closed the fork-time
deadlock but not the flutter-test-runner read stability issue. Push
them back under `dart test`.

Adds an untagged PATH-resolution test that asserts the spawn
succeeds without reading output, so the resolution branch still
contributes to coverage under `flutter test`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:36:51 +02:00
jpmschweitzerandClaude Opus 4.7 2cbabea000 add pre-push changelog concision gate (40 soft / 60 hard)
`ci/changelog_gate.sh` walks the `## [Unreleased]` section, measures
each bullet's word count (including indented continuations), and
fails at 60 words. Soft warnings between 40 and 60 don't block.
Wired into `make push-check` so the pre-push hook enforces it.

Trims six pre-existing over-cap bullets in the same commit so the
gate lands green. Released sections are frozen and untouched.

The rule itself lives in .claude/skills/git-commit/SKILL.md
"Be concise"; this gate is the executable companion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:26:45 +02:00
jpmschweitzerandClaude Opus 4.7 b1713f71cf git-commit skill: enforce concise CHANGELOG entries
Adds a "Be concise" subsection with hard rules (40-word soft cap,
no multi-paragraph bullets, no sub-headers, no probe numbers, no
nested file lists) and a before/after example so the rule is
unambiguous. Calibration tells the author to scan five existing
bullets and match their length.

Existing guidance ("short imperative phrases") was too easy to read
past — concrete commits this session shipped 5-paragraph bullets
crammed with rationale that belonged in the commit body. The new
text closes that loophole.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:22:38 +02:00
jpmschweitzerandClaude Opus 4.7 8074bf4201 replace forkpty() with posix_openpt() + posix_spawn() (T-96)
`forkpty` calls `fork()` underneath. `fork()` in a multithreaded
process is unsafe: only the calling thread survives in the child,
but libc locks held by other threads remain "locked forever." With
the multi-threaded Dart VM as parent, ~5% of spawns deadlocked in
the child before `execve` (forensic probe: child stuck in S state
with comm=`DartWorker`, master fd never sees POLLIN).

`posix_spawn` uses `vfork` on glibc/musl/macOS, keeping the parent
suspended until execve completes — no Dart code runs in the child.
Pty pair built via the POSIX-standard `posix_openpt` / `grantpt` /
`unlockpt` / `ptsname` sequence. Probed: zero hangs in 300
sequential spawns vs ~5% before.

Behavior change: missing executable / missing workingDirectory now
surface as a `PtyException` thrown by `NativePty.start` rather than
a diagnostic written from the child to the slave PTY. Cleaner error
path for callers.

Side benefit: drops the `libutil.so.1` dynamic-library dependency.
PTY now resolves entirely against libc via `DynamicLibrary.process()`.

Splits the library-level `@Tags(['forkpty'])` on session_test.dart
into a per-test tag, so the now-runnable-under-flutter-test cases
contribute to coverage. `dart_test.yaml` declares the tag so the
exclude-tags filters honor it. Drops the `retry: 2` workaround from
the formerly-flaky registry test.

D-5 amended. Trims session-introduced CHANGELOG entries that were
over-verbose for the Keep-a-Changelog format.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:21:41 +02:00
jpmschweitzerandClaude Opus 4.7 ab2e5e618b tree_sitter test coverage + DI seam, ratchet floor to 95
Add `colorForRole` switch-arm tests (every role → token mapping plus
the unknown-role fallback). Introduce a DI seam in `TreeSitterService`
and `TreeSitterLib` so tests can substitute the FFI surface and asset
loaders without dlopen'ing `libtree-sitter.so` —
`TreeSitterLib.testing(...)` takes named per-function overrides with
safe no-op defaults, and `TreeSitterLib.fromDynamicLibrary(...)` lets
the smoke test load the vendored library explicitly. Production
paths (`TreeSitterService.shared`, `TreeSitterLib.instance`) are
unchanged.

Fake-FFI tests walk every branch of `_init`, `_loadGrammar`,
`highlight`, and `dispose`. The smoke test catches FFI-signature
regressions the fakes can't, by exercising the real native library
end-to-end on Linux. Together this takes `tree_sitter_service.dart`
from 17% to 96% and crosses the global 95% target — closing out the
D-66 line-coverage epic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:21:05 +02:00
jpmschweitzerandClaude Opus 4.7 e430a87569 test sweep: kernel commands + widgets coverage, ratchet floor to 93
Add tests for `keybindings.dart` (KeyEvent → Keybinding mapping,
parse-error edges, resolver entries view), `toolchain_paths.dart`
(the Flutter-free `ToolchainView.resolved` static view), and several
`widgets/src/` primitives: tooltip hover/overlay, palette filter +
submit, multitab controller `copyWith` + size getters, and additional
markdown branches (h3–h6 headings, tables, strikethrough, default
block fallback, record-link tap).

Unfreezes the pre-push coverage floor that was held at 90 on
2026-05-14 by mistake and ratchets to 93. Tidies eight test files
that had accumulated unused imports flagged by `unnecessary_import`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 20:20:37 +02:00
jpmschweitzerandClaude 9030e564e5 hold coverage_floor fixed at 90
Stop ratcheting the pre-push line-coverage floor. 90% is the standing
obligation; gains above it are welcome but no longer raise the gate.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-14 21:21:14 +02:00
jpmschweitzerandClaude 5cad98224f keep the clide.dart barrel Flutter-free
`lib/kernel/src/toolchain.dart` is a `ChangeNotifier`, so it pulls in
`package:flutter/foundation.dart`. `GitClient` and `PqlClient` imported
it for the resolved binary paths, which leaked Flutter through the
`package:clide/clide.dart` barrel — breaking `dart test` on every core
subsystem suite (`ci/test_core.sh`), since pure Dart can't compile
Flutter packages.

Split the Flutter-free pieces into `toolchain_paths.dart`: `ResolvedPaths`,
`resolveToolchainPaths`, and a new read-only `ToolchainView` interface
with a `ToolchainView.resolved()` const factory. `Toolchain` now
implements `ToolchainView`; the clients depend on the interface. Core
test setups that built a `Toolchain` just to call `applyResolved`
switch to the factory.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-14 21:21:09 +02:00
jpmschweitzerandClaude a3a10cddf3 test sweep: kernel extensions + scheduler residuals (T-91)
Cover the remaining catch / no-op branches in
kernel/src/extensions_manager.dart (duplicate register, unknown
activate, activate-throws, deactivate-throws, keybinding unbind
on deactivate, `all` getter passthrough) and exercise the
SchedulerService event surface (ProjectOpened starts the ticker,
ProjectClosed stops it cleanly). Pushes line coverage to 92.73%.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-14 14:39:45 +02:00
jpmschweitzerandClaude Opus 4.7 b74ab54765 test sweep: daemon editor / files residuals (T-91)
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
- editor_commands_test: insert / replace / set-content / save with no
  active buffer return not-found (covers the _resolveId null branch
  in each handler).
- files_commands_test: files.watch emits a files.changed event when
  a file is created (covers the watcher.stream → events.emit wiring),
  FilesService.atCwd's parent-walk fallback when no .git is found in
  any ancestor.

Coverage: src/daemon/editor_commands.dart 88/100 -> ~95+;
files_commands.dart 64/70 -> 70/70.

Total coverage 92.33% -> 92.44%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 13:40:56 +02:00
jpmschweitzerandClaude Opus 4.7 91128a8f7f test sweep: cover daemon pql/git command exception branches (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Two fault-injection test files driving every pql.* and git.* daemon
handler with a Client whose toolchain points at a non-existent
binary. Each underlying Process.run throws ProcessException → wrapped
as PqlException / GitException → the handler's catch branch fires
and surfaces a toolError IpcResponse.

- pql_commands_errors_test (18 cases): every pql.* command lands in
  the catch + _pqlError helper.
- git_commands_errors_test (14 cases): every git.* command lands in
  the catch + _gitError helper. Skipped: stage-hunk + unstage-hunk
  which go through GitClient._applyPatch (uses Process.start, throws
  ProcessException directly without rewrapping in GitException).

Coverage: src/daemon/pql_commands.dart 105/149 -> 148/149 (99%);
src/daemon/git_commands.dart 122/146 -> 142/146 (97%).

Total coverage 91.59% -> 92.33%; floor bumped to 92.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 13:14:20 +02:00
jpmschweitzerandClaude Opus 4.7 0c063b835e test sweep: kernel/src/panels foundational coverage (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Two test additions for the panels subsystem:

- registry_test: setTabOrder ordering contract (unknown ids sink),
  definitionFor lookup, SlotId equality + hashCode + toString.
- drag_resize_test (new): horizontal drag adjusts sidebar slot size
  via setSize, contextPanel drag inverts the delta sign, hovered
  state flips line colour.

Coverage: kernel/src/panels/slot_id.dart 5/7 -> 7/7; registry.dart
30/42 -> ~all; drag_resize.dart 0/35 -> ~all.

Total coverage 90.99% -> 91.59%; floor bumped to 91.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:58:09 +02:00
jpmschweitzerandClaude Opus 4.7 72a3dce4a3 test sweep: foundational systems — files / ipc errno / panes (T-91)
test / unit + widget + golden + a11y (push) Failing after 32s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Three small foundational test additions:

- test/files/watcher_test.dart (new, 8 tests): FileChangeKind
  fromEvent across every FileSystemEvent.type + wire getter,
  FileChange.toJson, FileWatcher end-to-end (created event,
  ignored-path filtering, idempotent start, stop teardown).
- ignore_test: trailing /**, bare **, ? glob-pattern branches in
  the regex compiler.
- path_safety_test: PathOutsideRoot.toString embeds the three
  fields.
- ipc/errno_mapping_test: ENOTDIR / ENOMEM / EAGAIN branches in
  errnoToIpcError that weren't previously hit.
- panes/registry_test: RecordingEventSink.ofSubsystem filter.

Coverage: src/files/watcher.dart 10/36 -> ~ all; ignore.dart +
path_safety.dart residuals closed; ipc/errno_mapping.dart 3 added
branches; panes/event_sink.dart 100%.

Total coverage 90.53% -> 90.99%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:19:07 +02:00
jpmschweitzerandClaude Opus 4.7 aa29f5f3e8 test sweep: cover WelcomeView open-project dialog (T-91) — crosses 90%
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Four widget tests in test/builtin/welcome/dialog_test.dart driving
the WelcomeView open-folder fallback dialog. Uses a custom harness
that wraps the standard widget harness in a DialogHost so the
kernel.dialog.show() call inside _openFolder actually renders.

- MissingPluginException on pickDirectory → _OpenProjectDialog
  appears with the expected title / hint / Cancel / Open chrome.
- Cancel dismisses the modal cleanly.
- Open with an empty path is a no-op (early return in _submit).
- Open with a non-repo path keeps the dialog (project.open returns
  false, _loading flag flips back).

Coverage clears the **90% T-91 target**: 89.93% -> 90.53%. Floor
bumped to 90.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:08:40 +02:00
jpmschweitzerandClaude Opus 4.7 14d73b618f test: cover ClideKernel.of throw branch (T-91)
One small addition to facade_test: ClideKernel.of called from a
Builder with no ClideKernel ancestor throws the documented
FlutterError. Mirrors the existing ClideTheme.of coverage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:05:12 +02:00
jpmschweitzerandClaude Opus 4.7 fb48a3133f test sweep: icons, log.trace, DialogHost, FilesDropped getters (T-91)
Three small additions to push coverage toward the 90% target:

- test/widgets/icons_test.dart: one sweep test calling .paint() on
  every custom ClideIconPainter (Check, ChevronRight, ChevronDown,
  Dot, Folder, Gear, GitBranch, Plug, Search, Terminal, Warning).
- log_test: Logger.trace covered at minLevel.trace + filtered out
  at minLevel.info.
- services_bigger_test: DialogRouter.current getter; DialogHost
  widget rendered with backdrop + inner builder, then dismissed
  through the router. Plus FilesDropped subsystem/kind getters
  exercised through the existing notifyDropped test.

Coverage 89.08% -> 89.93%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 19:13:39 +02:00
jpmschweitzerandClaude Opus 4.7 a0bd459b7a test sweep: cover widgets/src markdown / code-block / accordion / scrollbar / pty-view (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
12 widget tests in test/widgets/more_widgets_test.dart covering the
next set of zero-coverage widgets:

- ClideMarkdown: headings + paragraphs + lists + code-block + hr +
  record-id link rendering through the md.Document → Widget compiler.
- ClideCodeBlock: plain source (no language), unavailable grammar
  fallback to plain text, didUpdateWidget re-highlight.
- ClideAccordion: collapsed (children hidden) vs expanded, tap
  toggles, leading-widget slot renders.
- ClideScrollbar: wraps a scrollable child, ScrollbarTheme inherited
  widget + its updateShouldNotify contract.
- ClidePtyView: Semantics live region wrapping a TerminalView.

Coverage: jumps from 86.58% to 89.08%. Floor bumped to 89.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 19:04:21 +02:00
jpmschweitzerandClaude Opus 4.7 86c3325de2 test sweep: cover widgets/src zero-coverage primitives (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
12 widget tests in test/widgets/zero_coverage_widgets_test.dart
covering six widgets that had 0% coverage:

- ClidePalette: closed → SizedBox.shrink; open → input + command
  list rendered; tap-to-invoke.
- ClideFilterBox: debounced onChanged (timer-flushed), clear button
  visibility + reset, onSubmitted forward.
- ColumnHat: left / center / right factories all render; center
  label joins project + branch with " > " separator; falls back to
  "clide" when neither set.
- ClideIconRail: one button per item, semantics labels, onSelect
  fires on tap.
- ClideSpine: label rotation + badge dot + onExpand tap; right-side
  variant.
- ClideResizeBorder: wraps child + renders 8 resize zones.

Coverage (totals lifted by these + the prior stale-lcov merge): jumps
from 83.92% to 86.58%. Floor bumped to 86.

Target reset to 90% per user direction: keep grinding sub-areas
until total clears 90%, then keep pushing as reasonable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:45:07 +02:00
jpmschweitzerandClaude Opus 4.7 dc86fac85e test sweep: cover SettingsStore project + ext scopes + YAML emitter (T-91)
test / unit + widget + golden + a11y (push) Failing after 32s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m3s
Seven new tests in test/kernel/src/settings_test.dart covering the
SettingsStore branches the existing 6-test suite didn't reach:

- project-scoped set + get round-trip when projectDir is configured
  (covers the project-file readFile branch + the project-scope set
  path).
- setting a project key without a project throws StateError.
- ext.* keys default to app scope; project overrides app when both
  are set (covers the project-overrides-app branch in _lookup).
- setProjectDir(null) clears the in-memory project values.
- YAML emitter handles every scalar branch: bool, num, string
  (simple + special-chars + empty), list (mixed types incl null),
  and round-trips through reload (covers _emitScalar + _emit
  branches for null / List / unknown types).
- load tolerates a malformed YAML file (_readFile catch path).
- load returns empty when file is missing or blank.

Coverage: kernel/src/settings.dart 104/123 -> 112/123 (91%).
Remaining lines are a couple of corner-case formatting paths in
_emit when the top-level value isn't a Map (the public API always
serializes a Map, so they're effectively unreachable through normal
use).

Total coverage 83.85% -> 83.92%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:27:04 +02:00
jpmschweitzerandClaude Opus 4.7 e2d98445f5 test sweep: cover ExtensionManager contribution branches + ctx (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Five new tests in test/kernel/src/extensions_manager_test.dart
covering the contribution-type case branches and the _ExtensionContext
passthrough surface that the existing 8-test suite didn't reach:

- TrayItemContribution lands in TrayRegistry on activate; deactivate
  removes it.
- StatusItem + ToolbarButton contributions activate/deactivate
  cleanly through PanelRegistry.
- LayoutPresetContribution exercises the no-kernel-side-wiring case
  branch (consumed by default-layout's own activate()).
- Every _ExtensionContext getter (log / events / messages / settings
  / theme / i18n / panels / arrangement / commands / palette /
  clipboard / files / notify / dialog / tray / secrets / os / net /
  focus / project / ipc) returns the same instance the kernel
  exposes — locks in the passthrough contract.

Coverage: kernel/src/extensions_manager.dart 85/130 -> 122/130
(94%). Remaining 8 lines are the disabled-by-default + persisted-
disabled paths plus the deactivate-during-failed-activate cleanup —
edge cases reachable only when extensions throw.

Total coverage 83.39% -> 83.85%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:22:33 +02:00
jpmschweitzerandClaude Opus 4.7 2a7875e1a9 remove OsBridge openURL/reveal tests — they spawn OS popups
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
services_bigger_test.dart's openURL + reveal tests called the real
OsBridge methods, which Process.run xdg-open / open / explorer.
On a desktop session the OS dispatcher (KIO on KDE, etc.) surfaces
a "Could not read file …" error dialog for the bogus URL, owned by
the desktop session not the test process — it persists after the
test exits and a fresh run spawns another one. The user has to
manually close each popup, blocking CI from running unattended.

Coverage value was minimal (anyOf(true, false)). Leaving fire() and
the rest of the OsBridge bus-event surface; command-shape coverage
of openURL/reveal can come from integration tests where a real OS
dispatcher is desired.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:02:37 +02:00
jpmschweitzerandClaude Opus 4.7 7ba0500f75 test sweep: cover kernel toolchain + medium services (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / integration_test (xvfb) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Two test files chasing the bigger kernel residuals:

- test/kernel/src/toolchain_test.dart (10 tests): Toolchain defaults
  + missing list, applyResolved with full / partial paths,
  waitForResolution sync + async, Toolchain.resolvePaths against the
  current workspace + dugite detection + PATH fallback,
  resolveToolchainPaths top-level matches the static.
- test/kernel/src/services_bigger_test.dart (15 tests): DialogRouter
  show/dismiss/queue/notify, FileServices.pick* UnimplementedError
  trio + notifyDropped event, OsBridge openURL / reveal / fire,
  WindowControls setStyle idempotency + MissingPlugin-safe
  platform-channel methods + isMaximized success path,
  SchedulerTier intervals + SchedulerTick payload + start/dispose.

Coverage: kernel/src/toolchain.dart 37/95 -> 67/95 (71%);
dialog.dart 20/47 -> 27/47 (remaining is the DialogHost widget,
needs a real overlay tree); files.dart 1/16 -> 14/16 (88%);
os.dart 1/26 -> 19/26 (73%); window_controls.dart 2/25 -> 25/25
(100%); scheduler.dart 14/41 -> 18/41 (remaining is the isolate
ticker entry point, only fires after a real project-open event).

Total coverage 82.43% -> 83.57%; floor bumped to 83.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:00:23 +02:00
jpmschweitzerandClaude Opus 4.7 8efcf186e6 test sweep: cover kernel ProjectManager + RecentProject (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m3s
18 tests in test/kernel/src/project_test.dart driving ProjectManager
with an injected onValidateProject hook so the manager doesn't shell
out to git in tests. Covers:

- RecentProject: relativePath HOME collapsing, timeAgo bucketing
  (minutes / hours / yesterday / days / weeks / months), toJson /
  fromJson round-trip, fromJson tolerance for missing fields.
- ProjectManager.open: non-git path (returns false), valid path
  (sets current, emits ProjectOpened, registers in recents),
  re-open deduplication, recents capped at 10.
- ProjectManager.close: resets current, emits ProjectClosed, no-op
  when already closed.
- ProjectManager.loadRecents: happy path, malformed-value tolerance,
  no-setting clears to empty.
- ProjectManager.openLast: no-stored, stored-but-missing,
  stored-and-exists.
- ProjectManager.resolveProject without injected validator falls
  back to Process.run.

Coverage: kernel/src/project.dart 2/72 -> 66/72 (92%). Remaining
6 lines are the _currentBranch helper + ProjectOpened-event-time
branch shake (need a real git in the sandbox to materialise the
branch).

Total coverage 81.64% -> 82.42%; floor bumped to 82.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:40:12 +02:00
jpmschweitzerandClaude Opus 4.7 2d123681be test sweep: cover kernel Tier-0 service stubs (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
19 tests in test/kernel/src/services_stubs_test.dart covering six
small Tier-0 service classes: ClideClipboard (typed write + readAs,
bounded LIFO history, typed history miss, writePlain/readPlain via
mocked platform channel, write-with-toPlain OS sync, clear),
FocusTracker (setActive flip + same-value no-op + clear), NetworkStatus
(default + setState idempotency), SecretsVault (per-extension
isolation, read/write/delete/deleteAll), TrayRegistry (add/remove +
priority sort + unknown-id no-op), Notifications (info/warn/error/
success levels, dismiss + unknown-id no-op).

Coverage: kernel/src/clipboard.dart 1/23 -> 23/23; focus.dart 1/12
-> 12/12; net.dart 0/6 -> 6/6; secrets.dart 0/8 -> 8/8; tray.dart
0/7 -> 7/7; notify.dart 4/23 -> 23/23. All six files now at 100%.

Total coverage 80.81% -> 81.64%; floor bumped to 81.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:36:22 +02:00
jpmschweitzerandClaude Opus 4.7 3339d3fcb5 test sweep: cover default_layout commands (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Eight new tests in test/builtin/default_layout/widget_test.dart
covering the DefaultLayoutExtension command handlers the existing
four-test suite didn't reach:

- All commands return the _notActivated() error pre-activate (sweeps
  every command's defensive null-context branch in one loop).
- palette.toggle flips the palette's open state.
- sidebar.collapse + context.collapse toggle their slots.
- panel.focus.left / .middle / .right — including the auto-expand
  branches when a focused side is collapsed.
- panel.focusMode toggles focus mode on the active slot.
- panel.focusMode.exit unwinds in order: focus mode → editor → palette,
  with the empty-data no-op fallback.
- editor.open + editor.close including the close-already-closed
  no-op.
- sidebar.section.N: auto-expand sidebar + no-op when no tabs are
  contributed.

Coverage: builtin/default_layout/src/extension.dart 60/167 -> 139/167
(83%). Remaining 28 lines are the _restoreLayout / _persistLayout
persistence paths and the section-activation happy path, which need
a populated tab list + a projectDir on settings to exercise — out
of scope for this batch.

Total coverage 79.80% -> 80.81%; floor bumped to 80.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:30:52 +02:00
jpmschweitzerandClaude Opus 4.7 3a6e906dc1 test sweep: cover welcome_view tail paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Eight new widget tests in test/builtin/welcome/widget_test.dart
covering the WelcomeView paths the existing render-it test didn't
reach:

- TIPS card visibility: shown when viewport height > 640, hidden
  when shorter (LayoutBuilder branch).
- Status line tri-state: "checking…" before toolchain resolution,
  "application ok" when all tools present, missing-tools listing
  when some are absent.
- Theme-name link tap fires the theme.pick command via the registry.
- Open folder tap with no native picker (returns null, function
  returns early) and with MissingPluginException (falls through to
  the path dialog via kernel.dialog.show).

Coverage: builtin/welcome/src/welcome_view.dart 84/221 -> 120/221
(54%). Remaining 101 lines are inside the _OpenProjectDialog,
_NotARepoDialog, and recent-project rows — they need either a
DialogHost in the test harness or a populated recents list, which
is materially more setup than the rest of this batch's pattern.

Total coverage 79.34% -> 79.80%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:25:17 +02:00
jpmschweitzerandClaude Opus 4.7 7b9feba987 test sweep: cover src/pty/env + native_pty error paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 34s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Two test additions for the pty subsystem:

- test/pty/env_test.dart (9 tests): PtyException.toString with and
  without errno, expandedPath on every platform branch, mergePtyEnv
  override precedence (clide defaults > process env > explicit
  overrides), clidePtyEnvDefaults shape.
- test/pty/session_test.dart extended (4 new tests): bare-command
  PATH resolution, non-existent workingDirectory triggering the
  chdir-failed diagnostic via the child branch, non-existent
  executable triggering the exec-failed diagnostic, resize on a
  live PTY.

Coverage: pty/env.dart 5/19 -> 9/19 (remaining 10 lines are the
macOS-only PATH-merge branch, only reachable when Platform.isMacOS).
pty/errors.dart 0/4 -> 3/4 (remaining 1 is a const-ctor phantom).
The new pty session tests run under `dart test --tags forkpty` so
their branch coverage doesn't surface via lcov, but the code paths
(chdir failure, execve failure, PATH resolution) are now verified.

Total coverage 79.26% -> 79.34%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:18:33 +02:00
jpmschweitzerandClaude Opus 4.7 b1e9abd6aa test sweep: cover daemon editor / files / pane / pql commands (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Extends the four existing daemon command suites with the verbs +
error paths the originals didn't reach:

- editor_commands_test (12 new): unreadable-path FileSystemException
  catch, editor.active with no buffer, editor.activate requires +
  validates id, editor.read no-active / unknown-id, editor.set-selection
  no-active / clamped, editor.set-content with + without selection,
  editor.save no-active, editor.close requires + validates id.
- files_commands_test (8 new): files.read happy + missing-path +
  empty-path + outside-root + missing-file, files.ls outside-root,
  files.watch idempotent, FilesService.atCwd resolver.
- pane_commands_test (10 new): argv-non-string rejection, unknown
  kind rejection, env passthrough, close / write / focus / resize
  missing-id and unknown-id validations, write requires bytes_b64
  or text, malformed base64 rejection.
- pql_commands_test (14 new): pql.files glob + limit, pql.backlinks
  happy, pql.outlinks missing, pql.tags, pql.query + pql.search
  happy paths + missing-arg user_error, pql.decisions.read missing
  + happy, pql.decisions.show with --with-refs / --with-tickets,
  pql.decisions.list domain filter, pql.tickets.list multi-filter,
  pql.tickets.show missing + happy, pql.tickets.status missing +
  partial-args, pql.tickets.board with team.

Coverage: src/daemon/editor_commands.dart 64/100 -> 88/100;
files_commands.dart 33/70 -> 64/70 (91%); pane_commands.dart 66/92
-> 78/92 (85%); pql_commands.dart 62/149 -> 105/149 (70% — remaining
44 lines are the per-command PqlException catch branches that only
fire when the pql subprocess itself fails mid-call).

Total coverage 77.92% -> 79.26%; floor bumped to 79.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:13:38 +02:00
jpmschweitzerandClaude Opus 4.7 8eaf7446a1 test sweep: cover daemon dispatcher + git_commands (T-91)
Two test additions toward finishing src/daemon/:

- test/daemon/dispatcher_test.dart (6 tests): the entire
  DaemonDispatcher surface — ping + version default handlers,
  unknown-command not-found error, register routing, isEmpty
  before/after registration, clear preserving ping + version.
- test/daemon/git_commands_test.dart extended (14 new tests): the
  git.* commands the existing suite didn't reach — git.diff with
  paths, git.stage-hunk + git.unstage-hunk (happy + missing-patch
  + bad-patch GitException), git.branches, git.checkout (happy +
  missing + unknown), git.log with count, git.push + git.pull both
  with and without a local bare remote, git.stage accepting a
  String single-path arg via _pathList.

Coverage: src/daemon/dispatcher.dart 8/22 -> 22/22 (100%);
src/daemon/git_commands.dart 73/146 -> 122/146 (84%). The
remaining 24 lines in git_commands are mid-call GitException
catch branches that need the git client to fail after the
dispatcher accepted the request.

Total coverage 77.05% -> 77.92%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:09:33 +02:00
jpmschweitzerandClaude Opus 4.7 035491f7db test sweep: finish src/git/ (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Closes out the three remaining files in src/git/ following the
client.dart batch:

operations.dart (25 new tests):
- GitException.toString
- GitLogEntry.toJson (body present + absent)
- gitStage / gitUnstage / gitStashPop / gitPush / gitPull error
  paths (no remote, empty stash, bogus path)
- gitUnstage with empty paths (unstage everything)
- gitStageHunk + gitUnstageHunk via _applyPatch
- _applyPatch surfaces stderr in GitException on a bad patch
- gitBranches happy + non-repo
- gitCheckout happy + unknown-branch error
- gitPull + gitPush round-trip against a local bare remote
- gitLog / gitCurrentBranch / gitBranches non-repo fallbacks
- gitDiscard with empty list short-circuit
- gitBin resolver

diff.dart (7 new tests):
- gitDiff with paths argument and non-repo fallback
- GitHunk.toPatch round-tripping header + every DiffLineKind
- GitDiff.toJson with / without oldPath
- parseDiffOutput edge cases: pre-diff garbage skipped, "\ No newline"
  marker captured as a header line, malformed @@ header skipped via
  _parseHunk null return

status.dart (4 new tests):
- branch.upstream + branch.ab populated from a local bare remote
- non-git directory returns an empty branchless status
- rename in porcelain output captures the original path
- parsePorcelainV1 short-part / empty-part / empty-input edge cases

Coverage: src/git/diff.dart 106/124 -> 124/124 (100%);
src/git/operations.dart 88/155 -> 148/155 (95% — remaining 7 lines
are gitPull/gitPush variants that need credentials, and the
gitBranches non-zero stderr path);
src/git/status.dart 86/98 -> 95/98 (97% — remaining 3 are the
ProcessException-during-call catch branches, only reachable if git
crashes mid-call).

Total coverage 76.04% -> 77.05%; floor bumped to 77.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 07:04:30 +02:00
jpmschweitzerandClaude Opus 4.7 7c8114ecbe test sweep: cover src/git/client.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
23 integration tests in test/git/client_test.dart driving a real git
binary against per-test sandbox repos. Covers every GitClient public
method that wasn't already exercised through the daemon command
suite:

- Queries: status (clean + with upstream tracking ahead/behind),
  diff with explicit paths, log, currentBranch, branches (with the
  current-marker check), repoRoot (in-repo + non-repo paths).
- Mutations: unstage with paths, commit-returns-hash, discard,
  discard with empty list, stash + stashPop with includeUntracked,
  checkout, stageHunk + unstageHunk via _applyPatch.
- Error surface: mutations throw GitException on non-zero exit,
  _applyPatch surfaces stderr from a bad patch, bad git binary path
  → ProcessException → GitException, queries return empty fallbacks
  on a non-git workDir.
- parseLog standalone parser: empty input, short-record skip, full
  record with body, 5-field record without body.

Coverage: src/git/client.dart 76/141 -> 124/141 (88%). The remaining
17 lines are the pull / push paths (would need a real remote with
matching credentials — out of scope) and the status GitException
catch branches that require an in-flight git process failure mid-call.

Total coverage 75.42% -> 76.04%; floor bumped to 76.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:46:13 +02:00
jpmschweitzerandClaude Opus 4.7 3175b7a633 test sweep: cover kernel/src/syntax (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Two test files covering the pure-Dart and fallback paths of the
tree-sitter integration. The native-FFI parsing depth stays
untested — DynamicLibrary.open('libtree-sitter.so') doesn't resolve
under the flutter test runner because the bundled lib sits at
native/linux-x64/ rather than on the linker search path. Real
parsing coverage would need an integration-test harness that copies
or symlinks the lib into the runner's working directory.

- test/kernel/src/syntax/language_map_test.dart (6 tests): every
  branch of grammarForPath — common extensions, case-insensitive
  matching, special filenames (Makefile / Dockerfile / .gitignore /
  justfile), no-dot/no-special-match fallthrough, unknown extension.
- test/kernel/src/syntax/tree_sitter_service_test.dart (9 tests):
  graceful-fallback paths of TreeSitterService when the library
  can't load — hasGrammar / languageFor / highlight all short-
  circuit cleanly, plus SyntaxResult.empty and SyntaxSpan field
  storage.

Coverage: language_map.dart 0/7 -> 7/7; tree_sitter_service.dart
1/131 -> 22/131 (the rest is deep FFI work); tree_sitter_ffi.dart
0/15 -> 1/15 (init entry only).

Total coverage 75.11% -> 75.42%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:41:14 +02:00
jpmschweitzerandClaude Opus 4.7 331201e287 test sweep: cover src/editor/ tail paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Adds 6 tests in test/editor/registry_test.dart closing out the
EditorRegistry methods the existing suite didn't reach:

- activate(id): unknown id is a no-op (no event emitted); known id
  flips the active buffer and emits editor.active-changed.
- setContent(id, content, selection?): explicit selection clamped to
  new content length, missing selection falls back to clamping the
  existing one, missing id is a silent no-op. Each emits the
  editor.edited replace event.
- contentFromArgs(args): the content_b64 fallback when text is
  absent, plus the empty-args default.
- Selection.hashCode + .toString.

Coverage: src/editor/buffer.dart 20/24 -> 24/24; src/editor/registry
.dart 87/105 -> 105/105. Both at 100%.

Total coverage 74.79% -> 75.11%; floor bumped to 75.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:37:14 +02:00