Repository navigation
feat: attestation progress events, M1 automatic progress (#3825) - #3859
Conversation
PR validation — ✅ 3 passing
AI Session Checks — 🟡 86% · ✅ 0 failing
|
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-1cdb32 |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-1cdb32 |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-1cdb32 |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-1cdb32 |
- |
Security Checks — ⚠️ 1 failing
⚠️ AI Security Analysis
The per-PR audit did not finish: 245 concerns went unreviewed (spend ceiling or time). No introduced risk was found in what it reviewed, but treat this as incomplete, not clean.
View in Chainloop ↗ · How this works ↗
✅ Secret Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ SAST Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ IaC Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scans not applied (2)
| Scan | Reason |
|---|---|
| Vulnerability Scan | no manifest/lockfile changed |
| GitHub Actions Scan | no workflow files changed |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
All reported issues were addressed across 88 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Add the RecordEvent and ListEvents calls, the workflow_run_events table, and the closing event that the control plane records when it stores, cancels, or expires a run. RecordEvent applies the checks of Store, and ListEvents the checks of View, so no new policy is added. Refs #3825 (M1, R-003, R-005, R-006, R-008) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The run expiry job also deletes run events older than the new workflow_run_events_retention setting, 90 days by default. The Helm chart exposes it as controlplane.attestations.workflowRunEventsRetention. Refs #3825 (M1, R-007) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
…scribe The attestation commands record a best-effort progress event on init, on each add, and on the policy evaluations. workflow run describe shows a run in progress with its provided and missing materials, the policy results so far, and its timeline. Against a control plane without run events, the recorder turns off and describe shows the run as before. Refs #3825 (M1, R-001, R-002, R-004, R-005, R-008) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
Drop the chainloop.policies.* events. The started event, now sent at the end of init, carries the init policy results. A new chainloop.push event, sent before the attestation is stored, carries the push policy results and fails with the blocking policies when a gate blocks the push. Refs #3825 (M1, R-001) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
Share one gate rule between the push event and the push command, select only the columns the run locks need, delete old events in one statement, and replace literals with constants. Refs #3825 (M1) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The push event is recorded after the dry-run return and before the attestation is stored, so a dry run records none. The gate check now lives in the push action, and the push command uses it. Refs #3825 (M1, R-001) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
- the expiry sweep skips a run that finished during the sweep, with no expiry metric or log - trace pushes do not enforce policy gates, so their push event never reports a block - blocking policies are listed once - describe counts a group of the contract once as required - describe JSON always has remote_state and added_by_collector - test the FailedPrecondition error mapping Refs #3825 (M1) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The key is at most 128 characters, each attribute string at most 256, and the policy name lists at most 100 names. The CLI recorder keeps the lists within the limit, and the counts stay complete. Refs #3825 (M1, R-008) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
An add that expands an archive into more than 20 materials records one event for the archive, with the sum of the policy counts, instead of one event for each material. So a large archive does not use up the events of the run. Refs #3825 (M1, R-001) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
An add that expands an archive also stores the archive itself as an EVIDENCE material. It now records an event for it, after the events of the expanded materials or after the summary event. Refs #3825 (M1, R-001) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The timeline is one tree: the root line has the start and the end of the attestation, and each step is one line. A step with more than one event, such as a failed then repeated add, folds its events below it. For a run in progress, the tree also shows each contract material that is missing and the push that is still to come, so it replaces the materials table. Refs #3825 (M1, R-004) Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The CLI no longer records a separate push event. When the control plane stores an attestation, it reads the attestation policy results and the gated policies with violations from the stored predicate, and puts them on the closing event of the run, in the same transaction as the status change. workflow run describe shows the timeline end as one "pushed and stored" line with the policy results, the blocking gates, and the short digest. The API drops the push event type and its attributes (numbers reserved) and adds blocking_policies to the attestation attributes. Supersedes R-001 and R-006 of spec issue-3825 with R-010 and R-011, and records the reason as D-011. Refs #3825 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
5c80d42 to
c5d1de3
Compare
…event Most pushes move the policy evaluations to the CAS, so the control plane can't rebuild the per-policy results at store time. The closing event goes back to digest only, and workflow run describe takes the policy status of the "pushed and stored" line from the stored attestation it already loads. Also: - regenerate the ent code without the push event type - restore the inline gate check of the push command from main - simplify the timeline renderer - spec: R-010 supersedes R-001, D-011 records the decision Refs #3825 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
There was a problem hiding this comment.
All reported issues were addressed across 27 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
The control plane now builds the progress of a run in progress and returns it, with the events of the run, in WorkflowRunService.View, so the CLI, the UI and other tools render it with no logic of their own. ListEvents and its after_event_id option are removed. The start event lists the materials that init resolves, from the contract and its policy groups, so the progress also counts the materials that policy groups require. A failed add after a successful one keeps the material as provided, with the error. Spec: R-011 supersedes R-003, D-012 supersedes D-007. Refs #3825 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
There was a problem hiding this comment.
2 issues found across 36 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/cli/pkg/action/runevents.go">
<violation number="1" location="app/cli/pkg/action/runevents.go:167">
P2: `expectedMaterials` silently drops resolved materials after the first 1,000, so progress reports incomplete required totals and can label later additions as not in the contract. Preserve all resolved materials by raising/removing the wire cap, or expose truncation explicitly instead of presenting partial progress.</violation>
</file>
<file name="docs/plans/issue-3825-attestation-progress-events.md">
<violation number="1" location="docs/plans/issue-3825-attestation-progress-events.md:299">
P2: `View` drops progress when listing events fails, despite this plan promising progress for every in-progress run. Construct fallback progress outside the successful `List` branch, or explicitly exempt this failure from R-011.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
WorkflowRunService.View goes back to its main behavior. The new GetProgress call, with the checks of View, returns the events of a run and, while it is in progress, the progress that the control plane builds. describe calls it after View, and an older control plane without it shows the run as before. A run with no events from the CLI, as from an older CLI, shows no timeline. Spec: R-011 and D-012 describe the separate call. Refs #3825 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
There was a problem hiding this comment.
1 issue found across 20 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/plans/issue-3825-attestation-progress-events.md">
<violation number="1" location="docs/plans/issue-3825-attestation-progress-events.md:236">
P2: This M1 summary still says the run view returns events and progress, although `GetProgress` is now the read path and `View` does not change. Replace that stale reference so the plan does not describe the wrong API.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 1cdb3220-119c-4a14-ac50-52d5437ee4eb
Implements milestone M1 ("Automatic progress") of the attestation progress events spec. Refs #3825. Spec and plan: #3857.
What it adds
Run events in the control plane (R-006, R-007, R-008, R-011). A new
workflow_run_eventstable stores short, timestamped progress events with the workflow run.AttestationService/RecordEventwrites events. It applies the same checks asStore.WorkflowRunService/GetProgressreturns the events of the run, oldest first, with the same checks asView. For a run in progress, it also returns its progress, which the control plane builds: one row for each expected material with its requirement and status (missing, provided, or failed), the required counts, and the attestation policy results ofinit. Clients render it as is.initresolves, from the contract and its policy groups. The start event lists them. A run of an older CLI uses the materials of its contract.RecordEventis exempt from the authz middleware next toStoreandCancel, andGetProgressmaps toPolicyWorkflowRunRead, asViewdoes.Viewdoes not change.Expirenow skips a run that is no longer in progress.workflow_run_events_retention, 90 days by default. The Helm value iscontrolplane.attestations.workflowRunEventsRetention.Automatic events from the CLI (R-010, R-002, R-005). The attestation commands record best-effort events:
init, with the init policy results and the expected materialsaddthat succeeds or fails, with the error text cut to 1 KBThe push records no event. The closing event of the store ends the push, and the signed attestation holds its policy results (D-011).
Material policy results go in the material events. Events hold only names, types, statuses, counts, digests, and the material value cut to 256 characters. Each call has a 2-second timeout, and the recorder turns off with no warning against a control plane without the new calls.
chainloop workflow run describe(R-004). It callsGetProgressafterViewand shows the progress and the events it returns. For a run in progress, it shows:For a finished run, the timeline shows as history after the signed attestation. Its last line, "pushed and stored", shows the policy status of the signed attestation and the short digest. Against an older control plane, which does not have
GetProgress,describeshows the run as before. A run from an older CLI, which records no events, shows no timeline. JSON output getseventsandprogressfields.Example of describe output
Spec changes
The spec merged in #3857. This PR supersedes two entries:
GetProgress, returns the events and the progress, and the control plane builds the progress. The run view does not change. This also makes the progress count the materials that policy groups require.The plan steps are updated to match.
AI assistance: this change was implemented with Claude Code.
🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri