Integration patterns
CI/CD pipeline
For a GitHub Actions pipeline that posts review comments on every PR without applying fixes:
daydream --non-interactive --comment
For an interactive local workflow that reviews, fixes, and tests:
daydream /path/to/project
For an unattended loop in CI that applies and validates fixes:
daydream --non-interactive --yes --loop 3
Phase A and Phase B split
When review and posting must run in separate steps (for example, review in a
pull-request trigger, posting in a workflow_run trigger), use the Phase A and
Phase B split:
# Phase A: review only, emit a findings artifact from the deep pipeline
daydream --findings-out findings.json --non-interactive /path
# Phase B: validate and post (separate job or trigger)
daydream post-findings findings.json --pr $PR --head-sha $SHA --repo owner/repo
The post-findings verb validates the artifact against event-derived facts
(confused-deputy gate), reconciles prior comments, minimizes stale findings, and
posts new ones.
PR feedback loop
When another bot (for example, CodeRabbit) has already posted review comments, Daydream can consume them, apply fixes, push, and respond:
daydream feedback 42 --bot coderabbitai[bot]
Corpus production
To produce a training corpus from the accumulated archive:
# 1. Harvest annotations from all indexed runs
daydream corpus harvest
# 2. Apply human labels for runs you have reviewed
daydream corpus label <session-prefix> --outcome accepted
# 3. Build the corpus with accepted-only filtering and stack stratification
daydream corpus build --out corpus.jsonl --stratify-by stack
Each build is reproducible. Pin the transaction time with --as-of to get the
same JSONL and the same lineage.json hash every time.
Fork customization
To run a customized Daydream — different phases, different review skills, your
own prompts — maintain a fork that adds a single top-level daydream_ext
package and nothing else. The package is discovered automatically
($DAYDREAM_EXT_DIR, else import daydream_ext) and mutates the per-run
registry: insert or remove flow steps, remap stack skills, add stacks for new
file types, and override prompts. Because no file under daydream/ changes,
the fork tracks upstream without merge conflicts.
daydream ext validate # resolve-check the extension before rolling it out
See Extensions for the module contract and recipes.