Skip to content

Commit 1a4d8d4

Browse files
committed
set workspace root
1 parent 72f2350 commit 1a4d8d4

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

demo/app/scenario_planning.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
st.set_page_config(page_title="Omen Strategic Reasoning", layout="wide")
2222
WORKSPACE_ROOT = Path(__file__).resolve().parents[2]
23+
DEMO_ROOT = WORKSPACE_ROOT / "demo"
24+
DEMO_DATA_ROOT = DEMO_ROOT / "data" / "scenarios"
25+
DEMO_OUTPUT_ROOT = DEMO_ROOT / "output"
26+
DEMO_ACTOR_ROOT = DEMO_ROOT / "data" / "actors"
2327

2428

2529
def _normalize_pack_id(value: Any) -> str:
@@ -63,8 +67,8 @@ def _read_json_file(*, base_dir: Path, pack_id: str, filename: str) -> dict[str,
6367

6468
def _load_sample_actor_payloads(pack_id: str) -> dict[str, Any]:
6569
safe_pack_id = _normalize_pack_id(pack_id)
66-
actor_dir = Path("demo/data/actors") / safe_pack_id
67-
actor_base = Path("demo/data/actors")
70+
actor_dir = DEMO_ACTOR_ROOT / safe_pack_id
71+
actor_base = DEMO_ACTOR_ROOT
6872
actor_profile_path = actor_dir / "actor_ontology.json"
6973
persona_path = actor_dir / "analyze_persona.json"
7074
status_path = actor_dir / "analyze_status.json"
@@ -586,10 +590,10 @@ def _render_flow_fallback(payloads: dict[str, Any]) -> None:
586590
with st.sidebar:
587591
st.header("Sample Data Source")
588592
st.warning("Demo mode: this app reads bundled demo artifacts only.")
589-
DATA_ROOT = "demo/data/scenarios"
590-
OUTPUT_ROOT = "demo/output"
591-
st.caption(f"Data root: {DATA_ROOT}")
592-
st.caption(f"Output root: {OUTPUT_ROOT}")
593+
DATA_ROOT = str(DEMO_DATA_ROOT)
594+
OUTPUT_ROOT = str(DEMO_OUTPUT_ROOT)
595+
st.caption(f"Data root: {DEMO_DATA_ROOT.relative_to(WORKSPACE_ROOT)}")
596+
st.caption(f"Output root: {DEMO_OUTPUT_ROOT.relative_to(WORKSPACE_ROOT)}")
593597

594598
candidates = discover_spec8_pack_candidates(data_root=DATA_ROOT, output_root=OUTPUT_ROOT)
595599
selected_pack = st.selectbox("Pack ID", options=candidates or [""], index=0)

0 commit comments

Comments
 (0)