Skip to content

feat(cli): salvage generic scaffold refresh for review#27

Merged
blackopsrepl merged 2 commits intorelease/0.6.0from
codex/release-0.6.0-scaffold-salvage
Mar 22, 2026
Merged

feat(cli): salvage generic scaffold refresh for review#27
blackopsrepl merged 2 commits intorelease/0.6.0from
codex/release-0.6.0-scaffold-salvage

Conversation

@blackopsrepl
Copy link
Copy Markdown
Collaborator

@blackopsrepl blackopsrepl commented Mar 21, 2026

Summary

  • preserve the richer generic standard scaffold on the existing --basic path
  • add a generic --list scaffold while keeping --list=vehicle-routing
  • use published solverforge-ui = "0.2.0" in the salvaged generic templates
  • update scaffold coverage to exercise the preserved template work and generated-project cargo checks

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test
  • cargo test -p solverforge-cli --test scaffold_test
  • cargo test -p solverforge-cli --test scaffold_test -- --ignored

Review Notes

@blackopsrepl blackopsrepl force-pushed the codex/release-0.6.0-scaffold-salvage branch from 4ffc147 to 1279239 Compare March 22, 2026 12:43
@blackopsrepl blackopsrepl marked this pull request as ready for review March 22, 2026 12:43
@blackopsrepl blackopsrepl merged commit 70de978 into release/0.6.0 Mar 22, 2026
4 checks passed
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: 12792399cf

ℹ️ 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 +31 to +33
pub fn new(item_facts: Vec<Item>, containers: Vec<Container>) -> Self {
let all_item_indices = (0..item_facts.len()).collect();
Self { item_facts, containers, all_item_indices, score: None }
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 Keep all_item_indices aligned with posted item IDs

Because the list scaffold exposes ItemDto.index as the item identifier, callers will naturally send their own IDs (for example database keys). Plan::new() discards those IDs and always rebuilds all_item_indices as 0..len, so any container entry that still contains the original IDs is now absent from the list variable’s element collection. In that case /schedules and /schedules/analyze will solve or analyze a different problem than the one the client submitted, typically dropping every non-zero-based item from the sequence model.

Useful? React with 👍 / 👎.

Comment on lines +98 to +99
let name_to_idx: std::collections::HashMap<&str, usize> =
item_facts.iter().map(|i| (i.name.as_str(), i.index)).collect();
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 Reconstruct container sequences by item ID instead of name

This rebuilds each container’s items list through a HashMap<&str, usize> keyed on Item.name. That makes the new list scaffold non-round-trippable as soon as two items share the same display name: both positions resolve to the last matching item index, so one item disappears and another is duplicated when /schedules or /schedules/analyze parses the payload. The generic template does not require unique names, so this will bite real users who load repeated labels like "Task" or "Order".

Useful? React with 👍 / 👎.

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.

1 participant