Dead code, each checked for callers first:
- graph::ReverseDeps::leaves (only its own test called it), health::run::sink_for (no caller,
and a doc describing something else), SnapshotProof::id and is_waived (no caller).
- Two whitespace collapsers become one, errors::catalog::collapse_whitespace; the classifier's
normalize is that plus lowercase. Three hand-folded SHA-256 hex digests become
model::sha256_hex (build.rs keeps its own: a build script cannot use the crate it builds).
- Six copies of asPdError become one, beside isPdError in ipc/errors.ts.
- Thirteen strings no screen renders, from both catalogs (status.resolving/executing/ready,
actions.confirm/browse/retry/openLogs, env.requiresPython/unusable,
packages.updateSelectedSoon, health.notInstalled, settings.localeSystem/saved).
- fixtures.rs is compiled only for tests and for xtask (feature `fixtures`), not into release.
Half-wired, finished rather than deleted: engine_info had a typed wrapper and no caller, while
ARCHITECTURE §7 promised a version beside each engine radio. Settings now shows it for the
selected environment, and says "not found" for an engine that is not installed.
Docs that described another project: core's "Phase 0" status, model.rs's specta, pip.rs's "lands
in M1", snapshot.rs's "execute takes a Snapshot" (it takes a SnapshotProof), declared_source's
doc stranded on validate_project, the pin validators' "character-class check" (they share
pep440::is_version now), three health wrappers in ipc/index.ts each under another's doc, and
three %LOCALAPPDATA% paths missing the data\ folder.
Repo: production builds carry no source maps - Tauri embeds dist/ in the executable, so
`sourcemap: true` shipped 2 MB of them to every user (X51). .gitignore covers insta's pending
snapshots and a downloaded SHA256SUMS.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TESTING §2 wants the frontend's IPC mocked "with recorded core payloads — the same JSON as
L1 fixtures, guaranteeing UI and core agree on shapes". Hand-writing that JSON defeats the
guarantee it is asking for: rename a field in model.rs and the component tests keep passing
against a shape the app never sends.
So `cargo run -p xtask -- ipc-fixtures` serializes real `Dist`/`OutdatedDist`/`Pin` values
into `ui/src/test/fixtures/`, and a test fails when the committed files no longer match —
the same mechanism and the same reasoning as `bindings.rs`. Verified by breaking one on
purpose: the test names the file and the command that fixes it.
It has already earned itself. `PinMode` is externally tagged, so a `Hold` pin is
`{"hold":{"version":"1.26.4"}}` while an `Exclude` is the bare string `"exclude"`, and
`sizeBytes` is *absent* rather than null on the editable row. Both are things hand-written
mock JSON gets wrong, and both are exactly what the 🔒 chip and the em-dash cell have to
render.
Generated into `ui/` rather than read out of `crates/` behind a Vite alias — same choice
as `generated.ts`, and it saves a build-time path that would have to agree with
vite.config.ts.
A second test guards the fixture *contents*, not just their shape: six rows chosen so that
every rule S2's table implements has a subject — an up-to-date row for dimming, a row with
no size, both pin modes on screen at once, and two of the four outdated rows pinned so
"N pinned excluded" is a real subtraction rather than 0. Editing the scenario without
noticing is how a component test quietly stops covering the case its name claims.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ARCHITECTURE section 9 says the frontend types are "generated with
specta/tauri-specta to prevent drift". This generates them from schemars instead,
and the deviation is recorded in the module doc rather than left to be discovered.
Why not specta: it is still 2.0.0-rc, and a project that holds rusqlite at 0.37
because 0.38 needs nightly, and refuses eslint-plugin-react over a transitive
advisory chain, cannot coherently take a pre-1.0 dependency into the crate that IS
the product. It would also mean a second derive stack beside the working one --
specta::Type on ~40 types plus hand-written impls for the newtypes. Meanwhile
schemars is already a dependency, the types already derive JsonSchema, and
`pipdock schema <T>` is already a documented public contract (CLI-SPEC section 6),
so this is additive.
What is given up: tauri-specta makes drift a compile error and this makes it a test
failure. One notch weaker at roughly a tenth of the cost, and the generated file
and wrapper layer are identical either way, so adopting specta later is a generator
swap rather than a redesign.
The staleness check lives in `cargo test`, not a bespoke CI step, so it fires
locally too. Its failure names the fixing command and reports the first differing
line -- assert_eq! over 400 lines of generated TypeScript buries the one thing the
reader needs.
Two things the emitter had to get right, both found by looking at the output rather
than by reasoning about it:
- An externally-tagged variant's payload arrives as an inline object with
`properties`, which the first draft rendered as `Record<string, never>`.
`Strategy` and `Trigger` both silently lost their contents -- generated code
that typechecks and is wrong, which is worse than none. `Strategy` now reads
`'compatible' | { 'force-latest': { overrides: PkgName[] } }`, and the kebab-case
tag is quoted because unquoted it parses as a subtraction.
- A union inside an array needs parentheses: `(string | null)[]`, not
`string | null[]`.
One limitation, asserted rather than papered over: schemars marks every `Option<T>`
as not-required regardless of serde attributes, so the schema cannot distinguish
`skip_serializing_if` ("key absent") from `serde(default)` ("key present holding
null"). Both emit `?: T | null`, which is a superset of what the wire can carry and
forces the UI to handle either. Narrowing one would assert something the schema
does not say.
Codegen lives in a new `xtask` crate rather than behind a `pipdock` flag:
regenerating TypeScript is a contributor's job, not a user's, and CLI-SPEC section 3
is a contract about what users can run.
206 tests, fmt and clippy clean; npm typecheck, lint and test green over the
generated file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>