Skip to content

Add reproducible scenario simulation and Stockpyl comparison - #18

Draft
falltwo wants to merge 2 commits into
mainfrom
agent/dag-20260912-7edaeaf2
Draft

falltwo wants to merge 2 commits into
mainfrom
agent/dag-20260912-7edaeaf2

Conversation

@falltwo

@falltwo falltwo commented Sep 13, 2026

Copy link
Copy Markdown
Owner

This PR adds an isolated scenario runner for one SKU and one purchase order. Given the same inputs, version, and seed, it produces the same result. The LLM does not participate in any numerical calculation.

The runner executes a deterministic baseline and compares it with Stockpyl using fixed tolerances. Inputs, computed results, and persisted output are validated. NaN, Infinity, arithmetic overflow, invalid containers, and values that cannot be serialized cause the run to fail, and the failure is still recorded for diagnosis.

Three synthetic fixtures cover normal operation, disruption, and substitution. Stockpyl remains pinned in requirements-scenario.txt; requirements-dev.txt includes it for tests and CI without adding it to production dependencies. Model limits, metric definitions, and the zero-demand fill-rate difference are documented in docs/research/scenario_validation.md.

Testing

  • Scenario suite: 87 passed
  • Remaining regression suite: 327 passed
  • Independent adversarial probes: exit 0
  • Combined with the Decision Case branch: 454 passed
  • GitHub Actions: passed

Scope

This change covers the reproducible research path only. It does not connect to the existing What-if UI, production database, ERP writes, multi-level BOMs, MCP, or DBOS. The fixtures and simulation results are test evidence, not business forecasts or benefit claims.

Add a single-SKU, single-PO Scenario contract, deterministic baseline and Stockpyl adapter, fail-closed validation, persisted results, fixtures, and regression coverage.
Install requirements-scenario.txt when present so Scenario and Stockpyl tests run in GitHub Actions without changing production dependencies.
@falltwo falltwo changed the title feat: add deterministic Scenario validation and Stockpyl comparison 新增可重算的情境模擬與 Stockpyl 比對 Sep 13, 2026
@falltwo falltwo changed the title 新增可重算的情境模擬與 Stockpyl 比對 Add reproducible scenario simulation and Stockpyl comparison Sep 13, 2026
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