Skip to content

feat(check): say when an agent can give the required approval - #992

Open
sandstream wants to merge 2 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-agent-approvers
Open

sandstream wants to merge 2 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-agent-approvers

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Owner decision 1 from kit-research claude-ship-vs-kit: yes, with the owner's condition that kit stays usable with every agent, not one vendor's.

Why

kit's default branch required reviews row passed with one required approval. Anthropic's Claude Approvals lets a policy file, .claude/approvals.yml, allow Claude to post an approving review, and its docs say "Claude's approving review can meet a GitHub branch rule that requires one approval." A change on those paths can then merge with no person approving, and the row stayed green.

What

src/agent-approval-policy.ts lists, per tool, how a repository lets an agent approve:

Tool Reader
Claude Approvals tracked .claude/approvals.yml / .yaml, root or subdirectory, a rule with claude: approves
OpenAI Codex none. Its GitHub review posts comments; its docs (read 2026-11-23) describe no setting that approves. Review rules live in AGENTS.md

A new tool that can approve is one more entry in READERS. Nothing in the row's wording is Claude-specific except the tool name it reports.

The row, with a policy that lets an agent approve:

Required approvals Row
1 warn: "main: 1 approval required, and an agent can give it: Claude Approvals (.claude/approvals.yml lines 5, 10). GitHub counts that approval, so a change on those paths can merge with no person approving"
2 or more pass, naming the agent
0 the existing warning
no such policy unchanged
  • Observe mode: a policy whose top-level mode is observe approves nothing and is not reported.
  • Tracked files only: the tools read the policy from the default branch, and git ls-files is the closest local fact.

Limits

  • A line scan, not a YAML parser. kit has no YAML dependency (ADR-0002).
  • A rule-level mode: observe is still reported, so the row can warn where the tool would not approve. The row names the lines so a person can check.
  • The row is remote, so it needs the GitHub token kit already uses for branch protection.

What changes for users

A repository with an enforced Claude Approvals policy that approves, and one required approval, sees a new warning.

Verification

  • src/agent-approval-policy.test.ts: seven tests, one in a real git repository with an untracked file and an observe-mode policy in a subdirectory.
  • node scripts/prepush.mjs: build, format, lint, tests of the changed files, self-audit pass. kit review and the new-source-file check fail locally for container reasons. Semgrep did not run (not installed here).
  • No protected path.

Generated by Claude Code

A Claude Approvals policy can let Claude post an approving review that
GitHub counts. With one approval required, kit's row passed while a
change could merge with no person approving. The reader is per tool, so
Codex or another agent that approves is one more entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at 12aa95201ed3: gates passed. All 33 checks passed on this commit, no file is in a protected class, 5 files and 249 lines changed. This approval is deterministic; it does not judge what the change is for.

…-sync-p6fg9a-agent-approvers

# Conflicts:
#	src/branch-protection-audit.ts
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at 973c54c4256e: not approved.

  • checks did not pass: windows shard 4/4, windows-native

Copy link
Copy Markdown
Owner Author

Re-ran the failed Windows jobs once. Shard 4/4 failed in captureIncomingCandidate with spawnSync openssl ETIMEDOUT, a test this PR does not touch; windows-native only reports the shard result.


Generated by Claude Code

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