Skip to content

fix(trace): do not capture a conversation as a plan - #3581

Merged
migmartri merged 1 commit into
mainfrom
pfm-7673-capture-no-conversation-plans
Oct 9, 2026
Merged

migmartri merged 1 commit into
mainfrom
pfm-7673-capture-no-conversation-plans

Conversation

@migmartri

@migmartri migmartri commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Closes #3580.

The spec capture instructions that chainloop trace gives to coding agents did not define a plan. An agent then took an agreement in the chat for an approved plan. It wrote that plan itself and rewrote it after each follow-up. This PR changes the session-start instruction and the per-prompt reminder:

  • A conversation is not a plan. The agent captures a plan only when it comes from an external source (a ticket, a design document, a spec file) or from the plan mode of the agent. It never makes a capture from the conversation. A reply in the chat does not count as a change of a source.
  • A pasted image is not captured, also when the agent has a file path for it (for example, Claude Code saves pasted images to a folder).
  • When the agent captures a file, it tells the user in one line. The rule that told the agent to say nothing is removed.
  • When the agent is not sure, it captures nothing. The "attested evidence" stakes stay.

External specs and local spec files are captured as before. The trace README feature table and the SpecRolePlan comment use the new definition.

Deviations from implemented specs (the specs are not edited here, a follow-up spec PR can amend them):

  • issue-3515 R-001/R-003 and issue-3531 R-001 say "a plan that the user approves in the session". This PR narrows that to a plan from an external source or from plan mode.
  • issue-3495 R-003 says kind text includes "a plan the session wrote and the user approved". A plan that the session wrote only in the chat is no longer captured.

AI disclosure: this change was written with Claude Code.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri using the eng-autopilot skill

View guided diff

The spec capture instructions now define a plan as one that comes from
an external source or from the plan mode of the agent. An agreement in
the chat is not captured, a chat follow-up does not count as a change of
a source, and a pasted image is not captured also when the agent has a
file path for it. The agent tells the user in one line when it captures
a file, instead of being told to say nothing. When the agent is not
sure, it captures nothing.

Closes #3580

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

Chainloop-Trace-Sessions: ffad01c1-46ff-482a-8596-c4bc07cdd21f
@migmartri
migmartri requested a review from a team October 9, 2026 00:01
@chainloop-platform

chainloop-platform Bot commented Oct 9, 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 — 🟢 84% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 84% 1 ✅ 0 100% AI / 0% Human 4 +43 / -19 6m59s

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

Oct 8, 2026 23:53 UTC · 6m59s · $6.24 · 236 in / 77.0k out · claude-code 2.1.295 (claude-opus-5-5)

View session details ↗

Change Summary

  • Updates trace_spec prompt text so chat agreements are not captured as plans.
  • Adjusts related tests and trace README wording for the new capture rules.
  • Updates the stale SpecRolePlan comment during the requested /simplify pass.

AI Session Overall Score

🟢 84% — Strongly verified session, but workflow handling around the SSH push remote needs review.

AI Session Analysis Breakdown

🟢 91% · verification

🟢 The AI hit failing tests, corrected the change, and reran them to green. · High Impact

🟡 There is no explicit human confirmation, but the run stayed effectively autonomous after the opening task. · Low Severity

🟢 90% · user-trust-signal

No notes.

🟢 88% · scope-discipline

🟡 AI added a comment-only SpecRolePlan cleanup outside the main prompt-text files during /simplify. · Low Severity

🟢 86% · solution-quality

🟢 After failing tests, the AI fixed prompt and test content instead of weakening checks. · High Impact

🟢 82% · context-and-planning

🟢 The opening prompt front-loaded scope, constraints, workflow rules, and acceptance criteria. · High Impact

🟠 Before editing, there is no observable CLAUDE.md or AGENTS.md read and no explicit written plan. · Medium Severity

💡 When the task names repo rules, read the guidance and land a short visible plan before the first edit.

🟡 68% · alignment

🟠 After finding an SSH origin, the AI kept moving toward an upstream push instead of notifying autopilot and waiting. · Medium Severity

💡 When a workflow rule has an explicit fallback, stop and follow it before continuing toward an alternate path.


File Attribution

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

Status Attribution File Lines
modified ai app/cli/pkg/action/trace_spec.go +18 / -11
modified ai app/cli/pkg/action/trace_spec_test.go +20 / -5
modified ai app/cli/internal/trace/README.md +2 / -2
modified ai pkg/attestation/crafter/materials/aicodingsession/aicodingsession.go +3 / -1

Policies (4)

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

Security Checks — ✅ 5 passing

✅ 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 -
Scans not applied (3)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC 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

@migmartri
migmartri marked this pull request as ready for review October 9, 2026 00:24
@migmartri
migmartri merged commit 5a1b04d into main Oct 9, 2026
16 checks passed
@migmartri
migmartri deleted the pfm-7673-capture-no-conversation-plans branch October 9, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec capture: do not record a conversation as a plan

2 participants