You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Rust library for NP-hard problem reductions. Implements computational problems w
7
7
These repo-local skills live under `.claude/skills/*/SKILL.md`.
8
8
9
9
-[run-pipeline](skills/run-pipeline/SKILL.md) -- Pick a Ready issue from the GitHub Project board, move it through In Progress -> issue-to-pr -> Review pool. One issue at a time; forever-loop handles iteration.
10
-
-[issue-to-pr](skills/issue-to-pr/SKILL.md) -- Convert a GitHub issue into a PR with an implementation plan. One item per PR: `[Rule]`issues require both models to exist on `main`; never bundle model + rule in the same PR.
10
+
-[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`.
11
11
-[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`.
12
12
-[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`.
13
13
-[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`.
Copy file name to clipboardExpand all lines: .claude/skills/add-model/SKILL.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,11 @@ Before implementation, verify that at least one reduction rule exists or is plan
55
55
56
56
**If associated rules are found:** List them and continue.
57
57
58
+
**If the issue explicitly claims ILP solvability in "How to solve":**
59
+
- One associated rule MUST be a direct `[Rule] <ProblemName> to ILP`
60
+
- Treat that direct ILP rule as part of the same implementation scope
61
+
- Do NOT split the model and its direct ILP rule into separate PRs
62
+
58
63
## Reference Implementations
59
64
60
65
Read these first to understand the patterns:
@@ -75,6 +80,7 @@ Before implementing, make sure the plan explicitly covers these items that struc
75
80
-`declare_variants!` is present with exactly one `default` variant when multiple concrete variants exist
76
81
- CLI discovery and `pred create <ProblemName>` support are included where applicable
77
82
- A canonical model example is registered for example-db / `pred create --example`
83
+
- If the issue explicitly claims direct ILP solving, the plan also includes the direct `<Problem> -> ILP` rule with exact overhead metadata, feature-gated registration, strong regression tests, and ILP-enabled verification
78
84
-`docs/paper/reductions.typ` adds both the display-name dictionary entry and the `problem-def(...)`
79
85
80
86
## Step 1: Determine the category
@@ -193,6 +199,19 @@ This example is now the canonical source for:
193
199
- paper/example exports via `load-model-example()` in `reductions.typ`
194
200
- example-db invariants tested in `src/unit_tests/example_db.rs`
195
201
202
+
## Step 4.7: Implement Direct ILP Rule When Claimed
203
+
204
+
If the issue explicitly says the model is solvable by reducing **directly** to ILP, implement `src/rules/<problem>_ilp.rs` in the **same PR** as the model. This is the one exception to the normal "one item per PR" policy: the direct `<Problem> -> ILP` rule is part of the model feature, not optional follow-up work.
205
+
206
+
Completeness bar:
207
+
- Feature-gate the rule under `ilp-solver` and register it normally
208
+
- Add exact overhead expressions and any required size-field getters; metadata must match the constructed ILP exactly
209
+
- Add strong tests in `src/unit_tests/rules/<problem>_ilp.rs`: structure/metadata, closed-loop semantics vs the source problem or brute force, extraction, `solve_reduced()` or ILP path coverage when appropriate, and weighted/infeasible/pathological regressions whenever the model semantics admit them
210
+
- Update CLI/example-db/paper paths so the claimed ILP solver route is actually usable and documented
211
+
- Verify with ILP-enabled workspace commands, not just non-ILP unit tests
212
+
213
+
A direct ILP rule shipped with a model issue must match the completeness bar of a standalone production ILP reduction. Do not add a stub just to satisfy the issue text.
@@ -206,6 +225,8 @@ Every model needs **at least 3 test functions** (the structural reviewer enforce
206
225
-**Serialization** — round-trip serde (when the model is used in CLI/example-db flows).
207
226
-**Paper example** — verify the worked example from the paper entry (see below).
208
227
228
+
If Step 4.7 applies, also add a dedicated ILP rule test file under `src/unit_tests/rules/<problem>_ilp.rs`. Use strong direct-to-ILP reductions in the repo as the reference bar: the tests should validate the actual formulation semantics, not just that an ILP file exists.
229
+
209
230
When you add `test_<name>_paper_example`, it should:
210
231
1. Construct the same instance shown in the paper's example figure
211
232
2. Evaluate the solution from the issue's **Expected Outcome** section as shown in the paper and assert it is valid (and optimal for optimization problems)
cargo test --features "ilp-highs example-db" --workspace --verbose
292
+
```
293
+
266
294
Structural and quality review is handled by the `review-pipeline` stage, not here. The run stage just needs to produce working code.
267
295
268
296
## Naming Conventions
@@ -292,3 +320,4 @@ Structural and quality review is handled by the `review-pipeline` stage, not her
292
320
| Schema lists derived fields | Schema should list constructor params, not internal fields (e.g., `matrix, k` not `matrix, m, n, k`) |
293
321
| Missing canonical model example | Add a builder in `src/example_db/model_builders.rs` and keep it aligned with paper/example workflows |
294
322
| Paper example not tested | Must include `test_<name>_paper_example` that verifies the exact instance, solution, and solution count shown in the paper |
323
+
| Claiming direct ILP solving but leaving `<Problem> -> ILP` for later | If the issue promises a direct ILP path, implement that rule in the same PR with exact overhead metadata and production-level ILP tests |
Copy file name to clipboardExpand all lines: .claude/skills/add-rule/SKILL.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,8 @@ Structural and quality review is handled by the `review-pipeline` stage, not her
193
193
194
194
- If the target problem already has a solver, use it directly.
195
195
- If the solving strategy requires ILP, implement the ILP reduction rule alongside (feature-gated under `ilp-solver`).
196
+
- A direct-to-ILP rule is a production reduction, not a stub. Match the completeness bar used by strong ILP reductions in this repo: exact overhead metadata, structure + closed-loop + extraction tests, weighted/infeasible/pathological regressions whenever the semantics require them, and ILP-enabled workspace verification.
197
+
- When this rule is the companion to a `[Model]` issue that explicitly claims ILP solvability, it belongs in the same PR as the model.
196
198
- If a custom solver is needed, implement in `src/solvers/` and document.
197
199
198
200
## CLI Impact
@@ -223,3 +225,4 @@ Aggregate-only reductions currently have a narrower CLI surface:
223
225
| Not adding canonical example to `example_db`| Add builder in `src/example_db/rule_builders.rs`|
224
226
| Not regenerating reduction graph | Run `cargo run --example export_graph` after adding a rule |
225
227
| Source/target model not fully registered | Both problems must already have `declare_variants!`, aliases as needed, and CLI create support -- use `add-model` skill first |
228
+
| Treating a direct-to-ILP rule as a toy stub | Direct ILP reductions need exact overhead metadata and strong semantic regression tests, just like other production ILP rules |
Copy file name to clipboardExpand all lines: .claude/skills/check-issue/SKILL.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,6 +227,7 @@ Applies when the title contains `[Model]`.
227
227
5. Check **How to solve** section:
228
228
- At least one solver method must be checked (brute-force, ILP reduction, or other)
229
229
- If no solver path is identified → **Warn** ("No solver means reduction rules can't be verified")
230
+
- If direct ILP solving is claimed, the issue must link a direct `[Rule] <ProblemName> to ILP` companion issue in the "Reduction Rule Crossref" section; otherwise → **Fail**
230
231
231
232
---
232
233
@@ -305,7 +306,7 @@ Check all template sections are present and substantive:
305
306
| Variables | Count, per-variable domain, semantic meaning |
306
307
| Schema | Type name, variants, field table |
307
308
| Complexity | Best known algorithm with citation **and** a concrete complexity expression in terms of problem parameters (e.g., `q^n`, `2^{0.8765n}`) |
308
-
| How to solve | At least one solver method checked |
309
+
| How to solve | At least one solver method checked; if ILP is claimed, a direct `[Rule] <ProblemName> to ILP` issue must be linked|
309
310
| Example Instance | Concrete instance that exercises the core structure |
310
311
| Expected Outcome | Satisfaction: one valid / satisfying solution with brief justification. Optimization: one optimal solution with the optimal objective value |
311
312
@@ -334,6 +335,7 @@ The formal definition must be **precise and implementable**:
334
335
- Optimization problems must include a concrete optimal solution and the optimal objective value
335
336
-**Detailed enough for paper**: This example will appear in the paper — it needs to be illustrative
336
337
-**Round-trip testable**: The example must be complex enough that a round-trip test (construct instance → solve → verify) can catch implementation bugs. A too-simple instance (e.g., 2 vertices, a single clause) may have a trivially correct solution that passes even with a wrong implementation. The example should have multiple feasible configurations with different objective values (for optimization) or a mix of satisfying and non-satisfying configurations (for satisfaction problems), so that correctness is meaningfully tested. Rule of thumb: the instance should have at least 2 suboptimal feasible solutions in addition to the optimal one.
338
+
-**ILP-testable when claimed**: If the issue advertises a direct ILP path, the example should be rich enough to support strong ILP closed-loop tests rather than a degenerate "any formulation passes" case.
Copy file name to clipboardExpand all lines: .claude/skills/issue-to-pr/SKILL.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ For `[Rule]` issues, `ISSUE_JSON` already includes `source_problem`, `target_pro
72
72
- If both `checks.source_model` and `checks.target_model` are `pass` → continue to step 4.
73
73
- If either is `fail` → **STOP**. Comment on the issue: "Blocked: model `<name>` does not exist in main yet. Please implement it first (or file a `[Model]` issue)."
74
74
75
-
**One item per PR:** Do NOT implement a missing model as part of a `[Rule]` PR. Each PR should contain exactly one model or one rule, never both. This avoids bloated PRs and repeated implementation when the model is needed by multiple rules.
75
+
**One item per PR, with one exception:** Do NOT implement a missing model as part of a `[Rule]` PR. `[Rule]` issues still require both models to exist on `main`. The only exception is a `[Model]` issue that explicitly claims direct ILP solvability: that PR should implement both the model and the direct `<Model> -> ILP` rule together.
76
76
77
77
### 4. Research References
78
78
@@ -89,7 +89,8 @@ Write implementation plan to `docs/plans/YYYY-MM-DD-<slug>.md` using `superpower
89
89
90
90
The plan MUST reference the appropriate implementation skill and follow its steps:
91
91
92
-
-**For `[Model]` issues:** Follow [add-model](../add-model/SKILL.md) Steps 1-7 as the action pipeline
92
+
-**For ordinary `[Model]` issues:** Follow [add-model](../add-model/SKILL.md) Steps 1-7 as the action pipeline
93
+
-**For `[Model]` issues that explicitly claim direct ILP solving:** Follow [add-model](../add-model/SKILL.md) Steps 1-7 **and**[add-rule](../add-rule/SKILL.md) Steps 1-6 for the direct `<Problem> -> ILP` rule in the same plan / PR
93
94
-**For `[Rule]` issues:** Follow [add-rule](../add-rule/SKILL.md) Steps 1-6 as the action pipeline
94
95
95
96
Include the concrete details from the issue (problem definition, reduction algorithm, example, etc.) mapped onto each step.
@@ -98,9 +99,14 @@ Include the concrete details from the issue (problem definition, reduction algor
- Batch 2: Step 6 (write paper entry — depends on batch 1 for exports)
100
101
102
+
For a `[Model]` issue with an explicit direct ILP claim, use:
103
+
- Batch 1: implement the model, register it, add the direct `<Problem> -> ILP` rule, and add model + rule tests
104
+
- Batch 2: write both the `problem-def(...)` and `reduction-rule(...)` paper entries, regenerate exports / fixtures, and run final ILP-enabled verification
105
+
101
106
**Solver rules:**
102
107
- Ensure at least one solver is provided in the issue template. Check if the solving strategy is valid. If not, reply under issue to ask for clarification.
103
-
- If the solver uses integer programming, implement the model and ILP reduction rule together.
108
+
- If a `[Model]` issue explicitly claims direct ILP solving, implement the model and the direct `<Problem> -> ILP` reduction together in the same PR. Do not leave the ILP rule as a follow-up.
109
+
- The direct ILP rule must meet the same completeness bar as a standalone production ILP reduction: exact overhead metadata, feature-gated registration, strong closed-loop / extraction / weighted / infeasible / pathological tests when applicable, CLI/example-db/paper integration, and ILP-enabled workspace verification.
104
110
- Otherwise, ensure the information provided is enough to implement a solver.
105
111
106
112
**Example rules:**
@@ -291,6 +297,6 @@ Run /review-pipeline to run agentic review (structural check, quality check, age
291
297
| Dirty working tree | Use `pipeline_worktree.py prepare-issue-branch` — it stops before branching if the worktree is dirty |
292
298
| Resuming wrong PR | Always validate `resume_pr.head_ref_name` contains `issue-{N}` before trusting it — GitHub search can return false positives |
293
299
|`prepare-issue-branch` inside worktree | Skip it when inside a `run-pipeline` worktree (CWD under `.worktrees/`) — the branch already exists |
294
-
| Bundling model + rule in one PR |Each PR must contain exactly one model or one rule — STOP and block if model is missing (Step 3.5)|
300
+
| Bundling unrelated model + rule in one PR |Keep the normal one-item-per-PR rule. The only exception is a `[Model]` issue that explicitly claims direct ILP solving, which should ship with its direct `<Model> -> ILP` rule|
295
301
| Plan files left in PR | Delete plan files before final push (Step 7c) |
296
302
|`make paper` or export steps changed tracked JSON after verification | Run `git status --short`, stage expected generated exports, and STOP if unexpected files remain before push |
0 commit comments