Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions architecture/ci-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ its release command. See
[release-identity-policy.md](../docs/release-identity-policy.md) for the
checked-in policy spelling and grammar.

Staging renderers resolve the selected tag with `git ls-remote` in preflight,
before the first source checkout. Lightweight tags use their direct object;
annotated tags use the peeled object. The resolver requires one full commit OID
and exports only that OID as a job output. All subsequent checkouts use the
output, then compare `HEAD^{commit}` with it before invoking Eggpack. The stage
job resolves the tag again and rejects movement since preflight. An optional
`GitHubStagingPolicyV1.environment` renders `environment.name` on `stage` only;
GitHub Environment creation and reviewer configuration remain repository-owner
operations and are not inferred by the renderer.

One correction worth recording: despite the name, no `workflow_call` trigger is
emitted, and `workflow_call` does not appear anywhere in the workspace sources.
The reusable renderer emits the same `WorkflowTrigger` set as the exact renderer
Expand Down Expand Up @@ -129,24 +139,36 @@ and rendered behaviour cannot diverge.

## Job and step composition

Triggers are emitted first (`:3140-3155`). `push:` and `workflow_dispatch:`
Triggers are emitted first (`:3320-3333`). `push:` and `workflow_dispatch:`
appear in the order the policy lists them. Dispatch gains a `release_tag` string
input only when staging is enabled *and* the tag source is `DispatchInput`
(`:3146-3152`); there is no branch or `latest` default. The top-level
`permissions` block is `contents: read` (`:3156`, and `:1669` for build-only),
(`:3323-3331`); there is no branch or `latest` default. The top-level
`permissions` block is `contents: read` (`:3335`, and `:1850` for build-only),
and every job restates it. Concurrency keys on workflow and ref, or on the
resolved staging tag for dispatch-driven staging (`:3167-3170`).
resolved staging tag for dispatch-driven staging (`:3340-3350`).

Dispatch tags are workflow data throughout the renderer. The reusable
`resolve` and write-scoped `stage` jobs bind `inputs.release_tag` to
`EGGPACK_RELEASE_TAG`, validate a bounded canonical stable `vX.Y.Z` form in
Bash, and do so before checkout. The resolver passes the tag to
`_resolve-release` only through the quoted `"$EGGPACK_RELEASE_TAG"` argument.
The renderer has a source-level guard that rejects either dispatch-tag
expression in any emitted `run:` script; the check permits the same value in
action inputs such as checkout `with.ref`, where it is data.
`m003j_dispatch_tag_validation_treats_values_as_data` proves a command
substitution marker executes in the old script template but not in the new
validation script.

| Order | Job | Line | `needs:` |
|---|---|---|---|
| 1 | `preflight` | `:3177` | — |
| 2 | `resolve` (reusable only) | `:3209` | `preflight` |
| 1 | `preflight` | `:3356` | — |
| 2 | `resolve` (reusable only) | `:3388` | `preflight` |
| 3 | one build job per `CIPlan` target | `:3246` | `resolve` if reusable, else `preflight` (`:3278-3282`) |
| 4 | one qualification job per build job | `:3371` | that build job (`:3397-3398`) |
| 5 | one consumer job per validated target | `:3441` | that qualification job (`:3475-3476`) |
| 6 | gate, id fixed `required_gate` | `:3526` | inline list (`:3534-3549`) |
| 7 | aggregate, id fixed `aggregate` | `:3599` | the gate (`:3610-3611`) |
| 8 | `stage`, only when the graph has staging | `:3673` | the aggregate, plus an `if:` tag guard (`:3710-3723`) |
| 8 | `stage`, only when the graph has staging | `:3895` | the aggregate, plus an `if:` tag guard (`:3900-3910`) |

