Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
647e27c
docs: add design spec for proposed reductions Typst note
zazabap Mar 31, 2026
aa57353
feat: add verify-reduction skill for mathematical verification of red…
zazabap Apr 1, 2026
83e3931
style: add YAML frontmatter + professional tone to verify-reduction s…
zazabap Apr 1, 2026
d09823d
feat: adversarial multi-agent verification in verify-reduction skill
zazabap Apr 1, 2026
518824a
docs: design spec for verify-reduction skill enhancements
zazabap Apr 1, 2026
05d06ac
docs: implementation plan for verify-reduction enhancements
zazabap Apr 1, 2026
d5b7821
feat: enhance verify-reduction with test vectors export, typed advers…
zazabap Apr 1, 2026
7d8c417
feat: create add-reduction skill — consumes verified artifacts from v…
zazabap Apr 1, 2026
022c1c0
feat: register add-reduction skill in CLAUDE.md, update verify-reduct…
zazabap Apr 1, 2026
1895610
fix: three improvements to verify-reduction and add-reduction skills
zazabap Apr 1, 2026
deb0598
refactor: concise verify-reduction (761→124 lines) + self-contained a…
zazabap Apr 1, 2026
26d1ca2
fix: restore structural requirements in verify-reduction (124→274 lines)
zazabap Apr 1, 2026
1e2b375
fix: harden add-reduction with file-level verification gates
zazabap Apr 1, 2026
f5fa887
fix: add CI-equivalent checks to add-reduction pre-commit gate
zazabap Apr 1, 2026
257845f
fix: correct add-reduction HARD GATE for canonical examples
zazabap Apr 1, 2026
62a26fa
feat: parent-side verification + pre-commit hook for add-reduction
zazabap Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ These repo-local skills live under `.claude/skills/*/SKILL.md`.
- [issue-to-pr](skills/issue-to-pr/SKILL.md) -- Convert a GitHub issue into a PR with an implementation plan. Default rule: one item per PR. Exception: a `[Model]` issue that explicitly claims direct ILP solvability should implement the model and its direct `<Model> -> ILP` rule together; `[Rule]` issues still require both models to exist on `main`.
- [add-model](skills/add-model/SKILL.md) -- Add a new problem model. Can be used standalone (brainstorms with user) or called from `issue-to-pr`.
- [add-rule](skills/add-rule/SKILL.md) -- Add a new reduction rule. Can be used standalone (brainstorms with user) or called from `issue-to-pr`.
- [add-reduction](skills/add-reduction/SKILL.md) -- Add a new reduction rule from verified artifacts (Python reduce() + test vectors JSON from `/verify-reduction`). Use instead of `add-rule` when verification artifacts exist.
- [review-structural](skills/review-structural/SKILL.md) -- Project-specific structural completeness check: model/rule checklists, build, semantic correctness, issue compliance. Read-only, no code changes. Called by `review-pipeline`.
- [review-quality](skills/review-quality/SKILL.md) -- Generic code quality review: DRY, KISS, cohesion/coupling, test quality, HCI. Read-only, no code changes. Called by `review-pipeline`.
- [fix-pr](skills/fix-pr/SKILL.md) -- Resolve PR review comments, fix CI failures, and address codecov coverage gaps. Uses `gh api` for codecov (not local `cargo-llvm-cov`).
Expand All @@ -26,6 +27,7 @@ These repo-local skills live under `.claude/skills/*/SKILL.md`.
- [propose](skills/propose/SKILL.md) -- Interactive brainstorming to help domain experts propose a new model or rule. Asks one question at a time, uses mathematical language (no programming jargon), and files a GitHub issue.
- [final-review](skills/final-review/SKILL.md) -- Interactive maintainer review for PRs in "Final review" column. Merges main, walks through agentic review bullets with human, then merge or hold.
- [dev-setup](skills/dev-setup/SKILL.md) -- Interactive wizard to install and configure all development tools for new maintainers.
- [verify-reduction](skills/verify-reduction/SKILL.md) -- End-to-end verification of a reduction rule: generates Typst proof (with YES+NO examples), Python verification script (7 mandatory sections, ≥5000 checks, exhaustive n≤5), adversary Python script (≥5000 independent checks), and test vectors JSON for downstream consumption by `add-reduction`. Iterates until all checks pass. Creates worktree + PR.
- [tutorial](skills/tutorial/SKILL.md) -- Interactive tutorial — walk through the pred CLI to explore, reduce, and solve NP-hard problems. No Rust internals.

## Codex Compatibility
Expand Down
49 changes: 49 additions & 0 deletions .claude/hooks/add-reduction-precommit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
# Pre-commit hook for add-reduction: blocks commits missing required files.
#
# This hook fires on any commit that stages a new rule file under src/rules/.
# It checks that the companion files (example_db test, paper entry, mod.rs)
# are also staged. If any are missing, the commit is blocked.
#
# Install: symlink or copy to .git/hooks/pre-commit
# ln -sf ../../.claude/hooks/add-reduction-precommit.sh .git/hooks/pre-commit

STAGED=$(git diff --cached --name-only)

# Only run for commits that add/modify rule files (not mod.rs or traits.rs)
RULE_FILES=$(echo "$STAGED" | grep "^src/rules/" | grep -v mod.rs | grep -v traits.rs | grep '\.rs$')
if [ -z "$RULE_FILES" ]; then
exit 0
fi

ERRORS=0

# Check example_db.rs is staged
if ! echo "$STAGED" | grep -q "example_db.rs"; then
echo "BLOCKED: src/unit_tests/example_db.rs not staged (Check 10 from #974)"
ERRORS=$((ERRORS + 1))
fi

# Check reductions.typ is staged
if ! echo "$STAGED" | grep -q "reductions.typ"; then
echo "BLOCKED: docs/paper/reductions.typ not staged (Check 11 from #974)"
ERRORS=$((ERRORS + 1))
fi

# Check mod.rs is staged
if ! echo "$STAGED" | grep -q "mod.rs"; then
echo "BLOCKED: src/rules/mod.rs not staged"
ERRORS=$((ERRORS + 1))
fi

# Check no verification artifacts are staged
if echo "$STAGED" | grep -q "docs/paper/verify-reductions/"; then
echo "BLOCKED: verification artifacts still staged — run git rm first"
ERRORS=$((ERRORS + 1))
fi

if [ $ERRORS -gt 0 ]; then
echo ""
echo "Fix the above and re-commit. See /add-reduction skill for details."
exit 1
fi
Loading
Loading