alpha-test
Skill9 starsChanged 26 days agoApache-2.0View on GitHub
Run and diagnose the dreamd alpha suites at scripts/alpha/ — the cross-harness append→recall plumbing smoke test AND the memory-quality suites (salience-ranking / attribution / dream-cycle golden gate, plus an optional LLM-judge relevance report). Use when the user wants to alpha-test dreamd, run the alpha suite, verify cross-harness recall (claude-code ↔ cursor), test whether recall/memory is any *good* (not just that it happens), or debug why a check fails.
- Reads credentials
- Deletes or force-pushes
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- release-dreamdSkill
- SKILL.mdSkill
The file
Files
dreamd alpha test
Two automated suites live at scripts/alpha/:
- Plumbing (
alpha-suite.sh) — proves a learning appended by one harness is recalled by an independent second harness, on both the daemon path (Phase 2) and the no-daemon JSONL-replay path (Phase 1). Uses lexically-unique payloads, so it proves recall happens but says nothing about whether it's good. - Quality (
quality-suite.sh+ optionalquality_judge.py) — proves the memory is actually good through the MCP boundary: salience-weighted ranking, attribution, and dream-cycle promotion (deterministic gate), plus a fuzzy natural-language relevance report (LLM judge). See Quality suite below.
Both are the code-path proof only; the real GUI round-trip (actual Cursor / Claude Code MCP clients + screenshot) is the manual DEMO-4 runbook, out of scope.
Run
cargo build -p dreamd # both suites run target/debug/dreamd
scripts/alpha/alpha-suite.sh # plumbing — pass = "7 passed, 0 failed"
scripts/alpha/quality-suite.sh # quality golden gate — pass = "14 passed, 0 failed"
scripts/alpha/quality_judge.py # optional LLM-judge relevance report (needs an API key)Pass = exit 0 and 7 passed, 0 failed. Needs python3 and git on PATH.
The suite redirects HOME=$(mktemp -d), so your real ~/.agent daemon,
registry, and memory are never touched — it kills the daemon and deletes the
sandbox on exit.
The 7 checks (in order)
- Phase 2 (daemon up): (1) daemon binds its socket; (2) a
claude-codeappend mints anevt_…id; (3) a separatecursorprocess recalls that write (polls ~18s for the daemon's ~5s index-commit cadence). - Boundary: (4) socket is gone after the daemon is killed.
- Phase 1 (no daemon): (5) a
cursorappend mints anevt_…id; (6) a fresh process replays the JSONL and recalls it; (7) that replay also recalls the earlier Phase-2 write.
Diagnosing a failure
The sandbox is deleted on exit. To inspect logs, temporarily comment out
rm -rf "$SANDBOX" in the cleanup() trap, re-run, then read
$SANDBOX/daemon.log (the script prints the sandbox path on the first line).
| Failing check | Most likely cause → fix |
daemon never bound socket | Debug binary missing/stale → cargo build -p dreamd; or the daemon crashed at startup → read $SANDBOX/daemon.log. |
append errored / no event id minted | MCP handshake failed (driver emits {"fatal":"initialize failed"}), or the payload was rejected. append_node requires source_harness (omitting it = silent deser fail); content >4 KiB is rejected. |
phase2 cross-harness recall FAILED | Index-commit lag exceeded the ~18s poll on a slow box → widen the seq 1 6 / sleep 3 loop; or a real Phase-2 daemon-bridge regression. Not a stale index — see invariants. |
socket still present; not a true Phase 1 | Daemon didn't exit within 3s of SIGTERM → re-run, or widen the shutdown wait loop. |
phase1 recall FAILED | Episodic JSONL read-path broke. Check AGENT_LEARNINGS.jsonl for a torn/blank line — episodic::scan halts at the first blank or newline-less final line. |
phase1 did NOT recall the earlier write | WEG-378 read-path regression canary: the Phase-2 write must persist in the same JSONL and replay. This check exists specifically to catch that regression. |
Invariants when reading output
- Isolation, not reset. The suite needs no clean-slate step — the
HOMEredirection gives a fresh store every run. There is nodreamd reset --allcommand; never suggest one. (So a stale index can't cause failures here — don't chase that ghost; it was the pre-isolation failure mode of the old manual suite.) isErrorsubstring trap. An append success payload is{"isError": false, …}. A baregrep -i errorfalse-positives on it — detect success by the mintedevt_…id. Apply this rule if you add assertions.- Order is load-bearing. The daemon must be up before the MCP client starts (Phase 1 in-process mode is sticky for a client's whole session). The script already sequences daemon → client; preserve that order if you edit it.
Quality suite (is the memory any good?)
The plumbing suite can't see a ranking regression — with unique payloads there's
only ever one match. The quality suite closes that gap through the exact MCP
surface a real harness uses. Recall order is score = bm25 × salience, where
salience = exp(−age_days/14) × (pain/10) × (importance/10) × (1 + ln(1 + d(recurrence))),
where d(0) = 0 and d(r) = 1.5 - 0.5 / r.
quality-suite.sh — deterministic golden gate (14 passed, 0 failed):
- Ranking (the wedge): appends a high-pain/importance lesson and a benign one
that repeats the query terms (so the benign one has higher BM25); asserts the
painful one still ranks #1 and that
salience(not BM25) drove it. This is the headline "recent painful important learnings outrank stale benign ones" claim, proven end-to-end — not just in the core lib test (crates/dreamd-core/tests/bm25_fastfield_integration.rs, which never crosses MCP). - Attribution: asserts a recalled record reports the exact
source_harness+skill_actionit was appended with (the recall wire DTO carries both). - Promotion: appends ≥3 events sharing one
skill_action(PROMOTION_THRESHOLD=3), runsSOURCE_DATE_EPOCH=… dreamd dream --no-commit, asserts the cluster promoted intosemantic/LESSONS.mdwith arecurrence_counts.jsoncount ≥3.
quality_judge.py — LLM-judge relevance report (report-only, never a gate):
seeds a realistic lessons corpus, issues natural-language queries a dev would
type (no lexical overlap), and asks a model to score whether the top recalled
lesson answers each query. Auth resolves ANTHROPIC_API_KEY → ANTHROPIC_AUTH_TOKEN
→ an ant auth login profile; with none it skips cleanly and exits 0 (so it
never blocks CI). Model via DREAMD_JUDGE_MODEL (default claude-opus-4-8). It
prints per-query scores + a mean; a low mean means recall is lexically fine but
not relevant — a real product signal, not a test failure.
Diagnosing quality-suite failures
RANKING GATE failed→ salience isn't reaching the query-time score. Check thatappend_node'spain/importanceflow to the Tantivy fastfields and thatrecallmultiplies salience (seesalience.rs); a fresh regression here would also breakbm25_fastfield_integration.rs.ATTRIBUTION GATE failed→ the provenance fields (RecallResultJson.metadata) regressed; recentsource_harness/skill_actionwork is the suspect.PROMOTION GATE/RECURRENCE GATE failed→ the dream cycle didn't cluster the 3 events. Read$SANDBOX/dream.log; likely askill_actionsplit or window change, or SOURCE_DATE_EPOCH putting the events out of the cluster window.
Files
scripts/alpha/alpha-suite.sh— plumbing suite (the 7 checks above).scripts/alpha/quality-suite.sh— quality golden gate (ranking / attribution / promotion).scripts/alpha/quality_check.py— JSON assertion helper for the golden gate.scripts/alpha/quality_judge.py— optional LLM-judge relevance report (key-gated).scripts/alpha/mcp_driver.py— minimal MCP stdio client; one process = one simulated harness (initialize→notifications/initialized→tools/call).scripts/alpha/README.md— the suite's own overview.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

