11 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 57ed5756c4 ci: unblock cargo audit on zbus 5, redact pip 26's finished progress bar, hold rfd at 0.16 (#84)
Three things have kept CI red since 2026-10-18; none touches the shipped program.

- **cargo audit** (required on every PR, and the daily Security scan) fails on
  RUSTSEC-2026-0370/0371/0372: zvariant, zbus_names and zvariant_derive were folded into
  zbus 6 on 2026-10-16 and marked unmaintained the same day. zbus reaches the tree only
  through tauri-plugin-opener and tauri-plugin-single-instance, for D-Bus on Linux;
  `cargo tree -i zbus --target x86_64-pc-windows-msvc` prints nothing. Every release of both
  plugins, the 3.0 alphas included, still requires zbus ^5.9, so there is no update to take.
  Ignored individually in .cargo/audit.toml with that reason and a removal condition.
  `cargo audit --deny warnings` is clean locally.

- **The Monday fixture-drift job** failed on pip/build-backend-failure/stdout.txt: pip 26
  ends a finished bar with the bare elapsed time, not `eta 0:00:00`, so `_is_progress` let
  the transfer rate through (15.1 MB/s committed, 75.1 MB/s on the next runner). The rule now
  keys on a trailing time token. Old vs new over every committed fixture line: exactly this
  one line changes verdict. The fixture is restored to `<PROGRESS>` in binary mode, 7 CRLF
  before and after; its blob is again b349d1f, the pre-pip-26 bytes.

- **rfd**: Dependabot's 0.17.2 bump (#83) adds a second rfd to the binary, because
  tauri-plugin-dialog 2.8.3 requires ^0.16 and src-tauri depends on rfd only because the
  plugin already compiles it. dependabot.yml now ignores rfd >= 0.17 until the plugin moves.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 06:37:19 +00:00
poli0981andClaude Opus 5.5 87dcb3452f fix(spikes): scrub progress bars line by line, not with a backtracking regex
SonarCloud's PR analysis flagged the progress-bar regex in capture.py's redaction again (S8786,
super-linear backtracking) — the second regex form of this rule it has flagged. A per-line test
cannot backtrack at all. It replaces exactly the lines the regex did on the LF text
`subprocess.run(text=True)` produces, checked against seventeen sample lines including the edge
cases (no space after the dashes, trailing whitespace, several "eta"s, a final line without a
newline); no committed fixture changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:55:27 +07:00
poli0981andClaude Opus 5.5 12bf723daa ci: failures reach someone, audits run on what is merged, releases are attested
- notify-ci-failure.yml lists its workflows by name. `workflows: ['*']` is not a wildcard to
  workflow_run: it matched nothing, so `main` was red from 2026-09-23 with no one told.
- cargo audit runs a prebuilt cargo-audit (taiki-e/install-action, pinned by commit) with
  `--deny warnings`, replacing rustsec/audit-check@v2 - Node 20, a check-run write token, and on a
  pull request a failure only for "critical", which is how September's advisories passed every PR.
  .cargo/audit.toml's contract (a new informational advisory fails CI) is now what runs.
- security-scan.yml: both audits daily against `main`, so an advisory against something already
  merged is reported the day it is published, not at the next PR.
- cargo deny (licences, sources, bans) with deny.toml: the licence allowlist makes "every bundled
  licence is GPL-3.0-compatible" a test. The workspace declares `publish = false`, which it never
  had - and without which cargo-deny judged the app crates as published ones.
- CodeQL analyses rust and actions as well as javascript-typescript. The comment saying CodeQL had
  no Rust support stopped being true in 2025.
- ci-node.yml: Pages and id-token write move from the workflow to the one job that needs them
  (Sonar S8233); the audit installs with --ignore-scripts (S6505); a new `tauri lockstep` job
  fails when a Tauri crate and its npm package drift apart on Cargo.lock and package-lock.json.
- release.yml: build (read-only token, no persisted credentials) and publish (attest + draft) are
  separate jobs; the tag must match all five version fields; SHA256SUMS.txt is LF, which
  `sha256sum -c` elsewhere needs; actions/attest-build-provenance attests the .exe and .msi;
  softprops/action-gh-release is pinned by commit; `workflow_dispatch` with `dry_run` builds any
  ref without attesting or drafting.
- ci-integration.yml also runs for the CLI, exec, audit, release metadata, errors, store, index,
  Cargo.lock and rust-toolchain.toml - every one of which its end-to-end steps run through.
