Skip to content

Phase 3: entities → ProblemSpec projection (closes #340) - #346

Draft
aarontrowbridge wants to merge 1 commit into
mainfrom
amico/projection-340
Draft

Phase 3: entities → ProblemSpec projection (closes #340)#346
aarontrowbridge wants to merge 1 commit into
mainfrom
amico/projection-340

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #340

Roadmap: plan-20260812-142100-problemspecs-issimo-roadmap W2.1
Master spec: spec-20260717-020639-typed-problem-specs-piccolo-amicode (entities ↔ ProblemSpec mapping table)

What exists: solvespec v4 already routes problem_specPiccolo.Specs.solve_spec (PROBLEM_SPEC_RUNNER). What's missing is the authoring side: deterministic TS projection.

Changes:

  • packages/schema/src/project.ts — deterministic FormulationEntity + CompositeSystemProblemSpec per master spec table: parameterization→pulse.kind+template, min_time→goal_treatment both+free_dt+time objective, ensemble→sampling wrapper, leakage→options, custom→not spec-expressible fallback with reason, T/N/max_iter/integrator passthrough. Validated via ajv (problemspec schema) before write.
  • amicode_formulate v2: projects → ~/.amico/problems/<slug>/problem.toml (+ JSON sidecar) ajv-validated; entity TOMLs still written; fallback reason surfaced when not spec-expressible (script-tier).
  • amicode_solve v2: reads problem.toml/json, applies T/N/max_iter/integrator overrides, re-validates, rewrites spec, emits solvespec.json with problem_spec path (still never launches — bash workflow owns launch).
  • Rename workspace card problem.tomlcard.toml (and card.json) with legacy fallback + migration, freeing the basename for the ProblemSpec; teach kindForFilename (TS + Julia) to table-sniff legacy cards so amico-validate no longer misfires.
  • Vitest goldens for projection + disambiguation; script-tier fallback untouched.

Verification: pnpm --filter @amicode/schema test 168 passed; pnpm --filter amicode test 932 passed; @amicode/amico-run 1 pre-existing flaky agent_spawn failure (main also fails, unrelated). Do not merge.

)

Deterministic Formulation+CompositeSystem → ProblemSpec per master spec
mapping table (parameterization→pulse.kind+template, min_time→
goal_treatment both+free_dt+time objective, ensemble→sampling wrapper,
leakage→options, custom→not spec-expressible fallback with reason,
T/N/max_iter/integrator flow-through).

- packages/schema/src/project.ts: new pure projection, validated via ajv
- packages/schema/src/index.ts: export projection, table-sniff
  kindForFilename for legacy card vs spec (problem.toml collision)
- packages/schema/julia/validate.jl: parity sniff
- packages/extension/opencode-plugin/problems.ts: rename workspace card
  problem.toml→card.toml (card.json), legacy fallback + migration
- packages/extension/opencode-plugin/amicode_tools.ts: amicode_formulate
  v2 projects → problem.toml/json ajv-validated; amicode_solve v2 reads
  problem.toml, applies T/N/max_iter/integrator overrides, emits
  solvespec.json with problem_spec path (still never launches)
- vitest goldens in project.test.ts + card vs spec disambiguation

Roadmap: plan-20260812-142100-problemspecs-issimo-roadmap W2.1
Spec: spec-20260717-020639-typed-problem-specs-piccolo-amicode

Closes #340
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 548e9d94-f308-433d-ae4d-03adf55ad03a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

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.

Phase 3: entities → ProblemSpec projection; amicode_formulate/solve v2 emit scriptless solvespecs

1 participant