From 05584eb9e5d94facc18e642ca92b80fb79de005d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Fri, 12 Jun 2026 02:18:14 +0200 Subject: [PATCH] drop the unused mocktail dep; amend D-25 (T-385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mocktail was pinned and documented as the IO-mocking strategy, but after the T-91 coverage drive it had zero imports — every IO seam ended up with an injected hand-rolled fake instead. D-25 is amended to record that the hand-rolled-fakes rule covers IO seams too; licenses.yaml and the lockfile follow. The ptyc binary removal noted in this sweep landed with the git-API commit (it was already staged). Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 6 ++++++ assets/licenses.yaml | 9 --------- governance/README.md | 2 +- governance/decisions/architecture.md | 2 +- governance/decisions/testing.md | 8 ++++---- pubspec.lock | 8 -------- pubspec.yaml | 1 - 7 files changed, 12 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e11ff97..1a5f1877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit. ### Removed +- **Dead-code sweep.** The legacy free-function git API (with its latent + pipe deadlock), ToolCheck, the fd-passing-era libc bindings, the GraphView + placeholder, the superseded ColumnHat widget, the tmux-era + TranscriptPublisher, the committed `ptyc` binary, and the unused + `mocktail` dev-dependency (D-25 amended) are gone. (T-385) + - **Dead welcome-screen tiles.** "Clone from git…" and "Start a Claude session" did nothing on tap and advertised shortcuts that were never registered; the tips card now lists only shortcuts that exist in the diff --git a/assets/licenses.yaml b/assets/licenses.yaml index 65f7502d..596d0244 100644 --- a/assets/licenses.yaml +++ b/assets/licenses.yaml @@ -205,15 +205,6 @@ dependencies: # Build-time-only dependencies — test runners, mocks, lints. Tracked # here for audit completeness; NOT rendered in the About screen. dev_dependencies: - - name: mocktail - kind: dart-package - version: "1.0.5" - homepage: https://pub.dev/packages/mocktail - license: MIT - purpose: >- - Mocks at IO / IPC boundaries. ChangeNotifier facades use - hand-rolled fakes instead of mocks (D-025). - - name: alchemist kind: dart-package version: "0.12.1" diff --git a/governance/README.md b/governance/README.md index 0299f306..66de51c0 100644 --- a/governance/README.md +++ b/governance/README.md @@ -66,7 +66,7 @@ You might also want, project-permitting: - [D-22: WCAG-AA contrast gate on bundled themes](decisions/accessibility.md#d-22-wcag-aa-contrast-gate-on-bundled-themes) — _accessibility_ - [D-23: Test pyramid — seven layers](decisions/testing.md#d-23-test-pyramid--seven-layers) — _testing_ - [D-24: Golden tests — primitives only, Alchemist + Ahem](decisions/testing.md#d-24-golden-tests--primitives-only-alchemist--ahem) — _testing_ -- [D-25: Mocks — mocktail at IO, hand-rolled fakes for ChangeNotifiers](decisions/testing.md#d-25-mocks--mocktail-at-io-hand-rolled-fakes-for-changenotifiers) — _testing_ +- [D-25: Mocks — hand-rolled fakes throughout; mocktail dropped](decisions/testing.md#d-25-mocks--hand-rolled-fakes-throughout-mocktail-dropped) — _testing_ - [D-26: Web driver — raw Playwright + Flutter semantics](decisions/testing.md#d-26-web-driver--raw-playwright--flutter-semantics) — _testing_ - [D-27: Startup regression gate](decisions/testing.md#d-27-startup-regression-gate) — _testing_ - [D-28: Test organisation — mirror `lib/` in `test/`](decisions/testing.md#d-28-test-organisation--mirror-lib-in-test) — _testing_ diff --git a/governance/decisions/architecture.md b/governance/decisions/architecture.md index 963f494a..d845c75f 100644 --- a/governance/decisions/architecture.md +++ b/governance/decisions/architecture.md @@ -73,7 +73,7 @@ Core, rendering, IPC, kernel, panel manager. ### D-10: State management — `ChangeNotifier` + `ListenableBuilder` - **Date:** 2026-04-21 - **Decision:** Per-feature state uses `ChangeNotifier` exposed through a feature facade (singleton-per-kernel); widgets subscribe via `ListenableBuilder`. No Riverpod, Provider, BLoC, or Redux. -- **Rationale:** SDK-shipped, zero deps, trivial to fake in tests (hand-rolled fakes in [D-25](testing.md#d-25-mocks--mocktail-at-io-hand-rolled-fakes-for-changenotifiers)). Violates [D-31 prefer-zero-deps](tooling.md#d-31-prefer-zero-deps-exact-pin) otherwise. See [R-8](../rejected/architecture.md#r-8-riverpod--provider--bloc-for-state). +- **Rationale:** SDK-shipped, zero deps, trivial to fake in tests (hand-rolled fakes in [D-25](testing.md#d-25-mocks--hand-rolled-fakes-throughout-mocktail-dropped)). Violates [D-31 prefer-zero-deps](tooling.md#d-31-prefer-zero-deps-exact-pin) otherwise. See [R-8](../rejected/architecture.md#r-8-riverpod--provider--bloc-for-state). - **Cost:** No codegen ergonomics; manual `notifyListeners()` discipline. The `ListenableBuilder.listenable` contract rejects rebuilds outside the subscribed notifier — intentional. - **Raised by:** 2026-04-21 planning. diff --git a/governance/decisions/testing.md b/governance/decisions/testing.md index fe5c7858..6a262ab5 100644 --- a/governance/decisions/testing.md +++ b/governance/decisions/testing.md @@ -18,10 +18,10 @@ Test pyramid, drivers, client-side constraint. - **Cost:** Goldens have zero real text; layouts rely on widget tests. Acceptable. - **Raised by:** 2026-04-21 planning. -### D-25: Mocks — mocktail at IO, hand-rolled fakes for ChangeNotifiers -- **Date:** 2026-04-21 -- **Decision:** `mocktail 1.0.4` mocks IO boundaries (sockets, processes, `dart:io` File/Directory). `ChangeNotifier` facades get hand-rolled fakes — tiny classes that extend `ChangeNotifier` with test-controlled setters. No `mocktail` for notifiers. -- **Rationale:** Mocking a `ChangeNotifier` with a generated mock hides subscription bugs — `notifyListeners` becomes a mock call instead of actually firing. Hand-rolled fakes exercise the real subscription machinery. +### D-25: Mocks — hand-rolled fakes throughout; mocktail dropped +- **Date:** 2026-04-21 (amended 2026-06-12) +- **Decision:** Test doubles are hand-rolled fakes — tiny classes that extend the real base (`ChangeNotifier` facades, `StreamJsonProcess`, `DaemonClient`) with test-controlled setters. **Amendment (2026-06-12, T-385):** `mocktail` was originally pinned for IO boundaries, but after the T-91 coverage drive it had zero imports — every IO seam ended up with an injected hand-rolled fake (`FakeDaemonClient`, fake process factories, recording event sinks) instead. The unused dep is dropped; the no-mocks-for-notifiers rule stands and in practice covers IO seams too. +- **Rationale:** Mocking a `ChangeNotifier` with a generated mock hides subscription bugs — `notifyListeners` becomes a mock call instead of actually firing. Hand-rolled fakes exercise the real subscription machinery. The same held at IO seams: constructor-injected fakes kept tests on real control flow. - **Cost:** Roughly 20 lines per fake. Rounds out to less code than configuring a mocktail whenCall chain. - **Raised by:** 2026-04-21 planning. diff --git a/pubspec.lock b/pubspec.lock index d782da07..bd98a95e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -338,14 +338,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" - mocktail: - dependency: "direct dev" - description: - name: mocktail - sha256: "5e1bf53cc7baa8062a33b84424deb61513858ea05c601b8509e683815b5914aa" - url: "https://pub.dev" - source: hosted - version: "1.0.5" node_preamble: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1863baf2..313edbfe 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,7 +69,6 @@ dev_dependencies: # Held at 1.31.0: flutter_test SDK-locks the resolvable ceiling here # (1.31.1 is latest but not reachable under our Flutter pin). test: 1.31.0 - mocktail: 1.0.5 # Held at 0.12.1: 0.13.0 disabled anti-aliasing on text painting, which # churns every golden. Dev-only, no advisory — defer the golden re-baseline # to its own change (T-353).