Job identifiers are not invented by the renderer. They come from the validated
plan, and `ReleaseCIPlanV1::validate` pins them to exact strings: the gate must
Expand All @@ -165,9 +187,9 @@ per output (`:3315`), `_capture-build` (`:3352`), artifact upload (`:3357`). The
install precedes the first `eggpack` invocation; source verification follows the
toolchain the install depends on. Least privilege is structural: every job
carries `permissions: contents: read` except `stage`, which carries
`contents: write` (`:3726`); no job receives `id-token: write`, and the renderer
fails closed if that string ever appears (`:3772-3774`). The staging token
travels through `env` only (`:3751`). Artifact handoff names are derived, not
`contents: write` (`:3913`); no job receives `id-token: write`, and the renderer
fails closed if that string ever appears (`:3960-3962`). The staging token
travels through `env` only (`:3939`). Artifact handoff names are derived, not
literal: `handoff_name` (`:432`), `BUILD_HANDOFF_FILE` (`:941`),
`QUALIFICATION_EVIDENCE_FILE` (`:943`), `CANDIDATES_DIR` (`:945`),
`GATE_OUTCOME_FILE` (`:947`), `RUNTIME_IDENTITY_ARTIFACT` (`:4440`).
Expand Down
4 changes: 2 additions & 2 deletions architecture/ci.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `eggpack-ci` — Deep Dive

Crate-level orientation for `eggpack-ci`: the largest component in the workspace
at 10256 lines in a single `src/lib.rs`. This file explains how that file divides
at 10772 lines in a single `src/lib.rs`. This file explains how that file divides
and what flows through it. It does not restate per-area detail — three deep
dives cover the parts.

Expand All @@ -18,7 +18,7 @@ Code baseline `fc072af`.

| Deep dive | Owns | Approximate region of `src/lib.rs` |
|---|---|---|
| [ci-rendering.md](ci-rendering.md) | policy types, `RunnerCommand`, the three renderers, drift checks | `:418-1843`, `:2926-3846` |
| [ci-rendering.md](ci-rendering.md) | policy types, `RunnerCommand`, the three renderers, drift checks | `:1066-2100`, `:3080-4005` |
| [ci-consumer-seam.md](ci-consumer-seam.md) | the external consumer validator, runtime identity, artifact handoff formats | `:1844-2209`, `:3847-4432`, `:4432-4596` |
| this file | crate orientation, the projection model, job vocabulary, gates, aggregation | `:42-453`, `:2210-2742`, `:2743-2925` |

Expand Down
4 changes: 2 additions & 2 deletions architecture/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ contract manifest
| `eggpack-manifest` | 1354 | [manifest.md](manifest.md) |
| `eggpack-core` | 5998 (4 files) | [core.md](core.md) |
| `eggpack-bootstrap` | 3436 | [bootstrap.md](bootstrap.md) |
| `eggpack-ci` | 10256 | [ci.md](ci.md) |
| `eggpack-ci` | 10772 | [ci.md](ci.md) |
| `eggpack-github` | 4873 (3025 + 1848 tests) | [github.md](github.md) |
| `eggpack-cli` | 3803 src + 381 integration tests | [cli.md](cli.md) |

Expand Down Expand Up @@ -221,7 +221,7 @@ authenticity or provenance claims.

### `eggpack-ci` — release CI planning and workflow rendering

Single `src/lib.rs` at 10256 lines, the largest component in the workspace.
Single `src/lib.rs` at 10772 lines, the largest component in the workspace.
Depends on `contract` + `core`. Projects a release into a provider-neutral
graph (`project_ci_plan` → `CIPlan` → `TargetJob`; `project_release_plan` →
`ReleaseCIPlanV1` with qualification, gate, aggregate/finalize, and staging
Expand Down
10 changes: 10 additions & 0 deletions crates/eggpack-ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ checkouts, and authorizes staging only for dispatches. Each job verifies
`HEAD^{commit}` against the checked-in `ReleasePlan.source_revision` before
release work; `ci check` compares the complete deterministic workflow.

For staging workflows, the first job validates the selected tag and resolves it
to a full commit OID with `git ls-remote` before checking out source. Annotated
tags are peeled to their commit. Every later checkout uses that frozen OID and
checks `HEAD^{commit}` before invoking Eggpack. Dispatch tags are bounded data
in `EGGPACK_RELEASE_TAG`, never executable workflow text. An optional
`GitHubStagingPolicyV1.environment` names a preconfigured GitHub Environment on
the write-authorized `stage` job only; repository owners configure its required
reviewers separately. Eggpack does not create the environment or grant its
approval.

M003d adds the consumer release composition seam without absorbing
product-owned release semantics. Static checked-in workflow shape
(`ReleaseWorkflowShapeV1`: canonical targets, build/core-qualification
Expand Down
Loading
Loading