Skip to content

feat(ai-security-context): add optional trace_checked mark to fix and introducing commits - #3886

Merged
migmartri merged 1 commit into
chainloop-dev:mainfrom
migmartri:miguel/pfm-8487-skip-the-ai-coding-session-lookup-for
Dec 5, 2026
Merged

migmartri merged 1 commit into
chainloop-dev:mainfrom
migmartri:miguel/pfm-8487-skip-the-ai-coding-session-lookup-for

Conversation

@migmartri

@migmartri migmartri commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Adds an optional boolean trace_checked to the fingerprint (fix commit) and to the introducing-commit record (introduced_by[]) of the AI security context schema, and to the matching Go wire types.

The producer sets the mark when the AI coding session lookup of a commit gave a definite result (sessions found or no session found). A later scan can then skip that commit instead of looking it up again on every run. A denied or failed lookup leaves the mark unset, so the commit is tried again. Absent and false mean the same thing, so existing security contexts stay valid.

This is the upstream part of PFM-8487. The schema sets additionalProperties: false on both records, so the CLI must accept the field before the producer can emit it.

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

🤖 Generated with Claude Code

View guided diff

… introducing commits

Add an optional boolean trace_checked to the fingerprint and to the
introducing-commit record of the AI security context schema, and to the
matching Go wire types. The producer sets it when the AI coding session
lookup of a commit gave a definite result, so that a later scan can skip
that commit instead of looking it up again.

Refs: PFM-8487

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

Chainloop-Trace-Sessions: deb88eab-8423-4439-97a4-9a9982edb21e
@chainloop-platform

chainloop-platform Bot commented Dec 5, 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 — 🟢 91% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 91% 1 ✅ 0 100% AI / 0% Human 5 +118 / -4 2m26s

🟢 91% — 100% AI — ✅ All policies passing

Dec 5, 2026 09:18 UTC · 2m26s · $3.16 · 112 in / 31.6k out · claude-code 2.1.337 (claude-opus-5-5)

View session details ↗

Change Summary

Adds optional trace_checked markers to fix and introducing-commit schema records and matching wire types. Updates fixtures and adds validation tests for compatibility and invalid values.

AI Session Overall Score

🟢 91% — Focused one-shot schema change with meaningful tests; filtered results limit verification confidence.

AI Session Analysis Breakdown

🟢 98% · scope-discipline

No notes.

🟢 96% · solution-quality

🟢 A shared boolean definition extends both records without relaxing validation; wire types preserve omission for false. · High Impact

🟢 95% · context-and-planning

🟢 Before editing, the agent outlined optional schema fields, matching wire types, fixtures, and tests. · High Impact

🟢 94% · alignment

No notes.

🟡 78% · verification

🟢 New validator tests exercise both commit roles, absent markers, both booleans, and rejection of strings, numbers, and null. · High Impact

🟠 Post-change test output removes passing package lines and does not preserve the validator result or runner exit status. · Medium Severity

💡 Preserve the changed package’s pass line and test runner exit status before reporting success.

🟡 One-shot session; user confirmation is structurally absent. · Low Severity

abstained · user-trust-signal

🟡 user-trust-signal not assessed — reviewer should confirm coverage · Low Severity


File Attribution

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

Status Attribution File Lines
modified ai internal/schemavalidators/schemavalidators_test.go +88 / -0
modified ai internal/schemavalidators/internal_schemas/aisecuritycontext/ai-security-context-0.1.schema.json +12 / -0
modified ai pkg/attestation/crafter/materials/aisecuritycontext/aisecuritycontext.go +10 / -0
modified ai internal/schemavalidators/testdata/ai_security_context_valid.json +4 / -2
modified ai pkg/attestation/crafter/materials/testdata/ai-security-context.json +4 / -2

Policies (4)

Status Policy Material Messages
✅ Passed ai-config-ai-agents-allowed ai-coding-session-deb88e -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-deb88e -
✅ Passed ai-config-no-secrets ai-coding-session-deb88e -
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-deb88e -

Security Checks — ✅ 7 passing

✅ AI Security Analysis

Nothing this change touches re-opens a recorded security fix.

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.

No issues found across 5 files

View guided diff | Re-trigger cubic

@migmartri
migmartri requested a review from a team December 5, 2026 09:55
@migmartri
migmartri merged commit 012af27 into chainloop-dev:main Dec 5, 2026
16 checks passed
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.

2 participants