Skip to content

Add provider capability matrix#259

Merged
paudley merged 5 commits into
mainfrom
paudley/179-provider-capability-matrix
Jun 23, 2026
Merged

Add provider capability matrix#259
paudley merged 5 commits into
mainfrom
paudley/179-provider-capability-matrix

Conversation

@paudley

@paudley paudley commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Closes #179

Summary

  • Adds a machine-readable provider capability registry covering Claude Code, Codex, Gemini CLI, and the generic fallback provider.
  • Generates docs/PROVIDER_CAPABILITY_MATRIX.md from that registry and wires make build / make check to sync and verify drift.
  • Updates provider tests so capability expectations and provider ids come from the registry, including the generic fallback skill-surface id.

Validation

  • cd go && go test -buildvcs=false ./internal/agenthooks ./internal/agenthookscli
  • make build
  • make check

Notes

  • Managed Go tests continue to emit the existing non-blocking warning that Go coverage is below the 90% project goal; the gate exits successfully.

@paudley paudley requested a review from ErinAudley as a code owner June 23, 2026 13:14
Copilot AI review requested due to automatic review settings June 23, 2026 13:14
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@paudley, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e6a515e5-d921-446e-b865-e211c8a97e9e

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc33b1 and 32150d3.

📒 Files selected for processing (1)
  • go/internal/agenthooks/settings.go
📝 Walkthrough

Walkthrough

A provider capability registry is introduced in go/internal/agenthooks, defining capability metadata for Claude, Codex, Gemini, and a generic fallback. Two new functions generate and persist a Markdown compliance matrix (docs/PROVIDER_CAPABILITY_MATRIX.md) and detect drift. The CLI and Makefile are wired with sync-provider-matrix and check-provider-matrix commands; the latter is added to the make check gate. Provider-native output tests and settings logic are updated to reference provider IDs from the registry instead of hardcoded literals.

Changes

Provider Capability Matrix Registry and CI Drift Check

Layer / File(s) Summary
ProviderCapability struct and ProviderGeneric constant
go/internal/agenthooks/settings.go, go/internal/agenthooks/spec.go
ProviderCapability gains 11 new exported JSON fields (display name, hook events, response/context shapes, MCP/setup targets, memory, verification, safety caveats). ProviderCapabilities() and its helper providerLimitedToolMapping are deleted from settings.go. ProviderGeneric Provider = "generic" constant is added to spec.go. skillSurfacePaths entry switches from "portable" to string(ProviderGeneric).
Provider capability registry and per-provider builders
go/internal/agenthooks/provider_capabilities.go (lines 1–225)
New file defines ProviderCapabilityMatrixRelativePath constant. ProviderCapabilities() returns a four-entry slice. Four builder functions (claudeProviderCapability, codexProviderCapability, geminiProviderCapability, genericProviderCapability) each fully populate the expanded struct with provider-specific metadata including coverage, hook events, response/context shapes, MCP setup, generated targets, memory behavior, supported/unsupported surfaces, verification fixtures, and safety caveats.
Markdown generation, file sync, and drift check I/O
go/internal/agenthooks/provider_capabilities.go (lines 227–418)
ProviderCapabilityMatrixMarkdown() renders the full report via strings.Builder with SPDX header, coverage summary table, and per-provider details. SyncProviderCapabilityMatrix writes it to disk with fixed directory/file modes. CheckProviderCapabilityMatrix reads on-disk content and compares exact equality against freshly generated Markdown (missing file treated as no-drift), returning the report path when drift is detected. Helper functions (appendCapabilitySummaryRow, appendCapabilityDetail, appendKeyValue, appendBulletList, markdownCell, providerLimitedToolMapping) format sections and escape pipes for table safety.
CLI subcommands and Makefile targets
go/internal/agenthookscli/main.go, Makefile
CLI adds errProviderMatrixDrift static error, dispatches sync-provider-matrix and check-provider-matrix with --root flag parsing, implements subcommand handlers, and updates usage output. Makefile adds the two targets invoking coding-ethos-agent-hooks, includes sync-provider-matrix in the build prerequisite chain, and adds check-provider-matrix to the check verification gate.
Test coverage for registry, CLI, and drift detection
go/internal/agenthooks/settings_test.go, go/internal/agenthookscli/main_internal_test.go
TestProviderCapabilitiesDocumentProviderLimits now expects 4 capabilities with expanded unsupported assertions for Codex, Gemini, and Generic. providerCapabilityExpectations() is rewritten to enumerate the full four-provider matrix. TestGeminiSettingsDoNotClaimUnsupportedPostToolUse uses providerSettingsSection() for extraction. TestSyncAndVerifySettingsRunsProviderSmokePayloads adds a registry-derived known-providers guard. TestVerifySettingsRejectsInvalidPortableSkillSurface updates to use ProviderGeneric. capabilityProbePayload() switches to agenthooks.ProviderX constants. CLI tests extended for both new subcommands.
Generated matrix doc and documentation updates
docs/PROVIDER_CAPABILITY_MATRIX.md, README.md, docs/INTEGRATIONS.md, docs/index.md, tests/TESTS.md
Generated PROVIDER_CAPABILITY_MATRIX.md enumerates all four providers with coverage, surfaces, memory, and verification sections. README.md removes hardcoded per-provider tables and references the generated matrix. INTEGRATIONS.md adds authoritative source note. docs/index.md adds navigation link. TESTS.md updates make check gate description. Auxiliary: celexpr/helpers.go adds Gemini directory cleanup; codeintelcli/main_internal_test.go captures stdout validation for git-signals; evaluators/cel_expression_test.go adds Gemini prompt-pack test case.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(70, 130, 180, 0.5)
    Note over Makefile,FS: make build / make check
  end
  participant Makefile
  participant CLI as coding-ethos-agent-hooks
  participant Reg as ProviderCapabilities()
  participant MD as ProviderCapabilityMatrixMarkdown()
  participant FS as docs/PROVIDER_CAPABILITY_MATRIX.md

  Makefile->>CLI: sync-provider-matrix --root .
  CLI->>Reg: enumerate Claude/Codex/Gemini/Generic
  Reg-->>CLI: []ProviderCapability
  CLI->>MD: render report string
  MD-->>CLI: Markdown string
  CLI->>FS: MkdirAll + WriteFile
  FS-->>CLI: ok
  CLI-->>Makefile: exit 0

  Makefile->>CLI: check-provider-matrix --root .
  CLI->>FS: ReadFile current report
  FS-->>CLI: on-disk content
  CLI->>Reg: enumerate providers
  CLI->>MD: render fresh report
  MD-->>CLI: fresh Markdown string
  CLI->>CLI: compare strings
  alt no drift
    CLI-->>Makefile: exit 0
  else drift detected
    CLI-->>Makefile: exit 1 + drift error
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • ErinAudley

