Skip to content

Make problem creation registry-driven and model-owned - #1132

Merged
isPANN merged 7 commits into
1075-growth-domainfrom
codex/dynamic-create-schema
Aug 12, 2026
Merged

Make problem creation registry-driven and model-owned#1132
isPANN merged 7 commits into
1075-growth-domainfrom
codex/dynamic-create-schema

Conversation

@isPANN

@isPANN isPANN commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace the monolithic derived CreateArgs with a deferred, registry-driven Clap parser
  • derive every selected variant’s flags and concrete numeric parsers from its typed construction contract
  • move exceptional construction semantics into model-local CreateSpec + TryFrom implementations
  • make CLI and MCP invoke the same registered constructor and emit canonical serialized model JSON
  • make optional random generation a model-owned, per-variant capability
  • keep the existing algebraic/formula/graph/misc/set taxonomy while declaring each category explicitly as typed schema metadata
  • remove superseded model-name dispatch, derived-field tables, compatibility aliases, schema-semantic branches, and the enlarged-thread-stack workaround
  • keep static shell completion generation shallow so it does not recursively expand every model’s dynamic flags

Resulting extension contract

An ordinary new model registers its schema and variants in the model module; CLI and MCP discover it without frontend changes. A model whose public construction input differs from its persisted representation defines a local typed CreateSpec and fallible conversion. Random generation is registered only for variants with a meaningful generator. Each schema explicitly selects one of the five established structural categories.

Unknown inputs, missing required inputs, invalid values, unsupported random generation, and missing registry metadata fail explicitly. There are no model-name fallbacks in CLI or MCP.

Stack

Known trade-offs

  • pred create builds lightweight subcommand shells for registered variants, but expands dynamic flags only for the selected variant. Startup work therefore remains linear in the number of registered variants.
  • Static shell completions include the stable command/problem layer but intentionally omit dynamically expanded per-model flags.

Verification

  • cargo test --workspace --all-targets --features mcp
  • cargo test -p problemreductions-cli --all-targets --features mcp
  • cargo test -p problemreductions --doc
  • cargo clippy --workspace --all-targets --features mcp -- -D warnings
  • construction-contract, random-contract, bounded-stack, numeric-parser, category-filter, and graph-export focused tests
  • manual pred list, unknown-category, SCS derived-field, and composite graph construction checks

Closes #1133
Closes #1135

* refactor: declare model categories explicitly

* refactor: preserve typed categories in graph export
@isPANN isPANN changed the title Build create arguments lazily from problem schemas Make problem creation registry-driven and model-owned Aug 12, 2026
@isPANN
isPANN merged commit 7cf3bac into 1075-growth-domain Aug 12, 2026
@isPANN
isPANN deleted the codex/dynamic-create-schema branch August 12, 2026 10:51
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