feat(trace): Copilot skills, spec pointers, and pasted images (M2)

Merged
MI
1mo ago
+1831-38

This PR builds M2 of the plan for GitHub Copilot support in Chainloop Trace (docs/plans/issue-3800-copilot-trace-provider.md): R-008, R-009, and R-010 for these requirements.

  • Skills tracking (R-008): the Copilot provider records each skill that the session loaded, from the skill.invoked events of the Copilot event log, and captures each skill folder through the shared skill pipeline. A skill listing does not count as a use.
  • Spec source pointers (R-009): exact copies of stored spec sources are replaced with pointers: full view reads, shell reads with cat (also in a combined output, at line boundaries), create calls, and apply_patch calls that add one file. Copilot also logs the input of each Trace hook in hook.start records, and the same copies there are replaced. Partial reads, changed content, failed tool calls, and other edits stay inline.
  • Pasted image pointers (R-009): each distinct image that the user attached is stored once as "Pasted image N", and the data of its session.binary_asset record is replaced with a pointer. An image that a tool gives the model stays inline.
  • End-to-end suite (R-010): the Copilot harness attaches pasted images with --attachment, so the pasted image check runs headless. The viewer-pointer, inline-copy, and skill-package checks that Codex uses now apply to Copilot too. The compatibility tables show the new Copilot cells.
  • Cache token accounting: the end-to-end check now compares the stored Copilot token counts with the per-call session.usage_record events of the event log, so the Copilot cell moves from Unknown to Yes.

Differences from the plan:

  • No separate transcript.go: the extensions read the event types of parse.go.
  • The Codex e2e checks are made to apply to Copilot, instead of a Copilot copy of them.
  • The cat matching helpers are copied from the Codex provider, not moved to a shared package.

Not verified:

  • A skill that the user starts with a slash command. Prompt mode sends the slash command to the model as text, so only skills that the model loads are checked.
  • The manual VS Code check, and the open question of the spec about the VS Code event log.

@matiasinsaurralde could you take a look?

Refs #3800

AI disclosure: Claude Code helped to research, implement, and test this change.

šŸ¤– Generated with Claude Code