Skip to content

PR 26: End-to-end hardening and release candidate validation#286

Merged
munezaclovis merged 75 commits into
mainfrom
feat/pr-26-rc-hardening
Jun 17, 2026
Merged

PR 26: End-to-end hardening and release candidate validation#286
munezaclovis merged 75 commits into
mainfrom
feat/pr-26-rc-hardening

Conversation

@munezaclovis

@munezaclovis munezaclovis commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the PR 26 release-candidate validation surface for setup, failure modes, uninstall/prune coverage, docs, and privileged macOS workflow checks
  • harden real artifact E2E coverage against the staging manifest and align resource runtime contracts for Postgres, RustFS, and Gateway/Caddy
  • fix the intermittent Gateway HTTPS race by waiting for TLS readiness when a local CA-backed route is present

Verification

  • cargo fmt --all --check
  • git diff --check HEAD
  • actionlint
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo nextest run --workspace --all-features --locked
  • PV_E2E_REAL_ARTIFACTS=1 PV_E2E_ARTIFACT_MANIFEST_URL=https://artifacts-staging.pv.prvious.dev/manifest.json cargo nextest run -p daemon --locked --run-ignored ignored-only -E 'test(real_artifact)'\n\n## Notes\n- cargo nextest run --workspace --all-targets --all-features --locked is not used because the existing config::bench/config harness=false target is incompatible with nextest --format terse; clippy still covers all targets.\n- The privileged macOS RC workflow is manual so the full system path can be attempted on GitHub-hosted macOS runners without blocking every PR.

Summary by CodeRabbit

  • New Features
    • Refresh artifact manifests earlier during setup; use manifest-derived default managed-resource plans.
    • Added gateway HTTPS/TLS readiness probing and improved foreground job heartbeats for long-running jobs.
    • Added privileged macOS RC and opt-in real-artifact E2E validation coverage.
  • Bug Fixes
    • Fixed Postgres support-file expectations to share/postgres.bki.
    • Improved ports installation behavior when system PF state isn’t current.
    • Hardened setup/daemon failure handling to prevent partial/unsafe changes.
    • Updated PF handling to use rdr-anchor for PV rules.
  • Documentation
    • Added PV user guide and expanded release-candidate documentation (including RC checklist).
  • Infrastructure
    • Extended release workflows with additional manifest wiring and richer workflow test assertions.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Adds HTTPS/TLS gateway readiness (GatewayHttps readiness check using rustls), daemon startup hardening (fail_running_jobs, IPC cleanup on DNS failure), setup-time artifact manifest refresh with fallback warning, automatic reconciliation-time installation of desired-but-missing managed resource tracks, RustFS process/health fixes, system integration PF ordering refactors, CLI resource lifecycle tests (MySQL/Postgres/Redis), a privileged macOS RC CI workflow, a real-artifact resource matrix E2E test suite, and RC/user documentation.

Changes

RC Validation and Infrastructure