- dependabot.yml: cooldowns, a group per ecosystem for Tauri packages and for actions and pip,
  TypeScript held below 6.1 (typescript-eslint's peer range), and the rust-toolchain ecosystem.
  A multi-ecosystem group would put both Tauri halves in one PR, but what it does to dependencies
  outside its patterns is undocumented; the lockstep job covers the gap instead.
- Sonar: NOSONAR with reasons on the dev scripts' argv and PATH lookups; bundle-cli.mjs no longer
  claims to run from beforeBuildCommand. The dev CSP moves out of index.html into a Vite plugin
  that reads devCsp from tauri.conf.json, so a release build carries one policy, the strict one
  (S7039); checked in the dev server, where React Refresh's preamble still runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:55:27 +07:00
poli0981andClaude Opus 5.5 2b07d4057b test(fixtures): the drift gate measures engines, not PyPI
The weekly re-capture has failed seven Mondays running (since 2026-08-31), and for most of them no
engine had changed at all:

- `clean-upgrade` asked for the *latest* idna, so 3.18 → 3.20 was "drift". Pinned to idna==3.10.
- pip's "(from versions: …)" listed every scipy release, so the requires-python fixture grew with
  each one. Redacted, like the release notice before it; no classifier reads it.
- The capture never upgraded pip: every venv ran the CPython-bundled 25.0.1 while 26.2.1 was
  current, so the job meant to catch a pip output change could not see one. `venv.create(...,
  upgrade_deps=True)`, and the report's `pip_version` is redacted because it now moves with each
  pip release (provenance still records it).
- `python-version: '3.12'` floated with the runner image, and the Python patch is recorded in both
  engines' output. Pinned to 3.12.10, the version every committed fixture was captured with.

The job now uploads what it captured whether or not the gate passes, so a real drift is fixed by
reviewing and committing exactly those bytes. `capture.py` also refuses an unknown `--only` name
(it used to capture nothing and exit 0) and exits 1 when nothing was captured; its two
backtracking-prone patterns (SonarCloud S8786) became a `[ \t]` class and a `partition`.

The other half of the red was real: uv 0.13.0 (2026-10-09) replaced its miette rendering — `×`,
`╰─▶`, "Caused by:" — with "error:" / "cause:". `UV_MIN_VERSION` is 0.10, so both renderings stay
under test: the current captures are frozen as `uv-0.11/` (uv 0.11.32, byte-identical copy) before
`uv/` is re-captured against the newest uv. The disposable-venv suite also stops running twice on
Monday mornings (the drift cron matched it too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:55:27 +07:00
poli0981andClaude Opus 5 2068f73f6a fix(fixtures): redact pip's release notice, which broke the drift gate weekly
pip's "[notice] A new release of pip is available: 25.0.1 -> 26.1.2" is a statement
about what is on PyPI today, not about anything the engine did, so it moves with
every pip release. `redact()` stripped the disposable venv path out of the *next*
line and left this one alone, so the weekly re-capture job failed on 2026-08-17 the
moment pip 26.2.1 shipped — across all nine pip fixtures carrying the line, not just
the one the truncated log happened to show.

Both halves go. The installed version is already in capture-provenance.json, and a
runner whose bundled pip moves would otherwise re-break this the same way. Safe for
the usual reason: no CLASSIFIERS entry reads a version out of stderr. The unit test
that proves the notice is not a failure keeps its real-pip literal, because what it
asserts about is what pip actually emits.

Also re-blesses one byte: uv's build-backend-failure stderr now ends with a newline.
Taken from the CI capture rather than a local one — uv is not on PATH here and that
scenario needs a numpy sdist build. Only two fixtures lacked a trailing newline, and
the other is report-encoding-crash, which is host-dependent and skipped in bulk runs,
so normalising inside redact() would have rewritten a fixture nothing re-captures.

One trap worth recording: `sed -i` under Git Bash rewrote every one of these files
in text mode and stripped the CRs, which is exactly the byte-exactness .gitattributes
`-text` exists to protect. The re-bless was redone in binary, asserting the CRLF
count is unchanged per file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 09:05:59 +07:00
poli0981andClaude Opus 5 9407bf23ff fix(spikes): three faults the first real drift run exposed
The `-diff` fix earned its keep immediately: the drift job's diff was readable for
the first time, and named all three of these.

1. The path regex ate prose. pip's --report JSON embeds package descriptions, and
   "Some things HTTP Core does do:\n\n* Sending HTTP requests." reads as drive `o:`
   followed by `\n` path segments, so the match swallowed the rest of the
   description. Require a non-alphanumeric before the drive letter -- that is what
   distinguishes a path from prose. Verified against both the corrupting input and
   real paths in raw, quoted and JSON-escaped form, then re-captured from live
   engine output so the descriptions are whole again.

2. pip's --report echoes the PEP 508 environment markers, which carry the host OS:
   "platform_release": "11" on a dev machine against "2025Server" on the runner,
   and a "platform_version" build number that moves with every Windows update.
   Machine identity, not engine behaviour. The interpreter version markers are
   deliberately left alone -- those can change a resolution, so a diff there is
   worth a human look.

3. report-encoding-crash cannot be re-captured on CI. The SP-2 UnicodeEncodeError
   needs a cp1252 console and a runner's is already UTF-8, so re-capturing there
   recorded an ordinary successful report and destroyed the only evidence of the
   blocker that shaped every pip invocation PipDock makes. Scenarios now carry a
   `reproducible` flag; host-dependent ones are skipped in a bulk run and print why,
   and are still capturable by name with --only.

Also renormalized the eight synthetic meta.json blobs. They were committed as CRLF
under the old blanket `-text`, and the new `*.json text eol=crlf` rule made git want
to renormalize them on every status -- a permanent phantom diff in the drift gate.

Verified on a real runner: run 30458056313 is the first green fixture-drift job,
re-capturing against the newest pip and uv and matching the committed fixtures
byte for byte. Locally, two full capture passes over both engines differ in 0 of 96
files, no machine-specific content anywhere in the tree, 183 tests green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 21:13:36 +07:00
poli0981andClaude Opus 5 4066aa63d4 fix(spikes): make fixture captures reproducible, and stop leaking $HOME
The weekly fixture-drift job has never been able to pass, and could not have.
Every capture built its venv in a `mkdtemp` directory whose name carries a random
suffix, and `redact()` replaced only the temp *root*, so the suffix survived into
every committed sidecar. A 100% false-positive rate, independent of any engine
release.

Four more sources of churn were underneath it, found by running the captures twice
back to back rather than by reasoning about them:

  - pip's "[notice] To update, run: <venv>\Scripts\python.exe" embeds the venv
    path -- which also shipped the capturing user's home directory to a public repo
  - CPython object addresses in urllib3 retry warnings, moved by ASLR
    ("<HTTPConnection object at 0x000001A92FBCFBC0>")
  - pip's download progress bar, which carries a transfer rate and an ETA
  - uv's per-phase timings ("Resolved 3 packages in 775ms")

Plus two absolute interpreter paths that can never match a re-capture on CI, where
Python lives in hostedtoolcache rather than under the user profile, and pip's cache
state, which turns "Downloading numpy-1.19.5.zip (7.3 MB)" into "Using cached ..."
depending on what the machine happened to have. A runner is always cold; a dev
machine is usually warm.

So: redact all of it, capture cache-free so both sides take the download path, and
split the sidecar by what each half is for. meta.json is the contract the gate
watches; capture-provenance.json records engine and interpreter versions and argv,
churns on every release, and is excluded from the gate by pathspec -- still
committed, so `git diff` always tells you which engine produced the current bytes.

This is the one place fixtures are not literal engine bytes, against the letter of
TESTING section 1. It is safe because nothing reads a path or a duration out of
them: every CLASSIFIERS entry in errors/catalog.rs keys off message text, and the
uv adapter only tests contains("Resolved "). Line endings are untouched -- `-text`
is what protects those. Verified: 173 tests green, and two full capture passes over
both engines differ in 0 of 96 files.

Two smaller things in the same area, both of which hid the problem:

  - .gitattributes set `-diff` as well as `-text` on the fixture tree. `-text` is
    what preserves the CRLF bytes the comment argues for; `-diff` only suppresses
    the textual diff, so the drift job's own diagnostics could report nothing but
    "Binary files differ". Scope byte-exactness to the .txt captures and let the
    JSON sidecars be diffable.
  - the "weekly, daily would be rude" drift job matched the nightly cron, the only
    one in the file, so it ran nightly. Give it its own '17 4 * * 1', and drop the
    run_attempt guard -- re-running is how you reproduce a drift failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 20:26:01 +07:00
poli0981andClaude Opus 5 7a30e635f7 feat(core): subprocess layer and error classifiers
Two pieces of M1, both of which turn a documented rule into something the
code cannot forget.

exec.rs is the single chokepoint for every external command. Command
takes a program and a Vec<String> and has no path that accepts a command
line, so the "argv arrays, never a shell" rule of SECURITY section 2 is
structural rather than a convention. Command::python() applies the SP-2
UTF-8 mitigation unconditionally, so no future call site can reintroduce
the pip --report crash by forgetting it. canonical_interpreter() case-
folds on Windows, which is the SP-6 finding about pins and snapshots
splitting in two.

The classifiers are driven by the captured corpus rather than by strings
someone typed into a test, and writing that gate immediately paid for
itself by failing on four real defects:

- uv reports an unknown package *through* its resolver, so not-found was
  classified as a version conflict. That would send users hunting for a
  constraint problem that does not exist.
- uv hard-wraps its diagnostics, so "was not found in the package\n
  registry" never matched as a literal. The classifier now collapses
  whitespace before matching, which makes every multi-word pattern
  wrap-proof.
- pip prefixes unrelated failures with "Ignored the following yanked
  versions", which hijacked the Requires-Python fixture as a yank. The
  yank rules are removed entirely: a yank is not a failure at all, since
  both engines exit 0 and install the release. It is detected
  structurally by the plan parsers and shown as a preview warning.
- Five catalog codes had no evidence of any kind.

On coverage: two codes moved to the internally-raised table because
that is where they genuinely belong, not to dodge the gate. PD-PKG-001
is raised by compat before an engine runs, and PD-ENV-002 is caught from
probe.py's externally_managed field at step zero. The PEP 668 scenario is
removed from the harness with its reasoning: the marker only applies
outside a venv, deleting pyvenv.cfg to fake that just breaks the venv
launcher, and planting it in a real system Python is not something a
fixture script should do to a developer's machine.

Two conditions that WERE reproducible are now real captures rather than
guesses: PD-NET-001 via an unreachable index, and the uv phrasing for it,
which needed three patterns pip does not use. The remaining eight are
synthetic, each flagged, justified, and carrying what would replace it;
a test enforces that labelling so they can never be mistaken for
evidence of real engine behaviour.

58 tests, clippy -D warnings clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 19:07:32 +07:00
poli0981andClaude Opus 5 4ab948ac7b feat: implement the two owner decisions from spike week
Requires-Python is now enforced by PipDock, not by the engine.

SP-2 found the engines disagree: scipy 1.7.3 declares >=3.7,<3.11, and on
Python 3.12 pip refuses it while uv plans to install it. G5 promises one
behaviour across heads, so the preview must not change shape because the
user flipped the engine radio. crates/pipdock-core/src/compat.rs screens
every candidate against the environment's version before any engine
command runs; rejects surface as PD-PKG-001 with the required range shown
against the found version.

This does not weaken "explain, don't reimplement" — resolution stays
entirely the engine's. compat.rs only filters candidates the engine should
never have been offered, using the slice of PEP 440 that actually appears
in Requires-Python: comparison, wildcard and compatible-release operators.
Specifiers it cannot parse count as compatible, because PipDock failing to
read metadata must never be the reason an installable package is refused.
Nine tests, including the exact scipy case the spike captured and the
boundary cases where an off-by-one would reject a supported Python.

probe.py keeps -I, and the cost is disclosed rather than hidden.

Isolated mode is what stops a poisoned environment injecting code into the
probe, so it stays; dropping to -E was rejected because a package in user
site is part of the untrusted surface the isolation exists to exclude, and
probing twice was rejected as a second interpreter start per scan for a
non-primary case. Instead probe.py now reports hidden_user_site — the
user-site path when it exists, sits off sys.path and is non-empty, else
null. Verified: the system Python reports the path (352 dists), a venv
reports null. The Installed screen shows a note naming the path only when
it is non-null, so users of the affected case are told exactly what is
missing while everyone else sees nothing.

ERROR-CATALOG PD-PKG-001 changes from a stderr classification to a
PipDock-raised code, because engine stderr cannot support it: pip reports
it as plain "No matching distribution found", indistinguishable from
PD-PKG-002, and uv does not enforce it at all.

Docs updated: ARCHITECTURE 3 and 4, DATA-FLOW 2, SECURITY 2, UI-SPEC 4,
ERROR-CATALOG 2, ROADMAP, CLAUDE.md, spikes/README.md. EN and VI strings
added for both notes.

Two non-blocking questions remain in spikes/README.md: search-ranking
scope for M1, and how to obtain the five error fixtures this machine
cannot produce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 18:38:46 +07:00
poli0981andClaude Opus 5 ab4d55ea0c feat(spikes): run Phase 0 spike week, SP-1 through SP-6
18 fixtures (9 scenarios x 2 engines) plus a reproducible capture harness.
Findings written up in spikes/README.md and summarised in the ROADMAP
Phase 0 table. Verdict: GO for shipping both engines, but for a different
reason than the roadmap anticipated.

SP-1 asked whether uv's plan output is too lossy to ship uv in v1.0. The
question turned out to be the wrong shape. Neither engine holds packages
back on `install -U <pkg>` — seeded with httpx 0.23.0, which requires
httpcore<0.16, both pip and uv plan httpcore 1.0.9 and exit 0, silently
breaking it. Restating the installed set as explicit requirements is what
produces the correct held-back plan. That makes it a hard requirement on
both adapters, not an optimisation: without it PipDock would preview a
plan that breaks the environment. uv also writes its entire plan to
stderr, and its conflict attribution is markedly better than pip's — uv
names the exact blocking constraint where pip says only that versions
conflict.

SP-2 found a blocker. `pip install --dry-run --report -` crashes with
UnicodeEncodeError on Windows under cp1252, because pip routes the report
JSON through vendored rich and the console codec. Confirmed on pip 25.0.1
and 26.1.2, so it is current, not legacy. It is data-dependent — an
all-ASCII report succeeds — which means it would pass local testing and
fail on users' machines. PYTHONIOENCODING=utf-8 plus PYTHONUTF8=1 fixes
it, and the crash is kept as a fixture so a regression is recognisable.
Also: yanked releases exit 0 in both engines, so PD-PKG-003 belongs in
the preview as a warning rather than in the failure path the catalog
implies; and the two engines disagree on Requires-Python enforcement.

SP-3 passes: 858k projects, 2.95s cold refresh against a 60s budget,
42.1ms worst keystroke against 50ms. But only in memory — scanning
SQLite per keystroke costs 218ms, four times over. Two cautions recorded:
16% headroom on fast hardware is thin for the low-end VM the spike asked
about, and raw nucleo ranking puts requests-ntlm above requests, so the
Search screen needs an exact/prefix boost to be usable.

SP-4 confirms SECURITY section 6 as written: --path cannot combine with
--no-deps, so freeze-file mode is the only option for a foreign env.

SP-5 is answered by SP-1 — no engine reports held-back items at all, so
resolved version, latest version and blocker must all be derived by
PipDock, for pip as much as for uv.

SP-6 avoided two identity bugs. `uv python list` returns downloadable
entries and shims that duplicate real interpreters, and the same
interpreter reports different path casing depending on how it was
launched, so env_hash must lowercase on Windows or a single environment
silently splits its pins and snapshot history in two. Microsoft Store
Python is not installed here and remains unverified.

Four decisions are queued for the owner at the end of spikes/README.md;
two of them change adapter behaviour and should land before M1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 18:04:37 +07:00
poli0981andClaude Opus 5 c4fe1c34e6 feat(core): scaffold the Cargo workspace, core crate and CLI surface
Phase 0 scaffold per ARCHITECTURE section 2. Everything compiles; nothing
resolves or mutates yet.

Implemented rather than stubbed, because the spikes need them and they are
the parts the invariants rest on:

- errors/catalog.rs: all 30 launch codes with their wire forms, plus tests
  that the wire codes are unique and match the PD-<AREA>-<NNN> grammar.
  Code::ALL drives the future "no code without fixture" gate.
- model.rs: PkgName::parse does PEP 508 validation and PEP 503
  normalization. This is the only way a name reaches an argv array, which
  makes SECURITY section 2 structural rather than aspirational; the test
  table rejects flags, separators and quoting attempts.
- probe.py: stdlib-only, Python 3.10 floor, per ARCHITECTURE section 4.
- The pip/uv argv builders, with tests asserting one token per argument.
- ExecutionSummary::tally, so the "13 successful, 2 failed" headline is
  derived from the rows rather than accumulated alongside them.

Stubbed with todo!() and a pointer to the milestone that fills them: the
Engine trait impls, discovery, index, graph, snapshot, pins, health.
UvEngine::parse_dry_run stays unimplemented on purpose — SP-1 must pin
uv's text plan format before anything parses it.

Two findings recorded in spikes/README.md:

- probe.py under -I hides user-site packages: 352 dists vs 376 without it
  and 375 from pip list, on a non-venv system Python. Venvs are unaffected.
  The fix trades a documented security control against list accuracy, so
  it is left as an open SP-6 decision rather than settled here.
- Python 3.14 deprecates subscripting absent metadata headers, which wrote
  DeprecationWarning to stderr on most distributions. probe.py now uses
  .get(); the probe must stay stderr-clean because noise reads as
  PD-ENV-003.

rusqlite is held at 0.37: 0.40 pulls libsqlite3-sys 0.38.1, whose build
script needs the unstable cfg_select! and will not build on stable 1.94.1.
Recorded in the ARCHITECTURE version manifest.

cargo fmt, clippy -D warnings and 23 tests are green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 17:25:56 +07:00