Add an opt-in SwiftPM job limit to coordinated builds and tests - #523
Add an opt-in SwiftPM job limit to coordinated builds and tests#523morluto wants to merge 5 commits into
Conversation
- `configured_swift_jobs` validates and parses the env var; `append_swift_jobs_arg` appends `--jobs N` only to coordinated SwiftPM invocations. - Request env is authoritative: when an env dict is provided we do not fall back to the daemon's `os.environ`, preventing cross-job leakage. - Integer validation matches the shell scripts exactly: positive decimal integer with no leading zeros and no sign (`^[1-9][0-9]*$`). - Wired into `swift-build`, `test`, `provider-test`, `swift_build_all`, and the `package_app.sh` / `build_swiftpm_release_products.sh` packaging paths. - Added `REPOPROMPT_SWIFT_JOBS` to `CONDUCTOR_ENV_KEYS` and echoed the effective limit in daemon logs and `run_operation_command` output. - Added focused tests for env authority, fingerprint reuse, unaffected non-Swift ops, packaging-script regex parity, and shell/Python validation consistency. - Documented the contract in `AGENTS.md`. Closes repoprompt#476
Only parse/validate the Swift jobs limit in DaemonState._run_job for swift-build, test, and provider-test operations. Packaging/build scripts and non-Swift lanes (sleep, diagnostics, etc.) must not be blocked by an invalid REPOPROMPT_SWIFT_JOBS value. Add daemon-level regression tests proving that invalid values do not affect sleep while swift-build product=all rejects the job in the daemon runner.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Current-main refresh on exact head |
Audit disposition — rebase and validate the real SwiftPM commands (2026-08-14)The request-environment authority, request-key fingerprinting, and propagation through coordinated build/test paths are coherent. The remaining gap is executable compatibility: argv-construction unit tests do not prove every generated form is accepted by the pinned SwiftPM. Please run the exact commands, especially |
Deep-review assessment — 2026-08-14Disposition: code-ready after real SwiftPM invocation checks. Request-environment authority, request-key separation, shell/Python validation parity, and propagation through packaging are coherent. The remaining gap is that the tests mainly inspect generated argv; they do not establish that every emitted command shape is accepted by the active SwiftPM version. Please execute each path at least once on the final head, especially |
Why
Conductor serializes heavy jobs across worktrees, but one admitted Swift build can still use many compiler workers. Global heavy slots and SwiftPM worker limits solve different problems: one bounds concurrent conductor jobs; the other bounds parallelism inside one job.
This PR adds the second control without changing default behavior.
Closes #476.
What changes
Adds:
When set, coordinated SwiftPM build, test, provider-test, packaging, run, and release-product paths receive
--jobs <N>.Contract
This is developer workload control, not application state, so it remains an environment contract at the coordinated command boundary.
Review order
Verification