Skip to content

feat(trace): allow an attribution on each line range - #3664

Merged
jiparis merged 2 commits into
chainloop-dev:mainfrom
jiparis:feat/trace-line-ranges-schema
Oct 20, 2026
Merged

jiparis merged 2 commits into
chainloop-dev:mainfrom
jiparis:feat/trace-line-ranges-schema

Conversation

@jiparis

@jiparis jiparis commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Implements milestone 1 of spec issue-3639 "Line ranges that point into the pushed code" (docs/specs/issue-3639-line-ranges.md), D-005.

The AI coding session schema now lets each line range carry an optional attribution property, ai or human. The Go type gets the same field. The CLI does not write the property yet. A later release writes it, so readers that check evidence against their own copy of the schema can take the new schema first.

Part of #3639. The follow-up PR that writes the attributed ranges depends on a release with this change.

AI disclosure: this change was written with the assistance of Claude Code.

🤖 Generated with Claude Code

View guided diff

Open the AI coding session schema so that each line range can carry an
optional attribution, ai or human. The CLI does not write it yet: a later
release writes it, so readers have time to take the new schema
(spec issue-3639, line ranges D-005).

Assisted-by: Claude Code
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>

Chainloop-Trace-Sessions: 9d041a37-66a6-476b-8571-897e21eefa5a
@chainloop-platform

chainloop-platform Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

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

View attestation ↗

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

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 92% 1 ⚠️ 1 95% AI / 5% Human 9 +251 / -16 12h16m48s

🟢 92% — 95% AI — ⚠️ 1 policies failing

Oct 19, 2026 19:38 UTC · 12h16m48s · $8.93 · 276 in / 87.9k out · claude-code 2.1.303 (claude-opus-5-5)

View session details ↗

Change Summary

  • Opens the AI coding session schema so each line range can carry optional attribution.
  • Records AI and human ranges at pushed-file positions in trace enrichment.
  • Adds schema, attribution, action-level, and e2e coverage plus a README update for line ranges.

AI Session Overall Score

🟢 92% — Spec-driven session with broad validation; only the opening prompt was thin.

AI Session Analysis Breakdown

🟢 95% · scope-discipline

No notes.

🟢 94% · user-trust-signal

🟢 User approved the two-PR plan immediately after the implementation summary. · High Impact

🟢 93% · alignment

🟢 Shipped schema, CLI, README, and tests line up with the captured scope. · High Impact

🟢 92% · verification

🟢 Targeted and aggregate go test runs passed after the failing tests were fixed. · High Impact

🟢 91% · solution-quality

No notes.

🟢 86% · context-and-planning

🟠 Opening ask was one line for a multi-milestone spec and CLI change. · Medium Severity

💡 Front-load scope and success criteria when work spans spec, schema, CLI, tests, and docs.


File Attribution

███████████████████░ 95% AI / 5% Human

Status Attribution File Lines
modified ai app/cli/pkg/action/trace_line_attribution_test.go +91 / -0
modified ai internal/schemavalidators/schemavalidators_test.go +55 / -5
modified ai app/cli/internal/trace/attribution/enrich_test.go +40 / -6
modified ai app/cli/internal/trace/attribution/enrich.go +31 / -4
modified ai app/cli/internal/trace/e2e/checks_more.go +23 / -0
modified ai internal/schemavalidators/internal_schemas/aicodingsession/ai-coding-session-0.1.schema.json +4 / -0
modified ai pkg/attestation/crafter/materials/aicodingsession/aicodingsession.go +4 / -0
modified ai app/cli/internal/trace/README.md +2 / -1
modified ai app/cli/internal/trace/e2e/checks.go +1 / -0

Policies (5, 1 failing)

Status Policy Material Messages
⚠️ Failed ai-session-no-auto-pr ai-coding-session-9d041a
  • Pull request opened without human approval (auto-approved: source=config, reason=subcommandResults): gh api repos/chainloop-dev/chainloop/pulls/3664/comments/4318142957/replies -X POST -F body=@/private/tmp/claude-501/-Users-jiparis-projects-chainloop/9d041a37-...
  • Pull request opened without human approval (auto-approved: source=config, reason=subcommandResults): gh pr create --draft --repo chainloop-dev/chainloop --base main --head jiparis:feat/trace-line-ranges --title "feat(trace): line ranges that point into the push...
  • Pull request opened without human approval (auto-approved: source=config, reason=subcommandResults): gh pr create --repo chainloop-dev/chainloop --base main --head jiparis:feat/trace-line-ranges-schema --title "feat(trace): allow an attribution on each line ran...
✅ Passed ai-config-ai-agents-allowed ai-coding-session-9d041a -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-9d041a -
✅ Passed ai-config-no-secrets ai-coding-session-9d041a -
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-9d041a -

Security Checks — ✅ 6 passing

✅ secret-scan

Status Policy Messages
✅ Passed secrets-detection -

✅ sast-scan

Status Policy Messages
✅ Passed cwe-top26-40-cusp -
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -

✅ 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 ↗

Security context

✅ Nothing this change touches has a recorded security-fix history.

View in Chainloop ↗ · How this works ↗


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

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

View guided diff | Re-trigger cubic

@jiparis
jiparis requested a review from a team October 19, 2026 20:42
Assisted-by: Claude Code
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>

Chainloop-Trace-Sessions: 9d041a37-66a6-476b-8571-897e21eefa5a
@jiparis
jiparis merged commit 6767675 into chainloop-dev:main Oct 20, 2026
19 of 21 checks passed
@jiparis
jiparis deleted the feat/trace-line-ranges-schema branch October 20, 2026 11:35
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