Repository navigation
refactor!: move constraint assembly out of src/constraints/mod.rs - #9
Merged
Merged
Conversation
…semble.rs The scaffold defined create_constraints inside an inline `mod assemble` in src/constraints/mod.rs, so every generated project carried code in a mod.rs. mod.rs now holds only the constraint-modules block, `mod assemble;` and `pub use assemble::create_constraints;`; src/constraints/assemble.rs defines create_constraints and owns the constraint-calls block, calling each module as `super::<id>::constraint()`. generate constraint, destroy constraint, check, the model contract and the neutral-scaffold replacement read and write both files through one ConstraintSources type, errors name the file they come from, and assemble.rs is never listed as a constraint. info.rs drops its duplicate list_constraints for the shared one. Test fixtures build the two files through test_support::constraint_sources. BREAKING CHANGE: Generated projects keep create_constraints and the constraint-calls block in src/constraints/assemble.rs, with each call written as `super::<id>::constraint()`; move them out of src/constraints/mod.rs before running generate, destroy or check.
SolverForge keeps module roots to module declarations and re-exports, and the scaffold now follows that rule. solverforge check enforces it for every mod.rs and lib.rs under src/: only `mod` declarations without a body, `use` and `extern crate` items, doc comments and the domain planning_model! manifest are allowed, and anything else is reported with the file and the item to move. The constraint manifest is held to the same rule when generate and destroy read it. Closes #8
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #8. Two commits: (1) breaking move of create_constraints and the constraint-calls block into src/constraints/assemble.rs; (2) solverforge check rejects code in any mod.rs or lib.rs. Local gate on the branch tip: fmt, clippy, unit, scaffold, runtime, MCP, install-skill, skill references and browser e2e all passed; slice 1 also passed unit and scaffold tests on its own.