Skip to content

feat(cli): show attestation evidence in the custom step that adds it - #3879

Merged
migmartri merged 5 commits into
mainfrom
issue-3878-evidence-in-its-step
Dec 2, 2026
Merged

migmartri merged 5 commits into
mainfrom
issue-3878-evidence-in-its-step

Conversation

@migmartri

@migmartri migmartri commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Adds spec issue-3878 and its implementation, in the same PR.

A pipeline records its own steps with chainloop attestation event, and adds the report of each step with chainloop attestation add. Until now nothing linked the report to its step, so the run timeline showed it as a separate row after the step. With this change, the evidence shows in the step that adds it.

  • chainloop attestation add --step <key> records the custom step on the material event (R-001). The material keeps its chainloop.material.<name> key, so the progress of the run does not change. A step that is not a valid custom key never fails the add: the CLI warns and drops the step.
  • The material attributes of a run event get an optional step, which the control plane checks with the rules of a custom key. No database change is needed.
  • chainloop workflow run describe shows each material in the custom step it names, in time order with the events of the step. A step with no matching custom event shows the material as a top-level row, as before (R-002).
  • chainloop attestation event takes its key with --step instead of --name (R-003, D-002). The command has no --name flag any more, so a call with it fails as an unknown flag.

This changes the flag name of R-013 of spec issue-3825 (attestation progress events). Spec issue-3825 is not edited. The new spec records the change in D-002.

The platform UI nests the material in its step in the same way, as a follow-up in the UI repository.

Closes #3878

This PR was written with AI assistance (Claude Code).

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri

View guided diff

@migmartri migmartri added the spec Design spec label Dec 2, 2026
@migmartri
migmartri requested a review from a team December 2, 2026 21:51
@chainloop-platform

chainloop-platform Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

Status Policy Material Messages
✅ Passed pr-min-approvals pr-info -
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — 🟢 86% · ⚠️ 1 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 86% 1 ⚠️ 1 100% AI / 0% Human 7 +68 / -23 23m14s

🟢 86% — 100% AI — ⚠️ 1 policies failing

Dec 2, 2026 22:09 UTC · 23m14s · $11.85 · 372 in / 114.3k out · claude-code 2.1.334 (claude-opus-5-5)

View session details ↗

Change Summary

Adds explicit material-to-step association in progress events and nests evidence chronologically in the run timeline. Replaces the event name flag with the step flag and corrects timestamps for retried evidence.

AI Session Overall Score

🟢 86% — Focused implementation and passing regression tests, with limited acceptance verification and no user confirmation.

AI Session Analysis Breakdown

🟢 94% · scope-discipline

No notes.

🟢 92% · solution-quality

🟢 Fixed timestamp selection in production rendering while retaining failed-attempt history. · High Impact

🟢 90% · context-and-planning

No notes.

🟢 88% · alignment

No notes.

🟢 87% · user-trust-signal

No notes.

🟡 75% · verification

🟢 Observed failing timeline and removed-flag tests, then passing command-package runs after production fixes. · High Impact

🟢 Parity tests exercise server and typed validation on limits, punctuation, non-ASCII characters, and newlines. · High Impact

🟠 The engaged user never explicitly confirmed that the behavior worked. · Medium Severity

💡 Confirm the rendered timeline in a real run before approving the change.

🟡 The 65-character test checks successful addition and omitted step, but does not assert the warning. · Low Severity


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
modified ai app/controlplane/pkg/biz/workflowrunevent_test.go +39 / -0
modified ai docs/specs/issue-3878-evidence-in-its-step.md +8 / -7
modified ai app/cli/cmd/attestation_event_test.go +10 / -4
modified ai app/cli/cmd/attestation_event.go +4 / -9
modified ai app/cli/cmd/workflow_run_timeline.go +5 / -1
modified ai app/cli/cmd/workflow_run_timeline_test.go +1 / -1
modified ai app/cli/pkg/action/runevents.go +1 / -1

Policies (4, 1 failing)

Status Policy Material Messages
✅ Passed ai-config-ai-agents-allowed ai-coding-session-4ba4f0 -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-4ba4f0 -
⚠️ Failed ai-config-no-secrets ai-coding-session-4ba4f0
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-4ba4f0 -

Security Checks — ✅ 7 passing

✅ AI Security Analysis

Reviewed this change against the project's security context (3 concerns hunted) — no introduced risk found.

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

View attestation ↗


Powered by Chainloop and Chainloop Trace

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 20 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread app/cli/cmd/workflow_run_timeline.go Resolved
Comment thread app/cli/pkg/action/runevents.go Resolved
Add spec issue-3878 and its implementation.

- attestation add --step records the custom step on its material events.
  A step that is not a valid custom key is dropped with a warning and
  never fails the add.
- Run event material attributes get an optional, validated step.
- workflow run describe shows each material in the custom step it names.
- attestation event takes its key with --step instead of --name, which
  now only warns.

Refs #3878

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: aafbb7ce-92cd-4202-a7ab-2f9bbb3e39b6
- A material row in a custom step shows and sorts at the time of the
  event that names the step, not of an earlier attempt.
- The warning for a dropped --step names the value.
- A test checks that a material step validates exactly as a custom
  event key, on the server and with the proto rule that the CLI uses.

Refs #3878

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 4ba4f0e5-96c0-4ee1-8610-0589238f2de8
- R-002 no longer repeats D-001.
- The data constraint cites R-005 of spec issue-3825 for names only.

Refs #3878

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 4ba4f0e5-96c0-4ee1-8610-0589238f2de8
@migmartri
migmartri force-pushed the issue-3878-evidence-in-its-step branch from 84e10db to 375913b Compare December 2, 2026 22:24
A call with --name now fails as an unknown flag. Spec issue-3878 R-003
and D-002 match the change.

Refs #3878

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 4ba4f0e5-96c0-4ee1-8610-0589238f2de8

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread app/cli/cmd/attestation_event.go Resolved
Refs #3878

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 4ba4f0e5-96c0-4ee1-8610-0589238f2de8

@matiasinsaurralde matiasinsaurralde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@migmartri
migmartri merged commit b55bfef into main Dec 2, 2026
15 of 16 checks passed
@migmartri
migmartri deleted the issue-3878-evidence-in-its-step branch December 2, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Design spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show attestation evidence in the custom step that adds it

2 participants