13 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 2539950cd5 fix: what an independent review of 1.6.0 found
A venv made with --symlinks is run and stored as itself, not as the base
Python its python.exe links to: validate_interpreter returned the
canonical path, so `--env .venv update --all --yes` would have changed
the system Python. Canonicalizing now only decides where a link leads
and whether it is PipDock's own; a link to another program is refused,
and a Microsoft Store alias (os error 1920) is judged by its own path.

The GUI merges and removes an added row by its path rather than by
envHash, which follows links: a re-add replaces a broken row, removal
sticks for an entry whose file is gone (a share), and neither runs
during a scan. Added entries are validated again on every listing in
both heads (envs::probe_listed), and the CLI checks its stored default
when it uses it. `env remove` makes a typed path absolute first.

SECURITY section 2 and env_probe's doc claimed an enforcement point over
IPC; they now say what is checked, and backlog X36-b records the rest.
notify.yml reports a Triage failure on a pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:22:12 +07:00
poli0981andClaude Opus 5.5 cfa5b4e1be docs: Add interpreter… in the specs, ACCESSIBILITY.md and the privacy policy
PRD P0-1, UI-SPEC §4, CLI-SPEC (env add/remove, their JSON, --env's new
refusal), CLI-GUIDE, ERROR-CATALOG (PD-ENV-001's new cases, and the
first button its advice ever had) and TESTING's golden count. SECURITY
§2 claimed for two milestones that interpreter paths were canonicalized
before use while the only check was existence; it now describes the
validator that makes it true. PRD also records P0-9's first-run uv
detection, P1-7 and P2 as not planned in maintenance mode.

legal/PRIVACY-POLICY.md 1.3 names the interpreter paths a person adds,
kept until removed, in both languages. With the repository URL it
already changed, the first-run gate shows once in 1.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:22:12 +07:00
poli0981andClaude Opus 5.5 ccae96dbeb chore: move to poli0981org — self-contained CI, Qodana, an npm licence gate, this week's dependencies (#119)
The repository now lives in the poli0981org organization, and this makes it at home there.

- main was red since 2026-11-18: RUSTSEC-2026-0543 (chrono), in Cargo.lock only through serde_with's weak features and compiled into nothing; ignored with its reason and exit condition.
- Supersedes #113–#118 (Rust 1.100.0, rusqlite 0.42.0, Tauri 2.12.6, code-health pins, actions, npm) plus jsdom 31.0.1; minimatch 11 closes GHSA-g3hv-75wg-m249. rfd 0.18 (#112) is held again until tauri-plugin-dialog moves.
- Dependabot's tauri groups never worked (it picks the most specific group); exclude-patterns on the catch-alls fix it.
- CI is self-contained: no workflow calls poli0981/.github; every action is pinned by commit; notify.yml vendors the Discord notifier.
- npm licences: scripts/check-licenses.mjs, deny.toml's allowlist for the npm half. Required, with cargo deny and tauri lockstep — eight required checks.
- Qodana in two parts (Rust, TS/JS), full scans, a triaged Rust baseline, fail on anything new. The Rust container needed its toolchain and CARGO_HOME pointed somewhere writable before it analysed anything.
- SonarQube Cloud analyses into poli0981org_pipdock; every npm ci runs with --ignore-scripts (S6505).
- Every repository URL points at the organization. README's attestation command for 1.4.0/1.5.0 had stopped working; it now says --owner poli0981 --signer-repo poli0981/pipdock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:50:41 +07:00
poli0981andClaude Opus 5.5 093ea4fce4 build(deps): dependencies to latest; classify pip 26.3's backend-unavailable (#102)
- cargo update (~60 bumps, 627 -> 616 crates) clears the yanked async-executor 1.14.0 that
  had turned cargo audit red on main and on every Dependabot PR since 2026-11-03 (Linux-only,
  never in the shipped binary). rusqlite 0.41.1 (SQLite 3.54.1), no code change. rfd 0.17 with
  tauri-plugin-dialog 2.8.4, which met the rfd ignore's own condition, so the ignore goes.
- npm: thirteen packages to latest; TypeScript still held at 6.0.3 (typescript-eslint peers <6.1).
- Tools: ruff 0.17.3, certifi, msgpack, platformdirs; constraints regenerated.
- Actions: taiki-e/install-action v2.87.32, sonarqube-scan-action v8.4.0; Node 24 -> 26 LTS.
  "Latest" means the newest release past each ecosystem's Dependabot cooldown.
- pip 26.3 renders an unloadable build backend as `error: backend-unavailable`, which fell
  through to PD-BLD-003; a classifier rule restores PD-BLD-002. Found by the drift job; live
  corpus re-captured with pip 26.3 / uv 0.13.7, the 26.2.1 capture frozen as pip-26.2/, and a
  test holds both renderings to one code.