Layer / File(s) Summary
TLS workspace dependencies
Cargo.toml, crates/daemon/Cargo.toml
Adds rustls and tokio-rustls workspace dependencies (ring/std/tls12 features, defaults disabled); adds rcgen to daemon dev-dependencies.
Database fail_running_jobs and daemon startup hardening
crates/state/src/database.rs, crates/daemon/src/error.rs, crates/daemon/src/lib.rs, crates/daemon/tests/daemon_foundation.rs
Adds fail_running_jobs bulk-update method, new StartupCleanupFailed error variant, and refactors daemon startup to clean up the IPC socket on DNS or job-fail errors with startup_error_after_endpoint_cleanup; adds tests for abandoned-job transitions, socket-in-use, and absent socket after failed DNS start.
GatewayHttps readiness check and TLS probing
crates/daemon/src/supervisor.rs, crates/daemon/tests/supervisor_foundation.rs
Adds ReadinessCheck::GatewayHttps variant; introduces check_tcp_once, check_https_once, tls_client_config (CA PEM-backed rustls), and shared HTTP response classifiers; adjusts timeout error-preservation; adds integration test verifying non-2xx HTTPS response is accepted as ready.
Gateway storage_path, XDG environment, and HTTPS readiness wiring
crates/daemon/src/gateway_config.rs, crates/daemon/src/gateway.rs, crates/daemon/tests/gateway_config.rs, crates/daemon/tests/gateway_reconciliation.rs, crates/daemon/tests/project_env_reconciliation.rs
Adds storage_path to GatewayConfigInput (Caddyfile storage file_system block) derived from CA cert SHA-256; injects XDG_CONFIG_HOME/XDG_DATA_HOME into FrankenPHP process specs and validate_config; selects GatewayHttps vs TCP readiness from primary_hostname project fragments; returns GatewayConfigReconciliation; updates all gateway config/reconciliation tests to new seed_runtime_ports/validate_config signatures; rewrites fake FrankenPHP to a Python HTTP+HTTPS server; adds legacy-metadata restart and project-root dotenv tests.
RustFS runtime fixes
crates/daemon/src/managed_resources/rustfs.rs, crates/daemon/src/managed_resources/tests.rs
Ensures data dir exists before config write; adds server subcommand to process args; changes readiness probe from / to /health; updates test fixture routing to accept /health.
Daemon auto-install of missing desired resource tracks
crates/daemon/src/error.rs, crates/daemon/src/managed_resources/mod.rs, crates/daemon/src/managed_resources/tests.rs
Adds ManagedResourceDefaultInstallFailures error variant; adds missing_desired_resource_installs, DesiredResourceInstallPlan, install_missing_desired_resource_tracks, and install_missing_desired_resource_tracks_blocking to reconcile_system_resources_with_catalog; adds setup-default fixture table and five reconciliation tests covering success, incomplete PHP pair, unsupported composer track, background-job failure, and aggregated-failure-with-independent-success.
Setup-time artifact manifest refresh
crates/cli/src/commands/setup.rs
Adds SetupResourcePlan, refresh_setup_artifact_manifest, resolve_default_resource_plan, and with_resource_http_client; refactors record_default_resource_desired_state to accept a precomputed plan slice; fetches/caches artifact manifest early with fallback warning.
Shared CLI resource test support module
crates/cli/tests/support/mod.rs, crates/cli/tests/support/resource_cli.rs
Adds resource_cli submodule with ResourceCliSpec, TestEnvironment, RunOutput, run_pv, managed_resource_records, resource_record_snapshots, FixtureArtifact, fixture helpers, seed_running_resource, resource_manifest, and ScriptedClient.
CLI lifecycle tests: MySQL, Postgres, Redis
crates/cli/tests/mysql.rs, crates/cli/tests/postgres.rs, crates/cli/tests/redis.rs
Adds snapshot tests for install/update/list/uninstall commands for each resource using the shared ResourceCliSpec and TestEnvironment fixtures.
Setup tests: online manifest fetch, cache fallback
crates/cli/tests/setup.rs
Rewrites setup tests to use ScriptedClient for manifest delivery; adds tests for fetch ordering, cached fallback warning, no-cache abort, .env preservation, backup file assertions, and updated default track version expectations.
Status, list JSON, and logs CLI test expansions
crates/cli/tests/status.rs, crates/cli/tests/list_json.rs, crates/cli/tests/logs.rs
Expands status fixture to seed multi-resource tracks/env/runtime snapshots; updates exit code and secret redaction assertions; adds list JSON composer/frankenphp omission test and logs resource alias filter test.
System integration: PF anchor and ports command conditional logic
crates/cli/src/commands/ports.rs, crates/cli/tests/ports.rs, crates/platform/src/pf.rs, crates/resources/src/runtime.rs, crates/resources/tests/runtime_adapters.rs
Refactors ports:install to conditionally inspect active PF redirect config only when system files are current; reorders pf.conf candidate validation to occur after anchor installation with rollback on validation failure; adds test coverage for skipped inspections and rollback behavior; aligns postgres required support-file path from share/postgresql/postgres.bki to share/postgres.bki.
Real-artifact resource matrix E2E suite
crates/daemon/tests/real_artifact_resource_matrix.rs, crates/daemon/tests/real_artifact_gateway_e2e.rs
Adds gated E2E test provisioning mysql/postgres/redis/mailpit/rustfs, linking a project, running reconciliation over a daemon socket, asserting dotenv substrings/ready allocations/running states/log files, and composer shim version validation; adds diagnostics helper and cleanup error propagation to the gateway E2E test.
CI workflows: app-release env, E2E step, privileged macOS RC
.github/workflows/app-release.yml, .github/workflows/real-artifact-e2e.yml, .github/workflows/privileged-macos-rc.yml
Adds PV_DEFAULT_ARTIFACT_MANIFEST_URL to app-release build env; adds real_artifact_resource_matrix nextest step to E2E workflow; introduces the full privileged macOS RC workflow with manifest HTTPS validation, pv build/install, evidence collection covering resolver/pf/CA/LaunchAgent/HTTP checks, and artifact upload.
Release workflow and docs validation tests
crates/pv-release/tests/workflow_defaults.rs, crates/pv-release/tests/release_docs.rs
Adds workflow fixture constants, updates app-release snapshot for dual manifest env vars, adds real-artifact-e2e and privileged-macos-rc workflow assertion tests, and adds RC checklist heading/default-track matrix validation test.
Integration test help-output snapshots
it/cli.rs
Adds three new CLI integration tests snapshotting pv --help output for core workflow commands, system integration subcommands, and shell commands.
Documentation: user guide, RC checklist, DESIGN/IMPLEMENTATION updates
docs/user/README.md, docs/release/rc-checklist.md, DESIGN.md, IMPLEMENTATION.md, README.md, release/artifacts/README.md
Adds full user guide and RC checklist; updates DESIGN.md --json/--force command tables, IMPLEMENTATION.md roadmap and RC scope text, README.md doc links, and artifacts README platform gating docs.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • prvious/pv#274: Both PRs modify RustfsRuntimeAdapter in crates/daemon/src/managed_resources/rustfs.rs—this PR changes the process arguments (server subcommand) and readiness path (/health), directly continuing the RustFS adapter work from #274.
  • prvious/pv#280: Both PRs introduce PV_DEFAULT_ARTIFACT_MANIFEST_URL env variable wiring in the build system—this PR adds it to the app-release build step and forwards it to RC workflows, building on the artifact manifest endpoint mechanism from #280.
  • prvious/pv#256: Both PRs modify the same daemon gateway codepaths (crates/daemon/src/gateway.rs reconciliation, validate_config API, crates/daemon/src/gateway_config.rs rendering), with this PR extending the FrankenPHP gateway runtime foundation from #256.

