intelligence-radar/tools/demo_advisor.py
tegwick 29ceb77938 Build reproducible capability advisor and scheduled source capture
Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a09c77-b1a9-7eb3-b501-6cb24b458c97
2026-09-13 23:07:41 +02:00

22 lines
1 KiB
Python

"""Synthetic advisor and frozen-replay demonstration in temporary storage."""
import json
from pathlib import Path
import sys
import tempfile
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from intelligence_radar.advisor import recommend, replay, render_report
repo = Path(__file__).resolve().parents[1]
with tempfile.TemporaryDirectory(prefix='radar-advisor-demo-') as directory:
root = Path(directory)
ident, report = recommend(root, json.loads((repo/'examples/task.json').read_text()),
json.loads((repo/'examples/advisor-catalog.json').read_text()),
json.loads((repo/'policies/advisor-v0.2.json').read_text()),
'2026-09-13', True)
assert replay(root, ident) == report
assert report['frontier'] == 'frontier-fixture'
assert report['efficient'] == 'efficient-fixture'
assert report['budget'] is None
print(render_report(root, ident))
print('Advisor demo passed; synthetic records stayed in temporary storage.')