diff --git a/.github/workflows/ci-integration.yml b/.github/workflows/ci-integration.yml index 53b6879..e24a89f 100644 --- a/.github/workflows/ci-integration.yml +++ b/.github/workflows/ci-integration.yml @@ -82,6 +82,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + persist-credentials: false - name: Setup Python ${{ matrix.python }} uses: actions/setup-python@v7 @@ -399,6 +401,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + persist-credentials: false # An exact patch, on purpose. pip's report records `python_full_version` and uv prints "Using # Python 3.12.x environment", so a floating `3.12` turns every runner-image Python bump into diff --git a/Cargo.lock b/Cargo.lock index 5c708d1..959c65f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2238,7 +2238,6 @@ dependencies = [ "console", "once_cell", "regex", - "serde", "similar", "strip-ansi-escapes", "tempfile", @@ -3239,7 +3238,6 @@ name = "pipdock-core" version = "1.3.0" dependencies = [ "async-trait", - "insta", "jiff", "nucleo", "reqwest", diff --git a/crates/pipdock-cli/src/main.rs b/crates/pipdock-cli/src/main.rs index 682795b..6658777 100644 --- a/crates/pipdock-cli/src/main.rs +++ b/crates/pipdock-cli/src/main.rs @@ -99,23 +99,27 @@ pub struct GlobalOpts { #[arg(long, global = true, value_enum)] pub engine: Option, - /// Machine-readable output; NDJSON for streaming commands. + /// Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + /// + /// Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming + /// commands" until 1.4.0, when several commands printed several documents. #[arg(long, global = true)] pub json: bool, - /// Assume defaults on all prompts. Conflicts resolve to *skip*, never *force*. + /// Assume the default at every prompt: a held-back package keeps its compatible version and + /// an impossible one is skipped. Only `--strategy latest` forces. #[arg(long, short = 'y', global = true)] pub yes: bool, - /// Reduce log output. + /// Do not stream engine output to stderr. (The log file is written regardless.) #[arg(long, global = true, conflicts_with = "verbose")] pub quiet: bool, - /// Increase log output. + /// Also write the log to stderr, at debug level. #[arg(long, global = true)] pub verbose: bool, - /// Tee logs to a file. + /// Also write the log to this file. The daily log in `data\logs\` is always kept. #[arg(long, global = true, value_name = "PATH")] pub log_file: Option, @@ -174,7 +178,7 @@ enum Command { /// Install packages. Install { - /// `name` or `name==version`. + /// A name with an optional PEP 440 specifier: `six`, `six==1.16.0`, `"six>=1.16,<2"`. #[arg(required = true)] specs: Vec, /// Print the resolution report and exit without changing anything. @@ -246,7 +250,7 @@ enum Command { /// Show or set the configured engine. Engine { - /// Engine to switch to; omit to print the current one. + /// Engine to switch to; omit to list both, with versions, marking the configured one. engine: Option, }, @@ -503,7 +507,7 @@ mod tests { "--yes", "--json", "--log-file", - r"C:\logs\pd.json", + r"C:\logs\pd.log", ]) .expect("nightly maintenance example"); diff --git a/crates/pipdock-cli/src/run.rs b/crates/pipdock-cli/src/run.rs index 4e1082c..613fd7e 100644 --- a/crates/pipdock-cli/src/run.rs +++ b/crates/pipdock-cli/src/run.rs @@ -26,10 +26,10 @@ use pipdock_core::{health, index, pins, plan, report, settings, snapshot}; use crate::{EngineArg, Exit, GlobalOpts, ToolArg}; -/// Resolve which engine to drive. +/// Resolve which engine to drive: `--engine` for one invocation, else the configured one. /// -/// ARCHITECTURE §3: first run probes `uv --version` on PATH and preselects uv when present. The -/// `--engine` flag overrides for one invocation. +/// ARCHITECTURE §3 describes a first run that probes for uv and preselects it; neither head does +/// that yet (Audit backlog X19), and this deliberately does not — see the comment below. #[must_use] pub fn engine_for(opts: &GlobalOpts) -> Box { let id = match opts.engine { @@ -963,6 +963,16 @@ fn preview_text(report: &plan::ResolutionReport) -> String { } } } + if !report.yanked.is_empty() { + // PD-PKG-003 is a warning, not a failure (SP-2). Shown in JSON only until 1.4.0. + line!("\nWithdrawn releases (yanked):"); + for y in &report.yanked { + match &y.reason { + Some(reason) => line!(" {} {} — {reason}", y.pkg, y.version), + None => line!(" {} {}", y.pkg, y.version), + } + } + } if let Some(detail) = &report.impossible { line!("\nImpossible:"); line!(" {}", detail.explanation); @@ -1086,8 +1096,8 @@ pub async fn tools_sync(opts: &GlobalOpts, force: bool, python: Option<&Path>) - } }); - // A fresh token nothing trips, matching every other CLI path: the CLI installs no Ctrl-C - // handler, and the flows build their own tokens for the GUI's `plan_cancel` to reach. Killing + // A fresh token nothing trips: only the mutating commands install a Ctrl-C handler, and a + // sync is not one of them, so Ctrl-C ends the process and the sync with it. Killing // the process still tears the tree down — `exec::TreeGuard`'s job object closes with the last // handle — which is verified rather than assumed: a killed sync leaves no orphan pip. let sink = engine::ProgressSink::new( @@ -1383,8 +1393,10 @@ pub async fn health( /// `--yes` means "assume defaults", and **the default over uncommitted work is don't**. A clean /// tree proceeds: one `git checkout .` puts it back, so an unattended fix there is recoverable, /// and refusing would make `--fix` useless in the pre-commit hook the exit-code rule was written -/// for. A dirty tree — or no repository at all — refuses with exit 2, because those are the cases -/// where a script could destroy work with no way back. +/// for. A dirty tree refuses with exit 2, because that is where a script could destroy work with +/// no way back. **Outside a repository `--yes` proceeds**: `fix::dirty` answers `None` both for a +/// clean tree and for no repository, so the two cannot be told apart here. Refusing there too is in +/// ROADMAP's Audit backlog; this comment used to claim it already did. /// /// The escape hatch is deliberately **not a flag**. It is `git commit` or `git stash`, which is the /// actual remedy and leaves the user something to return to; a `--force-fix` would exist only to be @@ -1429,7 +1441,8 @@ async fn apply_fix( true } else if interactive { if let Some(tree) = dirty { - println!( + // stderr, with the prompt it introduces: under `--json` stdout carries one document. + eprintln!( "\n{} uncommitted change(s) in this repository. PipDock cannot undo a fix, and \ `git checkout .` would take your own edits with it.", tree.entries @@ -2202,13 +2215,23 @@ pub async fn engine_status(opts: &GlobalOpts) -> Result { print_json(&[&pip, &uv]); return Ok(Exit::Success); } + // The help has always said this command shows the current engine; it listed both and never + // said which one PipDock would use. + let configured = Store::open(&app_data_dir()) + .and_then(|store| settings::load(&store)) + .map_or(EngineId::Pip, |s| s.engine); for info in [&pip, &uv] { let detail = match (&info.version, info.id, &env) { (Some(v), _, _) => v.clone(), (None, EngineId::Pip, None) => "no environment selected".to_owned(), (None, _, _) => "not available".to_owned(), }; - println!("{:<4} {detail}", info.id.as_str()); + let mark = if info.id == configured { + " (configured)" + } else { + "" + }; + println!("{:<4} {detail}{mark}", info.id.as_str()); } Ok(Exit::Success) } diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-audit.snap b/crates/pipdock-cli/tests/snapshots/golden__help-audit.snap index b1adfff..07fd01e 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-audit.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-audit.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-doctor.snap b/crates/pipdock-cli/tests/snapshots/golden__help-doctor.snap index 9dc4872..8701eef 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-doctor.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-doctor.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-engine.snap b/crates/pipdock-cli/tests/snapshots/golden__help-engine.snap index 4f71073..49a12e1 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-engine.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-engine.snap @@ -8,7 +8,7 @@ Usage: pipdock engine [OPTIONS] [ENGINE] Arguments: [ENGINE] - Engine to switch to; omit to print the current one + Engine to switch to; omit to list both, with versions, marking the configured one Possible values: - pip: ` -m pip` @@ -19,19 +19,21 @@ Options: Interpreter or environment directory. Defaults to the one `env use` set, else an auto-detected `.venv` in the working directory --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-env-list.snap b/crates/pipdock-cli/tests/snapshots/golden__help-env-list.snap index cd2d76f..1c16894 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-env-list.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-env-list.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-env-use.snap b/crates/pipdock-cli/tests/snapshots/golden__help-env-use.snap index b85a6e9..0d30585 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-env-use.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-env-use.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-env.snap b/crates/pipdock-cli/tests/snapshots/golden__help-env.snap index 445c333..f87d4c3 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-env.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-env.snap @@ -23,19 +23,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-health.snap b/crates/pipdock-cli/tests/snapshots/golden__help-health.snap index f686c80..cdc5747 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-health.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-health.snap @@ -32,19 +32,21 @@ Options: Apply ruff's safe fixes. Prompts before writing --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-index-refresh.snap b/crates/pipdock-cli/tests/snapshots/golden__help-index-refresh.snap index 71415a5..dff575b 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-index-refresh.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-index-refresh.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-index.snap b/crates/pipdock-cli/tests/snapshots/golden__help-index.snap index 63a4049..8409cf3 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-index.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-index.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-info.snap b/crates/pipdock-cli/tests/snapshots/golden__help-info.snap index 7526b4d..c738d14 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-info.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-info.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-install.snap b/crates/pipdock-cli/tests/snapshots/golden__help-install.snap index 306d1e9..c6ee9ea 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-install.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-install.snap @@ -8,7 +8,7 @@ Usage: pipdock install [OPTIONS] ... Arguments: ... - `name` or `name==version` + A name with an optional PEP 440 specifier: `six`, `six==[VERSION]`, `"six>=1.16,<2"` Options: --dry-run @@ -25,19 +25,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-list.snap b/crates/pipdock-cli/tests/snapshots/golden__help-list.snap index de73145..d8ffde9 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-list.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-list.snap @@ -21,19 +21,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-pin-add.snap b/crates/pipdock-cli/tests/snapshots/golden__help-pin-add.snap index 9aeeb74..5417670 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-pin-add.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-pin-add.snap @@ -25,19 +25,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-pin-list.snap b/crates/pipdock-cli/tests/snapshots/golden__help-pin-list.snap index 12b7d19..142c177 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-pin-list.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-pin-list.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-pin-remove.snap b/crates/pipdock-cli/tests/snapshots/golden__help-pin-remove.snap index 8cfea1e..e76ae11 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-pin-remove.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-pin-remove.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-pin.snap b/crates/pipdock-cli/tests/snapshots/golden__help-pin.snap index 1c44f71..030470b 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-pin.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-pin.snap @@ -24,19 +24,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-pip-upgrade.snap b/crates/pipdock-cli/tests/snapshots/golden__help-pip-upgrade.snap index 9ee40ee..839b1cd 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-pip-upgrade.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-pip-upgrade.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-schema.snap b/crates/pipdock-cli/tests/snapshots/golden__help-schema.snap index 3e546d4..731e13f 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-schema.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-schema.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-search.snap b/crates/pipdock-cli/tests/snapshots/golden__help-search.snap index cba08d3..145df26 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-search.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-search.snap @@ -27,19 +27,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-self-report-bug.snap b/crates/pipdock-cli/tests/snapshots/golden__help-self-report-bug.snap index a88974a..fbb80eb 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-self-report-bug.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-self-report-bug.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-self.snap b/crates/pipdock-cli/tests/snapshots/golden__help-self.snap index 3116d45..f8bc321 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-self.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-self.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-create.snap b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-create.snap index 0f57bbf..e7ab700 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-create.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-create.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-diff.snap b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-diff.snap index 7356404..f0db94e 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-diff.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-diff.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-list.snap b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-list.snap index c88f533..3a9a4d0 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-list.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-list.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-rollback.snap b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-rollback.snap index 6ef2fa5..43be94e 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-rollback.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot-rollback.snap @@ -22,19 +22,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot.snap b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot.snap index f2a007e..4c4f3f7 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-snapshot.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-snapshot.snap @@ -25,19 +25,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-tools-status.snap b/crates/pipdock-cli/tests/snapshots/golden__help-tools-status.snap index bc4a919..82c2f54 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-tools-status.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-tools-status.snap @@ -18,19 +18,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-tools-sync.snap b/crates/pipdock-cli/tests/snapshots/golden__help-tools-sync.snap index 77787c9..877089f 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-tools-sync.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-tools-sync.snap @@ -24,19 +24,21 @@ Options: Build on this interpreter instead of the newest discovered one --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-tools.snap b/crates/pipdock-cli/tests/snapshots/golden__help-tools.snap index 217c5ea..e8bc782 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-tools.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-tools.snap @@ -23,19 +23,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-uninstall.snap b/crates/pipdock-cli/tests/snapshots/golden__help-uninstall.snap index c3f0cee..ded45d1 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-uninstall.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-uninstall.snap @@ -25,19 +25,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help-update.snap b/crates/pipdock-cli/tests/snapshots/golden__help-update.snap index 240b821..fea12f7 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help-update.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help-update.snap @@ -37,22 +37,24 @@ Options: Ad-hoc exclusions on top of the pin list --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. --dry-run Print the resolution report and exit without changing anything -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__help.snap b/crates/pipdock-cli/tests/snapshots/golden__help.snap index 7b1c920..80be3c4 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__help.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__help.snap @@ -40,19 +40,21 @@ Options: - uv: `uv pip --python ` --json - Machine-readable output; NDJSON for streaming commands + Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6). + + Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents. -y, --yes - Assume defaults on all prompts. Conflicts resolve to *skip*, never *force* + Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces --quiet - Reduce log output + Do not stream engine output to stderr. (The log file is written regardless.) --verbose - Increase log output + Also write the log to stderr, at debug level --log-file - Tee logs to a file + Also write the log to this file. The daily log in `data\logs\` is always kept --no-snapshot DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning. diff --git a/crates/pipdock-cli/tests/snapshots/golden__schema-ExecutionSummary.snap b/crates/pipdock-cli/tests/snapshots/golden__schema-ExecutionSummary.snap index 6eb7335..a58d220 100644 --- a/crates/pipdock-cli/tests/snapshots/golden__schema-ExecutionSummary.snap +++ b/crates/pipdock-cli/tests/snapshots/golden__schema-ExecutionSummary.snap @@ -370,7 +370,7 @@ expression: out "properties": { "cancelled": { "default": false, - "description": "True when the user stopped this run part-way.\n\nARCHITECTURE §7 words this as `Skipped(UserCancelled)`, but [`StepStatus`] is a\npayload-free enum and giving it one changes the wire shape for every consumer. A flag on\nthe summary also matches what the summary sheet actually needs: \"cancelled\" is said once\nat the top, not repeated on forty rows.\n\nSteps that never ran are `Skipped`, which is already the honest status for them.", + "description": "True when the user stopped this run part-way.\n\nDATA-FLOW §3 used to word this as `Skipped(UserCancelled)`, but [`StepStatus`] is a\npayload-free enum and giving it one changes the wire shape for every consumer. A flag on\nthe summary also matches what the summary sheet actually needs: \"cancelled\" is said once\nat the top, not repeated on forty rows.\n\nSteps that never ran are `Skipped`, which is already the honest status for them.", "type": "boolean" }, "check": { diff --git a/crates/pipdock-core/Cargo.toml b/crates/pipdock-core/Cargo.toml index a1bc2a0..a246963 100644 --- a/crates/pipdock-core/Cargo.toml +++ b/crates/pipdock-core/Cargo.toml @@ -34,7 +34,6 @@ tokio-util = "0.7.20" tracing = "0.1.44" [dev-dependencies] -insta = { version = "1.49.0", features = ["json"] } jiff = "0.2.38" tokio = { version = "1.53.3", features = ["rt-multi-thread", "macros"] } diff --git a/crates/pipdock-core/src/engine/parse.rs b/crates/pipdock-core/src/engine/parse.rs index 16573d4..4f8916e 100644 --- a/crates/pipdock-core/src/engine/parse.rs +++ b/crates/pipdock-core/src/engine/parse.rs @@ -63,8 +63,8 @@ impl ParsedPlan { /// /// # Errors /// `PD-ENG-002` when stdout is empty, which is what pip leaves behind when it is too old for -/// `--report` **or** when the SP-2 encoding crash struck; `PD-ENG-003` when the JSON is present -/// but not the shape we know. +/// `--report` **or** when the SP-2 encoding crash struck; `PD-ENG-999` when the JSON is present +/// but not the shape we know — not `PD-ENG-003`, whose advice is to switch to pip. pub fn pip_report(stdout: &str, stderr: &str, installed: &[Dist]) -> Result { // Checked before anything is parsed, because the SP-2 crash does not leave stdout empty — it // leaves a *truncated* report, written up to the byte that could not be encoded. That is more diff --git a/crates/pipdock-core/src/engine/uv.rs b/crates/pipdock-core/src/engine/uv.rs index c7d076b..61c2455 100644 --- a/crates/pipdock-core/src/engine/uv.rs +++ b/crates/pipdock-core/src/engine/uv.rs @@ -7,8 +7,10 @@ //! //! Two consequences shape this adapter: //! -//! - `resolve` parses the plan whether or not uv exited zero, because its failure message is the -//! most useful thing it produces. +//! - `resolve` is decided by uv's exit status first: zero is a plan; a non-zero exit whose text +//! says no solution exists is a report (`impossible`), and anything else — a build failure, an +//! unreachable index — is classified as the failure it is. Parsing the plan regardless of the +//! exit status is how a failed build used to read as "nothing to change" (C3). //! - Every plan restates the installed set as explicit requirements. Without that, uv upgrades //! straight past an installed package's constraint and exits 0 — see [`super::plan_requirements`]. //! diff --git a/crates/pipdock-core/src/exec.rs b/crates/pipdock-core/src/exec.rs index 6fd8716..143fbf1 100644 --- a/crates/pipdock-core/src/exec.rs +++ b/crates/pipdock-core/src/exec.rs @@ -289,7 +289,7 @@ impl Command { /// Run to completion, capturing output. See [`TreeGuard`] for what "stop" means here. /// /// # Errors - /// `PD-ENG-001` when the program cannot be spawned, `PD-INT-001` when the watchdog fires. + /// `PD-ENG-001` when the program cannot be spawned, `PD-ENG-004` when the watchdog fires. pub async fn run(&self) -> Result { let started = self.logged_start(); // Spawned rather than `.output()`ed, so the child can be put in a job before it is waited diff --git a/crates/pipdock-core/src/health/fix.rs b/crates/pipdock-core/src/health/fix.rs index fe09d8f..e5ede74 100644 --- a/crates/pipdock-core/src/health/fix.rs +++ b/crates/pipdock-core/src/health/fix.rs @@ -260,8 +260,8 @@ pub async fn recheck( /// and `RuffFindings.fixable` counts only `Safe` for the same reason — the number in the dialog /// has to be the number the fix delivers. /// -/// **`ruff format` is deliberately not wired.** §4's `--check` toggle is read-only and stays -/// default-off. Formatting a whole project is a far larger blast radius than fixing seventeen lint +/// **`ruff format` is deliberately not wired**, not even as a check (CODE-HEALTH-SPEC §1). +/// Formatting a whole project is a far larger blast radius than fixing seventeen lint /// findings, and §7's non-goals are contractual per ROADMAP's standing risks. /// /// # Errors diff --git a/crates/pipdock-core/src/health/mod.rs b/crates/pipdock-core/src/health/mod.rs index 0d22313..63b3f8c 100644 --- a/crates/pipdock-core/src/health/mod.rs +++ b/crates/pipdock-core/src/health/mod.rs @@ -37,7 +37,8 @@ pub const TOOL_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(120 /// CODE-HEALTH-SPEC §4: vulture's default confidence floor. pub const DEFAULT_MIN_CONFIDENCE: u8 = 80; -/// CODE-HEALTH-SPEC §4: directories excluded from every tool, plus user globs from Settings. +/// CODE-HEALTH-SPEC §4: directories excluded from every tool. (Settings has no globs of its +/// own; a project's `exclude` in its own config is respected by ruff as usual.) pub const DEFAULT_EXCLUDES: &[&str] = &[".venv", "venv", "node_modules", "build", "dist", ".git"]; /// The release-time pin ledger, baked into the binary (CODE-HEALTH-SPEC §2). @@ -1340,8 +1341,9 @@ mod tests { /// The whole bootstrap, against real PyPI, into a scratch directory. /// - /// `#[ignore]`d because `cargo test --workspace` must not need a network. CI runs it explicitly - /// (`ci-integration.yml`), and so should anyone touching this module: + /// `#[ignore]`d because `cargo test --workspace` must not need a network. No CI job runs this + /// test — `ci-integration.yml` drives the same bootstrap end to end through `pipdock tools + /// sync` instead — so anyone touching this module should: /// `cargo test -p pipdock-core -- --ignored the_bootstrap`. #[tokio::test] #[ignore = "hits real PyPI; run with --ignored"] diff --git a/crates/pipdock-core/src/index/mod.rs b/crates/pipdock-core/src/index/mod.rs index 2c0ed6c..ab4c8f6 100644 --- a/crates/pipdock-core/src/index/mod.rs +++ b/crates/pipdock-core/src/index/mod.rs @@ -272,8 +272,10 @@ pub struct RefreshReport { /// offers to disable verification. /// /// # Errors -/// `PD-NET-010` when the fetch or ingest fails. The previous index is left in place and stays -/// searchable, because a failed refresh must not cost the user the index they already had. +/// `PD-NET-001`/`PD-NET-002` when PyPI cannot be reached or TLS fails (read from the error's +/// source chain), `PD-NET-010` when it answers with something that is not an index. Either way +/// the previous index is left in place and stays searchable, because a failed refresh must not +/// cost the user the index they already had. pub async fn refresh(app_data: &std::path::Path, now: jiff::Timestamp) -> Result { let started = std::time::Instant::now(); @@ -517,7 +519,9 @@ fn cached_metadata( async fn fetch_metadata(name: &PkgName) -> Result { let url = format!("https://pypi.org/pypi/{}/json", name.as_str()); - let response = http_client()? + // The shared client: a new one per call meant a new connection pool and TLS handshake for + // every package opened in Search (M37). + let response = shared_client()? .get(&url) .send() .await diff --git a/crates/pipdock-core/src/lib.rs b/crates/pipdock-core/src/lib.rs index 79663df..4e23d8f 100644 --- a/crates/pipdock-core/src/lib.rs +++ b/crates/pipdock-core/src/lib.rs @@ -34,11 +34,11 @@ pub mod exec; // reads them, so they are not compiled into one. #[cfg(any(test, feature = "fixtures"))] pub mod fixtures; -// build.rs's legal-documents hash, compiled here only so its tests run with the others. pub mod flow; pub mod graph; pub mod health; pub mod index; +// build.rs's legal-documents hash, compiled here only so its tests run with the others. #[cfg(test)] mod legal_hash; pub mod logging; diff --git a/crates/pipdock-core/src/plan/mod.rs b/crates/pipdock-core/src/plan/mod.rs index 3fbb127..7a69922 100644 --- a/crates/pipdock-core/src/plan/mod.rs +++ b/crates/pipdock-core/src/plan/mod.rs @@ -258,7 +258,7 @@ pub struct ExecutionSummary { pub counts: Counts, /// True when the user stopped this run part-way. /// - /// ARCHITECTURE §7 words this as `Skipped(UserCancelled)`, but [`StepStatus`] is a + /// DATA-FLOW §3 used to word this as `Skipped(UserCancelled)`, but [`StepStatus`] is a /// payload-free enum and giving it one changes the wire shape for every consumer. A flag on /// the summary also matches what the summary sheet actually needs: "cancelled" is said once /// at the top, not repeated on forty rows. diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index b5b9699..46c0644 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -1,7 +1,7 @@ { "$schema": "../gen/schemas/desktop-schema.json", "identifier": "default", - "description": "Exactly what the webview calls, and nothing preemptive (docs/SECURITY.md §2); lib.rs pins the set with a test. core:default stood here until 1.4.0: it granted some sixty core commands nothing used and not the one the legal gate's Decline needs, so Decline did nothing in the installed app. core:event:allow-listen/unlisten carry plan-, scan-, health- and audit-progress; core:window:allow-close is Decline. dialog:allow-open is Code Health's project-folder picker and Import requirements; dialog:allow-save is Save report and Export. BOTH ONLY ASK FOR A PATH — no fs permission is granted, so the webview cannot read or write a single file. Save report hands its path to a Rust command that writes the two files, because a general fs:allow-write-text-file would be a write-anywhere primitive in the webview of a tool that already runs subprocesses against the user's interpreters.", + "description": "Exactly what the webview calls, and nothing preemptive (docs/SECURITY.md §4); lib.rs pins the set with a test. core:default stood here until 1.4.0: it granted some sixty core commands nothing used and not the one the legal gate's Decline needs, so Decline did nothing in the installed app. core:event:allow-listen/unlisten carry plan-, scan-, health- and audit-progress; core:window:allow-close is Decline. dialog:allow-open is Code Health's project-folder picker and Import requirements; dialog:allow-save is Save report and Export. BOTH ONLY ASK FOR A PATH — no fs permission is granted, so the webview cannot read or write a single file. Save report hands its path to a Rust command that writes the two files, because a general fs:allow-write-text-file would be a write-anywhere primitive in the webview of a tool that already runs subprocesses against the user's interpreters.", "windows": ["main"], "permissions": [ "core:event:allow-listen", diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 2cbf513..2ab1ce2 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -954,7 +954,15 @@ pub async fn snapshot_diff( let hash = envs::env_hash(&env.interpreter); let snap = snapshot::load(&state.app_data, &hash, &id)?; let current = snapshot::parse_freeze(&engine.freeze(&env).await?); - Ok(snapshot::diff(¤t, &snap.entries())) + // What a rollback with this engine would see, as the CLI's `snapshot diff` and the rollback + // itself do. A plain diff here showed pip and setuptools as changes across engines that the + // rollback, rightly, would never touch — the two heads disagreed (G5). + Ok(snapshot::restorable_diff( + ¤t, + &snap.entries(), + snap.meta.engine, + engine.id(), + )) } /// What restoring a snapshot would do, parking the flow that would do it (DATA-FLOW §8). diff --git a/src-tauri/src/state.rs b/src-tauri/src/state.rs index 1291c94..a72e861 100644 --- a/src-tauri/src/state.rs +++ b/src-tauri/src/state.rs @@ -511,15 +511,22 @@ impl AppState { }) } - /// Claim the index slot for a load, if one is not already done or running. + /// Claim the index slot for a load, if one has not been tried yet. /// /// Returns `true` when the caller is now responsible for loading. Idempotent, so calling it on /// every Search render is harmless — which is what lets the screen ask without coordinating. + /// + /// **Only from `Cold`.** A failed load stays failed until a refresh clears it + /// ([`Self::invalidate_index`]) or the app restarts. This used to restart from `Failed` too, + /// which flipped the slot back to `Warming` *before* the search could report why — so on a + /// profile that had never downloaded the index, every answer said "warming", the screen asked + /// again every 150 ms, and the prompt to download the index never appeared. Found by running + /// the installed 1.4.0 build on a fresh profile. pub fn begin_index_load(&self) -> bool { let Ok(mut slot) = self.index.lock() else { return false; }; - if matches!(*slot, IndexSlot::Cold | IndexSlot::Failed(_)) { + if matches!(*slot, IndexSlot::Cold) { *slot = IndexSlot::Warming; return true; } @@ -586,6 +593,53 @@ mod tests { Sessions::default() } + /// An `AppState` over a store in a fresh temporary directory. + fn app_state(tag: &str) -> (AppState, PathBuf) { + let dir = std::env::temp_dir().join(format!("pipdock-state-{tag}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + let store = Store::open(&dir).expect("a store in a temp dir"); + let state = AppState { + app_data: dir.clone(), + store: tokio::sync::Mutex::new(store), + index: std::sync::Mutex::new(IndexSlot::Cold), + sessions: Sessions::default(), + health: Sessions::default(), + audit: Sessions::default(), + log: std::sync::Arc::new(LogRing::default()), + }; + (state, dir) + } + + #[test] + fn a_failed_index_load_says_why_rather_than_warming_forever() { + let (state, dir) = app_state("index"); + assert!(state.begin_index_load(), "the first search starts a load"); + state.finish_index_load(Err(pipdock_core::PdError::new( + Code::NetIndexRefreshFailed, + "the package index is empty", + ))); + + // The next search must not restart it: restarting reset the slot to Warming before the + // failure could be read, and the screen showed "warming" for ever on a fresh profile. + assert!( + !state.begin_index_load(), + "a failed load is not retried by a search" + ); + assert_eq!( + state.index_failure().as_deref(), + Some("the package index is empty") + ); + + // A refresh is what clears it. + state.invalidate_index(); + assert!( + state.begin_index_load(), + "after a refresh the next search loads again" + ); + drop(state); + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn claiming_an_empty_slot_leaves_it_claimed_for_the_caller() { let s = sessions(); diff --git a/tools/tools-requirements.txt b/tools/tools-requirements.txt index d2f899a..cf4bab2 100644 --- a/tools/tools-requirements.txt +++ b/tools/tools-requirements.txt @@ -17,6 +17,6 @@ deptry==0.25.1 vulture==2.16 ruff==0.17.1 -# P1 (Security tab, PRD P1-1). Pinned now so spike SP-4 has something concrete to invoke while -# it settles the foreign-environment audit flags. +# The Security tab (PRD P1-1, shipped in 1.2.0). Installed into its own venv, not Code Health's +# (health::AUDIT_TOOLS), so a bump here never re-syncs the other one. pip-audit==2.10.1 diff --git a/ui/src/components/PdDialog.tsx b/ui/src/components/PdDialog.tsx index 9834c83..1684e98 100644 --- a/ui/src/components/PdDialog.tsx +++ b/ui/src/components/PdDialog.tsx @@ -79,7 +79,10 @@ export function PdDialog({ e.preventDefault() if (!busy) onCancel() }} - className="max-w-lg rounded-pd border border-border bg-surface p-6 text-text backdrop:bg-bg/80" + // `m-auto`: Tailwind's preflight sets `margin: 0` on everything, which removes the + // `margin: auto` a modal is centred by — so every dialog opened in the window's + // top-left corner. Seen in the installed build; jsdom computes no layout to show it. + className="m-auto max-w-lg rounded-pd border border-border bg-surface p-6 text-text backdrop:bg-bg/80" >

