| name | dreams |
| description | Review brain inbox drafts, preserve durable memory, archive evidence, sync GBrain, and optionally commit. Public workflow defaults to no push. |
| triggers | ["$dreams","dreams","review brain inbox","promote memory drafts","review gbrain drafts"] |
| mutating | true |
Dreams
Use $dreams to run the reviewed memory maintenance cycle for a user's own
brain repository. The brain markdown repo is the source of truth; GBrain is the
generated index/search layer.
Public defaults:
- brain root: explicit
--brain <path> or detected git brain repo
- apply: yes after validation
- sync: yes unless
--no-sync
- commit: yes unless
--no-commit
- push: no unless
--push is explicitly passed
Never index inbox/, archive/, raw/, hook payloads, transcript dumps,
review ledgers, .dreams/ state, or source snapshots as normal semantic
memory. They are filesystem/git provenance only. Only reviewed curated pages in
allowlisted namespaces should enter the generated index.
Public Contract
Draft review and indexing are separate stages:
- Inventory candidate drafts under the configured brain repo's
inbox/,
including inbox/auto/YYYY-MM-DD/*.md created by stop hooks.
- Read the brain repo rules before classifying drafts:
README.md,
AGENTS.md, schema.md, RESOLVER.md, and the target directory
README.md.
- Classify every draft with a memory handling mode:
preserve-full,
preserve-substantial, synthesize, source-note, discard, duplicate,
or blocked-safety.
- Promote only safe, durable, reviewed material into curated allowlisted pages.
- Preserve important user-authored reasoning when fidelity matters. Do not
flatten original theses, decisions, lessons, or distinctive wording into a
generic summary.
- Archive reviewed source snapshots for provenance after ledger validation.
- Run redaction, review-ledger, session-owner, session-state, curated-page, and
index-allowlist checks before declaring success.
- Sync after writes unless
--no-sync or --dry-run.
- Commit after validation unless
--no-commit or --dry-run.
- Do not push unless
--push is explicitly passed.
Memory Boundary
Only these namespaces are semantic memory by default:
people/
companies/
projects/
decisions/
gotchas/
concepts/
meetings/
originals/
Everything else is evidence unless the operator intentionally changes the brain
schema. If an indexed result comes from inbox/, archive/, raw/, source
snapshots, scripts, reports, or ledgers, treat it as contamination and fix the
indexing boundary rather than relying on it.
Safety Rules
- Never promote secrets, credentials, private keys, raw connection strings,
unredacted local paths, raw access instructions, or unredactable sensitive
data.
- Never copy raw stop-hook metadata such as
transcript_path, git_remote, raw
transcript text, or local evidence paths into curated pages.
- If a draft is unsafe, mark it
blocked-safety and leave it for manual
recovery rather than archiving or promoting it.
- If a fact is useful but weakly supported, promote only with low confidence,
explicit provenance, and a narrow claim.
- If a draft is duplicate, point at the existing curated target instead of
creating a competing page.
- Safety beats recall. A smaller safe memory is better than a searchable leak.
Importance Scorecard
Use importance_score to decide preservation depth. Score each dimension 0-3:
future_retrieval: how likely future agents/users will need this
durability: whether it remains useful beyond the current session
specificity: whether it contains concrete names, commands, dates, paths, or
constraints
authorship: whether it contains user-authored thinking or decisions
fidelity: whether exact wording/rationale matters
Guidance:
- high total or explicit full-preserve signal ->
preserve-full
- concrete durable fact/decision/gotcha ->
preserve-substantial
- useful but broad context ->
synthesize
- weak provenance but useful source pointer ->
source-note
- routine status/log noise ->
discard
- already represented in curated memory ->
duplicate
- unsafe or unredactable ->
blocked-safety
Review Ledger
Every handled draft must produce a review-ledger row before source archiving or
finalization. The row is the auditable bridge between unreviewed draft evidence,
curated page edits, and later retrieval checks.
Each non-safety row needs:
decision and preservation_mode
importance_score
evidence_quality and concrete quality_reason
- non-empty
memory_units
coverage explaining represented and discarded content
targets for any curated memory change
target_actions describing create/update/append/noop work
- sanitized provenance such as
source_anchor and source_excerpt_summary
Each memory_units[] item needs:
summary
status: durable, source-note, duplicate, discard, blocked-safety, or
status-noise
source_anchor: a short sanitized pointer to the reviewed draft section
importance_score
preservation_mode
- target linkage when it contributes to curated memory
For stop-hook sessions, source_anchor should include the relevant
segment-N or draft-M:segment-N marker when the draft has multiple capture
segments.
Session Owners
For stop-hook session_id groups, use one session-owner subagent per session
group when the host supports native subagents. This is the no-loss path for
large agent sessions.
- Every session-owner spawn must request
reasoning effort: xhigh. If the host
uses multi_agent_v1.spawn_agent, pass reasoning_effort: "xhigh" and omit
model unless the operator explicitly requested a model change.
- Spawn session owners as a bounded rolling queue: at most 6 session-owner subagents may be live at once.
Start up to six, then wait for a report to be written and accepted before opening the next owner.
- Never spawn all pending owner tasks at once.
- Each owner must write the required JSON report to the assigned
report_path.
A chat-only summary is not accepted coverage.
- Ledger rows for session drafts must include
session_owner_report with
session_id, agent_id, report_path, report_sha256, and
covered_review_units.
validate-session-owner-reports.rb and validate-review-ledger.rb must both
accept the binding before finalization.
For huge sessions, segment deterministically into segment-1..segment-N.
Non-durable segment content still needs coverage so important content does not
disappear silently.
Proposal And Evidence Gates
Before applying curated changes, create proposal mirrors under the session's
proposals/curated/ tree for every curated target. The proposal mirrors are the
reviewable full-file output for changed pages.
After applying, require:
- proposal mirrors match current curated files
- each changed target has a timeline/source entry
indexed_at is empty or pending before sync and stamped after successful
sync
archive/dreams-session-audits/<session-id>/session-owner-audit.json exists
for session-owner runs
gbrain evidence index-ledger --brain-repo "$BRAIN" --source <source_id> --session "$SESSION" --include-archive-excerpts updates the
source_evidence lookup layer for curated rows only
- at least one changed curated target is discoverable with
get_evidence({target_slug}) or the CLI equivalent
Evidence indexing must not make inbox/ or archive/ semantic memory. It is a
target-slug provenance lookup for reviewed curated claims.
Helper Scripts
Use the shipped helpers from this skill directory with explicit paths:
ruby skills/dreams/scripts/init-session-state.rb --brain "$BRAIN" --no-push
ruby skills/dreams/scripts/inventory.rb --brain "$BRAIN" --session "$SESSION" --copy-sources
ruby skills/dreams/scripts/prepare-session-owner-tasks.rb --session "$SESSION" --inventory "$SESSION/inventory.json"
ruby skills/dreams/scripts/validate-session-owner-reports.rb --session "$SESSION" --inventory "$SESSION/inventory.json"
ruby skills/dreams/scripts/validate-review-ledger.rb --brain "$BRAIN" --session "$SESSION" --require-proposal-artifacts
ruby skills/dreams/scripts/archive-reviewed-sources.rb --brain "$BRAIN" --session "$SESSION"
ruby skills/dreams/scripts/export-session-audit.rb --brain "$BRAIN" --session "$SESSION"
ruby skills/dreams/scripts/redact-staged-artifacts.rb --brain "$BRAIN" --apply
ruby skills/dreams/scripts/sync-temporal-metadata.rb --brain "$BRAIN"
ruby skills/dreams/scripts/stamp-indexed-at.rb --brain "$BRAIN" --timestamp "$INDEXED_AT"
ruby skills/dreams/scripts/check-index-allowlist.rb
ruby skills/dreams/scripts/finalize-session-state.rb --brain "$BRAIN" --session "$SESSION"
ruby skills/dreams/scripts/validate-session-state.rb --brain "$BRAIN" --session "$SESSION"
For public installations, --push is a separate explicit operator decision.
Readiness, passing tests, or a completed local commit do not authorize remote
publication.
Verification
Before reporting completion, run the relevant local gates:
ruby skills/dreams/scripts/test-inventory.rb
ruby skills/dreams/scripts/test-finalize-session-state.rb
ruby skills/dreams/scripts/test-validate-review-ledger.rb
ruby skills/dreams/scripts/test-validate-session-state.rb
ruby skills/dreams/scripts/test-session-owner-workflow.rb
ruby skills/dreams/scripts/test-check-index-allowlist.rb
ruby skills/dreams/scripts/test-redact-staged-artifacts.rb
If the run changed public package contents, also run the repository's public
Dreams/hook tests and package/privacy checks. Do not claim the public surface is
ready until the tests and privacy scan are fresh.