Skip to content

feat(repl): /dream manual command + report rendering - #533

Merged
smallnest merged 1 commit into
masterfrom
feat/node-525-dream-command
Aug 1, 2026
Merged

feat(repl): /dream manual command + report rendering#533
smallnest merged 1 commit into
masterfrom
feat/node-525-dream-command

Conversation

@smallnest

Copy link
Copy Markdown
Owner

Summary

  • Intercept /dream and /dream --dry-run in the REPL loop (mirrors /compact /memory): spawn the process-isolated pigo --dream [--dream-dry-run] -C <cwd> subprocess, show a progress line, capture the single-line Report JSON on stdout, and render a full-table change report.
  • Full table: merged / deduped / paths-cleaned / pruned / distilled, bytes + files before→after, reconciled counts, and Notes. --dry-run reflects report.DryRun with a clear DRY-RUN label ("nothing written").
  • Error handling per SPEC §6.1: a pre-spawn read-only lock check surfaces "已有 dream 在运行" when a background dream holds a live lock; subprocess exit 1 or unparseable stdout prints a clear error without crashing the REPL. Subprocess bounded by a 10min timeout (SPEC §6.3).
  • RenderReportLine(report) exported for reuse by the startup background trigger (dream: startup background due-trigger + one-line summary #526). Added /dream to the /help command list.

Closes #525

Test plan

  • go build ./... && go vet ./... clean
  • go test ./internal/cli/repl/... ./internal/dream/... ./internal/cli/prompts/... green
  • Renderer unit tests: full table + one-line, DRY-RUN label, zero-value, byte formatting
  • Parse+render path via spawn seam with canned JSON (no real LLM), failure path, lock-held notice

Intercept /dream and /dream --dry-run in the REPL loop: spawn the
process-isolated `pigo --dream [--dream-dry-run] -C <cwd>` subprocess,
show a progress indication, capture the single-line Report JSON on
stdout, and render a full-table change report (merged/deduped/
paths-cleaned/pruned/distilled, bytes+files before→after, reconciled,
notes). --dry-run reflects report.DryRun with a clear DRY-RUN label.

A pre-spawn read-only lock check surfaces "已有 dream 在运行" when a
background dream already holds a live lock; subprocess exit 1 or
unparseable stdout prints a clear error without crashing the REPL
(SPEC §6.1). The subprocess is bounded by a 10min timeout (SPEC §6.3).

RenderReportLine is exported for reuse by the startup background
trigger (#526). Adds /dream to the /help command list.
@smallnest
smallnest merged commit b33576c into master Aug 1, 2026
1 check passed
@smallnest
smallnest deleted the feat/node-525-dream-command branch August 1, 2026 14:17
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.

dream: /dream manual command + report printing

1 participant