- Docs: ARCHITECTURE §10 re-verified, ERROR-CATALOG, TESTING, ROADMAP, CLAUDE.md.

Supersedes #97, #98, #99, #100, #101.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 10:21:48 +07:00
poli0981andClaude Opus 5.5 7124227262 docs: the specs say what the code does; 1.4.0 recorded, with its audit backlog
Every spec checked against the code rather than against itself, in four passes that each read the
branch's commits and then the source:
- CLI-SPEC/CLI-GUIDE: one JSON document per command (with the per-command table and the paths
  that print nothing), environment selection, logging, Ctrl-C and exit 130, the prompts as they
  are rather than the [A]bort and countdown that never existed, `.heldBack`, a `pipdock audit`
  section, and the rules every mutating command now follows.
- ARCHITECTURE/DATA-FLOW/ERROR-CATALOG: the Engine trait's real signatures, Requires-Python's
  three checkpoints, store v4 and the log folder, §7's return types and events, the state machine
  with re-probing and Force latest, where each §9 invariant is enforced, and 35 codes in 32 rows.
- SECURITY/TESTING/RELEASE-CI/CODE-HEALTH-SPEC: the PEP 668 override as built, four browser hosts
  and the exact capability set, attested releases, the new CI, the tools constraints, and test
  tiers that describe what runs rather than what was planned.
- UI-SPEC/PRD/README/I18N: the screens as they render, the keyboard, tokens and their contrast
  sweep, the feature matrix's status, attestation instructions, and I18N's one stated exception.

ROADMAP gets the 1.4.0 record — what was wrong, what running found that reading did not, what was
deliberately not done — and the **Audit backlog**: every finding not fixed, with where it is and
why it waited. CLAUDE.md's counts and contradictions are corrected, with the rules this release
left behind. changelog/1.x.md has the 1.4.0 entry, including "Changed for scripts" and "You will
see this once". AI-DISCLOSURE, README and About say which model and who released what. The legal
documents' effective date moves to the release date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:55:27 +07:00
poli0981andClaude Opus 5.5 2b4681954b feat(errors): PD-ENG-004 for an engine watchdog; WinError rules match exactly
**PD-ENG-004 `EngTimedOut`.** Every engine command shares one watchdog, and when it fired the run
reported PD-INT-001 — "PipDock hit an internal error" — for an sdist build that was simply still
compiling, and in the batch phase that error aborted the whole run with no summary and no
per-package retry. A timeout is a fact about the engine, not a PipDock bug, so it gets its own
code. Raised by PipDock, never classified from stderr, so it joins the `internally_raised` table of
the corpus gate. The exec layer starts producing it in the next commit.

The nine places: the catalog variant (`as_str`, `area`, `ALL`), both count tests (34 → 35), the
corpus gate, both `errors.json` catalogues, `codes.json` and `generated.ts` (regenerated, not
edited), the ERROR-CATALOG row (31 → 32 rows), and the five schema goldens that embed `Code` —
`Code`, `StepResult`, `ExecutionSummary`, `HealthReport`, `AuditReport` — each re-blessed for
exactly one new `const`, which is the contract change this is.

**WinError needles include the closing bracket.** Python prints `[WinError N]`, and the bare
"winerror 5" also matched 50, 53 and 59: `[WinError 53] The network path was not found` came out
as PD-PRM-001, "use a venv". `[WinError 53]` and `[WinError 10013]` (a firewall refusing the
socket, raised *as* a PermissionError) now classify as network failures, ahead of the permission
rules that would otherwise take them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:55:27 +07:00
poli0981andClaude Opus 5 91ba7bcc19 feat(core): the dirty tree, the third waiver, and PD-PRM-003
`health::fix` — everything that gates PipDock's **first write outside site-packages and
`%LOCALAPPDATA%`**.

DATA-FLOW §9.1 and §9.2 do not reach it. Both are scoped to a mutating **engine** call, and
ruff is a tool run from PipDock's own venv; more to the point, a fix rewrites the user's
*source tree*, which no snapshot in this application describes. A snapshot is a freeze and
§8's rollback is uninstall-the-added/install-the-removed, so one taken to protect source
files would have no consumer that could use it — invariant 2's own argument for the pip
upkeep exemption, a second time. The safety net CODE-HEALTH-SPEC §5 names is the user's own
version control, which is why the dirty finding lives *inside* `FixConsent` rather than
beside it.

