Skip to content

Refactor strategic actor simulation and improve scenario validation#19

Merged
RCFans merged 27 commits into
mainfrom
dev
Apr 6, 2026
Merged

Refactor strategic actor simulation and improve scenario validation#19
RCFans merged 27 commits into
mainfrom
dev

Conversation

@RCFans

@RCFans RCFans commented Apr 6, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 6, 2026 14:39
@RCFans RCFans merged commit a5f09a7 into main Apr 6, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the deterministic strategic-actor pipeline by (1) introducing template-driven planning inputs/outputs and (2) tightening validation around situation signals and scenario ontology ordering, while updating the CLI and tests to match the new artifact layout.

Changes:

  • Add YAML templates for situation signal extraction and scenario planning; normalize/enforce richer signal schema and deterministic A/B/C ordering.
  • Introduce a scenario planning orchestrator that emits auxiliary artifacts (planning_query.json, prior_snapshot.json) and update the omen scenario CLI defaults/pack-id handling accordingly.
  • Update deterministic simulate/compare to persist actor-derivation traces; remove NL compile flags and adjust smoke/integration/unit tests; bump version to 0.1.1.

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/omen/ingest/synthesizer/services/situation.py Loads signals.yaml, normalizes signal schema, and passes template/query payloads into LLM prompts.
src/omen/scenario/planner.py New planning orchestrator building planning query + prior snapshot and producing scenario ontology output.
src/omen/scenario/validator.py Enforces deterministic A/B/C ordering and validates richer situation signal schema.
src/omen/cli/situation.py Updates default artifact paths, allows pack-id situation references, and routes scenario planning through the new planner.
src/omen/cli/main.py / src/omen/cli/case.py Removes NL compile flags and adds actor derivation persistence into deterministic simulate/compare.
tests/* + docs/guides/situation-analysis.md Updates tests/docs to reflect new artifact paths and behavior; adds new coverage for planning stability and signal validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +43
pack_id = "strategic_actor_nokia_v1"
situation_path = tmp_path / "data" / "scenarios" / pack_id / "situation.json"
_write_situation_artifact(situation_path)

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The test writes the situation artifact to data/scenarios/<pack_id>/situation.json, but the CLI resolves a pack-id situation reference via resolve_situation_artifact_ref() to data/scenarios/<pack_id>/generation/situation.json. As written, omen scenario --situation <pack_id> will not find the artifact and the test will fail. Write the fixture to the generation/situation.json path (or call resolve_situation_artifact_ref(pack_id) and write to that).

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +41
- `data/scenarios/sap_v1/sap_reltio_acquisition_situation.json`
- `data/scenarios/sap_v1/sap_reltio_acquisition_situation.md`
- `data/scenarios/sap_v1/sap_reltio_acquisition_generation.json`

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

This guide still references the pre-refactor default output names/locations (e.g. sap_reltio_acquisition_situation.json, *_generation.json) but the CLI now defaults to data/scenarios/<pack_id>/generation/situation.json (and generation/generation.json). Please update the listed output paths to match the current CLI defaults to avoid misleading users.

Suggested change
- `data/scenarios/sap_v1/sap_reltio_acquisition_situation.json`
- `data/scenarios/sap_v1/sap_reltio_acquisition_situation.md`
- `data/scenarios/sap_v1/sap_reltio_acquisition_generation.json`
- `data/scenarios/sap_v1/generation/situation.json`
- `data/scenarios/sap_v1/generation/situation.md`
- `data/scenarios/sap_v1/generation/generation.json`

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +120
拿到 situation artifact 后,执行场景分解:

```bash
omen scenario --situation data/scenarios/sap_v1/sap_reltio_acquisition_situation.json
```

随后可继续:

```bash
omen simulate --scenario data/scenarios/sap_v1/sap_reltio_acquisition.json
```

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The command examples still use the old artifact filenames (*_situation.json / sap_reltio_acquisition.json). With the new defaults, scenario planning writes scenario_pack.json and the situation artifact lives under generation/situation.json. Update these example commands to match the new paths so copy/paste works.

Copilot uses AI. Check for mistakes.
Comment on lines 8 to +10
ROOT = Path(__file__).resolve().parents[2]
SCENARIO_PATH = ROOT / "data" / "scenarios" / "ontology.json"
NL_INPUT_PATH = ROOT / "tests" / "fixtures" / "scenario_compilation" / "nokia_nl_scenarios.json"

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

SCENARIO_PATH is now unused after switching the test to write a temporary scenario_pack.json. ruff check will flag this as an unused assignment; remove SCENARIO_PATH (and ROOT if it becomes unused) to keep lint passing.

Copilot uses AI. Check for mistakes.
Comment on lines 8 to +10
ROOT = Path(__file__).resolve().parents[2]
SCENARIO_PATH = ROOT / "data" / "scenarios" / "ontology.json"
NL_INPUT_PATH = ROOT / "tests" / "fixtures" / "scenario_compilation" / "nokia_nl_scenarios.json"

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

SCENARIO_PATH is now unused after switching the test to write a temporary scenario_pack.json. ruff check will flag this as an unused assignment; remove SCENARIO_PATH (and ROOT if it becomes unused) to keep lint passing.

Copilot uses AI. Check for mistakes.
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.

2 participants