Skip to content

fix(e2e): preserve managed-image producer attempts - #10451

Closed
prekshivyas wants to merge 1 commit into
mainfrom
fix/managed-image-producer-attempts
Closed

fix(e2e): preserve managed-image producer attempts#10451
prekshivyas wants to merge 1 commit into
mainfrom
fix/managed-image-producer-attempts

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve each managed-image cohort entry's producer run attempt instead of replacing it with the selected publication attempt. This allows a retried cohort publication to reuse successful platform artifacts from earlier attempts while still binding every SLSA provenance builder ID to the exact producing workflow attempt.

Changes

  • Copy each candidate artifact's run identity into the final cohort platform entry.
  • Validate platform run keys, run ID, attempt bounds, and the SLSA builder ID before publishing or consuming the cohort.
  • Add regression coverage for mixed-attempt cohorts, mismatched builder identities, and impossible future producer attempts.
  • Document the per-platform producer identity contract in the owning E2E guide.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Reviewed artifact identity validation end to end; the consumer rejects missing, malformed, mismatched, or future producer attempts and requires the SLSA builder ID to match the exact producing workflow attempt.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run --project e2e-support test/e2e/support/managed-image-cohort-contract.test.ts (12 passed)
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Strengthened artifact verification to ensure published platform images are tied to the correct workflow runs and attempts.
    • Rejected image publications with mismatched, incomplete, or newer provenance information.
    • Improved cohort validation so earlier valid publication attempts remain supported.
  • Tests

    • Added coverage for valid earlier attempts and invalid provenance or newer producer attempts.
    • Updated end-to-end validation guidance for workflow and provenance checks.

@prekshivyas prekshivyas self-assigned this Aug 27, 2026
@github-code-quality

github-code-quality Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 8df1bd2 in the fix/managed-image-pr... branch remains at 96%, unchanged from commit ba12fc0 in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit 8df1bd2 in the fix/managed-image-pr... branch remains at 84%, unchanged from commit ba12fc0 in the main branch.

Show a line coverage summary of the most impacted files.
File main ba12fc0 fix/managed-image-pr... 8df1bd2 +/-
src/lib/actions...sor-relaunch.ts 98% 91% -7%
src/lib/onboard...eate-attempt.ts 96% 90% -6%
src/lib/onboard...eate-journal.ts 90% 85% -5%
src/lib/onboard...vider/docker.ts 88% 85% -3%
src/lib/onboard...uild-context.ts 74% 74% 0%
src/lib/onboard...trap/adapter.ts 70% 71% +1%
src/lib/onboard...ndbox-create.ts 88% 89% +1%
src/lib/onboard...cker-journal.ts 73% 75% +2%
src/lib/onboard...er-gpu-patch.ts 79% 81% +2%
src/lib/actions...ary-recovery.ts 92% 97% +5%

Updated August 27, 2026 04:12 UTC

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 536f33e5-9433-4f65-bfbd-87bf520763aa

📥 Commits

Reviewing files that changed from the base of the PR and between ba12fc0 and 8df1bd2.

📒 Files selected for processing (4)
  • .github/workflows/managed-images.yaml
  • test/e2e/README.md
  • test/e2e/support/managed-image-cohort-contract.test.ts
  • tools/e2e/managed-image-cohort-contract.mts

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The change adds producer workflow run metadata to managed-image cohort records. Validation now checks run IDs, positive attempts, attempt ordering, and SLSA builder identities. End-to-end fixtures and documentation cover earlier, mismatched, and newer producer attempts.

Changes

Provenance validation

Layer / File(s) Summary
Platform evidence contract
tools/e2e/managed-image-cohort-contract.mts
validatePlatformEvidence validates producer run fields, run identity, attempt ordering, and SLSA builder identity.
Workflow manifest validation
.github/workflows/managed-images.yaml
The workflow stages candidate run metadata and passes repository, run ID, and attempt values to cohort and platform validation.
Attempt-aware fixtures and coverage
test/e2e/support/managed-image-cohort-contract.test.ts, test/e2e/README.md
Fixtures record producer runs. Tests cover earlier, mismatched, and newer producer attempts. Documentation describes the provenance rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 8df1b

The change preserves producer-attempt identity and adds validation and regression coverage; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ManagedImagesWorkflow
  participant CohortManifest
  participant jqValidation
  participant SLSAProvenance
  ManagedImagesWorkflow->>CohortManifest: stage candidate run metadata
  ManagedImagesWorkflow->>jqValidation: provide repository, run ID, and attempt
  jqValidation->>SLSAProvenance: validate builder identity for producer attempt
  SLSAProvenance-->>jqValidation: accept or reject provenance
  jqValidation-->>ManagedImagesWorkflow: validation result
Loading

Suggested reviewers: brandonpelfrey

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving managed-image producer attempts in E2E workflows.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/managed-image-producer-attempts

Comment @coderabbitai help to get the list of available commands.

@prekshivyas

Copy link
Copy Markdown
Collaborator Author

Superseded by #10450. The consolidated PR now includes the per-platform producer run contract, exact SLSA builder-attempt binding, bounded mixed-attempt validation, documentation, and regression tests.

prekshivyas added a commit that referenced this pull request Sep 8, 2026
<!-- markdownlint-disable MD041 -->
## Outcome

Managed-image cohort validation now accepts immutable cohort and
platform evidence retained from earlier attempts of the selected
workflow run. It still rejects evidence from another run, a future
attempt, or a SLSA builder that does not match the platform producer.

## Reason

GitHub failed-job reruns can retain successful producer jobs from an
earlier attempt. Requiring every platform producer and immutable cohort
alias to equal the selected workflow attempt rejected that valid state.
A rerun of every job still executes the publication-identity job and
mints a fresh cohort alias.

### Related issues

- Refs #10113.
- Completes the remaining producer-provenance scope from #10451.
- Relates to #10736, which now owns the stable PR artifact and
failed-job rerun selection contract on `main`.
- Relates to #10452. Its Hermes lifecycle correction is already present
on `main`, so this PR no longer carries a Hermes lifecycle diff.

## Changes

- Preserve each platform producer's `{id, attempt}` in the final cohort
contract.
- Accept a cohort or producer attempt only when it belongs to the
selected run and is no newer than the selected publication attempt.
- Bind every SLSA builder ID to the exact platform producer attempt in
both workflow-side and E2E-side validation.
- Emit the validated immutable cohort identity in the downstream
receipt.
- Execute the publication-identity workflow step to prove rerun-all
mints `ghrun-<run>-<attempt>`.
- Execute the cohort validator entry point and verify its complete
`GITHUB_OUTPUT` handoff.
- Keep identity coverage in the workflow owner and split its promotion
boundary into a focused test file.
- Validate normal and mixed-attempt promoted cohorts through the E2E
consumer.
- Reject a foreign producer run before publication and compare pointer
order with the last cohort staging call.
- Model registry bytes by exact immutable reference and mutable alias,
and reject a pointer command that reports success while leaving stale
alias bytes.

The current consumer is the managed-image receipt boundary used by
downstream E2E jobs. The cohort validator tests protect retained,
future, mixed-provenance, incomplete-agent, architecture, revision, and
immutable-base cases.

## Verification

- `npm run validate:pr` — passed against
`09a52be945ed699fe186e4ff4baac7cdd7a5cc8b`.
- `npx vitest run --project e2e-support
test/e2e/support/managed-image-cohort-contract.test.ts` — 17 tests
passed.
- `npx vitest run --project integration
test/inference/managed/managed-image-publication-workflow.test.ts
test/inference/managed/managed-image-publication-promotion.test.ts` — 39
tests passed.
- `npx vitest run --project e2e-support
test/e2e/support/pr-managed-image-publication.test.ts` — 25 tests passed
for the overlapping `main` rerun contract.
- `npx vitest run --project integration
test/automation/pull-requests/growth-guardrails.test.ts` — 45 tests
passed.
- Pre-commit and pre-push hooks — passed, including YAML, repository,
growth, secret-scan, and CLI TypeScript gates.
- GitHub commit verification —
`1d3c879bf9120251b79f750ae473a65316f2ffeb` is Verified; all 30 PR
commits are Verified.
- No secrets, API keys, or credentials are present in the diff.

## Review notes

- Security review: PASS. The change narrows the managed-image trust
boundary with exact repository, run, attempt, digest, base-reference,
and SLSA builder bindings. It adds no credential flow, privilege,
network destination, dependency, or mutable external input.
- CodeRabbit's identity-execution, final-stage ordering, and foreign-run
rejection findings are addressed in the workflow and promotion tests.
- `cjagwani` confirmed that the immutable cohort-alias blocker is
resolved and requested a current-base refresh for `E2E / PR Gate`. The
refresh is present. Current `main` removed that controller in #8625 and
its merge-gate tests classify the former check as advisory, so GitHub
cannot schedule that retired check.
- The [PR Review Advisor run for
`94062e5`](https://github.com/NVIDIA/NemoClaw/actions/runs/34016671873)
completed all nine specialists. Commit `1d3c879` closes its sole finding
by making the Docker substitute reference-aware and proving that the
production byte comparison rejects a stale pointer alias. The other
eight specialists found no issue.
- Documentation review: `no-docs-needed`. The final diff changes an
internal CI/E2E provenance contract and tests, with no user-facing
command, configuration, or supported workflow change.

---
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Managed image publications now support multi-platform cohort staging
and promotion with run and attempt metadata.
- Publication contracts include provenance details, including builder
identities and producing workflow attempts.
- Workflow reruns can retrieve and validate contracts across attempts
using stable run identifiers.

- **Bug Fixes**
- Improved validation rejects stale, mismatched, cross-run, or newer
publication candidates.
- Promotion now preserves and restores image references reliably,
including digest and cohort aliases.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant