Skip to content

fix(autopilot): harden Runtime PR sync, sandbox skips, job cleanup, and offline net/credit guards - #3420

Merged
Serhan-Asad merged 6 commits into
mainfrom
feat/autopilot-safety-and-engine-hardening
Nov 15, 2026
Merged

Serhan-Asad merged 6 commits into
mainfrom
feat/autopilot-safety-and-engine-hardening

Conversation

@Serhan-Asad

@Serhan-Asad Serhan-Asad commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Follows #3419

Lines changed: +1,413 / -125 across 24 files.

What is implemented

  • PR body Runtime: parsing and automatic synchronization (src/autopilot-core.mjs, prompts/cli/autopilot-core.prompt.md):
    • Tightens runtimeVerdicts so prose lines that start with Runtime without a colon (for example, Runtime errors are caught...) are never parsed as malformed Runtime: verdict lines.
    • Mechanically formats and synchronizes verified Runtime: verdict lines (and Evidence: runtime= state) from Autopilot's saved runtime verification state when updating PR descriptions, while still requiring the underlying saved runtime checks to pass.
  • Sandbox real-binding-unavailable handling (src/autopilot-core.mjs, prompts/cli/autopilot-core.prompt.md):
    • Treats saved rows with real-binding-unavailable (zero provider calls when no live binding exists in the local sandbox) as local skips rather than author refusals or runtime coverage losses, while verifying every test of a multi-test Story has a passing or skipped/service deciding check so unrun sibling tests are never excused.
    • Stops feeding generic operator-reconciliation client_advice into coding-agent repair prompts so worker runs focus on real code, test, and lint failures instead of stopping with false needs-person aborts.
  • Process-tree manifest bounds, stopped-job cleanup recovery, PID-recycling safety, and suite concurrency caps (src/agent-job.mjs, src/autopilot-core.mjs, owning prompts):
    • Raises the wrapper process-tree ps polling interval from 250 ms to 2000 ms and deduplicates and bounds captured process manifests to 512 entries.
    • Recovers stopped or timed-out jobs cleanly in cleanupAgentJob instead of latching .processes.error forever (including when prior retryable snapshot attempts recorded wrapper: null, failing closed on resolution write errors, and skipping -job.pid group collection, liveness probes, SIGTERM, and SIGKILL whenever job.pid has been recycled to an unrelated process without job.token).
    • Bounds Autopilot's full-suite node --test concurrency (--test-concurrency) to Math.max(1, Math.min(6, shareCpus)) when shareCpus is configured via ports.machine or ports.env.PDD_CHECK_CPUS (or directly on a node --test command).
  • Offline test network guard and credit-account skip guards (package.json, test/helpers/test-net-guard.mjs, src/login-pool.mjs, src/agent-adapters.mjs, src/autopilot-launcher.mjs, .github/workflows/ci.yml, scripts/vm-suite.sh, owning prompts):
    • Adds test/helpers/test-net-guard.mjs and loads it via --import in package.json scripts.test, CI, and scripts/vm-suite.sh to allow 127.0.0.1, ::1, localhost, 0.0.0.0, and Unix domain sockets while blocking external network calls with ERR_PDD_OFFLINE_TEST_NET_BLOCKED unless PDD_ALLOW_NET=1 or PDD_LIVE_CANARY=1.
    • Enforces credit and reset-eligible account skip guards across selectCloudPoolLogin, selectPoolLogin, loadLoginPool fallback normalization, runStepAgentProcess, and runAutopilotLauncher startup checks unless allowCredits: true is explicitly passed by a human CLI command.
  • Prompts and ownership headers:
    • Verified current Generated from ... prompt headers across all touched owned files via pdd owner.

What is tested

  • Focused local tests (Mac):
    • test/autopilot-hardening.test.mjs, test/test-home-isolation.test.mjs, test/agent-adapters.test.mjs, test/autopilot-launcher.test.mjs, test/autopilot-core.test.mjs, test/autopilot-core-evidence.test.mjs, test/autopilot-core-guard.test.mjs, test/autopilot-core-runtime-wait.test.mjs, test/agent-job.test.mjs, test/login-pool.test.mjs, test/cloud-accounts.test.mjs, test/file-owner.test.mjs, test/plain-prompts-and-frontmatter.test.mjs (0 failures).
  • Full test suite on runner VM (pdd-vm):
    • Passed 6,242 / 6,243 (0 failures, 1 skipped).

@Serhan-Asad
Serhan-Asad merged commit 307f9ba into main Nov 15, 2026
14 checks passed
@Serhan-Asad
Serhan-Asad deleted the feat/autopilot-safety-and-engine-hardening branch November 15, 2026 09:09
@Serhan-Asad Serhan-Asad mentioned this pull request Nov 15, 2026
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