Skip to content

refactor!: move constraint assembly out of src/constraints/mod.rs - #9

Merged
blackopsrepl merged 2 commits into
mainfrom
feature/constraint-assembly-file
Nov 9, 2026
Merged

blackopsrepl merged 2 commits into
mainfrom
feature/constraint-assembly-file

Conversation

@blackopsrepl

Copy link
Copy Markdown
Contributor

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.

…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
@blackopsrepl
blackopsrepl merged commit 5b4c563 into main Nov 9, 2026
8 checks passed
@blackopsrepl
blackopsrepl deleted the feature/constraint-assembly-file branch November 9, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor!: move constraint assembly out of src/constraints/mod.rs

1 participant