Poem

🐇 Hoppity-hop through the TLS chain,
The gateway checks HTTPS—no pain!
Manifests fetched before setup begins,
Missing tracks installed, the daemon wins.
A checklist for RC, evidence in tow,
This rabbit's release is ready to go! 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pr-26-rc-hardening

@codspeed-hq

codspeed-hq Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing feat/pr-26-rc-hardening (7df74f5) with main (72de262)

Open in CodSpeed

@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

This PR introduces a few release-readiness blind spots that should be addressed before using the RC validation as a merge/release gate.

Reviewed changes — I reviewed the PR 26 hardening work across setup manifest refresh, daemon/resource runtime behavior, real-artifact E2E coverage, privileged macOS RC validation, and release/user documentation.

  • Refresh setup manifests before system mutationpv setup now downloads or falls back to the Managed Resource artifact manifest before privileged setup steps and default-resource planning.
  • Install setup-default resources during reconciliation — daemon system reconciliation now installs missing desired default tracks without starting backing runtimes, including PHP/FrankenPHP pairing and Composer handling.
  • Harden daemon and gateway runtime readiness — daemon startup now preserves live jobs on duplicate starts, Gateway uses CA-aware HTTPS readiness when possible, Caddy storage is CA-isolated, and RustFS/Postgres runtime contracts were aligned with real artifacts.
  • Expand release-candidate validation — the PR adds a manual privileged macOS RC workflow, real-artifact resource matrix coverage, release docs checks, an RC checklist, and user-facing documentation.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using GPT𝕏

Comment thread crates/daemon/src/supervisor.rs Outdated
Comment thread .github/workflows/privileged-macos-rc.yml Outdated
Comment thread .github/workflows/privileged-macos-rc.yml Outdated

@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: 1e43ead29b

ℹ️ 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".