`consent_ok` builds the waiver from what the **server** observed, so a frontend claiming a
clean tree against one the server just found dirty is refused. Same shape as `ack_ok`
checking a `GuardAck` against the guard that produced it. A tree that *was* dirty and is
clean by the time the fix runs needs no acknowledgement — the thing waived no longer exists,
and refusing there would cost the user the fix for having committed.

`git --no-optional-locks status --porcelain --untracked-files=no`, and neither flag is
decoration. Plain `git status` refreshes and **writes `.git/index`** on a stat-dirty tree —
writing into the user's repository while checking whether it is safe to write would be a
poor first act for the write path. Untracked files are excluded because `git checkout .`
restores tracked files regardless, so warning about a scratch file is how a warning stops
being read. `None` covers no-repo, no-git, git-failed and timed-out, because all four leave
the caller with the same options.

**A security question answered by running it.** This is the one place PipDock runs a
PATH-resolved program with a user-controlled working directory, so a `git.exe` planted in a
cloned repository would matter if Windows' legacy `CreateProcess` search order applied. I
planted one and watched which ran: the real git. Rust's `Command` does its own resolution and
does not include the current directory. Recorded on the function, with a note to re-check if
the process layer ever changes.

**`PD-PRM-003`, not a reused `PD-PRM-001`.** That code is scoped to site-packages and its
catalogued action is "use a venv", which is nonsense for a read-only `util.py` — the same
class of wrong answer P3 removed when a corrupted `ruff.exe` reported "install the engine".
Raised internally, so it needs no classifier, only a corpus entry.

And the real hazard is worse than mis-coding: **ruff can fail to write a file and still exit
1**, which `is_findings_exit` accepts as a clean run — so the failure can be *silent*, with
the fix reporting success over a file it never touched. `ensure_writable` therefore refuses
the whole fix before the first byte, checking both the read-only attribute and an append
probe for the ACL case. A partial rewrite of a source tree is the worst thing this design can
produce, because nothing here can undo half of one.

The checklist is **nine** places and CLAUDE.md said eight: `HealthReport` embeds `Code`
through `ToolProblem`, so a new code re-blesses four schema goldens, not three. Corrected
there, along with the count in I18N §1 that was already stale.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 19:30:12 +07:00
poli0981andClaude Opus 5 1748ea06f5 feat(errors): PD-HLT-004, for a Python that cannot make a venv
`python -m venv` spawning fine and exiting non-zero had no honest code. The tools venv
bootstrap (next commit) is the first thing that can hit it, so the code lands before the
error path that raises it rather than being retrofitted onto one.

None of the three candidates worked. PD-NET-011 is Area::Net, and run::exit_for derives
the exit code from the area — so `tools sync || wait-for-network && retry` would loop
forever on a stripped Python, and both locales' shipped copy is explicitly about
downloading. PD-HLT-001 tells the user to re-sync the tools environment, which is the
operation that just failed. PD-INT-001 is "a PipDock bug", and a Python built without the
venv module is not one. Area::Hlt already maps to exit 1, which is right.

All eight places from CLAUDE.md in one commit, because seven of them are a broken build:
the variant, Code::ALL, both count assertions (32 -> 33), classifier_corpus's
internally_raised table without which the no-code-without-a-fixture gate fails, en+vi copy
under the 90-char cap, regenerated codes.json and bindings, and the catalog doc. Three
goldens re-blessed — Code plus the two schemas that embed it, StepResult and
ExecutionSummary. ResolutionReport does not embed it and did not move.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 21:31:22 +07:00
poli0981andClaude Opus 5 33bc2f967e docs: record Stage 7, and the four items it leaves open
UI-SPEC §3 gains a definition for `⚠ n`, which its own layout diagram has drawn
since the spec was written and which nothing specified. It counts error rows
currently on screen, not a session tally — the tally reads `⚠ 47` after a batch
where 47 packages failed, stays there, and tells the user nothing the summary in
front of them does not. Flagged as invention, because it is one.

ERROR-CATALOG §4 records that the URL is built once in core and called by both
heads, and that the ring is fed from three places rather than one: a resolve
emits no progress events at all, and a plan that would not resolve is the
commonest thing anyone reports.

I18N §1 is amended rather than left describing seven namespaces the app never
had. i18next's `nsSeparator` is `:`, so a real second namespace means
`t('errors:PD-NET-001')` at every call site — churn across every screen, bought
with lazy loading a bundled desktop app cannot use. One namespace, two files per
locale, and the error codes keep their own file because they are the only keys
whose names are a contract with Rust.

ROADMAP records S7 as **substantially done with four items open**, named rather
than quietly dropped: `engine_info`, the `COMMANDS` drift gate, the `Enter` map
with focus-follows-tab and one live region, and `PdEmptyState` on three surfaces.
Phase 3's first slice needs `engine_info`, so that one is owed either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 21:46:25 +07:00
poli0981andClaude Opus 5 fc0aa4ccf6 feat(core): removing from a system Python is refused, and a guard trip is not a typo
Three refusals a removal did not have.

