-
Notifications
You must be signed in to change notification settings - Fork 49
feat(graph): add pre-rebuild-check Claude Code skill #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stmcgovern
wants to merge
3
commits into
python-wheel-build:main
Choose a base branch
from
stmcgovern:skill/pre-rebuild-check
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+92
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| Analyze a fromager build graph and recommend how to eliminate wasted wheel builds before the next bootstrap. | ||
|
|
||
| ## Step 1: Run the check | ||
|
|
||
| Parse $ARGUMENTS for a graph.json path and any flags (`--json`, `--constraints`). If no path is found, ask the user. | ||
|
|
||
| ```bash | ||
| fromager graph check [flags] <graph.json> | ||
| ``` | ||
|
|
||
| ## Step 2: Respond based on the outcome | ||
|
|
||
| ### All checks pass | ||
|
|
||
| One line. Offer to compare against another graph if relevant. | ||
|
|
||
| ### Structural failures (dangling edges or cycles) | ||
|
|
||
| These block everything — don't analyze conflicts. Report what failed: | ||
|
|
||
| - **Dangling edges**: which packages are missing from the graph | ||
| - **Cycles**: which packages form the cycle | ||
|
|
||
| Self-loops are warnings (exit 0). Mention briefly, don't treat as blockers. | ||
|
|
||
| ### Version conflicts found | ||
|
|
||
| Present build efficiency first, then conflicts grouped by leverage. | ||
|
|
||
| **At scale (5+ conflicts):** Group by binding parent. One parent that binds 4 packages is one line, not four. Show the top binding parents ranked by how many packages they'd free, then summarize the rest. | ||
|
|
||
| **Per conflict**, present problem and fix together: | ||
|
|
||
| > **`<package>`** — \<collapsible|required>, bound by `<parent>` (`<specifier>`) | ||
| > → <recommendation> | ||
|
|
||
| **Collapsible** recommendations: | ||
|
|
||
| - Internal binding parent → "relax the specifier in `<parent>`" | ||
| - Exact `==` pin → "upgrade `<parent>` (can't relax an exact pin)" | ||
| - Quick workaround → "add `<package>==<pin>` to constraints.txt" | ||
|
|
||
| **Required** → blocker. `write_constraints_file` will likely fail. The binding parent must change before rebuilding. | ||
|
|
||
| ## Step 3: Offer artifacts and next steps | ||
|
|
||
| After presenting findings, proactively offer: | ||
|
|
||
| - **Constraints block**: Run `fromager graph check --constraints <graph.json>` and present the output as a ready-to-paste block for constraints.txt. | ||
| - **Binding parent detail**: "Want me to check the specifiers on `<parent>`?" when a binding parent drives multiple conflicts. | ||
| - **Comparison**: If the user has another graph (previous build, different accelerator), offer to diff: "Want to compare against `<other-graph>`?" | ||
|
|
||
| ## What to trust | ||
|
|
||
| - **Collapsible is a guarantee.** The check is conservative relative to `write_constraints_file`. Don't hedge — recommend with confidence. | ||
| - **Required is conservative.** The resolver may cascade-resolve some. Say "will likely fail" not "will fail." | ||
|
|
||
| ## Don't | ||
|
|
||
| - Don't restate the raw output — interpret it | ||
| - Don't explain how the tool works | ||
| - Don't list every conflict individually when grouping by parent is clearer | ||
| - Don't suggest fixes for required conflicts beyond "update the binding parent" | ||
|
|
||
| ## Example response | ||
|
|
||
| For a graph with 419 wheels, 3 collapsible conflicts, and 1 required: | ||
|
|
||
| > **419 wheels built, 3 extra.** 1 required conflict blocks the next build. | ||
| > | ||
| > **Blocker:** | ||
| > | ||
| > - **`tokenizers`** — required, bound by `transformers==4.40.0` (`tokenizers<0.20,>=0.19`). No pin satisfies all consumers. Update transformers before rebuilding. | ||
| > | ||
| > **Eliminate 3 extra builds:** | ||
| > | ||
| > - **`datasets`** and **`huggingface-hub`** — both bound by `unsloth-zoo==0.1.0`. Relaxing unsloth-zoo's specifiers frees both. Pin: `datasets==2.20.0`, `huggingface-hub==0.23.0` | ||
| > - **`fsspec`** — bound by `datasets==2.19.0` (`fsspec>=2023.1.0,<2024.6.0`). Pin: `fsspec==2024.5.0` | ||
| > | ||
| > Ready-to-paste constraints: | ||
| > | ||
| > ``` | ||
| > datasets==2.20.0 | ||
| > huggingface-hub==0.23.0 | ||
| > fsspec==2024.5.0 | ||
| > ``` | ||
| > | ||
| > Want me to check unsloth-zoo's specifiers, or compare against a previous build? | ||
|
|
||
| $ARGUMENTS | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,5 +252,6 @@ __marimo__/ | |
|
|
||
| # Misc | ||
| .skip-coverage | ||
| .claude | ||
| .claude/* | ||
| !.claude/commands/ | ||
| /.beads/ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.