Skip to content

feat(trace): add the Cursor harness to the end-to-end suite - #3683

Merged
jiparis merged 3 commits into
chainloop-dev:mainfrom
jiparis:feat/trace-e2e-cursor
Oct 21, 2026
Merged

jiparis merged 3 commits into
chainloop-dev:mainfrom
jiparis:feat/trace-e2e-cursor

Conversation

@jiparis

@jiparis jiparis commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Adds a Cursor harness to the Chainloop Trace end-to-end suite. This is part of milestone 3 of spec issue-3635 (R-003, R-004, R-011). It refs #3635.

  • e2e/cursor.go runs the Cursor CLI (cursor-agent -p --output-format stream-json --force --trust). HOME is a folder next to the workspace, so the Cursor configuration and hooks of the user do not load. The Trace hooks read the transcripts from the same folder. The CLI then has no stored login, so a run needs CURSOR_API_KEY.
  • Cursor runs its shell tool in a login shell. On macOS, path_helper puts /usr/local/bin first in PATH, so the git hooks ran an installed chainloop, not the CLI under test. The harness writes shell startup files in its HOME that set PATH back.
  • A result event with is_error fails the run, also when the process exits with status 0.
  • DisableSessionStart removes the sessionStart entry from .cursor/hooks.json.
  • The headless Cursor CLI cannot attach a pasted image, so a scenario with images is an error. The pasted image cell of Cursor is No, so the suite skips that scenario.
  • The Cursor output does not show the hook messages, so the hook message checks are "not covered" (R-004).
  • The suite config pins Cursor 2026.10.19-6bbf2c4 with the auto model, which is the only model of a free plan. In auto mode no output names the model, so the model name check is "not covered" for an auto session.
  • The Cursor cells of the feature tables come from a suite run: hook installation and deletion, the Trace run wrapper, and the spec source role, title, and description are Yes. Media skipped by redaction stays Unknown: the Cursor transcript holds no tool outputs, but a pasted image stays inline in it, and the headless CLI cannot attach an image to check it. The Cursor CLI sends the shell hooks, so the "Cursor IDE only" notes are removed.

This PR was written with the help of Claude Code.

Run the Cursor CLI (cursor-agent) headless in the Trace end-to-end
suite, with HOME next to the workspace so the configuration and hooks
of the user do not load. Pin the CLI version in the suite config.

Refs chainloop-dev#3635

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

Chainloop-Trace-Sessions: 0f698192-ddc8-487e-b214-474edc859d4e
@chainloop-platform

chainloop-platform Bot commented Oct 21, 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 11 +516 / -16 1h25m1s

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

Oct 21, 2026 10:40 UTC · 1h25m1s · $21.04 · 592 in / 219.1k out · claude-code 2.1.306 (claude-opus-5-5)

View session details ↗

Change Summary

  • Adds shared e2e scenarios and checks for Net contribution, Session updates, and Renames and rewrites.
  • Extends the runner and workspace setup to support follow-up git actions on a feature branch.
  • Adds focused unit tests for the new check helpers.
  • Updates the Trace README with the newly documented limits behind these rows.

AI Session Overall Score

🟢 91% — Well-scoped follow-up PR with real tests and passing e2e validation.

AI Session Analysis Breakdown

🟢 94% · verification

🟢 The AI reran targeted e2e suites until the three new rows passed. · High Impact

🟡 No user confirmation appears after T118; this follow-up phase ran effectively one-shot. · Low Severity

🟢 93% · alignment

No notes.

🟢 92% · scope-discipline

🟢 The AI split the suite-gap work into its own focused PR. · High Impact

🟢 90% · solution-quality

🟢 The fix extends shared scenarios and checks instead of special-casing one harness. · High Impact

🟢 88% · context-and-planning

No notes.

🟢 86% · user-trust-signal

No notes.


File Attribution

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

Status Attribution File Lines
created ai app/cli/internal/trace/e2e/cursor.go +262 / -0
created ai app/cli/internal/trace/e2e/cursor_test.go +160 / -0
created ai app/cli/internal/trace/e2e/checks_test.go +57 / -0
modified ai app/cli/internal/trace/README.md +10 / -11
modified ai app/cli/internal/trace/e2e/checks.go +9 / -0
modified ai app/cli/internal/trace/e2e/config.yaml +9 / -0
modified ai app/cli/internal/trace/PROVIDERS.md +2 / -2
modified ai app/cli/internal/trace/e2e/claude.go +2 / -2
modified ai app/cli/internal/trace/e2e/harness.go +3 / -0
modified ai app/cli/internal/trace/e2e/result_test.go +1 / -1
modified ai app/cli/internal/trace/e2e/e2e_test.go +1 / -0

Policies (4)

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

Security Checks — ✅ 6 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 -

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

No issues found across 8 files

View guided diff | Re-trigger cubic

Cursor runs its shell tool in a login shell, where the macOS
path_helper puts /usr/local/bin first in PATH. The git hooks of a
session then ran an installed chainloop, not the CLI under test. The
harness now writes shell startup files in its HOME that set PATH back.

In auto mode no output names the model, so the model detection check
is not covered for an auto session. Set the Cursor cells of the feature
tables from the suite results.

Refs chainloop-dev#3635

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

Chainloop-Trace-Sessions: 0f698192-ddc8-487e-b214-474edc859d4e
@jiparis
jiparis requested a review from a team October 21, 2026 11:41

@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 7 files (changes from recent commits).

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

View guided diff | Re-trigger cubic

Comment thread app/cli/internal/trace/README.md Outdated
A pasted image stays inline in the Cursor transcript, so the redaction
can see media there. The headless CLI cannot attach an image, so the
suite cannot check it.

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

Chainloop-Trace-Sessions: 0f698192-ddc8-487e-b214-474edc859d4e
@jiparis
jiparis merged commit a01a2f4 into chainloop-dev:main Oct 21, 2026
17 checks passed
@jiparis
jiparis deleted the feat/trace-e2e-cursor branch October 21, 2026 12:17
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