From f5fa847365c151d585a01ac24e032f00d23e4f7b Mon Sep 17 00:00:00 2001 From: doc Date: Fri, 9 Oct 2026 20:43:25 +0000 Subject: [PATCH 1/7] plans(ci): close M003j dispatch input hardening --- architecture/overview.md | 10 +- .../ci-release-orchestration/003j-status.md | 96 +++++++++++++++++++ ...dispatch-tag-shell-injection-corrective.md | 2 +- plans/registry.md | 13 ++- .../ci-release-orchestration-roadmap.md | 4 +- 5 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 plans/closure/ci-release-orchestration/003j-status.md diff --git a/architecture/overview.md b/architecture/overview.md index 9625426..babe091 100644 --- a/architecture/overview.md +++ b/architecture/overview.md @@ -25,7 +25,7 @@ reading instead of the source. Keeping them true is a manual obligation, and it has been missed before, so record what is actually true rather than what was once true. -The last code commit, `61b2c03`, changed five source files +The prior code commit, `61b2c03`, changed five source files (`builder.rs`, `qualification.rs`, `ci/src/lib.rs`, `cli/src/main.rs`, `github/src/lib.rs`). It also edited most of the deep dives, but **did not re-base the line numbers** in six of them, so roughly ninety citations pointed at @@ -73,6 +73,14 @@ whose intent it could not confirm. Treat those as indicative until re-based by symbol name. The rule from the `61b2c03` pass holds: re-base by reading the line and confirming it holds what the sentence claims, never by arithmetic alone. +CI M003j (`559d940`) modified `eggpack-ci/src/lib.rs` and increased its count to +10772 lines. The dispatch-rendering anchors were rechecked by symbol for this +change: workflow trigger/concurrency rendering (`3320-3350`), reusable resolve +(`3388`), write-scoped stage (`3895-3999`), and post-render check (`4003`). The +approximate `ci.md` renderer range and these relevant `ci-rendering.md` anchors +were updated. Other pre-existing `ci-rendering.md` citations were not +blanket-shifted; verify them by symbol before relying on them. + ## How to read this document This file has two jobs, deliberately: diff --git a/plans/closure/ci-release-orchestration/003j-status.md b/plans/closure/ci-release-orchestration/003j-status.md new file mode 100644 index 0000000..81d28b0 --- /dev/null +++ b/plans/closure/ci-release-orchestration/003j-status.md @@ -0,0 +1,96 @@ +# CI M003j Closure — Dispatch-Tag Shell Injection Corrective + +Status: **closed** + +Source plan: `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` + +Roadmap: `plans/subsystems/ci-release-orchestration-roadmap.md` + +Reviewed Eggpack baseline: `d61ca71fc0112be63e7e8ba31ba8fa2b1ce5a628`. + +Implementation commit and immutable producer pin: `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`. + +Reviewed consumer configurations: wg-basic `0b814fe02b5e09654e9363c8f61caf59b25ecc92` (R001 status/registry/roadmap-only update; workflow/config unchanged), Eggsearch `2e876e46724c02c502d78bf968e74a1ad6affb71`, Eggsact `d4e6e5c5cd7e9665373fbe312f4e1fb122fb5729`, and StegoEggo `a01a0222c6a5022a9eb3561f153b1e72b6e6c42a`. The source plan's originally confirmed wg-basic security-review baseline was `dbowm91/wg-basic@ff40f851508ccda52171c27cefdcdaf4ec1da2d5`. No consumer workflow or release-policy configuration was changed. + +Hosted CI: [run 37987890305](https://github.com/eggstack/eggpack/actions/runs/37987890305), push, attempt 1, `head_sha` exactly `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`, conclusion `success`. Linux stable, Linux 1.89.0, macOS, and Windows portability all passed. + +## Executive finding + +CI M003j is closed. Workflow-dispatch release tags are validated as bounded canonical stable `vX.Y.Z` data before the reusable resolver or write-scoped staging job checks out the selected source. The generated Bash reads the value through the quoted `EGGPACK_RELEASE_TAG` environment variable. The reusable resolver now uses this data path for both mapped and legacy exact-tag identity modes; the legacy mode previously placed the dispatch expression directly in the `_resolve-release` shell argument. A renderer guard rejects dispatch-tag expressions in any generated `run:` script while permitting data use in action inputs such as checkout `with.ref` and in concurrency keys. + +No build/qualification authority, staging permission, manifest schema, publication authority, or signing trust decision changed. No real dispatch, draft creation, signing, or publication occurred. + +## Requirement-to-evidence matrix + +| Requirement | Evidence | Result | +|---|---|---| +| Remove executable interpolation in reusable resolver and stage validation | `dispatch_tag_validation_step` emits an `env` binding and fixed Bash validator; resolve and stage branches place it before checkout. `m003c_tag_source_controls_checkout_input_and_stage_guard` asserts safe `run` bodies, environment binding, and validation-before-checkout ordering. | Pass | +| Route resolver CLI tag argument through data for legacy and mapped modes | Runtime `ResolveRelease` always uses the renderer-only `$release_tag` marker, which renders as the quoted `"$EGGPACK_RELEASE_TAG"`; resolver step binds the tag for both modes. `m003i_mapped_workflow_binds_tag_safely_and_preserves_event_mapping` remains green; M003j reusable render assertions cover dispatch mode. | Pass | +| Reject malformed or injected tags before source checkout | Validator caps input at 64 characters and accepts only canonical stable `vX.Y.Z`. Unix regression covers valid, empty, non-prefixed, leading-zero, prerelease, build suffix, newline, shell substitution, punctuation, and over-bound input. | Pass | +| Prove the test distinguishes the old vulnerable script | The controlled old-template Bash run creates a temporary marker from `$(touch ...)`; the rendered validator rejects the same fixture without creating the marker. No network or credentials are used. | Pass | +| Fail closed if unsafe dispatch expressions return to generated scripts | `contains_unsafe_dispatch_expression_in_run` rejects direct `inputs.release_tag` expressions in scalar and block `run:` forms. Mutation test inserts the old expression and verifies the guard detects it and `check_release_github` reports drift. | Pass | +| Preserve ref-name, mapped identity, staging scope, and release schema | RefName stays push/tag-only; DispatchInput remains dispatch-only; exact-source verification, M003i mapping, permissions and handoff remain unchanged. No schema or CLI document shape changed. Existing M003c/M003i regressions and the full workspace suite pass. | Pass | +| Qualify the exact implementation on required hosted platforms | Hosted run 37987890305 is green on Stable Linux, Rust 1.89.0 Linux, macOS, and Windows. | Pass | +| Re-render the affected consumer configuration without modifying it | From wg-basic's current checked-in workflow shape, contract, and GitHub policy: generation produced 33,370 bytes and `ci check: match`. Diff is exactly the two validation steps: each now has a bounded environment-based validator moved ahead of checkout. No policy key changed; the policy's pinned Eggpack revision remains consumer-owned and must be repinned by its plan. | Pass | +| Identify other adopted DispatchInput consumers | Current Eggsact, StegoEggo, and Eggsearch policies all select `dispatch_input`; their checked-in `release-binaries.yml` / `release-eggpack.yml` contain direct executable interpolation. Fresh render sizes were 56,534 / 56,596 / 76,328 bytes and self-check passed; `ci check` against each checked-in workflow correctly reports drift. Generated diffs replace both validation snippets and, in legacy exact-identity mode, replace the direct `_resolve-release --tag '${{ inputs.release_tag }}'` argument with `"$EGGPACK_RELEASE_TAG"`. | Confirmed; consumer remediation remains open | + +## Production implementation evidence + +- `crates/eggpack-ci/src/lib.rs`: one canonical bounded Bash validator is rendered into reusable `resolve` and `stage`; both run it before checkout. `ResolveRelease` takes the tag from a quoted environment reference in every identity mode. +- The generator scans emitted `run:` scalar and block forms for direct dispatch-tag interpolation and returns a bounded render error if one appears. Dispatch expressions remain permitted in non-executable action inputs and concurrency metadata. +- `crates/eggpack-ci/README.md`, `architecture/ci-rendering.md`, `architecture/ci.md`, and `architecture/overview.md` describe the new behavior and current source line counts/relevant anchors. +- Golden workflows for RefName staging are byte-identical; no golden fixture update was needed because the affected DispatchInput reusable flow is exercised from its actual parsed generated YAML in tests. + +Before/after consumer render: the two old `run: "test -n \"${{ inputs.release_tag }}\""` steps are replaced by a multiline validator using `EGGPACK_RELEASE_TAG`; the new steps precede checkout in both jobs. For legacy exact-identity configurations, `_resolve-release --tag '${{ inputs.release_tag }}'` also becomes `_resolve-release --tag "$EGGPACK_RELEASE_TAG"` with the expression moved into `env`. Other generated workflow sections and consumer policy keys are unchanged by the rerender. + +## Exact verification executed + +| Command/evidence | Result | +|---|---| +| `cargo test -p eggpack-ci --locked m003c_tag_source_controls_checkout_input_and_stage_guard -- --nocapture` | Passed | +| `cargo test -p eggpack-ci --locked m003j_dispatch_tag_validation_treats_values_as_data -- --nocapture` | Passed; controlled shell-substitution marker negative proved | +| `cargo test -p eggpack-ci --locked m003i_mapped_workflow_binds_tag_safely_and_preserves_event_mapping -- --nocapture` | Passed | +| `cargo run -p eggpack-cli --locked -- ci generate --workflow-shape ../wg-basic/release/eggpack/workflow-shape.json --contract ../wg-basic/release/eggpack/distribution.toml --github-policy ../wg-basic/release/eggpack/github-policy.json --output /tmp/eggpack-wg-basic-m003j.yml` | Generated 33,370 bytes | +| `cargo run -p eggpack-cli --locked -- ci check --workflow-shape ../wg-basic/release/eggpack/workflow-shape.json --contract ../wg-basic/release/eggpack/distribution.toml --github-policy ../wg-basic/release/eggpack/github-policy.json --workflow /tmp/eggpack-wg-basic-m003j.yml` | `ci check: match (33370 bytes)` | +| Generate and self-check Eggsact, StegoEggo, and Eggsearch reusable outputs | Passed at 56,534 / 56,596 / 76,328 bytes. Against the checked-in workflows, `ci check` reported expected drift (55,901 / 55,963 / 75,695 actual bytes) pending consumer repin/regeneration. | +| `scripts/check-local.sh` | Passed: format, check, clippy, per-crate tests, workspace tests, docs, dependency trees, package verification, and Rust 1.89.0 check/tests | +| Hosted [run 37987890305](https://github.com/eggstack/eggpack/actions/runs/37987890305) | Passed on exact implementation SHA across Linux stable, Linux 1.89.0, macOS, Windows | +| `git diff --check` | Passed | + +The package phase printed the pre-existing registry warning that locked `yoke-derive v0.8.3` is yanked; every package verification succeeded. No lockfile or dependency was changed. + +## Invariant review + +- **Data/code separation:** dispatch text is passed only as environment data and a quoted variable argument; the finite validator does not evaluate or re-expand it. +- **Validation order:** `resolve` and privileged `stage` validate before checkout. The earlier preflight checkout remains a pinned action input followed only by `cargo --version`; no checked-out workflow source executes there. The actual build graph depends on successful `resolve`. +- **Identity/source authority:** exact-source SHA verification and M003i tag/manifest mapping remain authoritative; canonical tag syntax does not authorize a source revision. +- **Privilege:** only stage retains `contents: write`, after aggregate. No signing secret, OIDC permission, publication step, or new network action was added. +- **Determinism:** canonical helper output is fixed; workflow generation remains byte-stable and consumer regeneration has zero drift. +- **Release evidence:** ReleaseManifest v1 and final-byte meaning are unchanged; no signature or provenance claim was added. + +Nothing was weakened to reach this milestone. + +## Failure, recovery, compatibility, and security review + +Invalid or oversized dispatch values fail before the resolver or stage checks out the requested tag. A failure leaves no build or draft mutation. A valid value proceeds through the existing exact-source checks. Reruns remain concurrency-serialized and staging remains draft-only/no-clobber. + +This changes generated reusable-workflow bytes and requires consumers to repin the immutable producer commit and regenerate their checked-in workflow under their own plan. Exact-tag workflow identities, RefName push behavior, `StagingTagSource`, CLI interfaces, manifest compatibility, and existing handoff documents remain compatible. No consumer workflow or release-policy configuration was edited; wg-basic received only the plan/registry status update cited below. + +Security review found no residual Eggpack dispatch-tag-to-shell path in generated `run:` text. The tag remains visible in YAML data positions (`with.ref`, environment binding, and concurrency group) by design. No live attack, dispatch, credentials, or privileged staging was attempted; only a harmless local marker fixture was executed. + +## Documentation and operations + +Producer pin for wg-basic Release Readiness R001 and other affected consumers: `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`. Each consumer plan must update its Eggpack tool revision, regenerate its checked-in workflow, and require its own `eggpack ci check` before signing or staging. No consumer key/config changed here. + +## Unresolved findings + +No unresolved producer finding remains. **High residual consumer finding:** wg-basic, Eggsact, StegoEggo, and Eggsearch still have checked-in dispatch workflows that embed `inputs.release_tag` in executable Bash. Their current configs were positively confirmed as `DispatchInput`; until each owner repins and regenerates through its own plan, those checked-in workflows remain exposed to this injection class. wg-basic Release Readiness R001 is now **ready** after a status-only update at `dbowm91/wg-basic@0b814fe02b5e09654e9363c8f61caf59b25ecc92`; workflow regeneration, provenance proof, and strict closure remain outstanding. Eggpack cannot close or silently edit the other external consumer plans. + +## Roadmap disposition and registry updates + +- CI M003j: `ready` → **closed**, this closure is its evidence record. +- The known downstream blocker is discharged: wg-basic Release Readiness R001 may resume using the immutable producer pin above. This is eligibility only; its implementation and closure remain consumer-owned. +- wg-basic updated R001's status to `ready` through its own plan/registry/roadmap in commit `0b814fe02b5e09654e9363c8f61caf59b25ecc92`; no consumer workflow, policy key, or production behavior changed in that commit. +- Eggsact, StegoEggo, and Eggsearch are also confirmed DispatchInput consumers with stale generated workflows. No corresponding corrective plan was found or changed in their repositories during this producer milestone; their maintainers need to register consumer-owned repin/regenerate work before treating those workflows as remediated. +- No other Eggpack implementation plan is promoted by this closure. The registry has no remaining ready Eggpack plan; future Eggpack implementation requires new plan authoring against the then-current evidence. +- CI M003i's historical closure is unchanged. diff --git a/plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md b/plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md index 5c65fb8..c277aec 100644 --- a/plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md +++ b/plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md @@ -1,6 +1,6 @@ # CI/Release M003j — Dispatch-tag Shell Injection Corrective -Status: ready for implementation. +Status: **closed** — strict closure is recorded at `plans/closure/ci-release-orchestration/003j-status.md` (implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`, hosted run `37987890305`, all four lanes green). Repository baseline: `eggstack/eggpack@d61ca71fc0112be63e7e8ba31ba8fa2b1ce5a628` (2026-10-08). Source roadmap: `plans/subsystems/ci-release-orchestration-roadmap.md`. Primary class: invariant / security corrective. diff --git a/plans/registry.md b/plans/registry.md index 271c2b9..eb073a4 100644 --- a/plans/registry.md +++ b/plans/registry.md @@ -85,7 +85,7 @@ Distribution predecessor evidence: - **Bootstrap M002b CLOSED:** `plans/closure/bootstrap-installers/002b-status.md`; implementation `88ddf2e796ac3674b306b51726c65ed7cc9bd29a`, hosted run `37806244313` green across Linux stable/MSRV, macOS, Windows. - **CI M003i CLOSED:** `plans/closure/ci-release-orchestration/003i-status.md`; implementation `3ddac9d84fc2e10b8451d38672f66b02e06724df`, hosted run `37813044035` green on Linux stable/MSRV, macOS, and Windows. The finite opt-in mapping preserves exact-tag defaults and ReleaseManifest v1; its mapped runtime identity envelope is explicitly versioned. - **Downstream handoff:** wg-basic Distribution M003 may resume against immutable producer SHA `3ddac9d84fc2e10b8451d38672f66b02e06724df`. Its own implementation, native qualification, and closure remain consumer-owned and were not changed in Eggpack. -- **Execution order:** M002b implementation → M002b strict four-platform closure → M003i implementation → M003i strict closure (complete) → separate wg-basic M003 handoff. These additions supersede historical 'no ready' snapshots below; earlier closure records remain unchanged. +- **Execution order:** M002b implementation → M002b strict four-platform closure → M003i implementation/closure → M003j implementation/strict closure (complete) → separate wg-basic Release Readiness R001 repin/rerender under its consumer-owned plan. Earlier closure records remain unchanged. ## Active subsystem roadmaps @@ -96,7 +96,7 @@ Distribution predecessor evidence: | Release manifest | active | `plans/subsystems/release-manifest-roadmap.md` | M002/M003 closed; M003a closed | M003a closed as a docs-only post-publication downstream-closure reconciliation after Eggup M004 closed (`eggstack/eggup@ea1f1c5e29302e5feca4599db9342d3a5ac93915`; formal Eggup status cleanup `eggstack/eggup@3b82d5397e728649a666690868a1e2d0fe42460d`); closure `plans/closure/release-manifest/003a-status.md`; M003 remains closed and no runtime/package requalification was performed or implied | | Build and qualification | active | `plans/subsystems/build-qualification-roadmap.md` | M001-M006 closed | M006 closed on `398cd43` + run 36484758546 under accepted ADR-0005 Option A; the milestone chain is closed and later work needs new evidence | | Bootstrap installers | active; corrective closed | `plans/subsystems/bootstrap-installers-roadmap.md` | M002b closed; prior milestones closed | M002b implementation `88ddf2e`, hosted run `37806244313`; POSIX runtime remains on Unix and Windows PowerShell archive runtime passed. M003 completion definition remains satisfied | -| CI/release orchestration | active; M003i closed, M003j security corrective ready | `plans/subsystems/ci-release-orchestration-roadmap.md` | M003j dispatch-input shell hardening | M003i historical closure retained; two generated `run:` expressions embed `inputs.release_tag` in shell; wg-basic Release R001 blocked on qualified M003j output | +| CI/release orchestration | active; M003i and M003j closed | `plans/subsystems/ci-release-orchestration-roadmap.md` | none ready | Producer fix is qualified; wg-basic R001 is ready at `dbowm91/wg-basic@0b814fe02b5e09654e9363c8f61caf59b25ecc92` with pin `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`. Eggsact, StegoEggo, and Eggsearch were also verified as DispatchInput consumers with stale generated workflows; their own plans remain required for remediation. | | Eggup interoperability | active | `plans/subsystems/eggup-interoperability-roadmap.md` | Eggpack M001a + Eggup adapter M001/M001a + Eggup M003 real-consumer adoption + Eggup M004 registry promotion all closed | The whole producer/consumer package seam is closed end to end; Release Manifest M003a closed the remaining Eggpack-side planning drift, and no Eggpack work remains on this seam; Eggwork Operations M003 remains producer-only | | Ecosystem adoption | active | `plans/subsystems/ecosystem-adoption-roadmap.md` | M001/M002/M003a/M003b closed | Closure `plans/closure/ecosystem-adoption/003b-status.md`. Paired plans: Eggpack `plans/implementation/ecosystem-adoption/003b-eggsearch-seven-target-eggpack-producer-cutover.md` (`325d44e`); Eggsearch `plans/implementation/eggpack-release-adoption/001-seven-target-eggpack-producer-cutover.md` (`377f9e8`, registry `6767062`). Implementation landed at `eggstack/eggsearch@eabbf80`; hosted run `37531104901` staged eggsearch `v0.4.2` as draft `405157598` with the exact 19-asset inventory, glibc 2.17 re-proven on all three GNU targets, ARMv7 required consumer validator green, Windows ARM64 required and green, and zero OIDC permission in generated jobs. Provenance attested the staged bytes in run `37561960304`; the draft was published 2026-10-07, closing the named condition | | Planning hygiene | active | `plans/subsystems/planning-hygiene-roadmap.md` | M001/M002 closed | M002 closed at `plans/closure/planning-hygiene/002-status.md`: docs/evidence-only post-M003a handoff reconciliation with an empty production/package/workflow diff; stale/duplicated control-surface text removed and the handoff bound to exact paired-plan paths | @@ -105,7 +105,7 @@ Distribution predecessor evidence: ## Dependency-ready implementation work -Planning Hygiene M002, Ecosystem M003b, Bootstrap M002b, and CI M003i are closed. **New dependency-ready CI M003j security corrective:** `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md`. A wg-basic release-readiness source audit confirmed two `workflow_dispatch.inputs.release_tag` interpolations into generated executable Bash, including the write-scoped staging job, at Eggpack `crates/eggpack-ci/src/lib.rs` around the reusable resolver and stage render. Fix and qualify the producer generator before wg-basic R001 repins/regenerates; no public release or new signing is authorized. +Planning Hygiene M002, Ecosystem M003b, Bootstrap M002b, and CI M003i/M003j are closed. CI M003j's strict closure is `plans/closure/ci-release-orchestration/003j-status.md`; its immutable producer implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce` passed hosted run `37987890305` on Linux stable/MSRV, macOS, and Windows. wg-basic updated Release Readiness R001 to `ready` in its own plan/registry commit `0b814fe02b5e09654e9363c8f61caf59b25ecc92`; consumer workflow changes remain outstanding. No public release or new signing is authorized by this producer closure. The table below is the **milestone-to-closure index plus active ready work**, not an implication that every historical row is executable. @@ -113,7 +113,7 @@ The table below is the **milestone-to-closure index plus active ready work**, no |---|---|---|---|---| | Bootstrap installers | M002b Windows POSIX archive-test portability | **closed** | `plans/implementation/bootstrap-installers/002b-windows-posix-archive-test-portability-corrective.md` | Closure `plans/closure/bootstrap-installers/002b-status.md`; implementation `88ddf2e`; hosted run `37806244313` all lanes green | | CI orchestration | M003i exact tag versus manifest release ID policy | **closed** | `plans/implementation/ci-release-orchestration/003i-explicit-tag-and-manifest-release-identity-corrective.md` | Closure `plans/closure/ci-release-orchestration/003i-status.md`; implementation `3ddac9d84fc2e10b8451d38672f66b02e06724df`; hosted run `37813044035` all four lanes green. wg-basic M003 may resume with this pin | -| CI orchestration | M003j dispatch-tag Bash interpolation corrective | **ready** | `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` | Hard: CI M003i closed; generated workflow root cause proven in source; wg-basic Release R001 needs immutable qualified fix | +| CI orchestration | M003j dispatch-tag Bash interpolation corrective | **closed** | `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` | Closure `plans/closure/ci-release-orchestration/003j-status.md`; implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`; hosted run `37987890305` all lanes green; wg-basic R001 unblocked to repin/regenerate | | Planning hygiene | M001 current evidence baseline + blocker reconciliation | closed | `plans/implementation/planning-hygiene/001-current-evidence-baseline-and-blocker-reconciliation.md` | Closure `plans/closure/planning-hygiene/001-status.md`; discharged CI M003b (eggsact `685fa373` + run `36886042696`) and closed Ecosystem M002 on stegoeggo `v0.5.0` (run `37181914252`); docs-only, zero production/package/workflow delta | | Planning hygiene | M002 post-M003a cross-repository handoff reconciliation | closed | `plans/implementation/planning-hygiene/002-post-m003a-cross-repository-handoff-reconciliation.md` | Closure `plans/closure/planning-hygiene/002-status.md`; docs/evidence-only; stale M003/M003a/M003b control-surface text reconciled against exact paired-plan paths; empty production/package/workflow diff | | Contract and conformance | M003 bounded direct-contract expansion CLI | closed | `plans/implementation/contract-conformance/003-bounded-direct-contract-expansion-cli.md` | Closure `plans/closure/contract-conformance/003-status.md`; implemented on `43fa2d7`; local-only scalar projection delegating to `DistributionContract`; `ci` family unchanged byte-for-byte; no new dependency, serialized schema, discovery, or framework | @@ -161,6 +161,7 @@ were removed rather than left to mislead. | Ecosystem adoption | M006 Egress archive pair | blocked | Remains after prior native adoption evidence; requires explicit archive/Python boundary review | | Provenance/authenticity | future | planned | Researchable but not implementation-ready: requires a dedicated trust ADR. Eggsearch's existing GitHub Artifact Attestation release is prior art only and does not select Eggpack's trust model | | Python/wheel adapters | future | planned | Remains behind broader native adoption (Phase 13); separate package-adapter planning, registry publication explicit | +| Adopted dispatch-workflow consumers | Eggsact, StegoEggo, Eggsearch | consumer-owned follow-up required | Their checked-in DispatchInput workflows still contain executable `inputs.release_tag` interpolation. M003j qualified producer pin `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce` is available; each consumer needs its own registered repin/regenerate plan before its workflow is considered remediated. | Build/Qualification M002a/M003/M004/M005 remain closed with hosted cross-platform evidence. CI M002 and Bootstrap M002 retain their historical implementation/closure records. Both M002a correctives are closed on implementation `4d2270a` with hosted run 36154905956 green. CI M003a retains its historical evidence (`36f1cc1`/36180399698); M003c corrected M003a/M003b's post-closure source-integrity and transfer findings in `5c28099`, qualified by hosted run 36213316240 (all four lanes green). CI M003d then closed the reusable consumer-composition/runtime-identity seam, and Build M005 closed deterministic cross-tool provisioning on `7a206ba` with hosted run 36256831000 green. @@ -281,7 +282,9 @@ External dist 0.33 spike [CLOSED, disposition C] --> prior art only ## Next handoff -Every closed milestone retains its closure record, so do not read this section as a shortlist: Contract M001/M002, Release Manifest M001/M001a/M002/M003/M003a, Build/Qualification M001–M006, CI M001/M002/M002a/M003a–M003h, Bootstrap M001/M002/M002a, Eggup Interoperability M001/M001a, Ecosystem M001/M002, External backend evaluation M001, and Planning Hygiene M001 all have accepted closure records under `plans/closure/`. Eggup Interoperability M003 is additionally closed downstream on the real Eggsact consumer. Per-subsystem detail is in `plans/subsystems/*-roadmap.md`; the milestone-to-closure index is the table above. +Every closed milestone retains its closure record, so do not read this section as a shortlist: Contract M001/M002, Release Manifest M001/M001a/M002/M003/M003a, Build/Qualification M001–M006, CI M001/M002/M002a/M003a–M003j, Bootstrap M001/M002/M002a, Eggup Interoperability M001/M001a, Ecosystem M001/M002, External backend evaluation M001, and Planning Hygiene M001 all have accepted closure records under `plans/closure/`. Eggup Interoperability M003 is additionally closed downstream on the real Eggsact consumer. Per-subsystem detail is in `plans/subsystems/*-roadmap.md`; the milestone-to-closure index is the table above. + +**CI M003j is closed** at `plans/closure/ci-release-orchestration/003j-status.md`; implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce` passed hosted run `37987890305` on all four required lanes. The producer dependency is discharged for wg-basic Release Readiness R001, which may repin this SHA and regenerate/check its workflow under its separate plan. No Eggpack implementation plan is currently ready; the next Eggpack implementation action is plan authoring if new producer work is identified. M003h is closed on the synchronized, verified candidate. **Ecosystem M002 stegoeggo is closed** at `plans/closure/ecosystem-adoption/002-status.md` §9: consumer implementation `3b96fae` and closure `c75132a` prove the second-repo cutover without a new Eggpack producer primitive, and the live evidence arrived as stegoeggo `v0.5.0` — Eggpack run `37181914252`, published 2026-10-04T06:34:19Z from source `57ca94c9…`, exact 15-asset inventory, manual publication, real public `0.4.2 -> 0.5.0` updater transition. The `0.4.3` milestone earlier planning anticipated was stopped pre-publication by the consumer on semver grounds and superseded by `0.5.0`. diff --git a/plans/subsystems/ci-release-orchestration-roadmap.md b/plans/subsystems/ci-release-orchestration-roadmap.md index 38bf53b..bd40430 100644 --- a/plans/subsystems/ci-release-orchestration-roadmap.md +++ b/plans/subsystems/ci-release-orchestration-roadmap.md @@ -100,7 +100,7 @@ M003h status-reconciliation/main-integration corrective plan: `plans/implementat M003i identity-separation corrective: `plans/implementation/ci-release-orchestration/003i-explicit-tag-and-manifest-release-identity-corrective.md` (**closed** at `plans/closure/ci-release-orchestration/003i-status.md`; implementation `3ddac9d84fc2e10b8451d38672f66b02e06724df`, hosted run `37813044035`, all four lanes green). The immutable producer pin unblocked the separate wg-basic Distribution M003 for its consumer-owned implementation and qualification. -M003j dispatch-tag shell-injection corrective: `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` (**ready**). A 2026-10-09 wg-basic first-public-release security review found `workflow_dispatch.inputs.release_tag` interpolated directly into executable Bash at two generator sites (resolve and write-scoped stage). Preserve M003i's source identity and fix unsafe render with env/data handling, deterministic negative tests, and a fresh immutable producer pin for wg-basic Release Readiness R001. +M003j dispatch-tag shell-injection corrective: `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` (**closed** at `plans/closure/ci-release-orchestration/003j-status.md`; implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`, hosted run `37987890305`, all four lanes green). Dispatch tags are bounded canonical data validated before resolver/stage checkout; direct dispatch-tag expressions in `run:` are rejected. wg-basic Release Readiness R001 is unblocked to repin/regenerate under its own plan. ## 8. Cross-cutting requirements @@ -142,7 +142,7 @@ Build/Qualification M001-M006 and CI M001/M002/M002a/M003c-M003g are closed on t | M003g live qualification failures corrective | closed | `plans/implementation/ci-release-orchestration/003g-live-qualification-corrective.md` | `plans/closure/ci-release-orchestration/003g-status.md`; implementations `5acda73`/`4b28820`/`5ac5b83`/`e5c81f2`; hosted runs 36638321253, 36642184204, 36646814734, 36652203168 all lanes | cross-tool PATH, invalid zigbuild check, artifact exec-bit stripping, consumer validation against failed evidence, stage arity, swallowed staging error, and boolean `make_latest` all corrected; live run 36652731202 staged a complete 15-asset draft for eggsact `v1.2.7`, which the maintainer then published | | M003h live qualification status reconciliation + main integration | closed | `plans/implementation/ci-release-orchestration/003h-live-qualification-status-reconciliation-and-main-integration.md` | `plans/closure/ci-release-orchestration/003h-status.md` | current `main@404f63ec` was merged by `609d5fb`; status reconciled, full verification passed, and `main` fast-forwarded without force | | M003i explicit tag and manifest release identity corrective | closed | `plans/implementation/ci-release-orchestration/003i-explicit-tag-and-manifest-release-identity-corrective.md` | `plans/closure/ci-release-orchestration/003i-status.md`; implementation `3ddac9d84fc2e10b8451d38672f66b02e06724df`; hosted run `37813044035` passed all four lanes | Finite checked-in opt-in stable-tag mapping with explicitly versioned runtime envelope; legacy exact-tag workflow bytes and ReleaseManifest v1 remain unchanged; wg-basic M003 may resume against the immutable producer SHA | -| M003j dispatch tag shell-injection corrective | ready | `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` | none (new corrective plan) | Two unsafe `run:` expression interpolations in runtime resolve and write-scoped stage; fix generator and prove no shell execution from dispatch input; wg-basic Release R001 waits on qualified producer pin | +| M003j dispatch tag shell-injection corrective | closed | `plans/implementation/ci-release-orchestration/003j-dispatch-tag-shell-injection-corrective.md` | `plans/closure/ci-release-orchestration/003j-status.md`; implementation `559d940af0fe6a2951eb17de1fcbecbf9e0bb6ce`; hosted run `37987890305` passed Linux stable/MSRV, macOS, and Windows | wg-basic Release Readiness R001 may resume with this producer pin; consumer regeneration and authorization remain separate | ## 13. 2026-10-08 corrective addendum — M003i From efd817980607c17d5d9ae21c0613397c315b16a8 Mon Sep 17 00:00:00 2001 From: CI Test Date: Fri, 13 Nov 2026 23:16:32 +0000 Subject: [PATCH 2/7] ci: serialize portability workspace tests --- .github/workflows/ci.yml | 2 +- AGENTS.md | 2 +- architecture/testing-and-portability.md | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d29bab..e285a60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - if: matrix.toolchain == 'stable' run: cargo fmt --all -- --check - run: cargo check --workspace --all-targets --locked - - run: cargo test --workspace --all-targets --all-features --locked + - run: cargo test --workspace --all-targets --all-features --locked -- --test-threads=1 - if: matrix.toolchain == 'stable' run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings - if: matrix.toolchain == 'stable' diff --git a/AGENTS.md b/AGENTS.md index 791185a..2c294be 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ Producer-side release construction/distribution for Eggstack. Does NOT replace E - Full local gate: `scripts/check-local.sh` — `fmt --check` → `check` → `clippy -D warnings` → per-crate tests → workspace tests → `doc` → `tree` → `package` → MSRV lane (`cargo +1.89.0 check/test`). - Fast loop: `cargo fmt --all -- --check`, `cargo check --workspace --all-targets --locked`, `cargo test -p --all-targets --all-features --locked`, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`. - Single test: `cargo test -p --all-targets --all-features --locked -- --nocapture` (e.g. `-p eggpack-core real_local_cargo_fixture_builds_a_direct_candidate`). -- Windows-only serialization when diagnosing: append `-- --test-threads=1` to core tests. +- The portability workspace suite runs with `-- --test-threads=1` so local Cargo fixture builds do not compete; for a focused Windows core-test diagnosis, append the same flag. - `cargo package` for non-leaf crates requires `--config 'patch.crates-io..path="crates/"'` flags — copy the exact invocation from `scripts/check-local.sh`. Never bare `cargo publish`. - CI (`.github/workflows/ci.yml`, `contents: read`): `linux` job = ubuntu × stable/1.89.0 (fmt only on stable, clippy/doc only on stable); `portability` = macOS/Windows stable with focused Windows builder, process-group, bootstrap-archive, and orchestration tests. diff --git a/architecture/testing-and-portability.md b/architecture/testing-and-portability.md index ac3e668..f8fe872 100644 --- a/architecture/testing-and-portability.md +++ b/architecture/testing-and-portability.md @@ -233,8 +233,9 @@ outputs, so running them twice buys nothing. `macos-latest` and `windows-latest`, `dtolnay/rust-toolchain@stable` only — **no MSRV lane on macOS or Windows**. Every step from line 43 to line 84 is `matrix.os == 'windows-latest'`-gated; both OSes then run plain -`cargo check` (85) and `cargo test --workspace --all-targets --all-features --locked` -(86). The Windows-only steps, in order: +`cargo check` (85) and `cargo test --workspace --all-targets --all-features --locked -- --test-threads=1` +(86). Serial execution keeps concurrent local Cargo fixture builds out of the +operator integration-test run. The Windows-only steps, in order: | Step | Lines | Why it exists | |---|---|---| From 77b04172f34c4750cb9e8c8c977df90b0234d972 Mon Sep 17 00:00:00 2001 From: CI Test Date: Fri, 13 Nov 2026 23:18:59 +0000 Subject: [PATCH 3/7] ci: scope serial workspace test to portability lanes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e285a60..041fbcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - if: matrix.toolchain == 'stable' run: cargo fmt --all -- --check - run: cargo check --workspace --all-targets --locked - - run: cargo test --workspace --all-targets --all-features --locked -- --test-threads=1 + - run: cargo test --workspace --all-targets --all-features --locked - if: matrix.toolchain == 'stable' run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings - if: matrix.toolchain == 'stable' @@ -83,4 +83,4 @@ jobs: name: Focused orchestration CLI harness (CI M002a) run: cargo test -p eggpack-cli --all-targets --all-features --locked generated_orchestration_cli_executes_capture_to_aggregate -- --nocapture - run: cargo check --workspace --all-targets --locked - - run: cargo test --workspace --all-targets --all-features --locked + - run: cargo test --workspace --all-targets --all-features --locked -- --test-threads=1 From ae50c5ebae38b947f5c0fddcc416ab9120c6d7f4 Mon Sep 17 00:00:00 2001 From: CI Test Date: Fri, 13 Nov 2026 23:30:46 +0000 Subject: [PATCH 4/7] cli: classify bounded package build failures --- crates/eggpack-cli/src/operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/eggpack-cli/src/operator.rs b/crates/eggpack-cli/src/operator.rs index 4d7bbfd..fb30c13 100644 --- a/crates/eggpack-cli/src/operator.rs +++ b/crates/eggpack-cli/src/operator.rs @@ -559,7 +559,7 @@ fn package(args: &[String]) -> Result<(), String> { ) })?; if attempt.process.outcome != eggpack_core::CommandOutcome::Success { - return Err(format!("build did not succeed for {}", planned.target)); + return Err(format!("build {}: {:?}", planned.target, attempt.process)); } let handoff = eggpack_ci::project_build_handoff(&plan, &bindings, &planned.target) .map_err(|error| format!("build handoff projection failed: {}", diagnostic(&error)))?; From 283731aa91e3d90a39e1bddeba299b1c00db76bf Mon Sep 17 00:00:00 2001 From: CI Test Date: Fri, 13 Nov 2026 23:39:03 +0000 Subject: [PATCH 5/7] test(cli): shorten Windows Cargo fixture paths --- .github/workflows/ci.yml | 2 +- AGENTS.md | 2 +- architecture/cli.md | 16 ++++++++-------- architecture/overview.md | 11 ++++++++++- architecture/testing-and-portability.md | 5 ++--- crates/eggpack-cli/tests/operator_commands.rs | 7 ++----- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 041fbcd..9d29bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,4 +83,4 @@ jobs: name: Focused orchestration CLI harness (CI M002a) run: cargo test -p eggpack-cli --all-targets --all-features --locked generated_orchestration_cli_executes_capture_to_aggregate -- --nocapture - run: cargo check --workspace --all-targets --locked - - run: cargo test --workspace --all-targets --all-features --locked -- --test-threads=1 + - run: cargo test --workspace --all-targets --all-features --locked diff --git a/AGENTS.md b/AGENTS.md index 2c294be..791185a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ Producer-side release construction/distribution for Eggstack. Does NOT replace E - Full local gate: `scripts/check-local.sh` — `fmt --check` → `check` → `clippy -D warnings` → per-crate tests → workspace tests → `doc` → `tree` → `package` → MSRV lane (`cargo +1.89.0 check/test`). - Fast loop: `cargo fmt --all -- --check`, `cargo check --workspace --all-targets --locked`, `cargo test -p --all-targets --all-features --locked`, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`. - Single test: `cargo test -p --all-targets --all-features --locked -- --nocapture` (e.g. `-p eggpack-core real_local_cargo_fixture_builds_a_direct_candidate`). -- The portability workspace suite runs with `-- --test-threads=1` so local Cargo fixture builds do not compete; for a focused Windows core-test diagnosis, append the same flag. +- Windows-only serialization when diagnosing: append `-- --test-threads=1` to core tests. - `cargo package` for non-leaf crates requires `--config 'patch.crates-io..path="crates/"'` flags — copy the exact invocation from `scripts/check-local.sh`. Never bare `cargo publish`. - CI (`.github/workflows/ci.yml`, `contents: read`): `linux` job = ubuntu × stable/1.89.0 (fmt only on stable, clippy/doc only on stable); `portability` = macOS/Windows stable with focused Windows builder, process-group, bootstrap-archive, and orchestration tests. diff --git a/architecture/cli.md b/architecture/cli.md index a2d2c50..0b3154a 100644 --- a/architecture/cli.md +++ b/architecture/cli.md @@ -707,7 +707,7 @@ capture, qualify, gate, aggregate — then asserts the negative cases. The operator family has the same property in the other direction: `eggpack plan` and `ci _resolve-release` share one encoder (`717-719`), and `package_qualify_collect_manifest_matches_ci_aggregate` -(`tests/operator_commands.rs:650`) asserts that the local path produces the +(`tests/operator_commands.rs:653`) asserts that the local path produces the same bytes the CI path produces. To be precise about a common confusion: no workspace crate depends on @@ -766,12 +766,12 @@ the only way to observe its stdout contract. | `contract_expand::argument_errors_exit_nonzero_without_a_scalar` | `tests/contract_expand.rs:250` | One defect per invocation; truncated invocations report `missing required`; `--flag=value` accepted | | `contract_expand::symlinked_and_oversized_contracts_are_refused` | `tests/contract_expand.rs:312` | Symlink and size-bound refusals at the process boundary | | `contract_expand::the_documented_readme_example_runs_verbatim` | `tests/contract_expand.rs:350` | The CLI README example, with its documented relative paths and working directory | -| `operator_commands::every_command_exits_zero_on_success_and_one_on_failure` | `tests/operator_commands.rs:395` | Exit-code mapping for all six commands | -| `operator_commands::check_accepts_a_valid_input_set` | `tests/operator_commands.rs:434` | The validation class accepts a resolvable input set | -| `operator_commands::plan_writes_the_same_bytes_as_ci_resolve_release` | `tests/operator_commands.rs:581` | One plan encoder, two surfaces | -| `operator_commands::package_qualify_collect_manifest_matches_ci_aggregate` | `tests/operator_commands.rs:650` | The local path's final bytes equal the CI path's | -| `operator_commands::help_names_every_command_and_its_class` | `tests/operator_commands.rs:1197` | The taxonomy is part of the help | -| `operator_commands::existing_command_families_still_behave` | `tests/operator_commands.rs:1244` | The `ci` and `contract` families are unregressed | +| `operator_commands::every_command_exits_zero_on_success_and_one_on_failure` | `tests/operator_commands.rs:398` | Exit-code mapping for all six commands | +| `operator_commands::check_accepts_a_valid_input_set` | `tests/operator_commands.rs:437` | The validation class accepts a resolvable input set | +| `operator_commands::plan_writes_the_same_bytes_as_ci_resolve_release` | `tests/operator_commands.rs:584` | One plan encoder, two surfaces | +| `operator_commands::package_qualify_collect_manifest_matches_ci_aggregate` | `tests/operator_commands.rs:653` | The local path's final bytes equal the CI path's | +| `operator_commands::help_names_every_command_and_its_class` | `tests/operator_commands.rs:1204` | The taxonomy is part of the help | +| `operator_commands::existing_command_families_still_behave` | `tests/operator_commands.rs:1251` | The `ci` and `contract` families are unregressed | The coverage shape follows from the crate's role. Most tests assert argument handling, arity, path helpers, and renderer parity, because that is where the @@ -789,7 +789,7 @@ rename fallback in `atomic_write` (`677-708`), and `reject_symlink_output` against a directory or symlink (`617-627`). `run()`'s exit-code mapping and `dispatch`'s unknown-top-level-token rejection are covered for the `contract` family (`4555`, `tests/contract_expand.rs:250`) and for the operator family -(`tests/operator_commands.rs:395`) but still only in-process for the `ci` +(`tests/operator_commands.rs:398`) but still only in-process for the `ci` family. See [testing-and-portability.md](testing-and-portability.md) for the workspace view. diff --git a/architecture/overview.md b/architecture/overview.md index 517a3ce..d510ebc 100644 --- a/architecture/overview.md +++ b/architecture/overview.md @@ -147,6 +147,15 @@ their behavior and the file's 7638-line count are unchanged. All 64 numeric architecture/planning citation ranges into that test file were checked against the unchanged source lines; none points to the edited lines, so no anchor moved. +**2026-11-13 — Windows operator fixture paths.** The temporary-root helper in +`crates/eggpack-cli/tests/operator_commands.rs` now uses a short PID/counter +component, avoiding full test names in nested Windows Cargo build paths. +That source file is now 2428 lines (three fewer); the six operator-test anchors +in `cli.md` were re-based by function name and verified at their new lines. +`operator.rs`'s failed-build diagnostic now includes only typed process +classification and byte counts; its line count and the surrounding anchors are +unchanged. + ## How to read this document This file has two jobs, deliberately: @@ -378,7 +387,7 @@ generated steps safe. | `src/main.rs` | 4617 | dispatch, the `ci` family, `contract expand`, file-safety helpers | | `src/operator.rs` | 1094 | the six local producer operator commands | | `tests/contract_expand.rs` | 381 | `eggpack contract expand` integration tests (8 tests) | -| `tests/operator_commands.rs` | 2431 | operator-family integration tests (30 tests) | +| `tests/operator_commands.rs` | 2428 | operator-family integration tests (30 tests) | The operator family gained three optional flags and three tightened behaviours in the 2026-10-23 review chain; `cli.md` documents each in full, and this card diff --git a/architecture/testing-and-portability.md b/architecture/testing-and-portability.md index f8fe872..ac3e668 100644 --- a/architecture/testing-and-portability.md +++ b/architecture/testing-and-portability.md @@ -233,9 +233,8 @@ outputs, so running them twice buys nothing. `macos-latest` and `windows-latest`, `dtolnay/rust-toolchain@stable` only — **no MSRV lane on macOS or Windows**. Every step from line 43 to line 84 is `matrix.os == 'windows-latest'`-gated; both OSes then run plain -`cargo check` (85) and `cargo test --workspace --all-targets --all-features --locked -- --test-threads=1` -(86). Serial execution keeps concurrent local Cargo fixture builds out of the -operator integration-test run. The Windows-only steps, in order: +`cargo check` (85) and `cargo test --workspace --all-targets --all-features --locked` +(86). The Windows-only steps, in order: | Step | Lines | Why it exists | |---|---|---| diff --git a/crates/eggpack-cli/tests/operator_commands.rs b/crates/eggpack-cli/tests/operator_commands.rs index da4bac5..5117722 100644 --- a/crates/eggpack-cli/tests/operator_commands.rs +++ b/crates/eggpack-cli/tests/operator_commands.rs @@ -82,13 +82,10 @@ const REVISION: &str = "0123456789abcdef0123456789abcdef01234567"; static NEXT: AtomicU64 = AtomicU64::new(0); -fn temp_root(label: &str) -> PathBuf { +fn temp_root(_label: &str) -> PathBuf { loop { let id = NEXT.fetch_add(1, Ordering::Relaxed); - let path = std::env::temp_dir().join(format!( - "eggpack-cli-operator-{label}-{}-{id}", - std::process::id() - )); + let path = std::env::temp_dir().join(format!("eggpack-{}-{id}", std::process::id())); match std::fs::create_dir(&path) { Ok(()) => return path, Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue, From 329a3dfdb166580de4770b2c6b2f046358983003 Mon Sep 17 00:00:00 2001 From: CI Test Date: Tue, 17 Nov 2026 15:46:51 +0000 Subject: [PATCH 6/7] fix: recheck process-group signals after leader exit --- AGENTS.md | 2 +- architecture/ci-consumer-seam.md | 12 +- architecture/cli.md | 2 +- architecture/overview.md | 42 ++-- architecture/process-execution.md | 205 ++++++++---------- architecture/testing-and-portability.md | 4 +- architecture/validation-model.md | 2 +- crates/eggpack-core/src/builder.rs | 174 +++++++++++---- ...process-group-signal-recheck-corrective.md | 139 ++++++++++++ plans/registry.md | 7 +- .../ci-release-orchestration-roadmap.md | 3 + 11 files changed, 408 insertions(+), 184 deletions(-) create mode 100644 plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md diff --git a/AGENTS.md b/AGENTS.md index 791185a..89a3313 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,4 +89,4 @@ Read the index in `overview.md` and follow one link. Grouped by what they cover: ## Planning conventions - Closure discipline: `plans/closure//NNN-status.md`. Compilation ≠ closure. History never rewritten — correctives are new `NNNa` plans; superseded material goes to `plans/archive/`. -- Current handoff (source: `plans/registry.md`): no milestone is **in progress** and none is registered **ready**; the last open obligation of the 2026-10-23 review chain — Release Manifest M004, the ADR-0006 `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — is **closed**: `0.1.1` is published to crates.io (checksum `352c3e327159615b763298e911e239f1decc4a2c9e28c28be8ddd28e50515e37`, tagged `eggpack-manifest-v0.1.1`), and both narrowings the package carries — the ADR-0006 digest rule and the `3ef806f` document bound — are recorded as compatibility events. The 2026-10-23 post-implementation review chain is closed (Build/Qualification M007, M008, M009; CI/Release M003l, M003m, M003n; Planning Hygiene M003; Bootstrap M003a), and **ADR-0006 is accepted** (Option A), having gated CI M003l's digest-acceptance work package only. A follow-up review of that chain's own output registered and closed a second corrective chain: Build/Qualification M007a (digest zero-length read refusal), M008a (floor contradiction mask and ELF offset overflow), M009a (local producer operator defects, including an input-destroying staging path), and CI/Release M003o (renderer panic and digest diagnostics). **The chain's first hosted CI run failed on macOS and registered a third corrective, CI/Release M003p**: the shared bounded runner treated a failed process-group signal as fatal, but macOS refuses to signal a group holding the unreaped zombie of an exited child and reports `EPERM` where Linux signals it successfully, so an output-bound violation was reported as a launch failure. M003p decides by observing whether the child has exited rather than by reading the errno, and hosted run `40263176191` is green on all four lanes. Both review chains left one obligation open — ADR-0006 §5.2/§9's `eggpack-manifest 0.1.1` publication and the release-manifest compatibility record — and M004 owns it; the `0.1.1` package carries **two** narrowings of the published acceptance set, the ADR-0006 digest rule and the `3ef806f` document bound, and only the first had been recorded. **Blocked** are Ecosystem M004 (Gregg sibling bundle), Ecosystem M005 (CodeGG runfile bundle), and Ecosystem M006 (Egress archive pair), each on its named adoption evidence and bundle/archive review; the provenance/authenticity line is **planned** pending a dedicated trust ADR, and Python/wheel adapters are **planned** behind broader native adoption. Contract M003, Bootstrap M003, and Ecosystem M003a/M003b are closed, so the contract-conformance and bootstrap-installers subsystems have no open work. The next Eggpack line is whatever the registry lists as `ready`; if that table is empty, the next action is plan authoring, not implementation. +- Current handoff (source: `plans/registry.md`): CI/Release M003pa is **active** under `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md`; no other milestone is registered **ready**; the last open obligation of the 2026-10-23 review chain — Release Manifest M004, the ADR-0006 `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — is **closed**: `0.1.1` is published to crates.io (checksum `352c3e327159615b763298e911e239f1decc4a2c9e28c28be8ddd28e50515e37`, tagged `eggpack-manifest-v0.1.1`), and both narrowings the package carries — the ADR-0006 digest rule and the `3ef806f` document bound — are recorded as compatibility events. The 2026-10-23 post-implementation review chain is closed (Build/Qualification M007, M008, M009; CI/Release M003l, M003m, M003n; Planning Hygiene M003; Bootstrap M003a), and **ADR-0006 is accepted** (Option A), having gated CI M003l's digest-acceptance work package only. A follow-up review of that chain's own output registered and closed a second corrective chain: Build/Qualification M007a (digest zero-length read refusal), M008a (floor contradiction mask and ELF offset overflow), M009a (local producer operator defects, including an input-destroying staging path), and CI/Release M003o (renderer panic and digest diagnostics). **The chain's first hosted CI run failed on macOS and registered a third corrective, CI/Release M003p**: the shared bounded runner treated a failed process-group signal as fatal, but macOS refuses to signal a group holding the unreaped zombie of an exited child and reports `EPERM` where Linux signals it successfully, so an output-bound violation was reported as a launch failure. M003p decides by observing whether the child has exited rather than by reading the errno, and hosted run `40263176191` is green on all four lanes. A later review found that this does not prove the whole group is empty; M003pa is active to retry after reaping the leader and accept only a successful retry or `ESRCH`, keeping every other case fail-closed. Both review chains left one obligation open — ADR-0006 §5.2/§9's `eggpack-manifest 0.1.1` publication and the release-manifest compatibility record — and M004 owns it; the `0.1.1` package carries **two** narrowings of the published acceptance set, the ADR-0006 digest rule and the `3ef806f` document bound, and only the first had been recorded. **Blocked** are Ecosystem M004 (Gregg sibling bundle), Ecosystem M005 (CodeGG runfile bundle), and Ecosystem M006 (Egress archive pair), each on its named adoption evidence and bundle/archive review; the provenance/authenticity line is **planned** pending a dedicated trust ADR, and Python/wheel adapters are **planned** behind broader native adoption. Contract M003, Bootstrap M003, and Ecosystem M003a/M003b are closed, so the contract-conformance and bootstrap-installers subsystems have no open work. The next Eggpack line is whatever the registry lists as `ready`; if that table is empty, the next action is plan authoring, not implementation. diff --git a/architecture/ci-consumer-seam.md b/architecture/ci-consumer-seam.md index b254f72..ca8151c 100644 --- a/architecture/ci-consumer-seam.md +++ b/architecture/ci-consumer-seam.md @@ -210,9 +210,9 @@ narrower and still real. The *shape* of the invocation is fixed and finite — o interpreter, one script path, one candidate path, no shell, no argument vector, no env map (`consumer_validator.rs:526-534`). The *environment* is built by the shared runner, which clears it and re-adds a five-variable allowlist -(`crates/eggpack-core/src/builder.rs:735`, `753-754`); the CI side contributes only +(`crates/eggpack-core/src/builder.rs:737`, `755-756`); the CI side contributes only the caller's explicit `PATH` (`consumer_validator.rs:299-300`), stdin is null -(`builder.rs:736`), and the working directory is explicit +(`builder.rs:738`), and the working directory is explicit (`consumer_validator.rs:304`). The *outcome is bounded*: timeout, output limits, a seven-value classification; a validator cannot hang or flood the job. This is a **separation-of-concerns** mechanism: `Passed` means an independent script exited @@ -240,9 +240,9 @@ bounded runner in `eggpack-core`: Everything the old private runner did is therefore core's contract, not the CI crate's: process-group/job termination on every failure path, a cleared -environment with a five-variable allowlist (`builder.rs:735`, `753-754`), null -stdin (`builder.rs:736`), the exact output truncation in `drain` -(`builder.rs:942-958`, which keeps `n.min(limit - len)`), and the bounded reader +environment with a five-variable allowlist (`builder.rs:737`, `755-756`), null +stdin (`builder.rs:738`), the exact output truncation in `drain` +(`builder.rs:944-960`, which keeps `n.min(limit - len)`), and the bounded reader joins. The runner outcome maps onto the consumer-validation outcome exactly (`consumer_validator.rs:536-555`): success → `Passed`, non-zero exit → `Failed(NonZeroExit)`, deadline → `Failed(Timeout)`, output bound → @@ -442,7 +442,7 @@ Where enforcement is weaker than it looks: The two gaps that the private CI runner used to have — output retention above the cap, and a preflight that discarded its over-limit flags — are gone with it. Both now belong to the shared runner: `drain` truncates exactly -(`crates/eggpack-core/src/builder.rs:942-958`) and the preflight's over-limit +(`crates/eggpack-core/src/builder.rs:944-960`) and the preflight's over-limit outcome is a non-success runner outcome, which the CI side maps to `Failed(InterpreterUnavailable)` (`consumer_validator.rs:503-506`). diff --git a/architecture/cli.md b/architecture/cli.md index 0b3154a..c665bbf 100644 --- a/architecture/cli.md +++ b/architecture/cli.md @@ -607,7 +607,7 @@ characters (`411-416`), then delegates to `eggpack_core::run_git_bounded` peel, `git rev-parse --verify refs/tags/^{commit}` (`builder.rs:535-541`); both use the same bounded runner with a 30 s deadline (`builder.rs:29`), a 4 KiB retained-output cap (`builder.rs:31`), a -`command-group` process group, and a cleared environment (`builder.rs:735`). +`command-group` process group, and a cleared environment (`builder.rs:737`). See [process-execution.md](process-execution.md) for the workspace spawn contract. diff --git a/architecture/overview.md b/architecture/overview.md index 6ef4f51..a31d4eb 100644 --- a/architecture/overview.md +++ b/architecture/overview.md @@ -9,11 +9,12 @@ It deliberately does **not** replace Eggup: Eggup remains the consumer-side verified installation/update/rollback layer, and the product repository owns release/install policy. See [eggup-manifest-consumer-v1.md](eggup-manifest-consumer-v1.md). -Code baseline `fa82486dab83d2369d330a3cef197a3651851c26` — the tree the line -counts and the `file:line` citations in this directory were measured and -verified against. That is the SHA the numbers below describe: this index changes -no Rust source, so the counts and citations stay true of the tree it commits onto. -Re-verify them against the workspace if you edit the overview again. +Code baseline `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09` — the committed `HEAD` +immediately before CI/Release M003pa's source change. The core line counts below +were remeasured on the current worktree, including the M003pa `builder.rs` patch, +and the affected citations were checked against that tree. +This is a worktree verification, not an immutable closure baseline; remeasure and +recheck against the exact candidate before closing M003pa. Milestone/evidence statuses are **not** restated here; `plans/registry.md` is the authority for those, and [principles-roadmap.md](principles-roadmap.md) narrates them. @@ -163,6 +164,18 @@ rewrites in the CLI, manifest, and GitHub source also preserved anchors. Affecte architecture citations were rechecked by symbol; the line-count table above remains pinned to `fa82486`. +**2026-11-17 — CI/Release M003pa process-group recheck (active).** The shared +runner now retries after reaping an exited leader and accepts only retry success +or `ESRCH`; a live or unverified group remains a hard failure. The helper and +retry outcomes are covered by deterministic tests, and the live-descendant test +uses an explicit release marker to prove that a surviving process would be +observed. The `run_bounded` anchor is `builder.rs:698`; the timeout regression +anchor is `builder.rs:1835`, both checked by symbol name. Current `eggpack-core` +source count is 9109 (`builder.rs` 2078, `digest.rs` 325), measured on the +current worktree based on `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09`. +`scripts/check-local.sh` passed on the current code. Hosted CI is not yet run; +the milestone remains active. + ## How to read this document This file has two jobs, deliberately: @@ -241,18 +254,19 @@ contract manifest |---|---|---| | `eggpack-contract` | 2937 (2449 + 488 tests) | [contract.md](contract.md) | | `eggpack-manifest` | 1536 | [manifest.md](manifest.md) | -| `eggpack-core` | 8935 (6 files) | [core.md](core.md) | +| `eggpack-core` | 9109 (6 files) | [core.md](core.md) | | `eggpack-bootstrap` | 3587 | [bootstrap.md](bootstrap.md) | | `eggpack-ci` | 12945 (14 files) | [ci.md](ci.md) | | `eggpack-github` | 5498 (3439 + 2059 tests) | [github.md](github.md) | | `eggpack-cli` | 8523 (5711 + 2812 tests) | [cli.md](cli.md) | -Counts are Rust source lines per crate, measured against the baseline named -above: every `.rs` file under `crates//`, production and test code alike. -A count in parentheses is the split inside the total — `production + tests`. The -test code lives in a `#[cfg(test)]` module in `src/` for every crate except -`contract` (whose conformance and fixture tests are separate `tests/` targets) -and `ci` and `github` (whose test modules are separate out-of-line files). +Counts are Rust source lines per crate, measured on the current worktree +described above: every `.rs` file under `crates//`, production and test +code alike. A count in parentheses is the split inside the total — `production + +tests`. The test code lives in a `#[cfg(test)]` module in `src/` for every crate +except `contract` (whose conformance and fixture tests are separate `tests/` +targets) and `ci` and `github` (whose test modules are separate out-of-line +files). ### `eggpack-contract` — layout authority and validators @@ -300,10 +314,10 @@ revision verification and for the consumer validator: | File | Lines | Stage | Deep dive | |---|---|---|---| | `src/lib.rs` | 1384 | `PackConfig` → `ReleasePlan`, policy types, `build_manifest` | [core-planning.md](core-planning.md) | -| `src/builder.rs` | 1902 | bindings, command specs, bounded execution, candidate discovery | [core-build.md](core-build.md) | +| `src/builder.rs` | 2078 | bindings, command specs, bounded execution, candidate discovery | [core-build.md](core-build.md) | | `src/qualification.rs` | 2982 | qualification methods, host matching, evidence | [core-qualification.md](core-qualification.md) | | `src/finalization.rs` | 928 | `finalize_release`, archive assembly, manifest aggregation | [core-finalization.md](core-finalization.md) | -| `src/digest.rs` | 327 | the one bounded file-digest authority | [core-finalization.md](core-finalization.md) | +| `src/digest.rs` | 325 | the one bounded file-digest authority | [core-finalization.md](core-finalization.md) | | `src/floor.rs` | 1412 | bounded ELF compatibility-floor inspection | [core-qualification.md](core-qualification.md) | Crate-level orientation, dependency direction, and the cross-file data diff --git a/architecture/process-execution.md b/architecture/process-execution.md index a734987..643d6a8 100644 --- a/architecture/process-execution.md +++ b/architecture/process-execution.md @@ -15,10 +15,10 @@ share one set of guarantees. | Site | Entry point | Spawn call | Deadline | Group handling | Environment | | --- | --- | --- | --- | --- | --- | -| Core build + preflight | `run_bounded_cancellable` (`crates/eggpack-core/src/builder.rs:461`) | `group_spawn()` at `builder.rs:799` | `spec.timeout`, ≤ 86 400 s (`builder.rs:714`) | `command-group` group/job, `kill()` + `wait()` (`builder.rs:820-834`) | `env_clear()` + 19-variable builder allowlist (`builder.rs:735`, `756-778`) | -| Core qualification smoke (native) | `run_qualification_process` (`builder.rs:569`) | same `run_bounded` | `smoke.timeout_ms` | same shared path | narrower 5-var allowlist (`builder.rs:753-754`) | +| Core build + preflight | `run_bounded_cancellable` (`crates/eggpack-core/src/builder.rs:461`) | `group_spawn()` at `builder.rs:801` | `spec.timeout`, ≤ 86 400 s (`builder.rs:715-716`) | `command-group` group/job, `kill()` + `wait()` (`builder.rs:824-845`) | `env_clear()` + 19-variable builder allowlist (`builder.rs:737`, `758-779`) | +| Core qualification smoke (native) | `run_qualification_process` (`builder.rs:569`) | same `run_bounded` | `smoke.timeout_ms` | same shared path | narrower 5-var allowlist (`builder.rs:755-756`) | | Core qualification smoke (QEMU) | `run_qemu_process` (`builder.rs:580`) | same `run_bounded` | `smoke.timeout_ms` | same shared path | narrower 5-var allowlist | -| Core git revision verification | `run_git_bounded` (`builder.rs:512`) | same `run_bounded` | 30 s (`GIT_TIMEOUT`, `builder.rs:29`) | same shared path | 7-var allowlist incl. `HOME` (`builder.rs:743-752`) | +| Core git revision verification | `run_git_bounded` (`builder.rs:512`) | same `run_bounded` | 30 s (`GIT_TIMEOUT`, `builder.rs:29`) | same shared path | 7-var allowlist incl. `HOME` (`builder.rs:742-753`) | | CLI source verification | `verify_source_revision` (`crates/eggpack-cli/src/main.rs:410`) | delegates to `run_git_bounded` | same 30 s | same shared path | same 7-var allowlist | | CI consumer validator | `run_consumer_validator` (`crates/eggpack-ci/src/consumer_validator.rs:323`) → `run_validator_process` (`consumer_validator.rs:521`) | delegates to `run_interpreter_bounded` (`builder.rs:485`) | `validator.timeout_ms`, 1 000–600 000 ms (`consumer_validator.rs:87`) | same shared path — group/job kill on every failure path | same narrow 5-var allowlist, plus the caller's explicit `PATH` override (`consumer_validator.rs:299-300`) | | CI interpreter preflight | `run_interpreter_preflight` (`consumer_validator.rs:488`) | delegates to `run_interpreter_bounded` | `timeout_ms.min(30_000)` (`consumer_validator.rs:499`) | same shared path | same as above | @@ -26,14 +26,14 @@ share one set of guarantees. ### What is shared and what is independent The five `eggpack-core` entry points are thin wrappers over one private -function, `run_bounded` (`builder.rs:696`), reached through `run_bounded_inner` +function, `run_bounded` (`builder.rs:698`), reached through `run_bounded_inner` (`builder.rs:608`), differing only in the `ExecutableAllowance` passed: `Builder` (`builder.rs:128`), `Candidate`, `Qemu`, `Git`, and `Interpreter` (`builder.rs:132`). One implementation, one place to audit, one set of guarantees. The allowance is what keeps the set narrow: `Git` admits only the -literal `git` (`builder.rs:709`), exactly as `Qemu` admits only the three named +literal `git` (`builder.rs:711`), exactly as `Qemu` admits only the three named QEMU binaries and `Interpreter` admits only `python3` and `python` -(`builder.rs:710`). +(`builder.rs:708-710`). `eggpack-ci` shares it. The crate still declares no `command-group` dependency; it reaches the runner through `eggpack-core`, which already owns @@ -57,12 +57,12 @@ The runner matches an exact expected value internally rather than returning it. `CommandSpec::expected_stdout` is a substring containment check, which is right for a tool banner (`builder.rs:175-176`) but too weak for a revision identity; the new `expected_stdout_exact` field (`builder.rs:177-181`) compares the trimmed stdout -for equality (`builder.rs:886-891`), and a miss becomes -`CommandOutcome::Failed(-1)` (`builder.rs:898-899`) rather than an error carrying +for equality (`builder.rs:888-893`), and a miss becomes +`CommandOutcome::Failed(-1)` (`builder.rs:900-901`) rather than an error carrying output. The Git allowlist deliberately keeps `HOME` and `USERPROFILE` -(`builder.rs:745-746`) that the narrower candidate and QEMU allowlists drop. +(`builder.rs:747-748`) that the narrower candidate and QEMU allowlists drop. `git` resolves helpers from `PATH`, and `safe.directory` is commonly set in the global config; clearing `HOME` would make self-hosted runners fail closed for a reason unrelated to release integrity. @@ -82,7 +82,7 @@ the job's build directory. The workspace therefore never uses bare `Child::kill` on a build or qualification path; it uses `command-group` 5.0.1 (`crates/eggpack-core/Cargo.toml:24`, pinned in `Cargo.lock:61-64`). -`group_spawn()` (`builder.rs:799`) returns a `GroupChild` owning a group/job with +`group_spawn()` (`builder.rs:801`) returns a `GroupChild` owning a group/job with two different implementations: - **Unix:** the child is spawned with `process_group(0)`, i.e. `setpgid(0, 0)`, @@ -96,89 +96,74 @@ two different implementations: Killing is not enough. The group must then be *waited for*, twice over. In the timeout and cancellation branches, `kill()` is immediately followed by `wait()` -(`builder.rs:820-825` for cancellation, `builder.rs:827-832` for the deadline). On +(`builder.rs:823-828` for cancellation, `builder.rs:830-835` for the deadline). On Unix that `wait()` loops `waitpid` over the negated pgid precisely so that already-exited group members are reaped rather than left as zombies (`command-group` `src/stdlib/child/unix.rs:71-85`); on Windows it drains the job completion port with `INFINITE` before waiting on the child (`src/stdlib/child/windows.rs:97-99`). Second, after the loop breaks, `run_bounded_inner` requires a final `try_wait()` to return `Some`; a `None` is -the error `process cleanup incomplete` (`builder.rs:874-877`). Skipping either +the error `process cleanup incomplete` (`builder.rs:876-879`). Skipping either wait is what leaves orphans and zombies behind a timeout, and both are present. The CI validator creates no group of its own: it delegates to the shared runner, which creates the group or job object and kills and waits for it. -### Signalling a group that has already exited - -A group's only member is the supervised child. When that child has already -exited it stays in the group as a zombie until it is reaped, and the group -holds no process at all once it is reaped. `command-group` documents that a -group which has already exited produces an error from `kill`. - -**The two supported platforms disagree about the zombie case, and not in the -way the errno suggests.** Linux signals a zombie process group successfully. -macOS refuses to signal a group that holds one and reports the *whole* group -signal as `EPERM` — not `ESRCH`. A run whose child exited just before the -runner noticed that its output bound was exceeded therefore terminated -cleanly on Linux and failed on macOS, with the runner reporting -`output-limit process-group termination failed`. - -The runner's rule (`terminate_process_group`, `builder.rs:675-694`, and -`group_signal_failure_is_benign` beside it at `builder.rs:644-649`) is: a -failed group signal may be ignored when there is nothing left to terminate. -That is true in two cases. - -- The signal failed with `ESRCH` — the kernel's own statement that the group - holds no process. -- The signal failed with any other errno **and** the supervised child has - already exited. The child is then a zombie or already reaped, and a child - that has exited is not a process that can outlive the run. - -The second case is the one that matters, and it is decided by observing the -child rather than by reading the errno: `try_wait` both observes and reaps a -child that has already exited. A group that holds a **live** process and -still cannot be signalled remains a hard failure, so the run fails closed. - -This is exact rather than permissive. A descendant that outlives the child is -caught by the drain budget — a reader still parked at its budget means a -descendant holds the write end of a pipe, and the run fails closed with the -output-limit outcome and terminates the group again. - -The check is Unix-only. A Windows job object is terminated through -`TerminateJobObject`, which reports a different condition for an empty job -and uses a different error space, where the value `3` means -`ERROR_PATH_NOT_FOUND` rather than `ESRCH`. - -Two regression tests pin the rule. `terminating_an_already_exited_process_group_is_not_a_failure` -reaps a child and asserts that the dependency reports the empty group as an -error while the runner does not. `a_failed_group_signal_is_benign_only_when_nothing_is_left_to_terminate` -pins the decision itself: `ESRCH` is benign, `EPERM` is benign only when the -child has exited, and `EPERM` with a live child is not benign. - -Without this, a completed run was reported as a failed one, and the caller -misread the failure: the CI consumer-validator maps every runner error onto -`InterpreterUnavailable`, so an output-bound violation was reported as "the -interpreter could not be launched`. +### Rechecking a failed process-group signal + +`command-group` sends Unix group termination with `killpg`. Linux can signal a +zombie member, while macOS may report `EPERM` when a group contains an +unreaped zombie. `ESRCH` remains the kernel's direct indication that the group +does not exist. + +M003p correctly addressed the macOS output-limit failure, but its exception +was too broad: `GroupChild::try_wait` reports only the supervised leader's +state. Reaping that leader does not prove the process group is empty; a live +descendant can remain, including one that closed stdout and stderr. The drain +budget detects descendants that keep a pipe open, but pipe completion is not +evidence that every group member has exited. + +The corrected rule (`terminate_process_group` and +`group_signal_failure_is_benign` in `crates/eggpack-core/src/builder.rs`) is: + +- Initial `ESRCH` is benign because the group is absent. +- For another initial signal error, a live or unverified supervised child is +a hard failure. +- If the supervised child has exited, `try_wait` reaps it and the runner + retries the group signal. Retry success means the group signal was sent to + remaining members; retry `ESRCH` proves the group is empty. Every other retry + error, including `EPERM`, remains a hard failure. + +Thus the zombie-only macOS case can resolve to an empty group on retry, but a +leader's exit alone never suppresses a group-signal failure. The rule is +Unix-only. Windows job objects use `TerminateJobObject` and a different error +space, where the value `3` means `ERROR_PATH_NOT_FOUND`, not `ESRCH`; their +behavior is unchanged. + +The regression suite pins the decision with injected signal outcomes, +retains the real empty-group case, and exercises termination with a live +descendant after its leader exits. The output-overflow test continues to cover +the actual bounded-runner path. M003pa is not closed until the local gate and +hosted macOS, Linux stable/MSRV, and Windows lanes pass on the same candidate. ## Timeouts and cancellation `run_bounded_inner` validates its own bounds before spawning and fails closed -with `invalid process bounds or executable` (`builder.rs:712-721`): timeout must +with `invalid process bounds or executable` (`builder.rs:714-723`): timeout must be non-zero and at most 86 400 s, and both output limits must be in `1..=MAX_OUTPUT` where `MAX_OUTPUT = 256 * 1024` (`builder.rs:20`). -The deadline is `Instant::now() + spec.timeout` (`builder.rs:819`) enforced by a -poll loop (`builder.rs:820-859`), not a blocking wait: each iteration calls -`child.try_wait()` (`builder.rs:845-850`) and sleeps 20 ms (`builder.rs:852`). +The deadline is `Instant::now() + spec.timeout` (`builder.rs:821`) enforced by a +poll loop (`builder.rs:822-855`), not a blocking wait: each iteration calls +`child.try_wait()` (`builder.rs:847-852`) and sleeps 20 ms (`builder.rs:854`). Polling is what makes cancellation observable at all — a blocking `wait()` would only notice a flag after the child had already exited. Ordering inside the loop is the contract. Cancellation is tested first -(`builder.rs:821`), the deadline second (`builder.rs:828`), the output bound -third (`builder.rs:835`), exit status last (`builder.rs:845`). When cancellation +(`builder.rs:823`), the deadline second (`builder.rs:830`), the output bound +third (`builder.rs:840`), exit status last (`builder.rs:847`). When cancellation and the deadline apply in the same iteration, the run breaks with -`(false, true, false)` and is classified `Cancelled` (`builder.rs:826`, +`(false, true, false)` and is classified `Cancelled` (`builder.rs:828`, `builder.rs:232`). A cancelled build therefore never reports as timed out, and an over-limit run is reported as an output-limit failure rather than as a build failure. The CI validator inherits that precedence unchanged and maps each @@ -186,35 +171,35 @@ runner outcome onto its own typed failure. A pre-loop cancellation check also exists in `qualification.rs:887-899`, so a cancelled qualification does not spawn at all. -Timeouts in use: builds get 1800 s (`builder.rs:1120`); toolchain preflights get -10 s each (`builder.rs:975`, `builder.rs:995`, `builder.rs:1025`, -`builder.rs:1044`); the QEMU emulator preflight gets 10 s +Timeouts in use: builds get 1800 s (`builder.rs:1122`); toolchain preflights get +10 s each (`builder.rs:977`, `builder.rs:997`, `builder.rs:1027`, +`builder.rs:1046`); the QEMU emulator preflight gets 10 s (`qualification.rs:845`); smoke runs get `smoke.timeout_ms` bounded to `1..=86_400_000` (`qualification.rs:151-152`); CI validator runs get `1_000..=600_000` ms (`consumer_validator.rs:87`) with the preflight further capped at 30 s (`consumer_validator.rs:499`). How a timeout reaches the caller: never as an error. `run_bounded_inner` returns -`Ok(ProcessEvidence)` with `CommandOutcome::TimedOut` (`builder.rs:892-893`, +`Ok(ProcessEvidence)` with `CommandOutcome::TimedOut` (`builder.rs:894-895`, enum at `builder.rs:224-235`). The build path converts any non-`Success` outcome into a `BuildAttempt` carrying the evidence and no candidates -(`builder.rs:1123-1150`). A timeout is therefore a recorded, typed, +(`builder.rs:1125-1134`). A timeout is therefore a recorded, typed, non-success *result*, not a raised error — which is what keeps a hung build from looking like a crash. One fidelity caveat in that classification: a failed `expected_stdout` check maps -to `CommandOutcome::Failed(-1)` (`builder.rs:898-899`), and a signal-terminated +to `CommandOutcome::Failed(-1)` (`builder.rs:900-901`), and a signal-terminated process also maps to `Failed(-1)` via `status.code().unwrap_or(-1)` -(`builder.rs:903`). Callers cannot distinguish a version mismatch from a +(`builder.rs:905`). Callers cannot distinguish a version mismatch from a signal kill by outcome alone. ## Output bounding and the no-output-leak rule Both stdout and stderr are piped and drained by dedicated threads -(`builder.rs:737-738`, threads at `builder.rs:815` and `498`). `drain` -(`builder.rs:942-958`) reads in 8 KiB chunks, keeps at most +(`builder.rs:739-740`, threads at `builder.rs:817`, `820`, and `498`). `drain` +(`builder.rs:944-960`) reads in 8 KiB chunks, keeps at most `limit - already_captured` bytes, and sets an overflow flag when a chunk does not -fit (`builder.rs:948-953`). Oversized output is *dropped*, not buffered to disk +fit (`builder.rs:947-955`). Oversized output is *dropped*, not buffered to disk and not truncated-with-a-tail. Both reader threads are joined before the outcome is computed, under a bounded budget (`join_drained`, `builder.rs`): a reader returns only at pipe EOF, which needs every write end closed, so a descendant @@ -226,26 +211,26 @@ removes a false-success path: a child that exits zero while a descendant holds the pipe used to be reported as a success with incomplete captured output. Overflow is a first-class failure. If either flag is set, the outcome is -`CommandOutcome::OutputLimitExceeded` (`builder.rs:896-897`), ranked below +`CommandOutcome::OutputLimitExceeded` (`builder.rs:898-899`), ranked below timeout and cancellation but above exit status — an over-limit run is never reported as a build failure, so an unbounded log flood cannot be mistaken for a compiler error. The CI validator used to cap the same way with readers of its own and to detect the overflow *promptly* rather than at the deadline. It no longer has readers -of its own: the shared `drain` (`builder.rs:942`) does the capping, and the +of its own: the shared `drain` (`builder.rs:944`) does the capping, and the shared runner detects the overflow promptly — `stream_over_limit` -(`builder.rs:938`) reads the same flag the drain thread sets, and the runner -terminates the whole group at the moment of excess (`builder.rs:835-846`). +(`builder.rs:940`) reads the same flag the drain thread sets, and the runner +terminates the whole group at the moment of excess (`builder.rs:840-845`). That prompt detection was CI's strength and it is now the shared runner's: a process that exceeds its output bound is killed when it exceeds it, not when its deadline arrives. The observable outcome is unchanged. The decisive rule is that **captured output contents never cross the API boundary.** `ProcessEvidence` carries only an outcome and two byte counts -(`builder.rs:256-263`, constructed at `builder.rs:905-909`); it has no output +(`builder.rs:256-263`, constructed at `builder.rs:907-911`); it has no output fields at all. The `expected_stdout` version substring is compared inside -`run_bounded_inner` (`builder.rs:886-891`) and is never stored, logged, or +`run_bounded_inner` (`builder.rs:888-893`) and is never stored, logged, or returned — the field's own doc comment says so (`builder.rs:175-176`). `ConsumerValidationEvidenceV1` is built from identity, interpreter, outcome, size, and digest only (`consumer_validator.rs:267-277`). @@ -259,15 +244,15 @@ failure text anywhere. ## Environment clearing and the allowlist -Every bounded spawn begins with `env_clear()` (`builder.rs:735`); the CI +Every bounded spawn begins with `env_clear()` (`builder.rs:737`); the CI validator reaches that same call through the shared runner. Nothing is inherited implicitly. Each variable is then re-added -only if it is present in the parent (`builder.rs:779-783`), and finally the +only if it is present in the parent (`builder.rs:781-785`), and finally the per-spec explicit overrides are applied with `command.envs(&spec.env)` -(`builder.rs:797`) — for a build, that is exactly `CARGO_TARGET_DIR` +(`builder.rs:799`) — for a build, that is exactly `CARGO_TARGET_DIR` (`builder.rs:442-446`). -The builder allowlist (`builder.rs:755-778`): +The builder allowlist (`builder.rs:758-779`): | Variable | Why it is allowed | | --- | --- | @@ -288,7 +273,7 @@ The builder allowlist (`builder.rs:755-778`): | `UniversalCRTSdkDir`, `UCRTVersion` | Universal CRT root and version. | Candidate and QEMU runs get a deliberately narrower set — `PATH`, `SystemRoot`, -`WINDIR`, `TEMP`, `TMP` (`builder.rs:753-754`). The untrusted binary being +`WINDIR`, `TEMP`, `TMP` (`builder.rs:755-756`). The untrusted binary being smoke-tested gets no `CARGO_HOME`, no `RUSTUP_HOME`, and no MSVC variables. This is the meaningful containment: a candidate that can observe the toolchain roots learns where the build machine's toolchain lives. @@ -300,7 +285,7 @@ security one. The CI validator no longer restates an allowlist. It runs under the narrow five-variable allowance that the candidate and QEMU runs use — `PATH`, -`SystemRoot`, `WINDIR`, `TEMP`, `TMP` (`builder.rs:753-754`) — which is the +`SystemRoot`, `WINDIR`, `TEMP`, `TMP` (`builder.rs:755-756`) — which is the same allowance the interpreter needs to locate its runtime. `PATH` may be replaced wholesale by a caller-supplied directory list (`consumer_validator.rs:299-300`), which is what keeps missing-interpreter tests hermetic; that override is a @@ -310,14 +295,14 @@ test-and-fixture facility, and its value is fully caller-controlled. eggpack does not provision a Windows C toolchain and does not pretend to. The MSVC variables in the allowlist are *preserved if already present* and otherwise -simply absent (`builder.rs:779-783`). Provisioning is the caller's and CI's +simply absent (`builder.rs:781-785`). Provisioning is the caller's and CI's responsibility: `.github/workflows/ci.yml:43-46` runs `ilammy/msvc-dev-cmd@v1` with `arch: x64` before any Windows build, and `.github/workflows/ci.yml:47-56` then verifies that `VCToolsInstallDir` is set and that `link.exe` resolves underneath it. The one adjustment eggpack makes is path ordering. On Windows, if -`VCToolsInstallDir` is set, `builder.rs:784-796` prepends +`VCToolsInstallDir` is set, `builder.rs:786-798` prepends `%VCToolsInstallDir%/bin/Hostx64/x64` to the copied `PATH`. `env_clear()` has discarded the environment `msvc-dev-cmd` carefully assembled, and this restores the single entry that determines which `link.exe` is used; the wider MSVC @@ -326,25 +311,25 @@ about them. The consequence on an uninitialized Windows host is bounded and quiet. `cargo` is found through `PATH`, finds no `link.exe`, exits non-zero, and the run is recorded -as `CommandOutcome::Failed(code)` (`builder.rs:902-903`) — or `Failed(-1)` if the +as `CommandOutcome::Failed(code)` (`builder.rs:904-905`) — or `Failed(-1)` if the tool was signal-terminated. The diagnostic that would explain *why* the link failed stays inside the discarded stderr buffer: only `stderr_bytes` is reported -(`builder.rs:908`). An operator sees "build failed, N bytes of stderr", and the +(`builder.rs:910`). An operator sees "build failed, N bytes of stderr", and the missing-environment diagnosis has to come from the CI step that checks for it, not from the captured linker output. ## The executable allowlist (ADR-0004 boundary) `ExecutableAllowance` (`builder.rs:127-132`) is the per-strategy restriction on -what may be executed. It is evaluated at `builder.rs:701-711`, *before* any +what may be executed. It is evaluated at `builder.rs:703-713`, *before* any `Command` is constructed, and a non-matching executable is rejected with -`invalid process bounds or executable` (`builder.rs:712-721`). +`invalid process bounds or executable` (`builder.rs:714-723`). | Allowance | Permitted executable | Enforcement | | --- | --- | --- | -| `Builder` | exactly `cargo`, `rustc`, or `zig` | `matches!(spec.executable.as_str(), ...)` (`builder.rs:702-704`) | -| `Candidate` | any **absolute** path, which must then be made executable | `Path::new(&spec.executable).is_absolute()` (`builder.rs:705`) | -| `Qemu` | exactly `qemu-x86_64`, `qemu-aarch64`, or `qemu-arm` | `matches!(...)` (`builder.rs:706-708`) | +| `Builder` | exactly `cargo`, `rustc`, or `zig` | `matches!(run.executable, ...)` (`builder.rs:704-706`) | +| `Candidate` | any **absolute** path, which must then be made executable | `Path::new(run.executable).is_absolute()` (`builder.rs:707`) | +| `Qemu` | exactly `qemu-x86_64`, `qemu-aarch64`, or `qemu-arm` | `matches!(...)` (`builder.rs:708-710`) | This is the enforcement point for ADR-0004's rejection of a generic shell DSL and of a "run whatever" escape hatch (`architecture/principles-roadmap.md:94-98`). @@ -364,7 +349,7 @@ executable is `candidate.path` from a discovered candidate artifact (`qualification.rs:917`), which was itself produced by a bounded build, re-verified, and made executable. So the candidate allowance trusts a path's origin, not its name. That is a deliberate difference in mechanism, and it is -why `ensure_candidate_executable` runs at `builder.rs:726-730` and a failure +why `ensure_candidate_executable` runs at `builder.rs:728-731` and a failure there is a build error rather than a spawn. The CI side closes the same hole twice over. The interpreter is a @@ -380,16 +365,16 @@ constructed. ## Preflight checks and their strength -`preflight` (`builder.rs:961-1058`) runs before any build, called from -`execute_target_cancellable` at `builder.rs:1104`. The checks are not of uniform +`preflight` (`builder.rs:963-1060`) runs before any build, called from +`execute_target_cancellable` at `builder.rs:1083`. The checks are not of uniform strength, and stating otherwise would misrepresent the guarantee. | Tool | Command | `expected_stdout` | Strength | | --- | --- | --- | --- | -| `rustc` | `+ --version` (`builder.rs:967-980`) | `None` (`builder.rs:978`) | **Exit status only** | -| `cargo` | `+ --version` (`builder.rs:987-1000`) | `None` (`builder.rs:998`) | **Exit status only** | -| `cargo-zigbuild` | `zigbuild --version` (`builder.rs:1020-1033`) | `Some("cargo-zigbuild ")` (`builder.rs:1031`) | **Substring verified** | -| `zig` | `version` (`builder.rs:1039-1052`) | `Some()` (`builder.rs:1049`) | **Substring verified** | +| `rustc` | `+ --version` (`builder.rs:968-982`) | `None` (`builder.rs:980`) | **Exit status only** | +| `cargo` | `+ --version` (`builder.rs:988-1002`) | `None` (`builder.rs:1000`) | **Exit status only** | +| `cargo-zigbuild` | `zigbuild --version` (`builder.rs:1021-1034`) | `Some("cargo-zigbuild ")` (`builder.rs:1033`) | **Substring verified** | +| `zig` | `version` (`builder.rs:1040-1052`) | `Some()` (`builder.rs:1051`) | **Substring verified** | | QEMU | ` --version` (`qualification.rs:840-850`) | `None` (`qualification.rs:848`) | **Exit status only** | | Python 3 | `--version` (`consumer_validator.rs:497`, run at `consumer_validator.rs:503`) | `expected_stdout` = `"Python 3"` (`consumer_validator.rs:502`) | **Substring verified** (`"Python 3"`) | @@ -406,14 +391,14 @@ exit-status-only, though there tool identity is a fixed finite mapping A missing interpreter is a failure, never a skip: an unusable `python3` returns `InterpreterUnavailable` (`consumer_validator.rs:551-554`) rather than passing validation vacuously. A missing cargo-zigbuild or Zig declaration is rejected before spawn -(`builder.rs:1044`, `builder.rs:1018`). +(`builder.rs:1014`, `builder.rs:1020`). ## No shell interpretation Every production spawn passes an argument vector to `Command::new` plus `.args`/`.arg`. There is no `sh -c`, no `cmd /C`, and no shell string anywhere in a spawn path. Core: `Command::new(run.executable).args(run.args)` -(`builder.rs:731-734`). CI: the same shared call, with the argv built as +(`builder.rs:733-736`). CI: the same shared call, with the argv built as OS-native arguments — script path and candidate path (`consumer_validator.rs:530-533`). Because no shell is involved, the workspace does not need to escape, quote, or diff --git a/architecture/testing-and-portability.md b/architecture/testing-and-portability.md index 50e29f5..fae8fd9 100644 --- a/architecture/testing-and-portability.md +++ b/architecture/testing-and-portability.md @@ -34,7 +34,7 @@ Two topologies coexist. **Inline `mod tests`.** Eight modules declared inside `src/*.rs`: `bootstrap/src/lib.rs:1066`, `cli/src/main.rs:1628`, `contract/src/lib.rs:1780`, -`core/src/lib.rs:770`, `core/src/builder.rs:1278`, `core/src/finalization.rs:491`, +`core/src/lib.rs:770`, `core/src/builder.rs:1281`, `core/src/finalization.rs:491`, `core/src/qualification.rs:1314`, and `manifest/src/lib.rs:424`. What this buys: tests can reach `pub(crate)` and private items without widening @@ -241,7 +241,7 @@ outputs, so running them twice buys nothing. | `ilammy/msvc-dev-cmd@v1` (arch x64) | 43-46 | Rust's MSVC toolchain needs an initialized developer environment before any Cargo build; without it `link.exe` is absent and the real-Cargo tests fail with a linker error, not a code failure | | Verify initialized MSVC linker environment | 47-56 | Fails fast and legibly: throws if `VCToolsInstallDir` is unset, and throws if `link.exe` resolves *outside* that directory. Guards against silently picking up a different `link.exe` on `PATH` | | Windows builder real Cargo candidate smoke | 57-59 | `real_local_cargo_fixture_builds_a_direct_candidate`; the only lane that proves a real Cargo build links on Windows | -| Process-group timeout and cancellation | 60-62 | `timeout_kills_and_waits_for_the_process_group` (`crates/eggpack-core/src/builder.rs:1757`); process-group/job semantics differ most on Windows | +| Process-group timeout and cancellation | 60-62 | `timeout_kills_and_waits_for_the_process_group` (`crates/eggpack-core/src/builder.rs:1835`); process-group/job semantics differ most on Windows | | Core tests serialized for diagnosis | 63-65 | `-- --test-threads=1`. A serialization workaround: the suite exhibits nondeterministic failures under parallel execution on Windows, so the Windows lane trades coverage speed for signal | | Windows CI crate tests | 66-68 | `-p eggpack-ci` on Windows — the CI crate has no `#[cfg(windows)]` block left; its Windows paths are runtime target checks (`crates/eggpack-ci/src/render_github.rs:230`, `crates/eggpack-ci/src/handoff.rs:380`) plus `cfg!(windows)` (`crates/eggpack-ci/src/consumer_validator.rs:220`), which Linux never exercises | | Verify pwsh 7 + `tar.exe` | 69-75 | `tar.exe` ships in the Windows image but is not guaranteed; the archive qualification lane requires both, so prerequisite failure is separated from test failure | diff --git a/architecture/validation-model.md b/architecture/validation-model.md index bd97fe6..12229fc 100644 --- a/architecture/validation-model.md +++ b/architecture/validation-model.md @@ -109,7 +109,7 @@ be a breaking change to that document only. | Crate | Enforcing sites | | --- | --- | -| core | `lib.rs:654`, `lib.rs:680`, `lib.rs:716`, `builder.rs:310`, `builder.rs:1091`, `finalization.rs:74`, `qualification.rs:138`, `qualification.rs:337`, `qualification.rs:593` | +| core | `lib.rs:654`, `lib.rs:680`, `lib.rs:716`, `builder.rs:310`, `builder.rs:1093`, `finalization.rs:74`, `qualification.rs:138`, `qualification.rs:337`, `qualification.rs:593` | | bootstrap | `lib.rs:323`, `lib.rs:409` | | ci | `consumer_validator.rs:80`, `:184`, `handoff.rs:78`, `:192`, `identity.rs:105`, `:199`, `planning.rs:191`, `:235`, `release_plan.rs:171` | | github | `lib.rs:175`, `:339`, `:433`, `:792`, `:929` | diff --git a/crates/eggpack-core/src/builder.rs b/crates/eggpack-core/src/builder.rs index 1e7fb80..5b826b9 100644 --- a/crates/eggpack-core/src/builder.rs +++ b/crates/eggpack-core/src/builder.rs @@ -625,53 +625,53 @@ fn run_bounded_inner( run_bounded(&run, cancellation, allowance) } -/// Whether a failed group signal can be ignored. +/// Whether a failed group signal is resolved by the kernel or a safe retry. /// -/// `ESRCH` means the group holds no process at all, which is exactly the -/// state the signal was meant to reach. +/// `ESRCH` proves the group is absent. For another error, an exited leader +/// must first be reaped and the whole group signalled again; only a successful +/// retry or retry `ESRCH` establishes that termination is complete. /// -/// Otherwise the supervised child may have exited between the decision to -/// terminate and the signal itself. It then stays in the group as a zombie -/// until it is reaped, and an unreaped zombie cannot be signalled: Linux -/// signals the group anyway, while macOS refuses the whole group and reports -/// `EPERM`. When the child has already exited there is no child left to -/// terminate, so the failure is benign for the same reason `ESRCH` is. +/// The initial error is not proof that the group is empty. In particular, +/// macOS `EPERM` can mean a group member is unsignalable, not absent. +/// `try_wait` reports only the supervised leader and cannot inventory the +/// remaining process group. /// -/// A group that holds a live process and still cannot be signalled is a hard -/// failure. That is the case where the child has not exited and the errno is -/// not `ESRCH`, and the run must fail closed. +/// The retry closure is lazy and runs only after the leader has exited and +/// been reaped. It sends the same group signal again, so live descendants are +/// still targeted. Any retry error other than `ESRCH` remains a hard failure. +/// Pipe EOF is not group inventory: descendants may close inherited pipes +/// and remain alive. This helper is used by each Unix termination path. #[cfg(unix)] -fn group_signal_failure_is_benign(error: &std::io::Error, child_exited: bool) -> bool { +fn group_signal_failure_is_benign( + error: &std::io::Error, + child_exited: bool, + retry_group_signal: impl FnOnce() -> std::io::Result<()>, +) -> bool { if error.raw_os_error() == Some(libc::ESRCH) { return true; } - child_exited + if !child_exited { + return false; + } + match retry_group_signal() { + Ok(()) => true, + Err(retry_error) => retry_error.raw_os_error() == Some(libc::ESRCH), + } } -/// Terminate the supervised process group, tolerating a group with nothing -/// left to terminate. +/// Terminate the supervised process group, tolerating only proven completion. /// -/// The group's only member is the supervised child. When that child has -/// already exited it stays in the group as a zombie until it is reaped, and -/// the group holds no process at all once it is reaped. Signalling a group -/// that holds nothing is reported by the kernel as `ESRCH` — "no such -/// process group" — and `command-group` documents that a group which has -/// already exited produces an error from `kill`. +/// On macOS, signalling a group containing an unreaped zombie can fail with +/// `EPERM`; reaping the leader may make the group empty, but it may also leave +/// live descendants. Therefore, after any non-`ESRCH` failure, the runner +/// reaps an exited leader and retries the group signal. A successful retry +/// reaches remaining members; retry `ESRCH` proves the group is empty. Every +/// other retry error remains a hard failure. /// -/// The two supported platforms disagree about the zombie case. Linux signals -/// a zombie successfully, while macOS refuses to signal a group that holds -/// one and reports `EPERM` for the whole group. A run whose child exited just -/// before the runner noticed that its output bound was exceeded would -/// therefore terminate cleanly on one platform and fail on the other, and it -/// would report an output-bound violation as a launch failure, because the -/// caller maps every runner error onto that outcome. -/// -/// This is exact rather than permissive. `ESRCH` is the kernel's own -/// statement that the group holds no process, and a child that has already -/// exited is not a process that can outlive the run. A descendant that -/// outlives the child is caught by the drain budget, which fails the run -/// closed. Every other case — a group that holds a live process and cannot -/// be signalled — remains a hard failure. +/// The drain budget detects a descendant that keeps a pipe open, but a +/// descendant that closes its pipes is not observable through that budget. +/// Group termination, not pipe state or leader status, is the authority here. +/// Existing timeout, cancellation, and output-limit classification is unchanged. fn terminate_process_group( child: &mut command_group::GroupChild, message: &str, @@ -679,15 +679,17 @@ fn terminate_process_group( match child.kill() { Ok(()) => Ok(()), Err(error) => { - // `try_wait` reaps a child that has already exited, so this both - // observes and clears the zombie that made the signal fail. - let child_exited = matches!(child.try_wait(), Ok(Some(_))); + // Reap the leader before retrying; its exit alone says nothing + // about other members that may still be in the process group. + let child_wait = child.try_wait(); + #[cfg(unix)] + let child_exited = child_wait.as_ref().is_ok_and(Option::is_some); #[cfg(unix)] - if group_signal_failure_is_benign(&error, child_exited) { + if group_signal_failure_is_benign(&error, child_exited, || child.kill()) { return Ok(()); } #[cfg(not(unix))] - let _ = child_exited; + let _ = child_wait; Err(build_err(message)) } } @@ -1692,15 +1694,91 @@ mod tests { } #[cfg(unix)] #[test] - fn a_failed_group_signal_is_benign_only_when_nothing_is_left_to_terminate() { + fn a_failed_group_signal_is_benign_only_after_recheck_proves_termination() { let no_such_group = std::io::Error::from_raw_os_error(libc::ESRCH); let not_permitted = std::io::Error::from_raw_os_error(libc::EPERM); - // The group is empty. - assert!(group_signal_failure_is_benign(&no_such_group, false)); - // The group holds only the zombie of a child that already exited. - assert!(group_signal_failure_is_benign(¬_permitted, true)); - // The group holds a live process that cannot be signalled. - assert!(!group_signal_failure_is_benign(¬_permitted, false)); + + assert!(group_signal_failure_is_benign( + &no_such_group, + false, + || { panic!("ESRCH must not trigger a retry") } + )); + assert!(!group_signal_failure_is_benign( + ¬_permitted, + false, + || { panic!("a live or unverified child must not trigger a retry") } + )); + assert!(group_signal_failure_is_benign(¬_permitted, true, || Ok( + () + ))); + assert!(group_signal_failure_is_benign(¬_permitted, true, || { + Err(std::io::Error::from_raw_os_error(libc::ESRCH)) + })); + assert!(!group_signal_failure_is_benign( + ¬_permitted, + true, + || { Err(std::io::Error::from_raw_os_error(libc::EPERM)) } + )); + } + #[cfg(unix)] + #[test] + fn terminating_an_exited_leader_still_signals_a_live_group_descendant() { + let root = crate::test_temp_dir("group-descendant-termination"); + let started = root.join("descendant-started"); + let release = root.join("descendant-release"); + let survived = root.join("descendant-survived"); + let started_arg = started.to_string_lossy().into_owned(); + let release_arg = release.to_string_lossy().into_owned(); + let survived_arg = survived.to_string_lossy().into_owned(); + let mut command = Command::new("sh"); + command.args([ + "-c", + "sh -c 'printf started > \"$1\"; while [ ! -e \"$2\" ]; do sleep 0.01; done; printf survived > \"$3\"' sh \"$1\" \"$2\" \"$3\" >/dev/null 2>&1 & exit 0", + "group-fixture", + started_arg.as_str(), + release_arg.as_str(), + survived_arg.as_str(), + ]); + let mut child = command.group_spawn().unwrap(); + + let leader_deadline = Instant::now() + Duration::from_secs(3); + let leader_status = loop { + match child.try_wait() { + Ok(Some(status)) => break Some(status), + Ok(None) if Instant::now() < leader_deadline => { + thread::sleep(Duration::from_millis(10)); + } + _ => break None, + } + }; + let descendant_deadline = Instant::now() + Duration::from_secs(1); + while !started.is_file() && Instant::now() < descendant_deadline { + thread::sleep(Duration::from_millis(10)); + } + + let terminated = terminate_process_group(&mut child, "test termination").is_ok(); + if !terminated { + let _ = child.kill(); + } + // If a live descendant was incorrectly left behind, releasing it makes + // it write a marker rather than relying on an arbitrary sleep duration. + fs::write(&release, "release").unwrap(); + let survivor_deadline = Instant::now() + Duration::from_secs(1); + while !survived.is_file() && Instant::now() < survivor_deadline { + thread::sleep(Duration::from_millis(10)); + } + let descendant_started = started.is_file(); + let descendant_survived = survived.exists(); + let leader_succeeded = leader_status.is_some_and(|status| status.success()); + fs::remove_dir_all(root).unwrap(); + + assert!(leader_succeeded, "the group leader must exit normally"); + assert!(descendant_started, "the live descendant fixture must start"); + assert!(terminated, "the process group must be terminated"); + assert!( + !descendant_survived, + "the descendant must not outlive group termination" + ); } #[test] fn nonzero_tool_exit_is_not_success() { diff --git a/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md b/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md new file mode 100644 index 0000000..a85268f --- /dev/null +++ b/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md @@ -0,0 +1,139 @@ +# CI/Release Orchestration Milestone 003pa — Process-Group Signal Recheck Corrective + +Status: active + +Corrects: CI/Release M003p, closed at `27cb16c` with closure `plans/closure/ci-release-orchestration/003p-status.md`. The historical plan and closure remain unchanged. + +Repository authoring baseline: `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09` + +Primary roadmap: `plans/subsystems/ci-release-orchestration-roadmap.md` + +Normative deep dive: `architecture/process-execution.md` + +Primary class: fail-closed process-group termination + +## 1. Why this milestone exists + +At the reviewed baseline, `terminate_process_group` treats a failed Unix group signal as benign whenever `GroupChild::try_wait` reports that the supervised leader exited (`crates/eggpack-core/src/builder.rs`, `group_signal_failure_is_benign` and `terminate_process_group`). Reaping the leader proves only that the leader exited; it does not prove the process group is empty. A surviving descendant may have closed stdout and stderr, so the drain budget is not proof that no group member remains. + +Apple documents `EPERM` for `killpg` when a group member is not signalable, and no group signal is sent. Therefore, accepting `EPERM` based only on the leader's exit can report termination as complete while a live descendant remains. `ESRCH` remains the kernel's direct indication that the group does not exist. + +The local output-bound regression did not reproduce in 30 repeated runs during research. A prior diagnostic sampled `EPERM` while the direct child had exited; it did not establish that the entire group was empty. The corrective must preserve the macOS zombie-only behavior without broadening the exception to live or unverified group members. + +## 2. Why ready + +- M003p is closed and its behavior is identified precisely; this plan corrects that closed milestone without editing its historical record. +- The defect is localized to the shared `eggpack-core` termination helper and its tests. The shared runner is the authority for builds, qualification, git, and CI consumer validation. +- No schema, public API, dependency, or external-repository change is required. +- The user has requested implementation and verification. The exact acceptance and local verification steps are listed below; hosted cross-platform qualification remains a closure requirement and is not implied by local success. + +## 3. Objective + +1. Keep an initial `ESRCH` benign. +2. For another failed Unix group signal, observe/reap the supervised child. If it is still live or its status is unavailable, keep the failure hard. +3. If the leader has exited, retry the group signal after reaping it. Treat only retry success or retry `ESRCH` as completed termination; any other retry error remains a hard failure. +4. Preserve the Windows job-object behavior and all public outcomes outside this termination distinction. +5. Add deterministic coverage for the retry decision and coverage that a surviving group descendant is still targeted; correct the normative process-execution documentation. + +## 4. Authority and invariants + +The termination rule belongs to `eggpack-core`'s shared bounded runner, not to the CI outcome mapper. The runner must not declare process-group termination complete based solely on the direct child's state. + +Affected invariants: + +- every failure path targets the whole process group/job; +- no live, unverified, or unsignalable group is treated as terminated; +- only `ESRCH`, successful retry, or retry `ESRCH` establish that no further signal failure remains; +- Windows job-object semantics and error classification remain unchanged; +- no public API, serialized format, generated workflow, or dependency changes; +- deterministic behavior and fail-closed error mapping are preserved. + +## 5. Scope + +### In scope + +- Tighten the private Unix group-signal failure/retry decision in `crates/eggpack-core/src/builder.rs`. +- Update the focused helper tests and add a process-group descendant regression if it can be made bounded and leak-safe. +- Update `architecture/process-execution.md` so it no longer claims that an exited leader proves the group is empty or that pipe-drain completion detects every descendant. +- Re-verify architecture citations into `builder.rs` by symbol/content, not by arithmetic; update affected citations. +- Update this plan's active status surfaces in the CI/release roadmap, registry, and `AGENTS.md`. Do not modify M003p's plan or closure. + +### Out of scope + +- Changing CI validator error-to-outcome mapping or generated workflow bytes. +- Changing timeout, cancellation, output-limit policy, process-group creation, or public APIs. +- Suppressing `EPERM` unconditionally, adding privileged test setup, or claiming that a direct-child status proves the whole group is empty. +- Commits, pushes, remote workflow dispatch, publication, or unrelated pre-existing worktree changes. + +## 6. Required work packages + +### WP1 — Fail-closed signal retry + +When the initial group signal fails with `ESRCH`, return success. For any other error, call `try_wait`. If the child is live or the wait status is unavailable, return the existing termination error. If the child exited, retry `GroupChild::kill`; accept retry success or retry `ESRCH`, and preserve the termination error for every other retry failure. + +### WP2 — Regression coverage + +- Deterministically cover initial `ESRCH`, a live/unverified leader, and an exited leader whose retry returns success, `ESRCH`, or `EPERM`. Confirm the retry closure is not called for the initial `ESRCH` or a live/unverified leader. +- Retain the real empty-group test. +- Add or strengthen a bounded process-group test demonstrating that a live descendant is still targeted after the leader exits. Do not rely on changing UID or other privileged setup; model an unsignalable retry with deterministic injected outcomes. +- Keep the output-overflow test as end-to-end coverage of the actual runner path. + +### WP3 — Normative documentation and citations + +Correct the process-execution deep dive's rule and descendant/drain claims, record the retry semantics and Windows boundary, and re-verify affected `builder.rs` citations by their named constructs. Preserve the M003p plan and closure as historical evidence. + +### WP4 — Verification and closure evidence + +Run the exact targeted commands and the canonical local gate below. Record results, including any platform or hosted-CI gaps, in a new `plans/closure/ci-release-orchestration/003pa-status.md` only when closure evidence is available. Do not mark this milestone closed based solely on compilation or local tests; hosted macOS, Linux stable/MSRV, and Windows lanes are required before closure. + +## 7. Failure, restart, and compatibility + +A retry error other than `ESRCH` is never downgraded because the supervised leader exited. The original termination error remains the public failure classification; captured process output remains unavailable to callers. If a test fails or a group cannot be proven terminated, stop and retain fail-closed behavior. The patch adds no migration requirement or compatibility change. + +The working tree contains unrelated pre-existing edits in `Cargo.lock`, `architecture/ci.md`, `architecture/github.md`, `architecture/overview.md`, `crates/eggpack-ci/Cargo.toml`, `crates/eggpack-ci/src/tests.rs`, `crates/eggpack-github/Cargo.toml`, and `crates/eggpack-github/src/lib.rs`; leave them intact and out of scope. + +## 8. Tests and exact verification commands + +Focused tests: + +```bash +cargo test -p eggpack-core --all-targets --all-features --locked group_signal -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked terminating_an_already_exited_process_group_is_not_a_failure -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked terminating_an_exited_leader_still_signals_a_live_group_descendant -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked stdout_overflow_is_bounded_and_not_success -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked parked_drain_reader_cannot_outlive_the_deadline -- --nocapture +``` + +Local checks: + +```bash +cargo fmt --all -- --check +cargo check --workspace --all-targets --locked +cargo clippy --workspace --all-targets --all-features --locked -- -D warnings +cargo test --workspace --all-targets --all-features --locked +scripts/check-local.sh +``` + +`scripts/check-local.sh` is the canonical gate and includes packaging and the Rust 1.89 MSRV lane. Hosted CI on the exact candidate remains required for closure; no remote dispatch or push is authorized by this plan. + +## 9. Acceptance criteria + +| Criterion | Evidence | +|---|---| +| Zombie-only macOS failure remains tolerated without assuming the group is empty | deterministic initial-`EPERM`, exited-leader, retry-`ESRCH` coverage and end-to-end output-bound test | +| Live/unverified group cannot be accepted from leader exit alone | deterministic retry-`EPERM` failure and live/unverified-leader failure coverage | +| A live descendant is still targeted after leader exit | bounded process-group regression, with no leaked descendant | +| Empty group remains benign | real empty-group regression passes | +| Windows behavior is unchanged | cfg review and hosted Windows lane | +| API, manifest, and generated workflow bytes are unchanged | diff review and existing workspace tests | +| Normative text and citations match the implementation | source-anchor review of affected `architecture/` citations | +| Local gate is green | exact `scripts/check-local.sh` result | +| Candidate is cross-platform qualified before closure | hosted run on the exact candidate SHA, all four lanes green | + +## 10. Stop conditions + +Stop and keep the milestone active if the retry returns any non-`ESRCH` error, if a live or unverified group is accepted, if any descendant test leaks a process, if the Windows path changes, if the local gate fails, if architecture citations are not verified, or if hosted CI for the exact candidate is unavailable or red. Do not commit, push, dispatch, or publish as part of this task. + +## 11. Closure evidence + +The closure record must preserve the distinction between implementation, local checks, hosted CI actually observed, and unavailable evidence. It must include the reviewed baseline, exact candidate identifier if one exists, regression-test outcomes, full local-gate result, hosted lane matrix or explicit gap, invariant/security review, documentation/citation evidence, and the registry/roadmap disposition. The prior M003p closure remains unchanged. \ No newline at end of file diff --git a/plans/registry.md b/plans/registry.md index b203086..2b98356 100644 --- a/plans/registry.md +++ b/plans/registry.md @@ -110,7 +110,7 @@ Planning Hygiene M002, Ecosystem M003b, Bootstrap M002b, CI M003i, and CI M003j The post-implementation review of 2026-10-23 registered a corrective chain. **Build/Qualification M007 is closed** (`e3c6192`): `eggpack-core` now has one canonical bounded file-digest authority. **ADR-0006 is accepted (Option A)**: the all-zeros SHA-256 sentinel is refused everywhere, `ReleaseManifest` stays at `schema_version: 1`, and the published `eggpack-manifest` crate takes a `0.1.1` patch release carrying the tightened rule. **CI M003l is closed** (`9cf0bf8`): the duplicate host-match, floor-applicability, exact-tag, SHA-256 acceptance, and file-digest rules are gone, and the two exact-tag rule sets — disjoint in both directions — are replaced by their union. **Build/Qualification M008 is closed** (`7e7cb6a`): a declared compatibility floor is no longer silently dropped, and every target declaring one carries a finite, closed floor verification status computed by bounded independent ELF inspection. **Build/Qualification M009 is closed** (`eb77d19` + `8950eb9`): six of the nine operator commands the canonical specification names now exist, sharing one implementation with the `ci _*` runners. **CI M003m is closed** (`bd73f5c`): the CI crate's consumer-validator execution routes through the workspace's single bounded process-group runner, and its production region now contains no process-spawning code at all. **CI M003n is closed** (`bf0acfe` + `028db4a`): one drift comparison replaces three byte-identical copies, one staging-payload builder replaces two copies that were 85.5% identical, the 845-line `render_release_github_inner` is decomposed, and the CI crate's single source file became a 14-file module tree with byte-identical output. **Planning Hygiene M003** (docs-only) is closed as well. **Bootstrap M003a** (the ADR-0006 adversarial digest fixture corrective, closure `plans/closure/bootstrap-installers/003a-status.md`) is closed too: five bootstrap fixtures used the all-zeros digest as a stand-in, and the corrective replaced them with a real digest that must be refused. The whole 2026-10-23 review chain is closed. -**A follow-up review of the chain's own output found defects in the newly written code and registered a second corrective chain.** **Build/Qualification M007a is closed** (`c17bdbe`): the canonical digest helper refuses a read that produced zero bytes, so a zero-length digest record cannot exist. **Build/Qualification M008a is closed** (`c17bdbe`): the floor reader no longer abandons its scan at the first non-numeric `GLIBC_` name — which was masking a **contradicted** floor as an admissible `Unverified` status — and its virtual-address translation can no longer overflow. **Build/Qualification M009a is closed** (`d2fbd07`): the operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`, is equivalent to the CI path in emulated qualification, identity mode, consumer-validator support, and input encoding, and derives a self-checking manifest. **CI M003o is closed** (`b205de6`): the workflow renderer refuses an over-long generated directory instead of panicking on a legal 128-character contract target, and two digest diagnostics name the reason they refused. **CI M003p is closed** (`27cb16c`): the chain's first hosted CI run failed on macOS, where the shared bounded runner refuses to signal a process group holding the unreaped zombie of an exited child and reports the whole signal as `EPERM`; the runner now decides by observing whether the supervised child has exited, and hosted run `40263176191` is green on all four lanes. Both review chains are closed. The obligation ADR-0006 created for the published crate — the `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — was tracked by Release Manifest M004, which is now **closed**: `0.1.1` is published, and both narrowings the package carries are recorded as compatibility events. +**A follow-up review of the chain's own output found defects in the newly written code and registered a second corrective chain.** **Build/Qualification M007a is closed** (`c17bdbe`): the canonical digest helper refuses a read that produced zero bytes, so a zero-length digest record cannot exist. **Build/Qualification M008a is closed** (`c17bdbe`): the floor reader no longer abandons its scan at the first non-numeric `GLIBC_` name — which was masking a **contradicted** floor as an admissible `Unverified` status — and its virtual-address translation can no longer overflow. **Build/Qualification M009a is closed** (`d2fbd07`): the operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`, is equivalent to the CI path in emulated qualification, identity mode, consumer-validator support, and input encoding, and derives a self-checking manifest. **CI M003o is closed** (`b205de6`): the workflow renderer refuses an over-long generated directory instead of panicking on a legal 128-character contract target, and two digest diagnostics name the reason they refused. **CI M003p is closed** (`27cb16c`): the chain's first hosted CI run failed on macOS, where the shared bounded runner refuses to signal a process group holding the unreaped zombie of an exited child and reports the whole signal as `EPERM`; the runner now decides by observing whether the supervised child has exited, and hosted run `40263176191` is green on all four lanes. Both review chains are closed. A later review found that M003p's exited-leader check does not prove the whole process group is empty; CI/Release M003pa is active to re-signal after reaping the leader and fail closed unless the retry succeeds or returns `ESRCH`. M003p's historical plan and closure remain unchanged. The obligation ADR-0006 created for the published crate — the `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — was tracked by Release Manifest M004, which is now **closed**: `0.1.1` is published, and both narrowings the package carries are recorded as compatibility events. The two subsystems that were closed before this chain keep their closure records here so the index is complete rather than partial: **Contract and conformance M001** closed at `plans/closure/contract-conformance/001-status.md` (the @@ -155,6 +155,7 @@ The table below is the **milestone-to-closure index plus active ready work**, no | Build and qualification | M009a local producer operator defects corrective | **closed** | `plans/implementation/build-qualification/009a-local-producer-operator-defects.md` | Closure `plans/closure/build-qualification/009a-status.md`; implementation `d2fbd07`. The operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`; it is equivalent to the CI path in emulated qualification (`--qemu-sysroot`), identity mode (`--identity-mode`), consumer-validator support (`--consumer-validators`), and input encoding (TOML or JSON); and `manifest` is self-checking — it reads archive members back out of the finalized archive and compares against the collected manifest, failing closed instead of reporting `manifest: ok` | | CI orchestration | M003o renderer panic and digest diagnostics corrective | **closed** | `plans/implementation/ci-release-orchestration/003o-renderer-panic-and-digest-diagnostics.md` | Closure `plans/closure/ci-release-orchestration/003o-status.md`; implementation `b205de6`. The workflow renderer's generated-directory check was an assertion that a legal 128-character contract target could trip — it is now a refusal. Two digest diagnostics named a formatting problem where ADR-0006 refuses the well-formed all-zeros digest; they now name the actual reason. The CI crate's 85 public items and every rendered byte are unchanged | | CI orchestration | M003p process-group termination of an already-exited group corrective | **closed** | `plans/implementation/ci-release-orchestration/003p-process-group-termination-of-an-already-exited-group.md` | Closure `plans/closure/ci-release-orchestration/003p-status.md`; implementation `27cb16c`; hosted run `40263176191` green on all four lanes after four failing runs. The first hosted CI run of the 2026-10-23 review chain (`40207520563`) failed on macOS: two CI-crate tests reported `Failed(InterpreterUnavailable)` where they expected `Failed(OutputLimit)`. macOS refuses to signal a process group that holds the unreaped zombie of an exited child and reports the whole signal as `EPERM`; Linux signals it successfully, so the local gate and the Linux lanes never saw it. The runner now decides by observing whether the supervised child has exited rather than by reading the errno: a failed signal is benign when there is nothing left to terminate, and a group holding a live process that cannot be signalled still fails the run closed | +| CI orchestration | M003pa process-group signal recheck corrective | **active** | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | Corrects M003p without rewriting its closed plan/closure. Leader exit alone does not prove the process group empty; after an initial non-`ESRCH` error and confirmed leader exit, retry the group signal and accept only success or retry `ESRCH`. Local gate and exact-candidate hosted CI remain required before closure | | Bootstrap installers | M001 generator/direct fixtures | closed | `plans/implementation/bootstrap-installers/001-direct-installer-generator.md` | Closure `plans/closure/bootstrap-installers/001-status.md` | | CI orchestration | M001 CIPlan/GitHub renderer | closed | `plans/implementation/ci-release-orchestration/001-ci-plan-and-github-renderer.md` | Closure `plans/closure/ci-release-orchestration/001-status.md`; hosted run 36040032768 passes all lanes | | CI orchestration | M002 qualification/aggregation gates + drift CLI | closed historically; corrective closed | `plans/implementation/ci-release-orchestration/002-qualification-aggregation-gates-and-drift-cli.md` | Historical closure retained; executable generated-workflow defect corrected and qualified by M002a (`plans/closure/ci-release-orchestration/002a-status.md`) | @@ -334,6 +335,8 @@ The first hosted CI run of that chain found a further defect in the shared bound ``` CI M003p process-group termination of an already-exited group [CLOSED: 27cb16c] + | + `--> CI M003pa process-group signal recheck [ACTIVE] ``` The obligation those two chains left outstanding is tracked by a third line: @@ -360,6 +363,8 @@ ADR-0006 [ACCEPTED 2026-10-23, Option A: digest acceptance set] ## Next handoff +**Active handoff: CI/Release M003pa** (`plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md`). Implement the fail-closed retry, run the exact local gate, and obtain hosted CI on the exact candidate before closure; do not rewrite M003p's historical closure. + Every closed milestone retains its closure record, so do not read this section as a shortlist: Contract M001/M002, Release Manifest M001/M001a/M002/M003/M003a, Build/Qualification M001–M006, CI M001/M002/M002a/M003a–M003h, Bootstrap M001/M002/M002a, Eggup Interoperability M001/M001a, Ecosystem M001/M002, External backend evaluation M001, and Planning Hygiene M001 all have accepted closure records under `plans/closure/`. Eggup Interoperability M003 is additionally closed downstream on the real Eggsact consumer. Per-subsystem detail is in `plans/subsystems/*-roadmap.md`; the milestone-to-closure index is the table above. M003h is closed on the synchronized, verified candidate. **Ecosystem M002 stegoeggo is closed** at `plans/closure/ecosystem-adoption/002-status.md` §9: consumer implementation `3b96fae` and closure `c75132a` prove the second-repo cutover without a new Eggpack producer primitive, and the live evidence arrived as stegoeggo `v0.5.0` — Eggpack run `37181914252`, published 2026-10-04T06:34:19Z from source `57ca94c9…`, exact 15-asset inventory, manual publication, real public `0.4.2 -> 0.5.0` updater transition. The `0.4.3` milestone earlier planning anticipated was stopped pre-publication by the consumer on semver grounds and superseded by `0.5.0`. diff --git a/plans/subsystems/ci-release-orchestration-roadmap.md b/plans/subsystems/ci-release-orchestration-roadmap.md index c55cf30..585e52d 100644 --- a/plans/subsystems/ci-release-orchestration-roadmap.md +++ b/plans/subsystems/ci-release-orchestration-roadmap.md @@ -110,6 +110,8 @@ A follow-up review of that chain's own output registered one further corrective The first hosted CI run of that chain — run `40207520563` on `d4d5e43` — failed on macOS, and registered one further corrective against this subsystem. **M003p** fixes the shared bounded runner's treatment of a process group that has already exited: macOS refuses to signal a group that still holds the unreaped zombie of an exited child and reports the whole signal as `EPERM`, where Linux signals it successfully. The runner treated any failed group signal as fatal, so an output-bound violation was reported as a launch failure on one platform and as an output-bound violation on the other. The rule is now that a failed group signal may be ignored when there is nothing left to terminate, decided by observing whether the supervised child has exited rather than by reading the errno; a group holding a live process that cannot be signalled still fails the run closed. It closed on `27cb16c`. +A review of M003p's group-empty assumption found that the supervised leader's exit does not prove the whole process group is empty: a surviving descendant may have closed its output pipes, and `EPERM` does not certify that the group has no live member. **M003pa** is active as a new corrective, preserving M003p's historical plan and closure. It keeps initial `ESRCH` benign; after another signal error, it reaps an exited leader and retries the group signal, accepting only retry success or retry `ESRCH`. A live/unverified leader or any other retry error remains a hard failure. Hosted cross-platform CI is required before closure. + ## 8. Cross-cutting requirements Least privilege, pinned actions, explicit timeouts, concurrency controls, artifact provenance, no secret leakage in generated summaries. @@ -157,6 +159,7 @@ Build/Qualification M001-M006 and CI M001/M002/M002a/M003c-M003g are closed on t | M003n producer implementation consolidation corrective | closed | `plans/implementation/ci-release-orchestration/003n-producer-implementation-consolidation-corrective.md` | `plans/closure/ci-release-orchestration/003n-status.md`; implementations `bf0acfe` + `028db4a` (cherry-picked `4692bd5` + `e66c7d1`) | One drift comparison replaces three byte-identical copies; one staging-payload builder replaces two copies that were 85.5% identical (301 of 352 lines); `render_release_github_inner` (845 lines) is decomposed into named private helpers; the CI crate's 12,221-line source file became a 14-file module tree with a 59-line crate root. The public API is byte-identical before and after and every rendered workflow, drift report, and staging payload is byte-identical | | M003o renderer panic and digest diagnostics corrective | closed | `plans/implementation/ci-release-orchestration/003o-renderer-panic-and-digest-diagnostics.md` | `plans/closure/ci-release-orchestration/003o-status.md`; implementation `b205de6` | The workflow renderer's generated-directory check was an assertion that a legal 128-character contract target could trip; it is now a refusal, so a caller-supplied contract cannot panic the renderer. Two digest diagnostics named a formatting problem where ADR-0006 refuses the well-formed all-zeros digest; they now name the actual reason. The CI crate's 85 public items and every rendered byte are unchanged | | M003p process-group termination of an already-exited group corrective | closed | `plans/implementation/ci-release-orchestration/003p-process-group-termination-of-an-already-exited-group.md` | `plans/closure/ci-release-orchestration/003p-status.md`; implementation `27cb16c`; hosted run `40263176191` green on all four lanes | The first hosted CI run of the 2026-10-23 review chain (`40207520563`) failed on macOS. The shared bounded runner treated a failed process-group signal as fatal, but macOS reports `EPERM` for a group holding the unreaped zombie of an exited child, where Linux signals it successfully. A failed signal is now benign when there is nothing left to terminate, decided by observing the child rather than by reading the errno; a group holding a live process that cannot be signalled still fails closed. The CI crate's 85 public items and every rendered byte are unchanged | +| M003pa process-group signal recheck corrective | active | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | no closure record yet | Corrects M003p's overbroad inference that an exited leader proves the group is empty. Keep only initial `ESRCH` or retry success/`ESRCH` benign after leader reaping; other cases fail closed. Local gate and hosted macOS/Linux stable+MSRV/Windows CI remain required before closure | ## 13. 2026-10-08 corrective addendum — M003i From 443a77d03a32e75e0d943bd8a009434fec34fd8b Mon Sep 17 00:00:00 2001 From: CI Test Date: Tue, 17 Nov 2026 16:14:23 +0000 Subject: [PATCH 7/7] docs: close CI M003pa with hosted evidence --- AGENTS.md | 2 +- architecture/overview.md | 35 +++---- .../ci-release-orchestration/003pa-status.md | 96 +++++++++++++++++++ ...process-group-signal-recheck-corrective.md | 10 +- plans/registry.md | 8 +- .../ci-release-orchestration-roadmap.md | 4 +- 6 files changed, 126 insertions(+), 29 deletions(-) create mode 100644 plans/closure/ci-release-orchestration/003pa-status.md diff --git a/AGENTS.md b/AGENTS.md index 89a3313..d796c3d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,4 +89,4 @@ Read the index in `overview.md` and follow one link. Grouped by what they cover: ## Planning conventions - Closure discipline: `plans/closure//NNN-status.md`. Compilation ≠ closure. History never rewritten — correctives are new `NNNa` plans; superseded material goes to `plans/archive/`. -- Current handoff (source: `plans/registry.md`): CI/Release M003pa is **active** under `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md`; no other milestone is registered **ready**; the last open obligation of the 2026-10-23 review chain — Release Manifest M004, the ADR-0006 `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — is **closed**: `0.1.1` is published to crates.io (checksum `352c3e327159615b763298e911e239f1decc4a2c9e28c28be8ddd28e50515e37`, tagged `eggpack-manifest-v0.1.1`), and both narrowings the package carries — the ADR-0006 digest rule and the `3ef806f` document bound — are recorded as compatibility events. The 2026-10-23 post-implementation review chain is closed (Build/Qualification M007, M008, M009; CI/Release M003l, M003m, M003n; Planning Hygiene M003; Bootstrap M003a), and **ADR-0006 is accepted** (Option A), having gated CI M003l's digest-acceptance work package only. A follow-up review of that chain's own output registered and closed a second corrective chain: Build/Qualification M007a (digest zero-length read refusal), M008a (floor contradiction mask and ELF offset overflow), M009a (local producer operator defects, including an input-destroying staging path), and CI/Release M003o (renderer panic and digest diagnostics). **The chain's first hosted CI run failed on macOS and registered a third corrective, CI/Release M003p**: the shared bounded runner treated a failed process-group signal as fatal, but macOS refuses to signal a group holding the unreaped zombie of an exited child and reports `EPERM` where Linux signals it successfully, so an output-bound violation was reported as a launch failure. M003p decides by observing whether the child has exited rather than by reading the errno, and hosted run `40263176191` is green on all four lanes. A later review found that this does not prove the whole group is empty; M003pa is active to retry after reaping the leader and accept only a successful retry or `ESRCH`, keeping every other case fail-closed. Both review chains left one obligation open — ADR-0006 §5.2/§9's `eggpack-manifest 0.1.1` publication and the release-manifest compatibility record — and M004 owns it; the `0.1.1` package carries **two** narrowings of the published acceptance set, the ADR-0006 digest rule and the `3ef806f` document bound, and only the first had been recorded. **Blocked** are Ecosystem M004 (Gregg sibling bundle), Ecosystem M005 (CodeGG runfile bundle), and Ecosystem M006 (Egress archive pair), each on its named adoption evidence and bundle/archive review; the provenance/authenticity line is **planned** pending a dedicated trust ADR, and Python/wheel adapters are **planned** behind broader native adoption. Contract M003, Bootstrap M003, and Ecosystem M003a/M003b are closed, so the contract-conformance and bootstrap-installers subsystems have no open work. The next Eggpack line is whatever the registry lists as `ready`; if that table is empty, the next action is plan authoring, not implementation. +- Current handoff (source: `plans/registry.md`): CI/Release M003pa is **closed** under `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md`; closure `plans/closure/ci-release-orchestration/003pa-status.md` records implementation `329a3dfdb166580de4770b2c6b2f046358983003` and hosted run `44118309795` green on all four lanes; no implementation milestone is **active** and none is registered **ready**; the next action is plan authoring, not implementation; the last open obligation of the 2026-10-23 review chain — Release Manifest M004, the ADR-0006 `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — is **closed**: `0.1.1` is published to crates.io (checksum `352c3e327159615b763298e911e239f1decc4a2c9e28c28be8ddd28e50515e37`, tagged `eggpack-manifest-v0.1.1`), and both narrowings the package carries — the ADR-0006 digest rule and the `3ef806f` document bound — are recorded as compatibility events. The 2026-10-23 post-implementation review chain is closed (Build/Qualification M007, M008, M009; CI/Release M003l, M003m, M003n; Planning Hygiene M003; Bootstrap M003a), and **ADR-0006 is accepted** (Option A), having gated CI M003l's digest-acceptance work package only. A follow-up review of that chain's own output registered and closed a second corrective chain: Build/Qualification M007a (digest zero-length read refusal), M008a (floor contradiction mask and ELF offset overflow), M009a (local producer operator defects, including an input-destroying staging path), and CI/Release M003o (renderer panic and digest diagnostics). **The chain's first hosted CI run failed on macOS and registered a third corrective, CI/Release M003p**: the shared bounded runner treated a failed process-group signal as fatal, but macOS refuses to signal a group holding the unreaped zombie of an exited child and reports `EPERM` where Linux signals it successfully, so an output-bound violation was reported as a launch failure. M003p decides by observing whether the child has exited rather than by reading the errno, and hosted run `40263176191` is green on all four lanes. A later review found that this does not prove the whole group is empty; M003pa is active to retry after reaping the leader and accept only a successful retry or `ESRCH`, keeping every other case fail-closed. Both review chains left one obligation open — ADR-0006 §5.2/§9's `eggpack-manifest 0.1.1` publication and the release-manifest compatibility record — and M004 owns it; the `0.1.1` package carries **two** narrowings of the published acceptance set, the ADR-0006 digest rule and the `3ef806f` document bound, and only the first had been recorded. **Blocked** are Ecosystem M004 (Gregg sibling bundle), Ecosystem M005 (CodeGG runfile bundle), and Ecosystem M006 (Egress archive pair), each on its named adoption evidence and bundle/archive review; the provenance/authenticity line is **planned** pending a dedicated trust ADR, and Python/wheel adapters are **planned** behind broader native adoption. Contract M003, Bootstrap M003, and Ecosystem M003a/M003b are closed, so the contract-conformance and bootstrap-installers subsystems have no open work. The next Eggpack line is whatever the registry lists as `ready`; if that table is empty, the next action is plan authoring, not implementation. diff --git a/architecture/overview.md b/architecture/overview.md index a31d4eb..e525c1e 100644 --- a/architecture/overview.md +++ b/architecture/overview.md @@ -9,12 +9,13 @@ It deliberately does **not** replace Eggup: Eggup remains the consumer-side verified installation/update/rollback layer, and the product repository owns release/install policy. See [eggup-manifest-consumer-v1.md](eggup-manifest-consumer-v1.md). -Code baseline `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09` — the committed `HEAD` -immediately before CI/Release M003pa's source change. The core line counts below -were remeasured on the current worktree, including the M003pa `builder.rs` patch, -and the affected citations were checked against that tree. -This is a worktree verification, not an immutable closure baseline; remeasure and -recheck against the exact candidate before closing M003pa. +Code baseline `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09` — the committed source +immediately before M003pa. The core line counts below were measured and affected +citations checked by symbol against exact implementation candidate +`329a3dfdb166580de4770b2c6b2f046358983003`; hosted run `44118309795` passed all +four lanes. M003pa is closed; its evidence is recorded in +`plans/closure/ci-release-orchestration/003pa-status.md`. Remeasure and recheck +citations against any later source change. Milestone/evidence statuses are **not** restated here; `plans/registry.md` is the authority for those, and [principles-roadmap.md](principles-roadmap.md) narrates them. @@ -164,17 +165,17 @@ rewrites in the CLI, manifest, and GitHub source also preserved anchors. Affecte architecture citations were rechecked by symbol; the line-count table above remains pinned to `fa82486`. -**2026-11-17 — CI/Release M003pa process-group recheck (active).** The shared -runner now retries after reaping an exited leader and accepts only retry success -or `ESRCH`; a live or unverified group remains a hard failure. The helper and -retry outcomes are covered by deterministic tests, and the live-descendant test -uses an explicit release marker to prove that a surviving process would be -observed. The `run_bounded` anchor is `builder.rs:698`; the timeout regression -anchor is `builder.rs:1835`, both checked by symbol name. Current `eggpack-core` -source count is 9109 (`builder.rs` 2078, `digest.rs` 325), measured on the -current worktree based on `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09`. -`scripts/check-local.sh` passed on the current code. Hosted CI is not yet run; -the milestone remains active. +**2026-11-17 — CI/Release M003pa process-group recheck (closed).** The shared +runner retries after reaping an exited leader and accepts only retry success or +`ESRCH`; a live or unverified group remains a hard failure. Deterministic helper +coverage and the release-marker live-descendant regression passed. The +`run_bounded` anchor is `builder.rs:698`; the timeout regression anchor is +`builder.rs:1835`, both checked by symbol name. The `eggpack-core` source count is +9109 (`builder.rs` 2078, `digest.rs` 325), measured against the implementation +candidate `329a3dfdb166580de4770b2c6b2f046358983003` from baseline +`1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09`. `scripts/check-local.sh` passed, and +hosted run `44118309795` passed Linux stable, Linux 1.89.0, macOS, and Windows on +the exact candidate. Closure evidence: `plans/closure/ci-release-orchestration/003pa-status.md`. ## How to read this document diff --git a/plans/closure/ci-release-orchestration/003pa-status.md b/plans/closure/ci-release-orchestration/003pa-status.md new file mode 100644 index 0000000..f4e9773 --- /dev/null +++ b/plans/closure/ci-release-orchestration/003pa-status.md @@ -0,0 +1,96 @@ +# CI/Release M003pa Closure — Process-Group Signal Recheck + +Status: closed + +Source plan: `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` + +Roadmap: `plans/subsystems/ci-release-orchestration-roadmap.md` + +Reviewed baseline: `1cd6d0bf43c93dc9fd572c2d69a3a675a2958b09` — the committed parent immediately before the M003pa implementation. + +Implementation commit: `329a3dfdb166580de4770b2c6b2f046358983003` (`fix: recheck process-group signals after leader exit`), pushed to `feat/auto-20261117-f257539b`. + +Hosted CI for the exact implementation SHA: [run 44118309795](https://github.com/eggstack/eggpack/actions/runs/44118309795), push event, attempt 1, completed successfully. All four required jobs reported success: + +| Lane | Result | Job | +|---|---|---| +| `linux (stable)` | success | [134162378950](https://github.com/eggstack/eggpack/actions/runs/44118309795/job/134162378950) | +| `linux (1.89.0)` | success | [134162379725](https://github.com/eggstack/eggpack/actions/runs/44118309795/job/134162379725) | +| `portability (macos-latest)` | success | [134162379635](https://github.com/eggstack/eggpack/actions/runs/44118309795/job/134162379635) | +| `portability (windows-latest)` | success | [134162379578](https://github.com/eggstack/eggpack/actions/runs/44118309795/job/134162379578) | + +The closure/status update is documentation-only; no production code changed after the implementation run. + +## Executive finding + +M003pa is closed. A failed Unix process-group signal is considered resolved only when the initial error is `ESRCH`, or when an exited/reaped leader is followed by a successful group-signal retry or retry `ESRCH`. A live or unverified leader and every other retry error remain hard failures. This does not infer that the group is empty from leader exit or pipe EOF. + +The implementation and regressions are in `crates/eggpack-core/src/builder.rs`. The retry helper is covered for initial `ESRCH`, a live/unverified leader, retry success, retry `ESRCH`, and a hard retry error. The bounded live-descendant test uses a release-file handshake to prove that a surviving descendant would write a marker; group termination prevents that marker. The real empty-group and output-overflow runner regressions remain covered. + +## Requirement-to-evidence matrix + +| Requirement | Evidence | Result | +|---|---|---| +| Initial `ESRCH` remains benign and does not retry | `a_failed_group_signal_is_benign_only_after_recheck_proves_termination` | pass | +| A live or unverified leader cannot authorize a retry or benign result | Same helper test; wait errors/non-exited status remain hard failures | pass | +| After leader reaping, only retry success or retry `ESRCH` is benign | Same helper test covers success, `ESRCH`, and retry `EPERM` | pass | +| A live descendant is still targeted after the leader exits | `terminating_an_exited_leader_still_signals_a_live_group_descendant`, using the release-file handshake | pass | +| A real already-exited/empty process group remains benign | `terminating_an_already_exited_process_group_is_not_a_failure` | pass | +| Actual output-overflow runner path remains bounded and fails | `stdout_overflow_is_bounded_and_not_success` | pass | +| Windows job-object behavior is unchanged | Unix-only retry handling; hosted Windows lane, including process-group timeout/cancellation and serialized core tests | pass | +| No public API, manifest/schema, dependency, or generated-workflow change | Reviewed implementation diff; only the private core runner/tests and documentation/planning files changed | pass | +| Normative documentation and affected citations match the implementation | `architecture/process-execution.md` and affected architecture citations rechecked by symbol; `eggpack-core` count is 9,109 lines (`builder.rs` 2,078; `digest.rs` 325) | pass | +| Local canonical gate is green | `scripts/check-local.sh`, exit 0; details below | pass | +| Exact candidate is cross-platform qualified | Hosted run `44118309795` on SHA `329a3dfdb166580de4770b2c6b2f046358983003`; all four jobs above | pass | + +## Verification executed + +Focused process-group checks passed: + +```text +cargo test -p eggpack-core --all-targets --all-features --locked group_signal -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked terminating_an_already_exited_process_group_is_not_a_failure -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked terminating_an_exited_leader_still_signals_a_live_group_descendant -- --nocapture +cargo test -p eggpack-core --all-targets --all-features --locked stdout_overflow_is_bounded_and_not_success -- --nocapture +``` + +The canonical `scripts/check-local.sh` gate passed with exit code 0. It includes formatting, workspace check/lint/tests, documentation, dependency-tree/package checks, and the Rust 1.89 MSRV lane. It ran in the worktree before the implementation commit; the eight unrelated pre-existing edits were present but excluded from commit `329a3df`. Hosted CI then tested the exact committed SHA on all four required lanes. + +## Production implementation evidence + +`group_signal_failure_is_benign` in `crates/eggpack-core/src/builder.rs` now accepts a lazy retry closure. It returns benign immediately only for initial `ESRCH`; otherwise the Unix termination path first calls `try_wait`, and invokes the retry only if the leader is observed exited and reaped. Retry success or `ESRCH` is accepted; any other retry error preserves the hard failure. The non-Unix path retains the existing job-object behavior. + +## Invariant review + +- Process-group termination remains the authority; leader status and pipe state do not inventory descendants. +- A failed signal is never downgraded based solely on leader exit. +- All non-`ESRCH` retry failures remain fail-closed. +- Existing timeout, cancellation, output-limit classification, bounded execution, and output redaction are unchanged. +- M003p's plan and closure are unchanged; M003pa is recorded as a separate corrective. + +## Failure and recovery review + +The original intermittent output-limit failure was not reproduced during the corrective work; the exact original errno/interleaving remains unobserved. A diagnostic had observed `EPERM` while the direct child had exited, but did not establish whether the process group was empty. The corrective addresses that uncertainty conservatively by re-signalling the group after reaping the leader and accepting only success or `ESRCH`. + +A triplicated full-core stress attempt under artificial concurrent load produced native qualification fixture `SmokeTimedOut` failures. The normal canonical gate and the exact-candidate hosted workspace tests passed; this stress-only timeout is not attributed to the M003pa process-group change. No descendant leak or hosted failure remains unresolved. + +## Compatibility and migration review + +No public API, wire format, manifest schema, dependency, workflow, or migration changed. The change is private to Unix process-group termination and its tests; the Windows path is unchanged and passed its hosted lane. Existing external consumers require no action. + +## Security review + +No new privilege, network, credential, publication, or shell surface was introduced. The runner continues to signal the supervised process group, preserve bounded execution/error handling, and avoid returning captured output contents. Retry failure remains fail-closed. + +## Documentation and operations evidence + +The normative process-execution deep dive and affected citations were updated. The overview, CI consumer seam, CLI, validation, and testing/portability references were checked; M003pa status was reconciled in the registry, roadmap, and `AGENTS.md`. The prior M003p history remains intact. + +## Unresolved findings + +- **Informational:** the precise original intermittent errno/interleaving could not be reproduced. No behavior remains unverified for the acceptance criteria: helper outcomes, descendant termination, the real output-overflow path, local gate, and all four hosted lanes passed. +- No blocker or high/medium-severity finding remains. + +## Roadmap disposition and registry updates + +M003pa is closed in the CI/release roadmap and registry, with this record linked from the plan. No implementation milestone is active or registered ready; the next action is plan authoring, not implementation. No dependent or cross-repository work is unlocked by this process-runner correction. M003p's historical plan and closure are unchanged. diff --git a/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md b/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md index a85268f..627ad10 100644 --- a/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md +++ b/plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md @@ -1,6 +1,6 @@ # CI/Release Orchestration Milestone 003pa — Process-Group Signal Recheck Corrective -Status: active +Status: closed Corrects: CI/Release M003p, closed at `27cb16c` with closure `plans/closure/ci-release-orchestration/003p-status.md`. The historical plan and closure remain unchanged. @@ -63,7 +63,7 @@ Affected invariants: - Changing CI validator error-to-outcome mapping or generated workflow bytes. - Changing timeout, cancellation, output-limit policy, process-group creation, or public APIs. - Suppressing `EPERM` unconditionally, adding privileged test setup, or claiming that a direct-child status proves the whole group is empty. -- Commits, pushes, remote workflow dispatch, publication, or unrelated pre-existing worktree changes. +- Remote workflow dispatch, publication, or changes to unrelated pre-existing worktree files. A commit/push requires explicit user authorization; the later authorization to push the implementation candidate solely for hosted CI is recorded in the closure record. ## 6. Required work packages @@ -114,7 +114,7 @@ cargo test --workspace --all-targets --all-features --locked scripts/check-local.sh ``` -`scripts/check-local.sh` is the canonical gate and includes packaging and the Rust 1.89 MSRV lane. Hosted CI on the exact candidate remains required for closure; no remote dispatch or push is authorized by this plan. +`scripts/check-local.sh` is the canonical gate and includes packaging and the Rust 1.89 MSRV lane. Hosted CI on the exact candidate remains required for closure. A later explicit user instruction authorized committing and pushing the implementation candidate solely to run CI; no remote workflow dispatch or publication occurred. ## 9. Acceptance criteria @@ -132,8 +132,8 @@ scripts/check-local.sh ## 10. Stop conditions -Stop and keep the milestone active if the retry returns any non-`ESRCH` error, if a live or unverified group is accepted, if any descendant test leaks a process, if the Windows path changes, if the local gate fails, if architecture citations are not verified, or if hosted CI for the exact candidate is unavailable or red. Do not commit, push, dispatch, or publish as part of this task. +Stop and keep the milestone active if the retry returns any non-`ESRCH` error, if a live or unverified group is accepted, if any descendant test leaks a process, if the Windows path changes, if the local gate fails, if architecture citations are not verified, or if hosted CI for the exact candidate is unavailable or red. Do not dispatch or publish. Commit/push requires explicit user authorization; the authorized follow-up push used for CI is documented in the closure record. ## 11. Closure evidence -The closure record must preserve the distinction between implementation, local checks, hosted CI actually observed, and unavailable evidence. It must include the reviewed baseline, exact candidate identifier if one exists, regression-test outcomes, full local-gate result, hosted lane matrix or explicit gap, invariant/security review, documentation/citation evidence, and the registry/roadmap disposition. The prior M003p closure remains unchanged. \ No newline at end of file +Closure record: `plans/closure/ci-release-orchestration/003pa-status.md`. M003pa is closed on implementation commit `329a3dfdb166580de4770b2c6b2f046358983003` after `scripts/check-local.sh` returned 0 and hosted run `44118309795` passed all four lanes on that exact SHA. The record distinguishes implementation evidence, local verification, hosted results, and the remaining informational observation. The prior M003p plan and closure remain unchanged. \ No newline at end of file diff --git a/plans/registry.md b/plans/registry.md index 2b98356..0e771cd 100644 --- a/plans/registry.md +++ b/plans/registry.md @@ -110,7 +110,7 @@ Planning Hygiene M002, Ecosystem M003b, Bootstrap M002b, CI M003i, and CI M003j The post-implementation review of 2026-10-23 registered a corrective chain. **Build/Qualification M007 is closed** (`e3c6192`): `eggpack-core` now has one canonical bounded file-digest authority. **ADR-0006 is accepted (Option A)**: the all-zeros SHA-256 sentinel is refused everywhere, `ReleaseManifest` stays at `schema_version: 1`, and the published `eggpack-manifest` crate takes a `0.1.1` patch release carrying the tightened rule. **CI M003l is closed** (`9cf0bf8`): the duplicate host-match, floor-applicability, exact-tag, SHA-256 acceptance, and file-digest rules are gone, and the two exact-tag rule sets — disjoint in both directions — are replaced by their union. **Build/Qualification M008 is closed** (`7e7cb6a`): a declared compatibility floor is no longer silently dropped, and every target declaring one carries a finite, closed floor verification status computed by bounded independent ELF inspection. **Build/Qualification M009 is closed** (`eb77d19` + `8950eb9`): six of the nine operator commands the canonical specification names now exist, sharing one implementation with the `ci _*` runners. **CI M003m is closed** (`bd73f5c`): the CI crate's consumer-validator execution routes through the workspace's single bounded process-group runner, and its production region now contains no process-spawning code at all. **CI M003n is closed** (`bf0acfe` + `028db4a`): one drift comparison replaces three byte-identical copies, one staging-payload builder replaces two copies that were 85.5% identical, the 845-line `render_release_github_inner` is decomposed, and the CI crate's single source file became a 14-file module tree with byte-identical output. **Planning Hygiene M003** (docs-only) is closed as well. **Bootstrap M003a** (the ADR-0006 adversarial digest fixture corrective, closure `plans/closure/bootstrap-installers/003a-status.md`) is closed too: five bootstrap fixtures used the all-zeros digest as a stand-in, and the corrective replaced them with a real digest that must be refused. The whole 2026-10-23 review chain is closed. -**A follow-up review of the chain's own output found defects in the newly written code and registered a second corrective chain.** **Build/Qualification M007a is closed** (`c17bdbe`): the canonical digest helper refuses a read that produced zero bytes, so a zero-length digest record cannot exist. **Build/Qualification M008a is closed** (`c17bdbe`): the floor reader no longer abandons its scan at the first non-numeric `GLIBC_` name — which was masking a **contradicted** floor as an admissible `Unverified` status — and its virtual-address translation can no longer overflow. **Build/Qualification M009a is closed** (`d2fbd07`): the operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`, is equivalent to the CI path in emulated qualification, identity mode, consumer-validator support, and input encoding, and derives a self-checking manifest. **CI M003o is closed** (`b205de6`): the workflow renderer refuses an over-long generated directory instead of panicking on a legal 128-character contract target, and two digest diagnostics name the reason they refused. **CI M003p is closed** (`27cb16c`): the chain's first hosted CI run failed on macOS, where the shared bounded runner refuses to signal a process group holding the unreaped zombie of an exited child and reports the whole signal as `EPERM`; the runner now decides by observing whether the supervised child has exited, and hosted run `40263176191` is green on all four lanes. Both review chains are closed. A later review found that M003p's exited-leader check does not prove the whole process group is empty; CI/Release M003pa is active to re-signal after reaping the leader and fail closed unless the retry succeeds or returns `ESRCH`. M003p's historical plan and closure remain unchanged. The obligation ADR-0006 created for the published crate — the `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — was tracked by Release Manifest M004, which is now **closed**: `0.1.1` is published, and both narrowings the package carries are recorded as compatibility events. +**A follow-up review of the chain's own output found defects in the newly written code and registered a second corrective chain.** **Build/Qualification M007a is closed** (`c17bdbe`): the canonical digest helper refuses a read that produced zero bytes, so a zero-length digest record cannot exist. **Build/Qualification M008a is closed** (`c17bdbe`): the floor reader no longer abandons its scan at the first non-numeric `GLIBC_` name — which was masking a **contradicted** floor as an admissible `Unverified` status — and its virtual-address translation can no longer overflow. **Build/Qualification M009a is closed** (`d2fbd07`): the operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`, is equivalent to the CI path in emulated qualification, identity mode, consumer-validator support, and input encoding, and derives a self-checking manifest. **CI M003o is closed** (`b205de6`): the workflow renderer refuses an over-long generated directory instead of panicking on a legal 128-character contract target, and two digest diagnostics name the reason they refused. **CI M003p is closed** (`27cb16c`): the chain's first hosted CI run failed on macOS, where the shared bounded runner refuses to signal a process group holding the unreaped zombie of an exited child and reports the whole signal as `EPERM`; the runner now decides by observing whether the supervised child has exited, and hosted run `40263176191` is green on all four lanes. Both review chains are closed. A later review found that M003p's exited-leader check does not prove the whole process group is empty. CI/Release M003pa closed at implementation `329a3df` with closure `plans/closure/ci-release-orchestration/003pa-status.md`; exact hosted run `44118309795` passed Linux stable, Linux 1.89.0, macOS, and Windows. It re-signals after reaping the leader and fails closed unless the retry succeeds or returns `ESRCH`. M003p's historical plan and closure remain unchanged. The obligation ADR-0006 created for the published crate — the `eggpack-manifest 0.1.1` patch release and the compatibility record ADR-0006 §5.4 requires — was tracked by Release Manifest M004, which is now **closed**: `0.1.1` is published, and both narrowings the package carries are recorded as compatibility events. The two subsystems that were closed before this chain keep their closure records here so the index is complete rather than partial: **Contract and conformance M001** closed at `plans/closure/contract-conformance/001-status.md` (the @@ -155,7 +155,7 @@ The table below is the **milestone-to-closure index plus active ready work**, no | Build and qualification | M009a local producer operator defects corrective | **closed** | `plans/implementation/build-qualification/009a-local-producer-operator-defects.md` | Closure `plans/closure/build-qualification/009a-status.md`; implementation `d2fbd07`. The operator family no longer destroys its own input candidates when `--output-dir` equals `--artifacts-dir`; it is equivalent to the CI path in emulated qualification (`--qemu-sysroot`), identity mode (`--identity-mode`), consumer-validator support (`--consumer-validators`), and input encoding (TOML or JSON); and `manifest` is self-checking — it reads archive members back out of the finalized archive and compares against the collected manifest, failing closed instead of reporting `manifest: ok` | | CI orchestration | M003o renderer panic and digest diagnostics corrective | **closed** | `plans/implementation/ci-release-orchestration/003o-renderer-panic-and-digest-diagnostics.md` | Closure `plans/closure/ci-release-orchestration/003o-status.md`; implementation `b205de6`. The workflow renderer's generated-directory check was an assertion that a legal 128-character contract target could trip — it is now a refusal. Two digest diagnostics named a formatting problem where ADR-0006 refuses the well-formed all-zeros digest; they now name the actual reason. The CI crate's 85 public items and every rendered byte are unchanged | | CI orchestration | M003p process-group termination of an already-exited group corrective | **closed** | `plans/implementation/ci-release-orchestration/003p-process-group-termination-of-an-already-exited-group.md` | Closure `plans/closure/ci-release-orchestration/003p-status.md`; implementation `27cb16c`; hosted run `40263176191` green on all four lanes after four failing runs. The first hosted CI run of the 2026-10-23 review chain (`40207520563`) failed on macOS: two CI-crate tests reported `Failed(InterpreterUnavailable)` where they expected `Failed(OutputLimit)`. macOS refuses to signal a process group that holds the unreaped zombie of an exited child and reports the whole signal as `EPERM`; Linux signals it successfully, so the local gate and the Linux lanes never saw it. The runner now decides by observing whether the supervised child has exited rather than by reading the errno: a failed signal is benign when there is nothing left to terminate, and a group holding a live process that cannot be signalled still fails the run closed | -| CI orchestration | M003pa process-group signal recheck corrective | **active** | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | Corrects M003p without rewriting its closed plan/closure. Leader exit alone does not prove the process group empty; after an initial non-`ESRCH` error and confirmed leader exit, retry the group signal and accept only success or retry `ESRCH`. Local gate and exact-candidate hosted CI remain required before closure | +| CI orchestration | M003pa process-group signal recheck corrective | **closed** | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | Closure `plans/closure/ci-release-orchestration/003pa-status.md`; implementation `329a3dfdb166580de4770b2c6b2f046358983003`; hosted run `44118309795` green on all four lanes for the exact SHA. Corrects M003p without rewriting its historical plan/closure; after leader reaping, only retry success or `ESRCH` is benign | | Bootstrap installers | M001 generator/direct fixtures | closed | `plans/implementation/bootstrap-installers/001-direct-installer-generator.md` | Closure `plans/closure/bootstrap-installers/001-status.md` | | CI orchestration | M001 CIPlan/GitHub renderer | closed | `plans/implementation/ci-release-orchestration/001-ci-plan-and-github-renderer.md` | Closure `plans/closure/ci-release-orchestration/001-status.md`; hosted run 36040032768 passes all lanes | | CI orchestration | M002 qualification/aggregation gates + drift CLI | closed historically; corrective closed | `plans/implementation/ci-release-orchestration/002-qualification-aggregation-gates-and-drift-cli.md` | Historical closure retained; executable generated-workflow defect corrected and qualified by M002a (`plans/closure/ci-release-orchestration/002a-status.md`) | @@ -336,7 +336,7 @@ The first hosted CI run of that chain found a further defect in the shared bound ``` CI M003p process-group termination of an already-exited group [CLOSED: 27cb16c] | - `--> CI M003pa process-group signal recheck [ACTIVE] + `--> CI M003pa process-group signal recheck [CLOSED: 329a3df] ``` The obligation those two chains left outstanding is tracked by a third line: @@ -363,7 +363,7 @@ ADR-0006 [ACCEPTED 2026-10-23, Option A: digest acceptance set] ## Next handoff -**Active handoff: CI/Release M003pa** (`plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md`). Implement the fail-closed retry, run the exact local gate, and obtain hosted CI on the exact candidate before closure; do not rewrite M003p's historical closure. +**No implementation milestone is active or registered ready.** CI/Release M003pa is closed at implementation `329a3dfdb166580de4770b2c6b2f046358983003`, with closure `plans/closure/ci-release-orchestration/003pa-status.md`; hosted run `44118309795` passed all four lanes on that exact candidate. The next action is plan authoring, not implementation. M003p's historical plan and closure remain unchanged. Every closed milestone retains its closure record, so do not read this section as a shortlist: Contract M001/M002, Release Manifest M001/M001a/M002/M003/M003a, Build/Qualification M001–M006, CI M001/M002/M002a/M003a–M003h, Bootstrap M001/M002/M002a, Eggup Interoperability M001/M001a, Ecosystem M001/M002, External backend evaluation M001, and Planning Hygiene M001 all have accepted closure records under `plans/closure/`. Eggup Interoperability M003 is additionally closed downstream on the real Eggsact consumer. Per-subsystem detail is in `plans/subsystems/*-roadmap.md`; the milestone-to-closure index is the table above. diff --git a/plans/subsystems/ci-release-orchestration-roadmap.md b/plans/subsystems/ci-release-orchestration-roadmap.md index 585e52d..0274241 100644 --- a/plans/subsystems/ci-release-orchestration-roadmap.md +++ b/plans/subsystems/ci-release-orchestration-roadmap.md @@ -110,7 +110,7 @@ A follow-up review of that chain's own output registered one further corrective The first hosted CI run of that chain — run `40207520563` on `d4d5e43` — failed on macOS, and registered one further corrective against this subsystem. **M003p** fixes the shared bounded runner's treatment of a process group that has already exited: macOS refuses to signal a group that still holds the unreaped zombie of an exited child and reports the whole signal as `EPERM`, where Linux signals it successfully. The runner treated any failed group signal as fatal, so an output-bound violation was reported as a launch failure on one platform and as an output-bound violation on the other. The rule is now that a failed group signal may be ignored when there is nothing left to terminate, decided by observing whether the supervised child has exited rather than by reading the errno; a group holding a live process that cannot be signalled still fails the run closed. It closed on `27cb16c`. -A review of M003p's group-empty assumption found that the supervised leader's exit does not prove the whole process group is empty: a surviving descendant may have closed its output pipes, and `EPERM` does not certify that the group has no live member. **M003pa** is active as a new corrective, preserving M003p's historical plan and closure. It keeps initial `ESRCH` benign; after another signal error, it reaps an exited leader and retries the group signal, accepting only retry success or retry `ESRCH`. A live/unverified leader or any other retry error remains a hard failure. Hosted cross-platform CI is required before closure. +A review of M003p's group-empty assumption found that the supervised leader's exit does not prove the whole process group is empty: a surviving descendant may have closed its output pipes, and `EPERM` does not certify that the group has no live member. **M003pa** corrected that inference while preserving M003p's historical plan and closure. It keeps initial `ESRCH` benign; after another signal error, it reaps an exited leader and retries the group signal, accepting only retry success or retry `ESRCH`. A live/unverified leader or any other retry error remains a hard failure. M003pa closed on implementation `329a3dfdb166580de4770b2c6b2f046358983003`; exact hosted run `44118309795` passed Linux stable, Linux 1.89.0, macOS, and Windows. ## 8. Cross-cutting requirements @@ -159,7 +159,7 @@ Build/Qualification M001-M006 and CI M001/M002/M002a/M003c-M003g are closed on t | M003n producer implementation consolidation corrective | closed | `plans/implementation/ci-release-orchestration/003n-producer-implementation-consolidation-corrective.md` | `plans/closure/ci-release-orchestration/003n-status.md`; implementations `bf0acfe` + `028db4a` (cherry-picked `4692bd5` + `e66c7d1`) | One drift comparison replaces three byte-identical copies; one staging-payload builder replaces two copies that were 85.5% identical (301 of 352 lines); `render_release_github_inner` (845 lines) is decomposed into named private helpers; the CI crate's 12,221-line source file became a 14-file module tree with a 59-line crate root. The public API is byte-identical before and after and every rendered workflow, drift report, and staging payload is byte-identical | | M003o renderer panic and digest diagnostics corrective | closed | `plans/implementation/ci-release-orchestration/003o-renderer-panic-and-digest-diagnostics.md` | `plans/closure/ci-release-orchestration/003o-status.md`; implementation `b205de6` | The workflow renderer's generated-directory check was an assertion that a legal 128-character contract target could trip; it is now a refusal, so a caller-supplied contract cannot panic the renderer. Two digest diagnostics named a formatting problem where ADR-0006 refuses the well-formed all-zeros digest; they now name the actual reason. The CI crate's 85 public items and every rendered byte are unchanged | | M003p process-group termination of an already-exited group corrective | closed | `plans/implementation/ci-release-orchestration/003p-process-group-termination-of-an-already-exited-group.md` | `plans/closure/ci-release-orchestration/003p-status.md`; implementation `27cb16c`; hosted run `40263176191` green on all four lanes | The first hosted CI run of the 2026-10-23 review chain (`40207520563`) failed on macOS. The shared bounded runner treated a failed process-group signal as fatal, but macOS reports `EPERM` for a group holding the unreaped zombie of an exited child, where Linux signals it successfully. A failed signal is now benign when there is nothing left to terminate, decided by observing the child rather than by reading the errno; a group holding a live process that cannot be signalled still fails closed. The CI crate's 85 public items and every rendered byte are unchanged | -| M003pa process-group signal recheck corrective | active | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | no closure record yet | Corrects M003p's overbroad inference that an exited leader proves the group is empty. Keep only initial `ESRCH` or retry success/`ESRCH` benign after leader reaping; other cases fail closed. Local gate and hosted macOS/Linux stable+MSRV/Windows CI remain required before closure | +| M003pa process-group signal recheck corrective | closed | `plans/implementation/ci-release-orchestration/003pa-process-group-signal-recheck-corrective.md` | `plans/closure/ci-release-orchestration/003pa-status.md`; implementation `329a3dfdb166580de4770b2c6b2f046358983003`; hosted run `44118309795` green on all four lanes | Corrects M003p's overbroad inference that an exited leader proves the group is empty. After leader reaping, only retry success or `ESRCH` is benign; other cases remain fail-closed | ## 13. 2026-10-08 corrective addendum — M003i