Skip to content

refactor(daemon): remove pid-file runtime adoption - #417

Open
clvsh wants to merge 3 commits into
mainfrom
refactor/remove-legacy-runtime-adoption
Open

clvsh wants to merge 3 commits into
mainfrom
refactor/remove-legacy-runtime-adoption

Conversation

@clvsh

@clvsh clvsh commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

PR 5 of the monitor plan: remove the pid-file runtime code. PV 0.2.6 moved every runtime onto monitors. It kept the pid-file code only for the cutover, which stops runtimes an older release left running. Once every install runs 0.2.6, nothing needs it.

Important

Merge any time; release only after the other laptop runs 0.2.6 and passes the three checks: no pid files, monitors in ~/.pv/run/m/, no legacy_runtime_stop_failed. Release with minimum_pv_version = 0.2.6. pv update refuses a manifest that requires a newer PV than the one installed, so a 0.2.5 install can't skip the cutover release.

What's removed

  • Legacy stop: stop_legacy_runtime and the pid-era identity checks in the supervisor: argv, script and executable matching, process_and_group_are_absent, and remove_unchanged_runtime_records.
  • Cutover: the cutover that every reconciliation and update job ran first, and its legacy_runtime_stop_failed log event.
  • Disable and uninstall: they lose their pid-file branch. They still stop every monitor, then remove only JSON records that no monitor backs.
  • Pid paths:
    • ProcessSpec.pid_path and ManagedProcess.pid_path
    • the gateway_pid, worker_pid and resource_pid helpers in PvPaths
    • adopt_recorded's unused pid argument, now adopt_recorded(metadata_path)
    • every cleanup helper's pid-file delete
  • Record fields: RuntimeMetadata's boot_session_id, process_start_identity and process_executable_identity (your decision, 2026-10-11). The struct has no deny_unknown_fields, so old records still parse; serde ignores the keys. Monitor records keep their own boot ID.
  • Config proof: a JSON record without a monitor instance no longer counts as config proof, so reconciliation replaces that runtime.

Docs

  • DESIGN.md:
    • The pid-file cutover paragraph is gone.
    • The self-update section now says releases after 0.2.6 require 0.2.6. The release workflow's default minimum_pv_version is still 0.1.0, and the release skill makes us confirm it every time.
  • CONTRIBUTING.md:
    • Describes fixtures under monitors: pv_fake::install_monitor, cleanup through stop_recorded_runtimes and stop_subject, and the test lifeline as the backstop.
    • Words the ownership rule for monitors.
    • Drops the script-identity tests from the python3 note.

Tests

  • Deleted, as legacy-only:
    • both cutover tests: the ordinary-job one in jobs.rs and the startup one in daemon_foundation.rs
    • the CLI previous-boot pid-file disable test
    • the supervisor unit test for remove_unchanged_runtime_records
    • the Python shebang-script ownership test and its fixture. Monitors don't match argv, so script identity no longer means anything.
  • Updated mechanically: about 150 call sites, mostly in gateway_reconciliation.rs. Two snapshots lose their pid_path lines; I checked that this was the only change in each.
  • Not added: no new tests, because this PR only deletes behavior. Disable with JSON-only records and orphan monitors is already covered by daemon_disable_stops_live_runtimes_without_a_plist_or_database, and the monitor prior-boot Postgres disable test stays.

Test plan

  • Full suite: 1637 passed, 5 fewer than before, matching the 5 deleted legacy tests. It also passed while a stress run of the runtime binaries shared the machine.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, cargo fmt --all --check and cargo shear are clean.
  • Stress: daemon_foundation, gateway_reconciliation, supervisor_foundation and cli::daemon together, --stress-count 5. One failed iteration on this branch and one on main (3cd321f7), in different tests, so the flake rate is the same. gateway_reconciliation alone passed 8 out of 8 runs.
    • The failure on this branch was gateway_reconciliation_replaces_legacy_admin_off_process_before_admin_contact: the replacement Gateway exited immediately. The test frees its reserved ports just before starting, so a parallel test can take one; that's the known port race in test: parallel tests race each other for the same ports #380.
    • Under extra load (the full suite running alongside), monitors twice reported their lifeline fd wasn't an inherited pipe. That never happened in fair runs on either branch, and this PR doesn't touch the lifeline. Worth a separate look.
  • Linux and Windows CI. The first run failed on three group-stop helpers that only the macOS monitor uses now; f810dd9 gates them to macOS. CI passes on all six jobs.