{title}

{children}
diff --git a/ui/src/components/PdPackageTable.test.tsx b/ui/src/components/PdPackageTable.test.tsx index 252eb6f..f6fc9b7 100644 --- a/ui/src/components/PdPackageTable.test.tsx +++ b/ui/src/components/PdPackageTable.test.tsx @@ -101,7 +101,7 @@ describe('pins', () => { // names the version. Matched by title, not text: a hold is usually at the package's current // version, so "1.26.4" legitimately appears in both the version cell and the chip. expect( - within(rowFor('scipy') as HTMLElement).getByTitle(/left out of bulk updates/i), + within(rowFor('scipy') as HTMLElement).getByTitle(/left out of every update/i), ).toHaveTextContent('pinned') expect(within(rowFor('numpy') as HTMLElement).getByTitle(/^Held at 1\.26\.4/)).toBeInTheDocument() }) diff --git a/ui/src/components/PdPalette.tsx b/ui/src/components/PdPalette.tsx index 5bfcb31..3ce0e3c 100644 --- a/ui/src/components/PdPalette.tsx +++ b/ui/src/components/PdPalette.tsx @@ -190,7 +190,8 @@ export function PdPalette({ onClose }: { onClose: () => void }) { // Backdrop only: clicks inside the panel below stop here first. if (e.target === ref.current) onClose() }} - className="mt-24 w-full max-w-xl rounded-pd border border-border bg-surface p-0 text-text backdrop:bg-bg/80" + // `mx-auto`: preflight's `margin: 0` removed the centring; see PdDialog. + className="mx-auto mt-24 w-full max-w-xl rounded-pd border border-border bg-surface p-0 text-text backdrop:bg-bg/80" >
{'·'} {scanning ? t('status.scanning') : t('status.idle')} - {/* §3 draws a log toggle here and it has been plain text since S1 — a control that looks - like one and does nothing. It opens the console drawer, which is the only log surface - that exists until M3's logging subsystem; disabled when there is no run to show. */} + {/* §3 draws a log toggle here and it was plain text from S1 — a control that looked like + one and did nothing. It opens the console drawer for the run in progress, and is disabled + when there is none. The persistent log is a file since 1.4.0 (Settings → Logs). */}