for install in installs {
match install {
DesiredResourceInstall::PhpPair { track } => {
commands.install_php_pair(TrackSelector::Track(TrackName::new(track)?), &client)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve partial installs when one default artifact fails

When any setup default install fails here, the ? returns immediately from the system reconciliation job, so every later default in installs is skipped. In the fresh pv setup path that means a transient PHP/FrankenPHP download or validation failure prevents Composer/MySQL/Postgres/Redis/etc. from even being attempted, contrary to the setup contract in DESIGN.md that default resource installation should install what it can and then report failures. Accumulate per-resource failures and continue through the remaining defaults before failing the job.

Useful? React with 👍 / 👎.

@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 in the latest diagnostics commit. The earlier Gateway fallback binding thread remains open because this delta did not change crates/daemon/src/gateway_config.rs.

Reviewed changes — I reviewed the commit since the prior Pullfrog review, focused on Gateway readiness failure diagnostics.

  • Logged Gateway readiness diagnosticscrates/daemon/src/gateway.rs now records a best-effort structured diagnostic event when a newly started runtime fails readiness, including the readiness error, child exit state, and loopback listener port snapshot.
  • Added runtime diagnostic log fieldscrates/daemon/src/structured_log.rs now appends runtime_readiness_diagnostics events to the daemon log for post-failure RC evidence.
  • Promoted platform for daemon diagnosticscrates/daemon/Cargo.toml now depends on platform outside dev-dependencies so daemon runtime code can inspect loopback listeners.

Pullfrog  | Fix it ➔View workflow run | Using GPT𝕏

@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: 01e527654d

ℹ️ 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".

Comment thread crates/platform/src/pf.rs Outdated
match run_system_output("/sbin/pfctl", &["-s", "nat"]) {
Ok(rules) => Ok(rules),
Err(non_sudo_error) => {
match run_system_output("/usr/bin/sudo", &["-n", "/sbin/pfctl", "-s", "nat"]) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow pf repair inspection to prompt for sudo

When /sbin/pfctl -s nat needs privileges and the user has no cached sudo timestamp, this fallback runs sudo -n, which I checked with sudo -h is “non-interactive mode, no prompts are used.” In the pv ports:install repair path where the system files are already current but active redirects are unloaded, this returns an error before the later install_pf_redirects call that could have prompted and reloaded pf, so interactive repairs fail unnecessarily; use a prompting sudo path for the mutating repair or defer privileged inspection until after authentication.

Useful? React with 👍 / 👎.

Comment thread crates/daemon/src/jobs.rs Outdated
message: heartbeat_message,
},
)
.await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not let heartbeat writes block job completion

If a foreground client keeps the daemon socket open but stops reading (for example its stdout pipe blocks), this .await can park on a full socket buffer. Because it runs inside the selected heartbeat branch, the completion future is no longer polled, so a reconciliation/update job can hang before persisting its final status; make the heartbeat best-effort with a short timeout or drop streaming on backpressure.

Useful? React with 👍 / 👎.

@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 in 91b1b2c. The earlier Pullfrog CA trust repair and empty Gateway fallback binding threads remain open because this delta did not address them.

Reviewed changes — I reviewed the single commit since the prior Pullfrog review, focused on Gateway readiness when PV-managed pf redirects are already active.

  • Probed Gateway readiness through public loopback portscrates/daemon/src/gateway.rs now selects 80/443 for Gateway readiness when active PV redirects match the stored Gateway high-port plan, while falling back to the stored high ports when redirects are absent or unreadable.
  • Covered public-port readiness construction — the Gateway unit tests now assert both GatewayHttps and empty-Gateway TCP readiness use the public ports when the selected port set represents active redirects.

Pullfrog  | Fix it ➔View workflow run | Using GPT𝕏

@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: 91b1b2cf83

ℹ️ 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".

- name: Build app binary
env:
PV_DEFAULT_APP_UPDATE_MANIFEST_URL: ${{ vars.R2_PUBLIC_BASE_URL }}/pv-app-manifest.json
PV_DEFAULT_ARTIFACT_MANIFEST_URL: ${{ vars.R2_PUBLIC_BASE_URL }}/manifest.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate amd64 releases on amd64 resource artifacts

This release build still publishes a darwin-amd64 PV binary from the matrix above, but this new compiled manifest URL can point at the artifact manifest produced by the current publication default, which only requires darwin-arm64 artifacts. On an Intel Mac, pv setup resolves TargetPlatform::DarwinAmd64 and validates every default resource with select_latest(..., target_platform), so a legally-published arm64-only RC manifest makes the shipped amd64 app fail before setup can proceed. Either do not publish/bake this manifest into the amd64 app for the arm64-only RC, or require matching amd64 resource artifacts before releasing the amd64 binary.

Useful? React with 👍 / 👎.

@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 — I reviewed the single commit since the prior Pullfrog review, focused on avoiding the privileged macOS RC restart race before update validation.

  • Moved restart after initial serving validation.github/workflows/privileged-macos-rc.yml now proves the project serves over HTTP and HTTPS before pv daemon:restart, then repeats status and serving checks after the restart.
  • Waited for restart reconciliation to go idle — the RC workflow now polls pv jobs --json until no jobs are running before pv update --check --json, and crates/pv-release/tests/workflow_defaults.rs pins that ordering.

Pullfrog  | View workflow run | Using GPT𝕏

@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 — I reviewed the single commit since the prior Pullfrog review, focused on allowing the first app publication run when there is no current stable app manifest or installer yet.

  • Allowed first app publication without current stable inputs.github/workflows/app-publication.yml now calls stage-app-publication through run_stage_app_publication() and avoids expanding current_stable_args when the optional current-stable objects are absent.
  • Pinned the missing-current-stable workflow contractcrates/pv-release/tests/workflow_defaults.rs now asserts the wrapper and zero-argument branch so the publication workflow keeps working under set -u.

Pullfrog  | View workflow run | Using GPT𝕏

@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

- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest

P2 Badge Pin actions in the real-artifact workflow

This new workflow runs several actions through mutable tags here and below (@v4, @stable, @v2) before executing the RC checks. If one of those tags is retargeted or compromised, a manually dispatched real-artifact run would execute unreviewed code in the repository context; this is especially risky for the optional privileged RC path. Pin these action references to full commit SHAs, as the adjacent app release/publication workflows do.

ℹ️ 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".

@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 in the new commit. The earlier Gateway fallback listener feedback remains open and unchanged outside this delta.

Reviewed changes — I reviewed the single commit since the prior Pullfrog review, focused on closing the privileged macOS RC workflow race after pv link.

  • Waited for link reconciliation before serving checks.github/workflows/privileged-macos-rc.yml now waits for pv jobs --json to show no running jobs after pv link before checking status and route serving.
  • Followed HTTP-to-HTTPS redirects in RC probes — the initial and post-restart HTTP checks now pass --location and the PV CA so the workflow verifies the HTTPS-backed route reached from http://pv-rc-project.test/.
  • Covered the workflow contract in release testscrates/pv-release/tests/workflow_defaults.rs now asserts the link-wait ordering and redirect-following HTTP probes.

Pullfrog  | Fix it ➔View workflow run | Using GPT𝕏

@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: 5d96e0bceb

ℹ️ 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".

Comment thread crates/cli/src/commands/setup.rs Outdated
manifest.resolve_track(&resource_name, track_selector)?
};

manifest.select_latest(&resource_name, track, target_platform)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not block setup on one missing default artifact

When the refreshed manifest lacks an artifact for any single setup default on the current platform, this ? aborts pv setup before DNS/ports/CA/daemon registration and before recording the other default resources. For example, a missing Redis/RustFS platform artifact prevents PHP/FrankenPHP and the Gateway from being set up at all, even though setup is meant to install what it can and report default-resource failures afterward. Accumulate this per-resource failure and continue planning the remaining defaults instead of failing the whole setup preflight.

Useful? React with 👍 / 👎.

@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: edccaf869e

ℹ️ 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".

- Update check and diagnostics executed
CHECKLIST

record_status setup required pv setup --yes --no-path

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass the RC artifact manifest into setup

When this workflow is run with artifact_manifest_url pointing at a candidate resource manifest (as real-artifact-e2e.yml does via inputs.manifest_url), this pv setup still resolves resources from the installed binary's compiled default; crates/cli/src/environment.rs falls back to resources::default_artifact_manifest_url() and its test asserts runtime env vars are ignored. The script only writes RESOLVED_ARTIFACT_MANIFEST_URL to the evidence summary, so the privileged RC can pass while never downloading or validating the candidate Managed Resource artifacts. Use an installer/binary built with that manifest, or provide a supported override for this setup/reconciliation path.

Useful? React with 👍 / 👎.

@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.

Caution

This PR introduces a release-candidate validation gap and an installer download hardening issue in the new privileged macOS RC path.

Reviewed changes — I reviewed the four commits since the prior Pullfrog review, focused on the switch from a local source-built RC binary to the candidate installer and the related workflow/test refactors.

  • Installed PV from the candidate installer.github/workflows/privileged-macos-rc.yml now resolves an installer_url, runs scripts/ci/privileged-macos-rc.sh, and executes the downloaded installer before the privileged setup/link/restart/uninstall evidence flow.
  • Passed installer inputs through real-artifact validation.github/workflows/real-artifact-e2e.yml now accepts installer_url and forwards it to the reusable privileged macOS RC workflow after the real-artifact jobs.
  • Added interactive CA trust modeplatform::PrivilegeMode lets normal pv ca:* and setup paths use interactive sudo-backed security commands while pv setup --non-interactive keeps sudo -n behavior.
  • Moved privileged RC assertions into checked-in script coveragecrates/pv-release/tests/workflow_defaults.rs now reads scripts/ci/privileged-macos-rc.sh directly and checks pinned workflow action references.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using GPT𝕏

Comment thread scripts/ci/privileged-macos-rc.sh Outdated
Comment thread scripts/ci/privileged-macos-rc.sh

@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

♻️ Duplicate comments (1)
scripts/ci/privileged-macos-rc.sh (1)

102-102: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Installer download can follow HTTP redirects despite HTTPS initial URL.

The curl --location call follows redirects but does not constrain redirect protocols. A malicious redirect could downgrade to HTTP before the installer script executes on a privileged runner.

Suggested fix
-record_status download-installer required curl --fail --show-error --silent --location --retry 3 --retry-delay 2 "$RESOLVED_INSTALLER_URL" -o "$PV_RC_INSTALLER"
+record_status download-installer required curl --fail --show-error --silent --location --proto '=https' --proto-redir '=https' --retry 3 --retry-delay 2 "$RESOLVED_INSTALLER_URL" -o "$PV_RC_INSTALLER"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/privileged-macos-rc.sh` at line 102, The curl command in the
record_status download-installer line uses the --location flag to follow
redirects but does not restrict which protocols redirects can use, potentially
allowing a downgrade from HTTPS to HTTP. Add the --proto-redir flag set to
=https in the curl command to ensure that any HTTP redirects encountered during
the download are restricted to HTTPS protocol only, preventing potential
man-in-the-middle attacks on the privileged runner.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/privileged-macos-rc.sh`:
- Line 106: The preflight check on the line with record_status and sudo -n true
uses the || operator to call record_blocked when sudo fails, but this does not
actually prevent script continuation since record_blocked succeeds, causing the
entire line to exit successfully. After calling record_blocked to report the
sudo-required failure, the script needs to explicitly exit or return to prevent
subsequent privileged commands from executing and producing noisy output from
unavoidable failures.

---

Duplicate comments:
In `@scripts/ci/privileged-macos-rc.sh`:
- Line 102: The curl command in the record_status download-installer line uses
the --location flag to follow redirects but does not restrict which protocols
redirects can use, potentially allowing a downgrade from HTTPS to HTTP. Add the
--proto-redir flag set to =https in the curl command to ensure that any HTTP
redirects encountered during the download are restricted to HTTPS protocol only,
preventing potential man-in-the-middle attacks on the privileged runner.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8787759f-9c7c-42f0-8ae7-8f313a1cbee9

📥 Commits

Reviewing files that changed from the base of the PR and between b07144e and edccaf8.

⛔ Files ignored due to path filters (6)
  • Cargo.lock is excluded by !**/*.lock
  • crates/cli/tests/snapshots/ports__ports_install_skips_active_rule_inspection_before_first_install.snap is excluded by !**/*.snap
  • crates/cli/tests/snapshots/ports__ports_install_writes_prepared_and_system_pf_artifacts.snap is excluded by !**/*.snap
  • crates/daemon/tests/snapshots/gateway_config__gateway_config_renderer_outputs_empty_gateway_listener.snap is excluded by !**/*.snap
  • crates/platform/tests/snapshots/resolver_config__pf_conf_reference_inspection_reports_missing_current_stale_conflict_and_unreadable.snap is excluded by !**/*.snap
  • crates/platform/tests/snapshots/resolver_config__pf_config_renders_pv_owned_anchor_and_pf_conf_reference.snap is excluded by !**/*.snap
📒 Files selected for processing (31)
  • .github/workflows/app-publication.yml
  • .github/workflows/privileged-macos-rc.yml
  • .github/workflows/real-artifact-e2e.yml
  • Cargo.toml
  • DESIGN.md
  • crates/cli/src/commands/ca.rs
  • crates/cli/src/commands/ports.rs
  • crates/cli/src/commands/setup.rs
  • crates/cli/src/environment.rs
  • crates/cli/tests/ca.rs
  • crates/cli/tests/ports.rs
  • crates/cli/tests/postgres.rs
  • crates/cli/tests/setup.rs
  • crates/daemon/Cargo.toml
  • crates/daemon/src/gateway.rs
  • crates/daemon/src/gateway_config.rs
  • crates/daemon/src/jobs.rs
  • crates/daemon/src/structured_log.rs
  • crates/daemon/src/supervisor.rs
  • crates/daemon/tests/gateway_reconciliation.rs
  • crates/daemon/tests/real_artifact_resource_matrix.rs
  • crates/daemon/tests/supervisor_foundation.rs
  • crates/platform/Cargo.toml
  • crates/platform/src/lib.rs
  • crates/platform/src/pf.rs
  • crates/platform/src/trust.rs
  • crates/platform/tests/resolver_config.rs
  • crates/pv-release/tests/release_docs.rs
  • crates/pv-release/tests/workflow_defaults.rs
  • docs/user/README.md
  • scripts/ci/privileged-macos-rc.sh
✅ Files skipped from review due to trivial changes (1)
  • docs/user/README.md
🚧 Files skipped from review as they are similar to previous changes (11)
  • Cargo.toml
  • crates/cli/src/commands/ports.rs
  • crates/daemon/Cargo.toml
  • crates/pv-release/tests/release_docs.rs
  • crates/cli/tests/ports.rs
  • crates/cli/src/commands/setup.rs
  • crates/cli/tests/postgres.rs
  • crates/pv-release/tests/workflow_defaults.rs
  • .github/workflows/real-artifact-e2e.yml
  • DESIGN.md
  • crates/daemon/tests/gateway_reconciliation.rs

Comment thread scripts/ci/privileged-macos-rc.sh 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.

✅ No new issues found.

Reviewed changes — I reviewed the four commits since the prior Pullfrog review, focused on the release workflow platform gate, setup partial-default planning, privileged macOS RC validation, CA/pf privilege handling, Gateway readiness, and foreground job streams.

  • Gated app release platforms.github/workflows/app-release.yml now accepts app_platforms, builds and stages only selected app platforms, and the generated installer tolerates an arm64-only preview lane.
  • Relaxed setup default planning failurespv setup now records and reconciles valid default Managed Resource plans even when unrelated defaults fail manifest planning, then exits failure with the unresolved default errors.
  • Repaired privileged CA and pf pathspv ca:trust, setup, and ports commands now pass explicit interactive or noninteractive privilege modes, remove denied/stale CA entries before re-trusting, and inspect active pf redirects through the appropriate privilege path.
  • Hardened Gateway and daemon streaming behavior — the empty Gateway fallback restores explicit loopback binding, foreign-listener probes are bounded, and long-running foreground update/reconcile jobs emit bounded heartbeat log events.
  • Closed privileged RC validation gapsscripts/ci/privileged-macos-rc.sh now constrains installer redirects to HTTPS, checks the installed binary for the resolved manifest URLs before setup, and fails early when passwordless sudo is unavailable.

Pullfrog  | View workflow run | Using GPT𝕏

@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 — I reviewed the single commit since the prior Pullfrog review, focused on the setup default-track cleanup and Gateway timing regression coverage.

  • Simplified setup default track cloningcrates/cli/src/commands/setup.rs now uses .cloned() when carrying the resolved PHP default track into FrankenPHP planning.
  • Relaxed the Gateway timing harnessgateway_reconciliation_bounds_foreign_https_listener_probe now gives the outer test timeout 2 seconds while keeping the production readiness timeout path under test at 100ms.

Pullfrog  | View workflow run | Using GPT𝕏

@munezaclovis
munezaclovis merged commit a0e0566 into main Jun 17, 2026
4 checks passed
@munezaclovis
munezaclovis deleted the feat/pr-26-rc-hardening branch June 17, 2026 06:25
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