Summary by CodeRabbit

  • Bug Fixes
    • Runtime cleanup now relies on monitored process groups, reducing the risk of stopping an unrelated process when a recorded process ID has been reused.
    • Runtime records are retained when cleanup cannot confirm the process group has stopped.
  • Compatibility
    • Updating from releases before 0.2.6 requires migration to monitor-managed runtimes; releases after 0.2.6 must meet the minimum version requirement to ensure that migration occurs.

PV 0.2.6 moved every runtime onto monitors and kept the pid-file code
only to stop runtimes an older release left running. Once every install
runs 0.2.6, that code has nothing left to do, so it goes:

- the legacy stop and its pid-file identity checks (argv, script and
  executable matching) in the supervisor
- the cutover that every reconciliation and update job ran first
- the pid-file branch of disable and uninstall, which now remove only
  JSON records that no monitor backs
- the pid_path field of ProcessSpec and ManagedProcess, the pid path
  helpers in PvPaths, and adopt_recorded's unused pid argument
- RuntimeMetadata's boot_session_id, process_start_identity and
  process_executable_identity fields. Old records still parse, since
  serde ignores the keys.

A record without a monitor instance no longer counts as config proof.
Releases after 0.2.6 must require 0.2.6, so `pv update` can't skip the
cutover; DESIGN.md now says so. CONTRIBUTING.md describes fixtures
under monitors and drops the script-identity tests.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T05:16:00.793544Z e9a1bb6 New commits
🔒 Security Review ✅ Completed 2026-10-11T20:39:51.962683Z baff35e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Walkthrough

Walkthrough

The change removes PID-file paths and legacy PID-based runtime cleanup. Runtime adoption, stopping, health checks, and record removal now use monitor ownership and runtime metadata. Tests, fixtures, release settings, and design guidance are updated for this model.

Changes

Runtime ownership and cleanup

