Repository navigation
feat(trace): capture Codex skills and spec materials - #3690
Conversation
Implement milestone 2 of #3657 with skill snapshots, spec-source pointers, pasted-image materials, and viewer-compatible transcript replacements. Assisted-by: Codex Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 01a15f80-7cef-7100-a8fc-389f64109471
PR validation — ✅ 3 passing
AI Session Checks — 🟡 76% ·
|
| Avg score | Sessions | Failing policies | Attribution | Files | Lines | Total Duration |
|---|---|---|---|---|---|---|
| 🟡 76% | 2 | 98% AI / 2% Human | 13 | +2009 / -57 | 1h4m0s |
🟡 80% — 99% AI — ✅ All policies passing
-
Oct 21, 2026 17:27 UTC · 48m25s · $4.17 · 23.4M in / 103.6k out · codex 0.163.0 (gpt-6.1-sol)
Change Summary
-
- Adds Codex skill tracking, spec-source pointer replacement, and pasted-image handling.
- Adds Codex-specific regression and E2E checks plus material-assembly tests.
- Updates provider capability docs, compatibility tables, and the Codex design spec for milestone 2.
AI Session Overall Score
-
🟡 80% — Solid milestone-2 delivery, but verification provenance and one CI claim need review.
AI Session Analysis Breakdown
-
🟢 90% · context-and-planning
-
🟢 The session started with the ticket and design spec before implementation began. · High Impact
🟢 88% · scope-discipline
-
No notes.
🟢 86% · solution-quality
-
🟢 The provider adds compile-time extension conformance instead of ad hoc feature flags. · High Impact
🟢 84% · user-trust-signal
-
🟢 The user kept delegating follow-up work instead of taking the task back. · High Impact
🟡 72% · alignment
-
🟠 One CI summary overclaimed green status before the AI corrected a still-running job. · Medium Severity
💡 Re-query live checks before summarizing CI so pending jobs stay explicit.
🟡 68% · verification
-
🟠 Test output is visible, but the captured execution ledger cannot prove the requested checks ran. · Medium Severity
💡 Prefer a captured runner path whose command and result can be cited directly.
-
File Attribution
███████████████████░99% AI / 1% HumanStatus Attribution File Lines created ai app/cli/internal/trace/codex/materials.go+773 / -0 created ai app/cli/internal/trace/codex/extensions_test.go+311 / -0 created ai app/cli/internal/trace/codex/skills.go+305 / -0 created ai app/cli/internal/trace/e2e/checks_codex.go+170 / -0 created ai app/cli/pkg/action/trace_codex_materials_test.go+155 / -0 modified ai app/cli/internal/trace/codex/transcript.go+43 / -12 modified ai docs/specs/issue-3657-codex-trace-provider.md+43 / -1 created ai app/cli/internal/trace/e2e/checks_codex_test.go+39 / -0 modified ai app/cli/internal/trace/README.md+10 / -6 modified ai app/cli/internal/trace/e2e/checks_more.go+15 / -0 modified ai app/cli/internal/trace/PROVIDERS.md+3 / -3 modified ai app/cli/internal/trace/e2e/checks.go+6 / -0 modified ai app/cli/internal/trace/e2e/scenarios.go+1 / -1
Policies (4)
Status Policy Material Messages ✅ Passed ai-config-ai-agents-allowedai-coding-session-01a15f- ✅ Passed ai-config-no-dangerous-commandsai-coding-session-01a15f- ✅ Passed ai-config-no-secretsai-coding-session-01a15f- ✅ Passed ai-config-mcp-servers-allowedai-coding-session-01a15f- -
🟡 72% — 94% AI — ⚠️ 1 policies failing
-
Oct 21, 2026 21:52 UTC · 15m35s · $1.07 · 5.0M in / 21.5k out · codex 0.163.0 (gpt-6.1-sol)
Change Summary
-
- Adds Codex skill tracking plus spec-source and pasted-image pointer handling.
- Tightens code-mode patch and failure-envelope replacement rules in
materials.go. - Adds Codex regression and E2E checks and updates milestone 2 compatibility docs.
AI Session Overall Score
-
🟡 72% — Milestone 2 landed, but signing detours and thin verification kept confidence at yellow.
AI Session Analysis Breakdown
-
🟢 88% · scope-discipline
-
No notes.
🟢 86% · solution-quality
-
🟢 Patch replacement now rejects computed scripts instead of guessing through them. · High Impact
🟢 83% · context-and-planning
-
🟢 The AI captured the milestone spec before it edited the PR branch. · High Impact
🟡 68% · alignment
-
🔴 The AI bypassed commit signing once, then needed repeated user corrections to restore the required SSH-signed workflow. · High Severity
💡 Treat signing and similar workflow safeguards as part of the ask unless the user explicitly approves a bypass.
🟡 56% · verification
-
🟢 The AI added focused regression tests before changing the Codex materials logic. · Medium Impact
🔴 The PR adds Codex regression tests, but the captured session lacks validator-recognized execution for the new checks. · High Severity
💡 When milestone verification depends on live or package-wide runs, capture the exact executed command output instead of only updating docs.
🟡 54% · user-trust-signal
-
🟠 The user had to re-ask for the review and then restate that they wanted the bugs fixed. · Medium Severity
💡 When a user starts with review language, close that loop before pivoting into adjacent exploratory work.
-
File Attribution
██████████████████░░94% AI / 6% HumanStatus Attribution File Lines modified ai app/cli/internal/trace/codex/materials.go+72 / -33 modified ai app/cli/internal/trace/codex/extensions_test.go+62 / -0 modified ai app/cli/internal/trace/README.md+1 / -1
Policies (4, 1 failing)
Status Policy Material Messages ✅ Passed ai-config-ai-agents-allowedai-coding-session-01a160- ✅ Passed ai-config-no-dangerous-commandsai-coding-session-01a160- ⚠️ Failedai-config-no-secretsai-coding-session-01a160- Secret (generic-api-key) detected in session content [turn=353, source=tool_result, line=1]: {"chunk_id":"e0bb23","wall_time_seconds":0.089919133,"exit_code":0,"original_token_count":120,"output":"INF commit record saved sha=4a104f56dcb94804236448afe985427ef8f5da1e\n[codex/pr-3690-material-po...
- Secret (generic-api-key) detected in session content [turn=379, source=tool_result, line=1]: {"chunk_id":"c1caf5","wall_time_seconds":1.001324277,"session_id":53489,"original_token_count":133,"output":"file:/home/migmartri/.gitconfig\tssh\nfile:/home/migmartri/.gitconfig\t/home/migmartri/.ssh...
- Secret (generic-api-key) detected in session content [turn=410, source=tool_result, line=1]: {"chunk_id":"964cae","wall_time_seconds":0.000020749,"exit_code":0,"original_token_count":82,"output":"{\"head\":\"4a104f56dcb94804236448afe985427ef8f5da1e\",\"url\":\"https://github.com/chainloop-dev...
- Secret (generic-api-key) detected in session content [turn=443, source=tool_result, line=1]: {"chunk_id":"def8a7","wall_time_seconds":0.865971668,"exit_code":0,"original_token_count":776,"output":"{\"conclusion\":\"action_required\",\"name\":\"DCO\",\"output\":{\"annotations_count\":0,\"annot...
✅ Passed ai-config-mcp-servers-allowedai-coding-session-01a160- -
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 |
Security context
✅ Nothing this change touches has a recorded security-fix history.
View in Chainloop ↗ · How this works ↗
Powered by Chainloop and Chainloop Trace
Refs #3657 Assisted-by: Codex Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 01a15f80-7cef-7100-a8fc-389f64109471
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Requires human review: Auto-approval blocked because this review re-detected 3 unresolved issues already reported by Cubic.
View guided diff | Re-trigger cubic
Keep output metadata outside material pointers, retain canonical pointers in native timeline records, and recognize nested skill results and valid source text that resembles an error. Clarify the documented support limits and pasted-image requirement. Refs #3657 Assisted-by: Codex Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 01a15f80-7cef-7100-a8fc-389f64109471
Chainloop-Trace-Sessions: 01a16073-95dd-7912-9463-66bbce3e4522 Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
4a104f5 to
ab5873d
Compare
Codex sessions now capture used skill definitions and supporting files. They store each distinct pasted image once and replace supported spec copies with material pointers.
Pointers replace copies in viewer messages and retained native events. Images remain inline if decoding or storage fails.
Skills and spec pointers remain Partial in the compatibility table. Skill capture covers filesystem skills in the root session. Transformed output, mixed or computed patches, and unsupported formats remain inline. Child sessions remain outside scope.
Code-mode patch replacement accepts one awaited
tools.apply_patchcall with a literal argument or an immediately precedingconstliteral. The call can use thetextwrapper. Other scripts remain inline because their patch arguments can change before the write.Failure checks inspect JSON text, nested command results, promise results, and tool error flags. Failed writes retain their original transcript content. Valid source documents that start with
Error:still support pointers.The author requested an update to the current milestone 2 spec. R-001 through R-006 remain unchanged. R-007 through R-010 and D-004 define milestone 2 and supersede the original exclusion. The spec update follows the eng-spec workflow.
Refs #3657. This PR delivers milestone 2. The parent issue remains open until both milestones pass their required checks.
tested manually too
Checks:
make -C app/cli testpasses, including the new regression cases for computed patches and failed writes.openrouter/openai/gpt-6-luna.Assisted-by: Codex
Provider checklist
PR #3684 delivered the core provider and CLI wiring. This PR adds the three optional extensions and connects them to session evidence. Codex has no dedicated skill tool. The existing lifecycle hooks scan the rollout for skill loads.
Provider package (
app/cli/internal/trace/<agent>/)Nameand checkvar _ trace.Provider = (*Provider)(nil)at compile time.InstallHooksidempotent and preserve user hooks.InstallHooksForTraceRun.SettingsFile.UninstallHooks.HooksInstalledonly for Chainloop hooks.FilePath,Cwd, andTranscriptPathvalues.ToolUseID,AgentID, andCommand. ReadAgentVersionandModelwhen the transcript omits them.IsFileWritingToolandIsCommandTool, including any plugin list.CaptureFileSnapshot,ResolveBeforeContent, andCleanupAfterEdit, or reverse edits throughHookInput.Edits.ToolUseIDfor shell pre and post hooks.CopySessionDatasafe to repeat. Check payload paths. Preserve hook execution when the agent or transcript is missing.opts.SessionDir.CopySessionDataandParseSessionindependent of the control plane and network.*state.Storesotrace run --localworks outside Git repositories.RawSession["main"]non-nil. Each line must contain a JSON object.Supports*methods.trace.ErrAnnounceUnsupportedfromAnnounceToUserwhen no channel exists.SkillTracker,SpecCopyReplacer, andPastedImageFinder, with a compile-time check for each interface.testdata/, announcement responses, and copying.CLI wiring
providers/registry.go.traceProviderFlags,any(), andnames().--<agent>totrace initandtrace run, with help text.chainloop trace hook <agent> …commands tocmd/trace_hook.gowithskipActionOptsInit.providers/capabilities_test.go.cmd/trace_init_providers_test.goandcmd/trace_init_test.go.make generate. This PR leaves the commands and wiring from feat(trace): add Codex provider #3684 unchanged.End-to-end tests and documentation
e2e.Harnessine2e/<agent>.go.e2e/e2e_test.go.e2e/config.yaml.README.md, using suite results.README.md.README.md.docs/specs/and cite its requirement IDs in the PR.