Commit 13249b3
feat: explicit variant declarations with complexity metadata (#102)
* fix: show full variant values in `pred show` variants list
The variants list now shows all values (e.g., MIS/SimpleGraph/i32)
instead of hiding default values. This makes it clear what graph and
weight types each variant uses.
The diff-from-default slash notation is still used for reduction edges
to keep them concise.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: support slash variant notation in pred create (e.g., MIS/KingsSubgraph)
- Use parse_problem_spec + resolve_variant instead of resolve_alias
so `pred create MIS/KingsSubgraph --graph ...` works
- Resolved variant from reduction graph is used in output JSON instead
of hardcoded variant maps
- Simplify KColoring and KSatisfiability branches by removing redundant
local variant variables
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* cli improvement
* feat: add DeclaredVariant marker trait
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add VariantEntry inventory struct
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add declare_variants! macro
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add declare_variants! to graph model files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add declare_variants! to remaining model files
Adds variant declarations for optimization (QUBO, SpinGlass, ILP),
satisfiability (Satisfiability, KSatisfiability), set (MaximumSetPacking,
MinimumSetCovering), and specialized (CircuitSAT, Factoring) models.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: #[reduction] now checks DeclaredVariant at compile time
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: ReductionGraph builds nodes from VariantEntry with complexity
Phase 1 now builds variant nodes from VariantEntry inventory (with
complexity metadata), then Phase 2 creates edges from ReductionEntry.
Adds variant_complexity() getter for querying a variant's time complexity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: include complexity in graph JSON export
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: display per-variant complexity in pred show
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: sort variants_for() deterministically (default variant first)
* chore: fix formatting, clippy, and doctest issues
- Remove unused `mut` from ensure_node closure
- Sort variants_for() deterministically (default variant first)
- Change declare_variants! doctest from `ignore` to `text`
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: cover VariantEntry Debug and variant_complexity None branch
Adds test coverage for the two uncovered patch areas:
- VariantEntry Debug formatting
- variant_complexity returning None for unknown problems
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: validate K-param consistency and extract shared CLI/MCP utils
- Add validate_k_param() to detect contradictions between variant suffix
(e.g., /K2) and --k flag (e.g., --k 3) for KColoring/KSatisfiability
- Extract shared helpers (ser, variant_map, parse_positions, LCG, random
graph generation) into util.rs to eliminate CLI/MCP duplication
- Apply consistent K-param validation in both CLI create and MCP
create_problem paths (including random generation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add design for review-implementation as parallel subagents
Split review-implementation into two parallel subagents (structural +
quality) dispatched with fresh context. Integrates with executing-plans
after each batch and standalone /review-implementation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add structural and quality reviewer prompt templates
Self-contained prompt templates for review subagents:
- structural-reviewer-prompt.md: model/rule checklists + semantic review
- quality-reviewer-prompt.md: DRY, KISS, HC/LC, HCI, test quality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: rewrite review-implementation as subagent orchestrator
SKILL.md now dispatches two parallel subagents (structural + quality)
with fresh context instead of running checks inline. Detection uses
git diff --diff-filter=A to find new model/rule files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: update review-implementation description in CLAUDE.md
Reflects new subagent-based dispatch and executing-plans integration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve PR review comments (dedup wrappers, MCP overhead, doc fix)
- Remove thin wrapper functions in create.rs, use util:: directly
- Add overhead info to MCP show_problem edge JSON (matching CLI output)
- Fix UnitDiskGraph variant type in design doc (f64 → i32)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove working plan files from branch
These were implementation plans consumed during development and are
no longer needed in the tree.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add copilot-review step after PR creation
Instructs the agent to run `make copilot-review` after creating a PR
to get GitHub Copilot code review feedback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* copilot review
* feat: add fix-pr skill for resolving PR feedback
New skill that handles:
- Fetching and triaging PR review comments (user + Copilot)
- Checking CI status via gh api
- Fixing codecov coverage gaps using gh api (not local cargo-llvm-cov)
- Structured workflow: gather -> triage -> fix -> verify -> report
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix MIS reduction
* fix MIS to UDG issue
* fix One default
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8c1bbdb commit 13249b3
57 files changed
Lines changed: 2415 additions & 650 deletions
File tree
- .claude
- skills
- fix-pr
- review-implementation
- docs
- paper/static
- plans
- src/reductions
- examples
- problemreductions-cli
- src
- commands
- mcp
- tests
- problemreductions-macros/src
- src
- models
- graph
- optimization
- satisfiability
- set
- specialized
- registry
- rules
- unitdiskmapping
- ksg
- unit_tests
- rules
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
122 | | - | |
| 124 | + | |
123 | 125 | | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
0 commit comments