feat(sleep): Antigravity harvest source + full SessionDigest evidence (re #97)#153
Open
Alphaxalchemy wants to merge 3 commits into
Open
feat(sleep): Antigravity harvest source + full SessionDigest evidence (re #97)#153Alphaxalchemy wants to merge 3 commits into
Alphaxalchemy wants to merge 3 commits into
Conversation
* 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.
…in evidence/dashboard * harvest_antigravity.py — digests Google Antigravity trajectory DBs (~/.gemini/antigravity/conversations/*.db): schema-less protobuf string walker extracts user prompts (step_type 14), artifact finals (5) and tool calls (33); filters the /goal system wrapper and tool-echo noise; copies each DB before opening to dodge live-writer locks. New transcript_source value: 'antigravity' (config + --source choice). * harvest evidence event now records the COMPLETE SessionDigest (all prompts/finals/tools/files/feedback), and the dashboard's Harvest section renders it as a full expandable digest view. * dashboard config grid: transcript source + max sessions/night.
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New harvest source: Google Antigravity conversations (+ full SessionDigest in evidence)
Stacked on #151 and #152 — review only the last commit here. Proposed separately and last on purpose: this source is Windows/Google-specific and reverse-engineered, so it shouldn't gate the evidence/dashboard work — but it directly answers the direction of #97 (harvesting from more agent surfaces than Claude Code): same ask, different editor — the point is that
transcript_sourceis pluggable, and this PR both adds a source and exercises the seam a Copilot source would use.Why
SkillOpt-Sleep can only learn from what it can harvest. Users who do their daily work in other agentic editors have their richest transcripts outside
~/.claude. In this case the user's real corpus lives in Google Antigravity:~/.gemini/antigravity/conversations/— 273 SQLite "trajectory" databases, one per conversation, protobuf-encoded steps, no documented schema. The format was cracked empirically: step type 14 = user prompts, type 5 = artifact/answer content, type 33 = tool calls.The second half of this PR closes an evidence gap the new source exposed: the harvest evidence event previously recorded only a head excerpt of each session, so the chain's very first link ("these transcripts went in") was weak. It now records the complete SessionDigest — every user prompt in full, assistant finals, tools used, files touched, feedback signals, timestamps, source — and the dashboard's Harvest section renders each as an expandable digest card. That makes the transcripts → mined-checks link in the evidence chain verifiable end-to-end, which is a prerequisite for scoring the miner against what the user actually asked.
What
skillopt_sleep/harvest_antigravity.py— newtranscript_source: "antigravity"(config +--source):/goalsystem wrapper andread_url(...)-style tool-echo noise out of the prompt stream;Verified
Live run on the 3 most recent real Antigravity sessions: harvested 3 → DeepSeek mined 1 checkable task → reflect proposed 4 edits → gate rejected all (0.167 → 0.167, no strict improvement) in ~20s / ~7k tokens / 31 evidence events — with the recovered user prompts verbatim and clean in the digest view. Full test suite: no new failures vs pristine
main.Honest caveats