Skip to content

Add runnable example programs and update README example instructions#50

Merged
blackopsrepl merged 1 commit intomainfrom
codex/add-examples-directory-with-standard-examples-hzzrlj
May 7, 2026
Merged

Add runnable example programs and update README example instructions#50
blackopsrepl merged 1 commit intomainfrom
codex/add-examples-directory-with-standard-examples-hzzrlj

Conversation

@blackopsrepl
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide small, self-contained example programs covering scalar, list, mixed, and classic CSP problems to demonstrate typical use-cases.
  • Make README example instructions point to the crate-local examples and show concrete cargo run commands for each example variant.

Description

  • Added four example binaries under crates/solverforge/examples/: scalar_graph_coloring.rs, list_tsp.rs, mixed_job_shop.rs, and nqueens.rs, each implementing a small, documented demo problem.
  • Updated README.md examples section to reference crates/solverforge/examples/, added brief example type bullets (Scalar/List/Mixed) and replaced the single cargo run -p nqueens line with explicit cargo run -p solverforge --example ... invocations for each new example.

Testing

  • Built the workspace examples with cargo build --examples, which completed successfully.
  • Ran the test suite with cargo test, and all automated tests passed.

Codex Task

Generate model-owned source functions on planning solutions instead of public suffix extension traits. Move source metadata through __internal and add the hidden UnassignedEntity hook that powers fluent .unassigned().

Migrate tests, README, wireframes, and root examples to ConstraintFactory::for_each(Plan::field()). Replace the temporary minimal solver with root scalar, list, mixed, and nqueens SolverManager examples.
@blackopsrepl blackopsrepl force-pushed the codex/add-examples-directory-with-standard-examples-hzzrlj branch from d88b219 to d0232ce Compare May 7, 2026 09:34
@blackopsrepl blackopsrepl marked this pull request as ready for review May 7, 2026 09:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0232ce124

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +65 to +68
for node in solution.nodes {
let color = node
.color_idx
.and_then(|idx| solution.colors.get(idx))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Iterate nodes by reference before accessing colors

In the Completed branch, for node in solution.nodes moves the nodes field out of solution, and the loop body then reads solution.colors, which uses a partially moved struct and triggers a borrow checker error (E0382). This prevents the new scalar-graph-coloring example from compiling/building (including via the updated make examples target). Iterate with for node in &solution.nodes (or destructure fields first) so solution.colors remains accessible.

Useful? React with 👍 / 👎.

@blackopsrepl blackopsrepl merged commit cee6133 into main May 7, 2026
4 checks passed
@blackopsrepl blackopsrepl deleted the codex/add-examples-directory-with-standard-examples-hzzrlj branch May 7, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant