Skip to content

Comments

Add compare_to option to policy system#34

Merged
nhorton merged 3 commits intomainfrom
claude/add-policy-compare-to-CC5Ry
Jan 15, 2026
Merged

Add compare_to option to policy system#34
nhorton merged 3 commits intomainfrom
claude/add-policy-compare-to-CC5Ry

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 15, 2026

Add compare_to field to policies with three options:

  • base (default): Compare to merge-base with default branch
  • default_tip: Two-dot diff against default branch tip
  • prompt: Compare to state captured at prompt submission

Changes:

  • Add compare_to to policy schema with enum validation
  • Update policy parser to handle compare_to with base as default
  • Move git diff logic into evaluate_policies.py for per-policy handling
  • Rename capture_work_tree.sh to capture_prompt_work_tree.sh
  • Run capture on every prompt submit (for compare_to: prompt)
  • Remove capture call from stop hook (no longer needed)
  • Remove get_changed_files.sh (logic now in Python)
  • Update job instructions to document compare_to field
  • Add tests for compare_to field

Add compare_to field to policies with three options:
- base (default): Compare to merge-base with default branch
- default_tip: Two-dot diff against default branch tip
- prompt: Compare to state captured at prompt submission

Changes:
- Add compare_to to policy schema with enum validation
- Update policy parser to handle compare_to with base as default
- Move git diff logic into evaluate_policies.py for per-policy handling
- Rename capture_work_tree.sh to capture_prompt_work_tree.sh
- Run capture on every prompt submit (for compare_to: prompt)
- Remove capture call from stop hook (no longer needed)
- Remove get_changed_files.sh (logic now in Python)
- Update job instructions to document compare_to field
- Add tests for compare_to field
After git add -A, unstaged files become staged, so we need to use
git diff --name-only --cached to see them, not git diff --name-only HEAD.
@nhorton nhorton merged commit 41327ec into main Jan 15, 2026
2 checks passed
@nhorton nhorton deleted the claude/add-policy-compare-to-CC5Ry branch January 15, 2026 18:30
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