Skip to content

feat(ai-security-context): add optional attempts to unresolved commits - #3888

Merged
migmartri merged 1 commit into
chainloop-dev:mainfrom
migmartri:feat/ai-security-context-unresolved-attempts
Dec 6, 2026
Merged

migmartri merged 1 commit into
chainloop-dev:mainfrom
migmartri:feat/ai-security-context-unresolved-attempts

Conversation

@migmartri

@migmartri migmartri commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Adds an optional attempts field (non-negative integer) to the unresolved definition of the AI security context schema. It records how many times triage tried and failed to classify a commit: the agentic large-diff triage for an oversize commit, or the one-shot triage for any other commit. When the count reaches the cap, the hole stops retrying and retryable becomes false.

Strata already writes this field on unresolved holes. Because unresolved has additionalProperties: false, chainloop attestation add rejects such contexts with "additionalProperties 'attempts' not allowed". The field is optional, so the schema stays at security-context-0.1 and existing contexts remain valid. It mirrors the existing attempts field on survivor.

Refs: PFM-8486

AI disclosure: this change was produced with assistance from Claude Code.

🤖 Generated with Claude Code

View guided diff

Unresolved holes can now record how many times triage tried and failed
to classify the commit. The field is optional, so the schema stays at
security-context-0.1 and existing contexts remain valid.

Refs: https://linear.app/chainloop/issue/PFM-8486

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

Chainloop-Trace-Sessions: 46352acc-1770-40e5-a6f4-5c4966e2ddb9
@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 — 🟢 97% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 97% 1 ✅ 0 100% AI / 0% Human 2 +37 / -0 2m0s

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

Dec 5, 2026 22:25 UTC · 2m0s · $1.96 · 58 in / 13.2k out · claude-code 2.1.337 (claude-opus-5-5)

View session details ↗

Change Summary

Adds optional nonnegative integer attempts to unresolved security context entries while retaining the existing schema version. Adds validation cases for zero, positive, negative, and fractional values.

AI Session Overall Score

🟢 97% — Autonomous peer-request run delivers a focused, tested schema fix; human reactions remain unavailable.

AI Session Analysis Breakdown

🟢 98% · scope-discipline

No notes.

🟢 97% · solution-quality

🟢 Defined attempts as a nonnegative integer in the schema instead of relaxing strict validation globally. · High Impact

🟢 97% · verification

🟢 Observed the new cases fail before the fix, then the complete validator package pass afterward. · High Impact

🟢 Tests call the real validator for zero, positive, negative, and fractional attempts with specific error assertions. · High Impact

🟡 One-shot peer-request session has no user confirmation by design. · Low Severity

🟢 96% · alignment

No notes.

🟢 95% · context-and-planning

No notes.

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 +32 / -0
modified ai internal/schemavalidators/internal_schemas/aisecuritycontext/ai-security-context-0.1.schema.json +5 / -0

Policies (4)

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

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 2 files

View guided diff | Re-trigger cubic

@migmartri
migmartri requested a review from a team December 5, 2026 22:32
@migmartri
migmartri merged commit d40cccf into chainloop-dev:main Dec 6, 2026
15 of 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