Poem

🐇 A matrix of providers, neat and true,
Generated from the registry—no more ad hoc brew!
Claude, Codex, Gemini, and Generic too,
Sync writes the doc, Check finds what drifts askew,
make check now guards each surface path in view.
The rabbit stamped it done, with one last hop—
No scattered tables left, the drift shall stop! 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add provider capability matrix' directly describes the main change—introducing a machine-readable provider capability registry and generated compliance documentation.
Description check ✅ Passed The PR description addresses all key template sections: summarizes what changed and why, documents validation steps, identifies the capability surface as 'provider registry', and notes outcomes.
Linked Issues check ✅ Passed The PR fully satisfies issue #179 acceptance criteria: registry covers all four providers (Claude Code, Codex, Gemini CLI, generic), documentation distinguishes supported/partially-supported/unsupported surfaces, make check verifies drift, tests reference provider IDs from registry, and no hidden policy behavior remains undocumented.
Out of Scope Changes check ✅ Passed All changes are directly aligned with #179 scope: adding the provider capability registry, generating documentation, integrating with build/check, and updating tests to use the registry. Minor supporting updates (CEL expression test, codeintelcli stdout capture) address pre-existing regressions exposed during validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch paudley/179-provider-capability-matrix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a generated Provider Capability Matrix to document supported, partially supported, and unsupported adapter surfaces across different providers. It adds CLI commands and Makefile targets to sync and check the matrix, updates relevant documentation, and defines a generic fallback provider. Review feedback suggests setting the generated markdown file's permissions to 0o644 for standard readability, caching the static provider capabilities slice to avoid unnecessary allocations, removing redundant filepath.Clean calls, and avoiding unnecessary URL-escaping of slashes in the markdown output to improve document readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread go/internal/agenthooks/provider_capabilities.go Outdated
Comment thread go/internal/agenthooks/provider_capabilities.go
Comment thread go/internal/agenthooks/provider_capabilities.go
Comment thread go/internal/agenthooks/provider_capabilities.go
Comment thread go/internal/agenthooks/settings_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 575-587: The check-provider-matrix target has incorrect
prerequisites and should match the dependencies of sync-provider-matrix since
both invoke the same binary $(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks. Change
the prerequisite list for the check-provider-matrix target from
ensure-hook-runtime to ensure-go go-tools-install to ensure the Go tools and
binary are properly built before the target runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cb678c85-12fc-4c33-9a31-717336ff903d

📥 Commits

Reviewing files that changed from the base of the PR and between 12debae and b9ee5b0.

📒 Files selected for processing (12)
  • Makefile
  • README.md
  • docs/INTEGRATIONS.md
  • docs/PROVIDER_CAPABILITY_MATRIX.md
  • docs/index.md
  • go/internal/agenthooks/provider_capabilities.go
  • go/internal/agenthooks/settings.go
  • go/internal/agenthooks/settings_test.go
  • go/internal/agenthooks/spec.go
  • go/internal/agenthookscli/main.go
  • go/internal/agenthookscli/main_internal_test.go
  • tests/TESTS.md
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Test (Python 3.11)
  • GitHub Check: Go coverage
  • GitHub Check: Coding Ethos SARIF Gate / Coding Ethos SARIF Gate
  • GitHub Check: Validate GitHub workflows
  • GitHub Check: Unified lint
  • GitHub Check: Test (Python 3.13)
  • GitHub Check: Go fuzz smoke
  • GitHub Check: CodeQL (go)
🧰 Additional context used
📓 Path-based instructions (1)
Makefile

📄 CodeRabbit inference engine (AGENTS.md)

Makefile: Use make install to install dependencies
Use make check as the canonical automated verification gate; use make test or uv run pytest only as focused Python-test helpers

Files:

  • Makefile
🧠 Learnings (1)
📚 Learning: 2026-06-23T12:26:47.373Z
Learnt from: paudley
Repo: paudley/coding-ethos PR: 258
File: go/internal/geminiprompts/render.go:125-132
Timestamp: 2026-06-23T12:26:47.373Z
Learning: In the paudley/coding-ethos repo, the documented guideline “Gemini prompt pack should be generated in go/internal/geminiprompts/” refers to the generator implementation location (Go source), not the location of the generated prompt-pack artifact. Always treat PromptPackPath as the enforced output artifact path `.coding-ethos/gemini/prompt-pack.json` (e.g., render_test.go asserts PromptPackPath, and compiler_policies.go / hookrunner lookup / README document the expected path). Do not flag a code review issue just because PromptPackPath points to `.coding-ethos/gemini/prompt-pack.json`; only flag violations if the artifact output path logic breaks that enforced contract.

Applied to files:

  • go/internal/agenthooks/spec.go
  • go/internal/agenthookscli/main.go
  • go/internal/agenthookscli/main_internal_test.go
  • go/internal/agenthooks/provider_capabilities.go
  • go/internal/agenthooks/settings.go
  • go/internal/agenthooks/settings_test.go
🪛 checkmake (0.3.2)
Makefile

[warning] 445-445: Target "check" should be declared PHONY.

(phonydeclared)


[warning] 587-587: Target "build" should be declared PHONY.

(phonydeclared)

🔇 Additional comments (10)
go/internal/agenthooks/settings_test.go (1)

40-47: LGTM!

Also applies to: 79-79, 93-110, 121-208, 302-302, 534-534, 693-698, 747-747, 756-756, 1130-1158

go/internal/agenthookscli/main_internal_test.go (1)

122-133: LGTM!

Also applies to: 150-153

go/internal/agenthookscli/main.go (4)

23-28: LGTM!


48-51: LGTM!


204-245: LGTM!


285-287: LGTM!

Makefile (1)

445-445: LGTM!

go/internal/agenthooks/settings.go (1)

93-109: LGTM!

Also applies to: 983-1010

go/internal/agenthooks/spec.go (1)

16-17: LGTM!

go/internal/agenthooks/provider_capabilities.go (1)

1-421: LGTM!

Comment thread Makefile
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026
@paudley

paudley commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

Stage 2 update

Addressed the provider matrix review feedback in commit 660f009:

  • Set the generated provider matrix file mode to 0644 and added a test assertion for it.
  • Removed redundant filepath.Clean calls from the provider matrix check path and generated-doc drift test.
  • Removed slash escaping from the generated Markdown and added policy normalization plus a regression test so .coding-ethos/gemini/prompt-pack.json remains readable without tripping the advertising filter.
  • Changed check-provider-matrix to depend on ensure-go go-tools-install, matching the binary it invokes.
  • Fixed a stdout capture race in codeintelcli that the commit hook exposed while running the full Go suite.

I did not apply the static cached slice suggestion because the repo hook blocks package globals with gochecknoglobals; keeping the local registry construction satisfies the local policy.

Validation run:

  • go test -buildvcs=false ./internal/agenthooks ./internal/agenthookscli ./internal/celexpr ./internal/evaluators ./internal/codeintelcli
  • go test -buildvcs=false ./internal/codeintelcli -count=30
  • make build
  • make check
  • policy-git commit and push hooks

All passed. The Go coverage warning below the 90% project goal remains non-blocking.

@paudley paudley enabled auto-merge (squash) June 23, 2026 13:46
Copilot AI review requested due to automatic review settings June 23, 2026 18:12

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go/internal/agenthooks/settings.go`:
- Around line 328-345: The syncSettingsFile and syncTextSettingsFile functions
contain identical directory creation and file writing logic with the same error
wrapping patterns. Extract the common MkdirAll and WriteFile block into a new
helper function called writeSettingsFile that accepts path and content string
parameters and returns an error. This helper should handle both the directory
creation and file writing with their respective error messages. Then refactor
both syncSettingsFile and syncTextSettingsFile to call this helper function with
the appropriate path and rendered content instead of duplicating the write
logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 93a429dd-9db5-451a-983b-e6c46f07ec5c

📥 Commits

Reviewing files that changed from the base of the PR and between b9ee5b0 and 1fc33b1.

📒 Files selected for processing (13)
  • Makefile
  • README.md
  • docs/INTEGRATIONS.md
  • docs/PROVIDER_CAPABILITY_MATRIX.md
  • docs/index.md
  • go/internal/agenthooks/provider_capabilities.go
  • go/internal/agenthooks/settings.go
  • go/internal/agenthooks/settings_test.go
  • go/internal/agenthookscli/main.go
  • go/internal/agenthookscli/main_internal_test.go
  • go/internal/celexpr/helpers.go
  • go/internal/codeintelcli/main_internal_test.go
  • go/internal/evaluators/cel_expression_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Go coverage
  • GitHub Check: Test (Python 3.11)
  • GitHub Check: Coding Ethos SARIF Gate / Coding Ethos SARIF Gate
  • GitHub Check: Unified lint
  • GitHub Check: Validate GitHub workflows
  • GitHub Check: Test (Python 3.13)
  • GitHub Check: CodeQL (go)
  • GitHub Check: Go fuzz smoke
🧰 Additional context used
📓 Path-based instructions (1)
Makefile

📄 CodeRabbit inference engine (AGENTS.md)

Makefile: Use make install to install dependencies
Use make check as the canonical automated verification gate; use make test or uv run pytest only as focused Python-test helpers

Files:

  • Makefile
🧠 Learnings (1)
📚 Learning: 2026-06-23T12:26:47.373Z
Learnt from: paudley
Repo: paudley/coding-ethos PR: 258
File: go/internal/geminiprompts/render.go:125-132
Timestamp: 2026-06-23T12:26:47.373Z
Learning: In the paudley/coding-ethos repo, the documented guideline “Gemini prompt pack should be generated in go/internal/geminiprompts/” refers to the generator implementation location (Go source), not the location of the generated prompt-pack artifact. Always treat PromptPackPath as the enforced output artifact path `.coding-ethos/gemini/prompt-pack.json` (e.g., render_test.go asserts PromptPackPath, and compiler_policies.go / hookrunner lookup / README document the expected path). Do not flag a code review issue just because PromptPackPath points to `.coding-ethos/gemini/prompt-pack.json`; only flag violations if the artifact output path logic breaks that enforced contract.

Applied to files:

  • go/internal/celexpr/helpers.go
  • go/internal/codeintelcli/main_internal_test.go
  • go/internal/evaluators/cel_expression_test.go
  • go/internal/agenthookscli/main_internal_test.go
  • go/internal/agenthookscli/main.go
  • go/internal/agenthooks/settings_test.go
  • go/internal/agenthooks/provider_capabilities.go
  • go/internal/agenthooks/settings.go
🔇 Additional comments (6)
go/internal/agenthookscli/main.go (1)

17-17: LGTM!

Also applies to: 100-155, 157-162, 326-333

Makefile (1)

33-34: LGTM!

Also applies to: 583-588

go/internal/agenthooks/settings_test.go (1)

20-20: LGTM!

Also applies to: 166-172, 208-219, 255-297

go/internal/agenthookscli/main_internal_test.go (1)

8-15: LGTM!

Also applies to: 103-165, 203-256

go/internal/agenthooks/settings.go (1)

347-370: LGTM!

Also applies to: 391-407

go/internal/agenthooks/provider_capabilities.go (1)

16-16: LGTM!

Also applies to: 298-298

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go/internal/agenthooks/settings.go`:
- Around line 328-345: The syncSettingsFile and syncTextSettingsFile functions
contain identical directory creation and file writing logic with the same error
wrapping patterns. Extract the common MkdirAll and WriteFile block into a new
helper function called writeSettingsFile that accepts path and content string
parameters and returns an error. This helper should handle both the directory
creation and file writing with their respective error messages. Then refactor
both syncSettingsFile and syncTextSettingsFile to call this helper function with
the appropriate path and rendered content instead of duplicating the write
logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 93a429dd-9db5-451a-983b-e6c46f07ec5c

📥 Commits

Reviewing files that changed from the base of the PR and between b9ee5b0 and 1fc33b1.

📒 Files selected for processing (13)
  • Makefile
  • README.md
  • docs/INTEGRATIONS.md
  • docs/PROVIDER_CAPABILITY_MATRIX.md
  • docs/index.md
  • go/internal/agenthooks/provider_capabilities.go
  • go/internal/agenthooks/settings.go
  • go/internal/agenthooks/settings_test.go
  • go/internal/agenthookscli/main.go
  • go/internal/agenthookscli/main_internal_test.go
  • go/internal/celexpr/helpers.go
  • go/internal/codeintelcli/main_internal_test.go
  • go/internal/evaluators/cel_expression_test.go
📜 Review details
🔇 Additional comments (6)
go/internal/agenthookscli/main.go (1)

17-17: LGTM!

Also applies to: 100-155, 157-162, 326-333

Makefile (1)

33-34: LGTM!

Also applies to: 583-588

go/internal/agenthooks/settings_test.go (1)

20-20: LGTM!

Also applies to: 166-172, 208-219, 255-297

go/internal/agenthookscli/main_internal_test.go (1)

8-15: LGTM!

Also applies to: 103-165, 203-256

go/internal/agenthooks/settings.go (1)

347-370: LGTM!

Also applies to: 391-407

go/internal/agenthooks/provider_capabilities.go (1)

16-16: LGTM!

Also applies to: 298-298

🛑 Comments failed to post (1)
go/internal/agenthooks/settings.go (1)

328-345: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract the duplicated directory+write block into a shared helper.

syncSettingsFile (Lines 334-344) and syncTextSettingsFile (Lines 378-388) contain identical MkdirAll + WriteFile logic with the same error wrapping. A small helper keeps the two write paths from drifting.

♻️ Proposed helper
func writeSettingsFile(path, content string) error {
	if err := os.MkdirAll(filepath.Dir(path), settingsDirMode); err != nil {
		return fmt.Errorf("create settings directory: %w", err)
	}
	if err := os.WriteFile(path, []byte(content), settingsFileMode); err != nil {
		return fmt.Errorf("write settings: %w", err)
	}
	return nil
}

Then both syncSettingsFile and syncTextSettingsFile can return writeSettingsFile(path, content) after rendering.

Also applies to: 372-389

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go/internal/agenthooks/settings.go` around lines 328 - 345, The
syncSettingsFile and syncTextSettingsFile functions contain identical directory
creation and file writing logic with the same error wrapping patterns. Extract
the common MkdirAll and WriteFile block into a new helper function called
writeSettingsFile that accepts path and content string parameters and returns an
error. This helper should handle both the directory creation and file writing
with their respective error messages. Then refactor both syncSettingsFile and
syncTextSettingsFile to call this helper function with the appropriate path and
rendered content instead of duplicating the write logic.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026
@paudley paudley merged commit 0dd4181 into main Jun 23, 2026
22 checks passed
@paudley paudley deleted the paudley/179-provider-capability-matrix branch June 23, 2026 18:38
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.

[feature] Add provider adapter capability matrix and generated compliance report

2 participants