Skip to content

feat(sleep): local control-panel dashboard (stacked on evidence chain)#152

Open
Alphaxalchemy wants to merge 2 commits into
microsoft:mainfrom
Alphaxalchemy:feat/sleep-dashboard
Open

feat(sleep): local control-panel dashboard (stacked on evidence chain)#152
Alphaxalchemy wants to merge 2 commits into
microsoft:mainfrom
Alphaxalchemy:feat/sleep-dashboard

Conversation

@Alphaxalchemy

@Alphaxalchemy Alphaxalchemy commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Local control-panel dashboard for SkillOpt-Sleep

Stacked on the evidence-chain PR #151 — the first commit here is that PR; review only the second commit (dashboard.py / dashboard.html / CLI / dashboard tests) in this one. Kept separate deliberately so the observability substrate can be judged (and merged) independently of the UI that renders it.

Why

The evidence PR makes every night's chain recorded; this PR makes it inspectable and steerable by a human. The originating concern was the same audit: the sleep gate is strict by design, and when it rejects a night the user had no way to see why without spelunking JSONL by hand — and no way to adjust the four prompts driving the pipeline without editing source. If the long-term goal is validating the miner and evolving the prompts (the meta-loop sketched in the evidence PR), a human needs a place to read the exchanges and try prompt variants first.

What

  • skillopt_sleep/dashboard.py + dashboard.html — a stdlib-only (no dependencies added) local web control panel bound to 127.0.0.1, laid out to mirror the pipeline flow:
    • per-stage role / model / prompt display, with live prompt editing through the registry (overrides apply on the next model call);
    • a per-night evidentiary chain browser over evidence.jsonl — harvest, miner exchanges, mined tasks + checks, replay attempts, reflect edits;
    • the gate math spelled out (baseline/candidate formula, trials, decision);
    • config editor, run / dry-run launcher, and explicit adopt (nothing auto-adopts from the UI).
  • CLI: python -m skillopt_sleep dashboard [--port] [--no-browser].

Tests

TestDashboardApi added to tests/test_sleep_evidence.py: overview + HTML endpoints, prompt-override round-trip through the API, unknown-night 404. Pure stdlib, loopback only. Full suite: no new failures vs pristine main (same 11 pre-existing research-suite loader errors).

Live smoke: served a real project with 16 historical nights plus a live DeepSeek night; the rejected night's full chain, the verbatim miner exchange, and the gate arithmetic all render and were verified in the browser.

Series

Part 2 of 3: #151 (evidence chain + prompt registry) → this PR#153 (Antigravity harvest source (per the "more sources" direction of #97)).

* skillopt_sleep/evidence.py — append-only, thread-safe, redacted
  evidence.jsonl per night: harvest sessions -> miner exchanges (verbatim
  prompt/reply) -> mined tasks with checks -> split assignment -> every
  replay attempt (phase-tagged, cache hits marked) -> per-task scores with
  failing checks named -> reflect exchanges + parsed edits -> gate trials
  and the final decision with its score arithmetic -> staged artifacts.
  Config-gated (evidence_log, default on; evidence_max_chars cap).

* skillopt_sleep/prompts.py — central registry of the four LLM prompt
  templates (miner/attempt/judge/reflect), byte-identical defaults to the
  previously inlined strings; user overrides in prompts.json take effect
  on the next model call (mtime-checked), no restart needed.

* cycle.py builds dual backends from config (optimizer_*/target_*),
  pre-creates the staging dir so evidence lands beside the report;
  staging.new_staging_dir() de-collides same-second runs;
  latest_staging() now skips non-adoptable (evidence-only) folders.

* tests/test_sleep_evidence.py — 8 no-network stdlib tests: chain
  completeness, redaction/truncation/ordering, disable flag, prompt
  override round-trip + live effect, no-tasks-night adoption guard.
* skillopt_sleep/dashboard.py + dashboard.html — stdlib-only local web
  control panel (127.0.0.1) mirroring the pipeline flow: per-stage role/
  model/prompt display and live editing, per-night evidentiary chain
  browser (reads evidence.jsonl), gate math spelled out, config editor,
  run/dry-run launcher, and explicit adopt.

* New CLI: python -m skillopt_sleep dashboard [--port] [--no-browser].

* tests: TestDashboardApi — overview/HTML, prompt override round-trip
  via the API, unknown-night 404. Still pure-stdlib, loopback only.
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.

1 participant