Layer / File(s) Summary
Monitor-owned supervisor contract
crates/daemon/src/supervisor.rs, crates/state/src/paths.rs, supervisor and state tests, crates/daemon/test-fixtures/supervisor/*
The supervisor no longer stores PID-file paths or provides legacy PID-based stopping. Adoption uses runtime metadata paths, and state no longer exposes PID-file path helpers.
Metadata-based runtime operations
crates/daemon/src/runtime_stop.rs, crates/daemon/src/gateway.rs, crates/daemon/src/health.rs, crates/daemon/src/managed_resources/*, crates/daemon/src/jobs.rs, crates/daemon/src/structured_log.rs
Runtime specifications and cleanup use metadata paths. Runtime record collection selects JSON records. Health checks adopt recorded runtimes from metadata, and update and reconciliation jobs no longer call legacy-runtime cleanup.
Metadata-only test and fixture migration
crates/cli/tests/*, crates/daemon/tests/*, crates/daemon/src/managed_resources/tests.rs
Tests adopt and stop recorded runtimes through metadata paths. Tests for legacy PID-file migration and script-identity ownership are removed or changed.
Fixture and release guidance
CONTRIBUTING.md, DESIGN.md, .agents/skills/release-app-version/SKILL.md, .github/workflows/app-release.yml
Contributor guidance describes monitor installation and cleanup. Design and release guidance identify PV 0.2.6 as the migration version, and the release input defaults to that minimum.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor


Merge Risk: 🟡 Moderate · up to e9a1b

A release can let older installations skip the runtime migration, and the contributor guide overpromises cleanup after test-process exit. Enforce the release floor and clarify the cleanup guarantee before merging.

Architecture Summary

Architecture risk: 🔵 Low · up to e9a1b

The change affects 3 systems.

Changed systems: crates, CONTRIBUTING.md, DESIGN.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 23 changed files map to changed impact.
  • observed — CONTRIBUTING.md (service) was modified; 1 changed file maps to changed impact.
  • observed — DESIGN.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/cli/tests/daemon.rs: Runtime fixtures for the worker, Mailpit, and MySQL no longer receive PID-file paths; their metadata paths remain configured.
  • observed — Modified behavior in crates/cli/tests/daemon.rs: The daemon fixture no longer assigns a PID-file path; it retains its metadata path.
  • observed — Modified behavior in crates/cli/tests/daemon.rs: The Postgres fixture no longer assigns a PID-file path; its metadata path remains configured.
  • observed — Modified behavior in crates/cli/tests/daemon.rs: Removed the test that wrote previous-boot Postgres PID and metadata records for a reused live PID, then asserted disable deleted those records without signaling that process. The replacement test concerns a previous-boot monitor record.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 69.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 123 functions across 11 files. (4 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing pid-file runtime adoption from the daemon.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 69.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 123 functions across 11 files. (4 skipped: 4 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing refactor/remove-legacy-runtime-adoption (e9a1bb6) with main (3cd321f)

Open in CodSpeed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
CONTRIBUTING.md (1)

61-62: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Do not document SIGKILL cleanup as unconditional.

The monitor attempts bounded process-group cleanup and exits, but cleanup can become Unproven if the group does not exit. In that case, the monitor keeps its records and may leave a runtime running.

Suggested documentation change
-Whenever the test process exits, even by SIGKILL, its lifeline closes and every monitor it started stops its runtime and
-exits. A failed test therefore leaves nothing running.
+Whenever the test process exits, even by SIGKILL, its lifeline closes and every monitor it started attempts to stop its
+runtime and exits. If cleanup cannot prove that the process group is empty, the monitor keeps its records for recovery.

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 0d92e9dc-175e-4d3f-a800-c9d0d5ffde34
📥 Commits

Reviewing files that changed from the base of the PR and between 3cd321f and baff35e.

⛔ Files ignored due to path filters (2)
  • crates/daemon/tests/snapshots/gateway_reconciliation__caddy_cli_command_and_process_specs_are_stable.snap is excluded by !**/*.snap
  • crates/daemon/tests/snapshots/supervisor_foundation__process_spec_debug_omits_empty_private_environment_and_redacts_values.snap is excluded by !**/*.snap
📒 Files selected for processing (25)
  • CONTRIBUTING.md
  • DESIGN.md
  • crates/cli/tests/daemon.rs
  • crates/cli/tests/support/runtime.rs
  • crates/daemon/src/gateway.rs
  • crates/daemon/src/health.rs
  • crates/daemon/src/jobs.rs
  • crates/daemon/src/managed_resources/fake.rs
  • crates/daemon/src/managed_resources/mailpit.rs
  • crates/daemon/src/managed_resources/mod.rs
  • crates/daemon/src/managed_resources/mysql.rs
  • crates/daemon/src/managed_resources/postgres.rs
  • crates/daemon/src/managed_resources/redis.rs
  • crates/daemon/src/managed_resources/runtime_contracts.rs
  • crates/daemon/src/managed_resources/rustfs.rs
  • crates/daemon/src/managed_resources/tests.rs
  • crates/daemon/src/runtime_stop.rs
  • crates/daemon/src/structured_log.rs
  • crates/daemon/src/supervisor.rs
  • crates/daemon/test-fixtures/supervisor/owned-python-runtime.py
  • crates/daemon/tests/daemon_foundation.rs
  • crates/daemon/tests/gateway_reconciliation.rs
  • crates/daemon/tests/supervisor_foundation.rs
  • crates/state/src/paths.rs
  • crates/state/tests/state_foundation.rs
💤 Files with no reviewable changes (12)
  • crates/daemon/src/managed_resources/mailpit.rs
  • crates/daemon/src/managed_resources/redis.rs
  • crates/daemon/src/structured_log.rs
  • crates/state/src/paths.rs
  • crates/daemon/src/managed_resources/mysql.rs
  • crates/daemon/src/managed_resources/fake.rs
  • crates/daemon/src/managed_resources/mod.rs
  • crates/daemon/test-fixtures/supervisor/owned-python-runtime.py
  • crates/daemon/src/managed_resources/postgres.rs
  • crates/state/tests/state_foundation.rs
  • crates/daemon/src/managed_resources/rustfs.rs
  • crates/cli/tests/daemon.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread crates/daemon/src/supervisor.rs
Comment thread DESIGN.md Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The legacy-path deletion introduces a warnings-as-errors build failure on Linux and Windows. Both portability CI jobs fail, and the same failure reproduces locally.

Reviewed changes
Reviewed the complete PR diff and traced monitor ownership, runtime cleanup, config proofs, and the documented release prerequisite.

  • Legacy Cutover Removal: Deletes pid-file runtime stopping, pre-job cutover, and legacy process-identity matching.
  • Monitor-Only Records: Removes PID-path APIs and legacy metadata fields while retaining monitor-backed adoption and config proofs.
  • Shutdown Cleanup: Restricts runtime-record discovery to JSON and preserves monitor shutdown, recovery, and Postgres exit-proof requirements.
  • Tests And Documentation: Updates fixtures, path assertions, and snapshots, removes legacy-only tests, and documents the required PV 0.2.6 release transition.

Validation: cargo fmt --all --check and the changed runtime-path integration test passed. RUSTFLAGS="-D warnings" cargo check --locked -p daemon failed with the three diagnostics described inline, matching Linux and Windows CI. macOS lifecycle tests were not run locally because this host is Linux; macOS CI remains in progress.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread crates/daemon/src/supervisor.rs
…ilds

With the pid-file stop gone, only the macOS monitor stops a process group, so stop_process_group, wait_for_process_group_exit and the Stop signal variant are macOS-only.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes
Reviewed f810dd99 against the previously reviewed baff35ea, with the complete PR diff as context.

  • Scoped Process Signals: Gated ProcessSignal::Stop to macOS, where its remaining constructors and match arms are compiled.
  • Restored Portable Builds: Gated stop_process_group and wait_for_process_group_exit to macOS, matching their remaining monitor callers without changing macOS shutdown behavior.

Validation: RUSTFLAGS="-D warnings" cargo check --locked -p daemon and cargo fmt --all --check passed locally. Linux and Windows portability CI both pass. macOS CI remains in progress; native lifecycle tests were not run on this Linux host because the delta only changes platform compilation guards.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

Only 0.2.6 moves runtimes from pid files onto monitors, so a later release that allows an older installed PV would let `pv update` skip that step. The release workflow's minimum_pv_version now defaults to 0.2.6 instead of 0.1.0, and the release skill says never to go below it. CONTRIBUTING.md no longer promises that a monitor always proves its runtime's group gone when a test's lifeline closes.
@clvsh

clvsh commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai on your CONTRIBUTING.md note about test cleanup: agreed, fixed in e9a1bb6. The fixture-lifecycle text now says that when a test's lifeline closes, each monitor stops its runtime's process group and exits. If a monitor can't prove the group is gone, it keeps its records for recovery, so check for leftover processes after an unexplained failure. It no longer promises that a failed test always leaves nothing running.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes
Reviewed e9a1bb64 against the previously reviewed f810dd99, with the complete PR diff as context.

  • Raised the release minimum default to 0.2.6 and aligned the release instructions and design documentation with the required monitor cutover.
  • Clarified fixture cleanup guarantees to describe process-group cleanup and retained recovery records when shutdown cannot be proven.

Validation: cargo test --locked -p pv-release --test workflow_defaults -p self-update --test app_update_manifest passed. Traced the release input into the generated manifest and verified the updater rejects an unmet minimum version. Native macOS lifecycle tests were not rerun for this configuration/documentation-only delta; macOS and Windows CI remain in progress, while Linux CI passes.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9a1bb6408

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

description: "Minimum installed PV version that may apply this app release; at least 0.2.6, which moves pid-file runtimes onto monitors"
required: true
default: "0.1.0"
default: "0.2.6"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject release minimums below 0.2.6

Because workflow_dispatch inputs are editable, a post-0.2.6 release can still be dispatched with minimum_pv_version=0.2.5: the prepare step only rejects an empty value and publishes every other string unchanged. This lets a pre-0.2.6 installation skip the sole pid-file-to-monitor migration after this commit removes the legacy-runtime stop path, leaving existing runtimes unmanaged or causing reconciliation to collide with their occupied ports. Enforce a parsed minimum of 0.2.6 in the workflow rather than relying on the default.

AGENTS.md reference: AGENTS.md:L4-L4

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
CONTRIBUTING.md (1)

61-62: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the unconditional cleanup guarantee.

Line 61 says every monitor stops its process group and exits when the test process exits. Line 62 allows a monitor to be unable to verify that the group is gone. Describe cleanup as an attempt, not a guaranteed result.

Suggested wording
-Whenever the test process exits, even by SIGKILL, its lifeline closes and every monitor it started stops its runtime's process group and exits.
+When the test process exits, its lifeline closes. Each monitor attempts to stop its runtime's process group. If it cannot verify that the group is gone, PV keeps its records for recovery.

The PR objective says lifeline closure must not be documented as proof that the runtime group is gone.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: c7e1e757-553f-4a57-a047-496b8f141510
📥 Commits

Reviewing files that changed from the base of the PR and between f810dd9 and e9a1bb6.

📒 Files selected for processing (4)
  • .agents/skills/release-app-version/SKILL.md
  • .github/workflows/app-release.yml
  • CONTRIBUTING.md
  • DESIGN.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +7 to +9
description: "Minimum installed PV version that may apply this app release; at least 0.2.6, which moves pid-file runtimes onto monitors"
required: true
default: "0.1.0"
default: "0.2.6"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n -C 10 'minimum_pv_version|0\.2\.6|app_version|app-version|::error::' .github/workflows/app-release.yml

Repository: prvious/pv

Length of output: 7035


🏁 Script executed:

set -e
printf '%s\n' '--- workflow metadata and release-record blocks ---'
nl -ba .github/workflows/app-release.yml | sed -n '42,170p'
nl -ba .github/workflows/app-release.yml | sed -n '250,390p'
printf '%s\n' '--- migration-floor references ---'
rg -n -C 6 -F -- 'minimum_pv_version' .github DESIGN.md CONTRIBUTING.md scripts src 2>/dev/null || true
rg -n -C 5 -F -- '0.2.6' .github DESIGN.md CONTRIBUTING.md scripts src 2>/dev/null || true

Repository: prvious/pv

Length of output: 36573


🏁 Script executed:

set -e
printf '%s\n' '--- write-app-release-record definition and callers ---'
rg -n -C 8 -F -- 'write-app-release-record' . --glob '!target/**' --glob '!node_modules/**'
printf '%s\n' '--- minimum-version consumers in release tooling ---'
rg -n -C 8 -F -- 'minimum-pv-version' crates .github --glob '!target/**'
rg -n -C 8 -F -- 'minimum_pv_version' crates --glob '!target/**'

Repository: prvious/pv

Length of output: 5746


🏁 Script executed:

set -e
rg -n -F -- 'write-app-release-record' crates/pv-release
rg -n -F -- 'minimum_pv_version' crates/pv-release
printf '%s\n' '--- pv-release source outline/files ---'
rg --files crates/pv-release

Repository: prvious/pv

Length of output: 24901


🏁 Script executed:

set -e
printf '%s\n' '--- CLI command declarations and dispatch ---'
nl -ba crates/pv-release/src/cli.rs | sed -n '120,205p'
nl -ba crates/pv-release/src/cli.rs | sed -n '320,415p'
printf '%s\n' '--- record writer ---'
nl -ba crates/pv-release/src/record_writer.rs | sed -n '1,155p'
printf '%s\n' '--- version type definition and comparison support ---'
rg -n -C 8 -F -- 'struct PvVersion' crates/pv-release/src crates/pv-version/src 2>/dev/null || true
rg -n -C 5 -F -- 'enum PvVersion' crates/pv-release/src crates/pv-version/src 2>/dev/null || true

Repository: prvious/pv

Length of output: 12417


🏁 Script executed:

set -e
printf '%s\n' '--- app release request and writer ---'
nl -ba crates/pv-release/src/app.rs | sed -n '300,445p'
nl -ba crates/pv-release/src/app.rs | sed -n '640,705p'
printf '%s\n' '--- release-record parser ---'
nl -ba crates/pv-release/src/record.rs | sed -n '190,280p'
printf '%s\n' '--- app version type and parser references ---'
rg -n -C 8 -F -- 'struct AppUpdateVersion' crates/pv-release/src
rg -n -C 8 -F -- 'enum AppUpdateVersion' crates/pv-release/src
rg -n -C 5 -F -- 'AppUpdateVersion::parse' crates/pv-release/src

Repository: prvious/pv

Length of output: 10531


🏁 Script executed:

set -e
nl -ba crates/pv-release/src/app.rs | sed -n '445,650p'

Repository: prvious/pv

Length of output: 7844


Enforce the migration floor for later releases.

minimum_pv_version is caller-controlled. The workflow checks only that it is non-empty, and the app release writer stores it unchanged. AppReleaseRecord::from_json validates only that both versions have valid syntax; it does not compare them. A normal app release after 0.2.6 can therefore be published with a lower minimum and let pv update skip the migration. Add a version-aware check that rejects values below 0.2.6 for later releases while preserving the migration release's required minimum.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd --type f '^CONTRIBUTING\.md$' --exec cat -n {}

Length of output: 9547


@clvsh Thanks for the update and clarification. Verified CONTRIBUTING.md, Line 60–64: monitors retain records when they cannot prove the process group is gone. The text also directs contributors to check for leftover processes after an unexplained failure. This addresses my cleanup-documentation concern.


✏️ Learnings added
Learnt from: clvsh
URL: https://github.com/prvious/pv/pull/417

Timestamp: 2026-10-12T05:20:01.277Z
Learning: In prvious/pv, CONTRIBUTING.md's Fixture Lifecycle guidance does not guarantee that a failed test leaves no processes running. When the test's lifeline closes, its monitors stop their runtimes' process groups and exit. If a monitor cannot prove its process group is gone, it retains records for recovery. Contributors must check for leftover processes after an unexplained failure.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant