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
daydream --review --findings-out findings.json --non-interactive
# 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.