**PEP 668.** DATA-FLOW §2's preamble says "all mutating flows", and `UpdateFlow`
has refused externally-managed environments since S1. `UninstallFlow` did not, so
PipDock would strip packages out of a system Python it declines to *upgrade* —
the worse of the two operations, since there is no resolver standing between the
user and the damage.

**The guard was advisory.** `start` returned a `GuardReport` and `execute` ran
the engine; between those two points nothing stopped a caller from not looking.
DATA-FLOW §5's three options are a dialog, and a dialog is not an enforcement
point. `GuardAck` is, and it is a named waiver rather than a `bool` for the
reason `SnapshotProof` is: `execute(true, …)` at a call site says nothing about
what was true.

**PD-RES-004**, because the CLI printed `PD-PKG-002` — "no matching
distribution", the opposite of the truth. Every package involved exists, and that
is exactly why the removal is refused; a user grepping their logs for a typo
would have found this instead. Adding it moves both count assertions (31 → 32),
the `internally_raised` table, both locale catalogs, and three goldens —
`Code` plus the two schemas that embed it.

The exit code goes 1 → 2. CLI-SPEC §5 defines 1 as "completed with per-package
failures (see JSON `counts.failed`)", but a guard trip executes nothing, so a
script following the table reads counts that are not there. 2 is "plan aborted",
which is what happened, and it is what `exit_for` already derives from
`Area::Res` — so the binary stops disagreeing with its own mapping. Both are
non-zero, so CLI-SPEC §7's `|| echo` example is unaffected.

Verified against a real venv: the guard now prints PD-RES-004 and exits 2. The
PEP 668 gate is not reproducible here — the marker lives in the base stdlib, so
planting one would mark the machine's real Python — and it is covered by the unit
test instead, the same reason `classifier_corpus` lists PD-ENV-002 as internally
raised.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 21:46:25 +07:00
poli0981andClaude Opus 5 1bc103bc75 feat(app): the plan session, and the four commands that drive it
The architectural centre of S3. `UpdateFlow` is a **resumable state machine** and IPC is
stateless: `plan_resolve` builds the flow, the user reads the preview, and `plan_decide` or
`plan_execute` arrives as a separate message seconds later. Something has to hold the flow
in between, and that is `PlanSlot` in `AppState`.

**One plan at a time, and `PD-RES-003` when a second arrives.** Nothing structurally
prevents it — the calls are independent messages — and two concurrent plans would interleave
engine commands against one environment while DATA-FLOW §9.3's staleness check compared
against a set the other plan was busy changing. `claim()` takes the slot before any work,
and **every** exit path releases it: a claim that leaks would leave the session refusing
plans forever, which is the failure mode this design has to be careful about.

`Busy` moves the flow out rather than borrowing it, because `execute` awaits for as long as
the install takes and holding the slot's lock across that would block `plan_cancel` — the
one command that must work precisely then. For the same reason the cancellation token lives
in its own lock, held only long enough to read an `Option`.

**`UpdateFlow::start` now takes the pins, not the `Store`.** Not a tidy-up: `Store` wraps a
`rusqlite::Connection` and is `Send` but not `Sync`, so a future holding `&Store` across an
await is not `Send` and a Tauri command cannot return one. It did not compile. Reading the
pins first is one synchronous line at each call site, and the flow no longer reaches into a
database at all — it can now be driven in a test without one.

`plan_execute` returns the snapshot alongside the summary. The CLI prints the id *before*
execution because DATA-FLOW §3 draws them as distinct states; the summary sheet needs it
*after*, to offer the rollback. One envelope beats a second command to go and look it up.

`PD-RES-003` went through the whole catalog process rather than round it: the "no code
without a fixture" gate rejected it until it was listed as internally raised with the module
that owns it, and both locale catalogs carry its copy — otherwise `PdErrorRow` would show
`errors.unknown` for a condition PipDock raises itself. `Decision` joins SCHEMA_TYPES too,
since `PdConflictRow` needs the 3-way type.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 18:47:15 +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 5e8d78bb27 docs: add design documentation baseline
Commits the full v0.1 design suite written during the design phase:
PRD, architecture, data flow, UI/CLI specs, code-health spec, error
catalog, security, testing, release/CI and i18n docs, plus the roadmap.

The legal documents (EULA, disclaimer, privacy policy, third-party
notices) must be committed publicly because the in-app legal gate links
to their GitHub URLs at first run.

Also adds .gitignore, which the repo was missing.

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