Add browser dashboard, run tracing, and logged navigation decisions
- dashboard.py: stdlib http.server + JSON API (tree/trace/dream/status, POST submit/relabel); static/ single-page Redux-DevTools-style inspector - trace.py: runs.jsonl lifecycle events keyed by run_id - scheduler/skills/skill: every decision carries run_id; navigation choices now logged (navigate:category/leaf); requeues stamp meta.parent_run - cli: 'dashboard' subcommand; config.json untracked per-machine (see config.example.json)
This commit is contained in:
@@ -39,6 +39,7 @@ def test_pipeline_end_to_end(tmp_path):
|
||||
config = load_config()
|
||||
require_real(config)
|
||||
config["log"] = str(tmp_path / "decisions.jsonl")
|
||||
config["trace"] = str(tmp_path / "runs.jsonl")
|
||||
scheduler, config = build_scheduler(config)
|
||||
|
||||
inputs = [
|
||||
@@ -55,6 +56,16 @@ def test_pipeline_end_to_end(tmp_path):
|
||||
rows = scheduler.log.read()
|
||||
assert len(rows) > 0, "expected SemIf decisions to be logged"
|
||||
|
||||
phases = [r.get("extra", {}).get("phase") for r in rows]
|
||||
assert "navigate:category" in phases, "navigation decisions must be logged"
|
||||
assert "navigate:leaf" in phases, "navigation decisions must be logged"
|
||||
for row in rows:
|
||||
assert row.get("extra", {}).get("run_id"), "every decision must carry a run_id"
|
||||
|
||||
trace_rows = scheduler.trace.read()
|
||||
assert any(r["kind"] == "submit" for r in trace_rows)
|
||||
assert any(r["kind"] == "assessed" for r in trace_rows)
|
||||
|
||||
report = dream(scheduler.log)
|
||||
assert report.cross_entropy is not None
|
||||
print(report.render())
|
||||
@@ -70,6 +81,7 @@ def test_busy_choice_path(tmp_path):
|
||||
config = load_config()
|
||||
require_real(config)
|
||||
config["log"] = str(tmp_path / "decisions.jsonl")
|
||||
config["trace"] = str(tmp_path / "runs.jsonl")
|
||||
scheduler, config = build_scheduler(config)
|
||||
|
||||
scheduler.busy("driving on the freeway", skill="driving")
|
||||
|
||||
Reference in New Issue
Block a user