Skip to content

docs: add versioned CLI capture matrix contract - #257

Open
harshitethic wants to merge 3 commits into
Siddhant-K-code:mainfrom
harshitethic:feat/capture-matrix-foundation
Open

harshitethic wants to merge 3 commits into
Siddhant-K-code:mainfrom
harshitethic:feat/capture-matrix-foundation

Conversation

@harshitethic

Copy link
Copy Markdown

Summary

Adds the first machine-readable + human-readable capture matrix for the CLI hook adapters, scoped to Claude Code and OpenAI Codex as requested in #239.

What changes

  • docs/capture-matrix.json defines provider setup/config/rollback, privacy notes, known gaps, and per-capability coverage.
  • docs/capture-matrix.md gives the reviewer-facing version of the same boundaries.
  • tests/test_capture_matrix.py keeps provider IDs unique, enforces the coverage schema, checks the human docs mention every machine-readable provider, and prevents an entry from claiming verified without a tested version, verification date, and fixture/test reference.

Trust boundary

The current repository documents adapter behavior, but it does not contain a clean-environment verification record with exact Claude/Codex versions. This PR therefore marks both entries unverified rather than fabricating version/date evidence. The structure makes that missing evidence visible and gives a deterministic place for #239's future verification command to update.

For Codex, the matrix intentionally does not claim session-end/stop coverage because the current integration docs only claim session start, prompts, responses, and PreToolUse/PostToolUse activity.

Scope

This is a focused foundation for #239, not a claim to close the full issue. The remaining work is the executable setup/doctor verification path and automated stale-entry checks tied to real provider-version fixtures.

Validation

The added test is dependency-free (unittest + stdlib JSON/pathlib). I could not run the local suite because the connected development machine is offline; upstream CI is the verification gate for this branch.

Refs #239.

Comment thread docs/capture-matrix.json
"capture_method": "cli_hooks",
"setup_command": "agent-strace setup --cli claude",
"config_location": "~/.claude/settings.json",
"rollback": "Remove the AgentTrace hook commands written by agent-strace setup from ~/.claude/settings.json.",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent-strace setup --cli claude does not write this file. cmd_setup prints JSON and tells the user to add it manually. This rollback text incorrectly implies that setup modified ~/.claude/settings.json. Describe removal of the manually added hook block, or make setup install it before documenting this behavior.

with self.subTest(provider=provider["id"]):
self.assertIn(provider["name"], self.docs)
self.assertIn(provider["setup_command"], self.docs)
self.assertIn(provider["config_location"], self.docs)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only checks three identifying strings. Coverage and verification can contradict capture-matrix.json while the test still passes, despite the human and machine-readable consistency goal. Assert the rendered coverage and status values, or generate the Markdown table from the JSON.


def test_verified_entries_require_reproducibility_metadata(self):
for provider in self.matrix["providers"]:
if provider["verification_status"] != "verified":

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verification_status is never validated. A typo such as verifiedd bypasses the reproducibility checks and still passes the contract test. Add an allowed-status assertion, then require the metadata for the exact verified value.

Comment thread docs/capture-matrix.json
"file": "provider_defined",
"command": "provider_defined",
"error": "provider_defined",
"stop": "unavailable"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated Codex config registers a Stop hook, and test_codex_hooks.py verifies that handle_stop records the assistant response. Marking stop as unavailable contradicts the shipped adapter. Keep session_end unavailable, but mark stop captured or rename this capability if it means something else.

Comment thread docs/capture-matrix.json
"capture_method": "cli_hooks",
"setup_command": "agent-strace setup --cli codex",
"config_location": "~/.codex/hooks.json",
"rollback": "Remove the AgentTrace hook commands written by agent-strace setup from ~/.codex/hooks.json.",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup --cli codex replaces the entire hooks.json with write_text(). Removing the AgentTrace commands cannot restore hooks that were overwritten, so this rollback is not reversible for existing users. Merge with the existing config or create a backup, then document the actual restoration step.

This branch has not been deployed

No deployments
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