Skip to content

Commit f6bd4ca

Browse files
committed
actor simulate
1 parent fac8bb5 commit f6bd4ca

10 files changed

Lines changed: 375 additions & 62 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.12"]
12+
python-version: ["3.12", "3.13"]
1313
steps:
1414
- uses: actions/checkout@v5
1515
- name: Set up Python ${{ matrix.python-version }}

config/prompts/base.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ prompt_meta:
3333
scenario_enhance_prompt:
3434
id: base.scenario_enhance_prompt
3535
version: 1.0.0
36+
scenario_prior_prompt:
37+
id: base.scenario_prior_prompt
38+
version: 1.0.0
3639
prompts:
3740
system_prompt: |
3841
You are a strategic ontology engineer.
@@ -329,7 +332,7 @@ prompts:
329332
[[source_text]]
330333
331334
situation_decompose_prompt: |
332-
You are a strategy analyst. Decompose situation artifact into deterministic scenarios A/B/C.
335+
You are a strategy planner. Decompose situation artifact into deterministic scenarios A/B/C.
333336
Return ONLY valid JSON object with keys:
334337
pack_id, pack_version, derived_from_situation_id, ontology_version, scenarios.
335338
@@ -427,7 +430,7 @@ prompts:
427430
[[source_text]]
428431
429432
scenario_enhance_prompt: |
430-
You are a strategy analyst. Derive StrategicActor strategic_style from widely known historical similar cases.
433+
You are a organizational behavior analyst. Derive StrategicActor strategic_style from widely known historical similar cases.
431434
Return ONE valid JSON object only.
432435
433436
Required output keys:
@@ -451,3 +454,31 @@ prompts:
451454
strategic_actor_role: [[strategic_actor_role]]
452455
current_case_id_to_exclude: [[current_case_id_to_exclude]]
453456
actor_ontology_json: [[actor_ontology_json]]
457+
458+
scenario_prior_prompt: |
459+
You are a organizational behavior analyst. Score the probability of selecting scenario A/B/C based on StrategicActor style.
460+
Return ONE valid JSON object only.
461+
462+
Required output:
463+
{
464+
"raw_prior_scores": [
465+
{"scenario_key": "A", "score": 0.00-1.00, "explain": "..."},
466+
{"scenario_key": "B", "score": 0.00-1.00, "explain": "..."},
467+
{"scenario_key": "C", "score": 0.00-1.00, "explain": "..."}
468+
]
469+
}
470+
471+
Rules:
472+
- Use only StrategicActor style and scenario candidate definitions.
473+
- Evaluate behavioral fit, not textual overlap.
474+
- Treat this as a probability distribution problem. If one scenario is highly likely due to actor style, the others must be discounted accordingly to maintain the sum.
475+
- Provide A/B/C exactly once.
476+
- The sum of scores for A, B, and C MUST equal exactly 1.0 (A + B + C = 1).
477+
- score must be numeric and non-negative.
478+
- explain must be concise and decision-relevant.
479+
- Do not output markdown or extra keys.
480+
481+
actor_ref: [[actor_ref]]
482+
actor_style_json: [[actor_style_json]]
483+
scenario_candidates_json: [[scenario_candidates_json]]
484+
fallback_similarity_json: [[fallback_similarity_json]]

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "omenai"
7-
version = "0.1.2"
7+
version = "0.1.3"
88
description = "The AI-Powered open-source strategic reasoning engine."
99
readme = "README.md"
10-
requires-python = ">=3.12,<3.13"
10+
requires-python = ">=3.12"
1111
authors = [{ name = "StrategyLogic" }]
1212
license = "AGPL-3.0-or-later"
1313
license-files = ["LICENSE", "NOTICE.md"]

specs

Submodule specs updated from f4a4484 to 1895282

src/omen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Omen strategic reasoning engine package."""
22

33
__all__ = ["__version__"]
4-
__version__ = "0.1.2"
4+
__version__ = "0.1.3"

src/omen/cli/situation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def _append_scenario_decomposition_trace(
150150
scenario_artifact_path: Path,
151151
situation_ref: Path,
152152
decomposition_quality: dict[str, Any] | None,
153+
planner_trace: dict[str, Any] | None = None,
153154
) -> None:
154155
payload: dict[str, Any] = {}
155156
if trace_path.exists():
@@ -171,6 +172,11 @@ def _append_scenario_decomposition_trace(
171172
"validation_issues": list((decomposition_quality or {}).get("validation_issues") or []),
172173
"logic_issues": list((decomposition_quality or {}).get("logic_issues") or []),
173174
}
175+
if isinstance(planner_trace, dict):
176+
payload["scenario_planner"] = {
177+
"actor_style_enhancement": dict(planner_trace.get("actor_style_enhancement") or {}),
178+
"prior_scoring": dict(planner_trace.get("prior_scoring") or {}),
179+
}
174180
save_auxiliary_json(trace_path, payload)
175181

176182

@@ -455,6 +461,8 @@ def handle_scenario_command(args: Any) -> int:
455461
config_path=str(args.config),
456462
traces_dir=output_path_arg.parent / "traces",
457463
)
464+
planner_trace = dict(ontology.pop("_planner_trace", {}) or {})
465+
458466
output_path = save_scenario_ontology_slice(output_path_arg, ontology)
459467
markdown_path = output_path.with_suffix(".md")
460468
save_scenario_ontology_markdown(markdown_path, ontology)
@@ -464,6 +472,7 @@ def handle_scenario_command(args: Any) -> int:
464472
scenario_artifact_path=output_path,
465473
situation_ref=situation_path,
466474
decomposition_quality=ontology.get("decomposition_quality"),
475+
planner_trace=planner_trace,
467476
)
468477
print(f"Saved scenario planning artifact to {output_path}")
469478
print(f"Saved scenario planning summary to {markdown_path}")

0 commit comments

Comments
 (0)