Repository navigation
forge-pilot: R10 thin campaign adapter and fixed-candidate roundtrip qualification (P8) - #113
Merged
Merged
Conversation
…qualification Bind mission/source/fixture/patch/evaluator/dataset/policy/route identities into a closed versioned CampaignBinding carried only through existing owners (ApprovalRecord.reviewed_artifact_refs, executor request_id, bundle plan description). Pre-effect admission reads the persisted review back, recomputes digests, and mints the permit only via evaluate_policy -> issue_execution_permit. Adds campaign_fixed_candidate_roundtrip with real forge-executor runs, cold reopen, and per-witness negative tests.
…TBSY)
forge_executor_tests wrote each stub tool with fs::write + set_permissions and
then executed it. Under the parallel test runner a concurrent fork can inherit
the stub's still-open write fd, and Linux then refuses to exec the file with
ETXTBSY ('Text file busy'). cargo_fixture_selects_the_cargo_branch_not_python
failed this way once on the rebased P8 head with an unchanged test file.
Stubs are now written to a sibling temp name, made executable, and renamed
into place, so no fd ever holds the final path open for writing. Test-only.
Verified: forge_executor_tests 25/25 runs, 0 ETXTBSY; forge-pilot +
forge-engine --lib --tests 403 passed, 0 failed; fmt and clippy clean.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds the R10 campaign adapter (P8) to
forge-pilotas a thin layer over existing owners, and its qualification test,campaign_fixed_candidate_roundtrip.forge-pilot/src/campaign.rs(new).CampaignBindingis a versioned, closed (deny_unknown_fields) record with a blake3 digest. It binds the mission contract reference (contract:<64hex>) and kanban attachment id, carried as opaque references the Ares owner issues; the source-tree and fixture digests; the patch hash (same algorithm as the engine's); evaluator id and digest; dataset partition and digest; policy version and digest; and route id and digest.bind()builds it;verify()recomputes every digest from the actual inputs and returns a typed error on any mismatch.campaign-binding:<digest>is the exactApprovalRecord.reviewed_artifact_refsentry, the executorrequest_id, the plan input and the bundle treatment description. There is no new table, schema or evidence store; the persisted review holds only existing owner types (case, plan, approval); it is re-read at admission only to re-verify the binding, and is never accepted as proof that an effect occurred. The change touches onlycampaign.rs, onelib.rsline and one new test file.admit_pre_effect) reads the persisted review back, recomputes the binding, requires the persisted case, plan and approval ids to equal the reviewed ids and the approval to carry exactly the binding reference, then lets the owners decide:approval_matches,policy_as_of,evaluate_policy,issue_execution_permit. The issued permit must carry the reviewed case, plan, scope and exact execution input. Within the adapter, permits come only fromissue_execution_permit; it constructs none itself.reopen_run_state) reconstructs completed, failed, unknown (empty or torn result, or missing evidence) and never-started runs from disk, reusing the executor's readback, without re-running anything.Qualification
campaign_fixed_candidate_roundtripruns the realforge-executorbinary on a fixed known-good and a fixed known-bad candidate after admission, then evaluation, canonical export and import, and a cold reopen with fresh store handles. The good candidate reopens intact; the bad candidate is kept as imported evidence, and the realforge_engine::promoterefuses it (no promotion row).Separate tests cover: changed patch, source, staged fixture, evaluator, mission reference, dataset, policy or route; wrong namespace or target; missing, unreadable or symlinked review; substituted approval; generated ids that differ from reviewed ids; an approval bound to another case or plan; a missing or substituted reviewed artifact; stale, not-yet-valid and expiry-less approvals; a policy not in force; owner refusals of the permit; empty, op-less and no-op patches (no gain, no promotion); duplicate import (idempotent, one import row); missing evidence (nothing imported, nothing promoted); and evidence from another campaign.
Evidence
On head
ab70c9c(rebased ontomaina4dfb91, the merge of #112 (promotion gated on retained executions); the adapter's diff has the same sha256 before and after the rebase):cargo fmt --all -- --checkandcargo clippy --locked -p forge-pilot --lib --bins --tests -- -D warnings: clean.cargo test --locked -p forge-pilot -p forge-engine --lib --tests: 403 passed, 0 failed, 0 ignored.Contract recipe (
closed_loop_normalization_tests,loop_roundtrip_tests,verification_control_tests,campaign_fixed_candidate_roundtrip): all pass;campaign_fixed_candidate_roundtripalone is 37 passed.Mutation: 57 single-line mutants of
campaign.rs, each killed by a named test, run against the final campaign test set on6bedd08; sources restored byte-identical (sha2563a78a8bf…, the same file atab70c9c). Mutants were not re-run atab70c9c; that commit changes onlyforge_executor_tests.rs.A second commit (
ab70c9c, test-only) addresses an intermittentETXTBSY("Text file busy") inforge_executor_tests.rs. The likely cause (inferred from the error, not instrumented): stub tools were written and then executed while a concurrent test fork could still hold the write fd. Stubs are now written to a temp name and renamed into place.cargo_fixture_selects_the_cargo_branch_not_pythonfailed once this way on the rebased head with that file unchanged; after the change, 25 of 25 runs were clean.These are local runs on one host; no hosted CI run existed for this head when this was written.
Scope and limits