Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Definition of done

Cerebro generates the whole fleet dashboard, cron rebuilds it three times a day (crontab -l lists 0 5,9 * * * and 59 23 * * *), and agents answer questions from that output over MCP. No file in this repository says what “done” would look like. Issue #121 records the gap, and issue #120 records the version consequence. This page is the exit predicate for 1.0.0.

Accepted by the maintainer on 2026-11-24, which makes it the standard, not a suggestion. Accepting the definition and meeting it are different acts: two criteria below fail, so cerebro-v1.0.0 cannot be cut yet and no version number moved. Each criterion below carries the command that checks it, because a criterion without a measurement is a wish. Where the definition needs judgement rather than a number, the question sits in Open questions for the maintainer instead of being answered here.

Premise

The claim cerebro makes about itself is small and testable. It says a journal page tells you what you did that day. Everything else the dashboard prints, the project pages, the statistics, the TODO list, the TUI, reads from the same collectors, so the definition anchors on the journal rather than on a feature count.

Two facts about the commit collector make that anchor the right one:

  • crates/cerebro-core/src/storage.rs:120 keeps the 20 newest commits from HEAD and drops the rest, and storage.rs:128 stores the committer instant rather than the author instant.
  • crates/cerebro/src/generators/journal.rs:40 regenerates each day page from whatever the collector returns on the day the build runs.

Put together, those mean a day page describes the moment it was built instead of the day it names. Issue #114 is open on exactly that. A definition of done that skips this fact describes a demo, not a record.

What 1.0.0 means

1.0.0 means the journal tells you what you actually did.

One sentence, six criteria, and a command beside each one. Criteria 3 and 5 fail today. Criterion 6 is partial. Criteria 1, 2, and 4 pass, each with a caveat recorded next to it, and this page says which is which.

Release predicate. A 1.0.0 tag is cut by hand, by the maintainer, on a machine where every criterion passes against his own cortex. It is never a side effect of a commit marker. See Version policy.

Criteria

Each criterion lists the command that checks it and the result of running that command on this machine on 2026-11-23. The build under test is main at 822cab9, the installed binary is cerebro 0.5.0, and the live configuration is ~/.config/cerebro/config.toml with timezone = "America/New_York" and output_dir = "/Users/ryan/Projects/cortex/content".

The lab recipes write only under a temporary directory and run with HOME pointed inside it, so they cannot write to the live cortex or the shared cache at ~/Library/Caches/cerebro/cache.json. Never run any recipe here against the real configuration with --fresh. That rewrites recorded days.

1. One page holds one local calendar day

A day page names the zone it buckets in, and every entry on it belongs to that civil day in that zone.

Measure.

page="$HOME/Projects/cortex/content/journal/2026/11/21.md"
head -2 "$page"                                    # the bucketing comment
grep -c '5040e67' "$page"                          # the 19:11 probe commit
awk '/^## /{p=$2} /^- `/{split($0,a,"`"); print p, a[2]}' "$page" |
  while read -r p h; do
    TZ=America/New_York git -C "$HOME/Projects/$p" show -s \
      --date=format-local:%Y-%m-%d --pretty=%cd "$h"
  done | sort -u

The first command must print <!-- days bucketed in America/New_York -->, which day_bucket_note() in crates/cerebro-core/src/time.rs writes into every generated day page. The second must find 5040e67, committed at 19:11 local on 21 November, which is 2026-11-22 00:11 UTC. The UTC frame that issue #113 removed filed it under 22 November. The third block resolves every hash on the page back to its stored day, and it must print one date. The last command assumes a project’s directory name matches its config name, which holds for this cortex.

Result. Pass. The comment is present, grep -c returns 1, and the last block printed a single line, 2026-11-21, for all 27 commits on the page. A clean sandbox build of a repository with commits at 14:02 and 19:11 on 21 November put both of them on journal/2026/11/21.md.

Frame caveat. Cerebro buckets the committer instant. Three activitypub-habits commits authored on 22 November sit on the 21 November page because their committer instants land there. Counting 21 November by author date gives 63 commits across 9 repositories, and by committer date gives 65. Which instant owns a day is a decision, not a bug, so it goes to Open questions.

2. Every reader finds the page the generator wrote

cerebro journal read and the MCP read_journal tool return the bytes the generator wrote, from the shipped configuration, with no per-command path argument.

Measure.

page="$HOME/Projects/cortex/content/journal/2026/11/21.md"
cerebro journal read 2026-11-21 | jq -j .content > /tmp/cli-page.md
cmp /tmp/cli-page.md "$page" && echo "CLI IDENTICAL"
printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"check","version":"0"}}}' \
  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"read_journal","arguments":{"date":"2026-11-21"}}}' |
  cerebro mcp 2>/dev/null | grep '"id"' | tail -1 |
  jq -r '.result.content[0].text' | jq -j .content > /tmp/mcp-page.md
cmp /tmp/mcp-page.md "$page" && echo "MCP IDENTICAL"

cerebro journal read 2026-11-21 must report "exists": true. A false answer here is issue #116 coming back.

Result. Pass on the configuration in use. jq -r .exists returned true, and both cmp runs reported the page byte for byte, 2672 bytes each.

Resolution caveat. The two readers agree because they apply the same rule, not because they follow settings.output_dir. The command resolves the parent of output_dir and then joins the literal content (content_root_of_config in crates/cerebro/src/main.rs, then crates/cerebro-core/src/queries/journal.rs), and the MCP server joins content under CORTEX_PATH. Both hold while output_dir ends in a directory named content, which is the documented default and this machine’s setting. A configuration that names anything else splits the generator from its readers.

Measure the split.

SB=$(mktemp -d)/split; mkdir -p "$SB/repo" "$SB/pages" "$SB/home"
printf 'work\n' > "$SB/repo/w.txt"
git -C "$SB/repo" init -q
git -C "$SB/repo" add -A
git -C "$SB/repo" -c user.name=t -c user.email=t@e.invalid commit -qm first
cat > "$SB/config.toml" <<TOML
[settings]
output_dir = "$SB/pages"
timezone = "America/New_York"

[[projects]]
name = "split"
repo_path = "$SB/repo"
active = true
TOML
HOME="$SB/home" cerebro -c "$SB/config.toml" build --fresh
find "$SB/pages/journal" -name '*.md'   # the generator wrote here
HOME="$SB/home" cerebro -c "$SB/config.toml" journal read "$(date +%F)"

Result. The build writes $SB/pages/journal/2026/11/23.md, and the read command answers "exists": false, because it looks in $SB/content. The same mismatch is a narrower form of #116 and the MCP server behaves the same way. Whether 1.0.0 owes a fix or a documented constraint is an open question.

3. A day’s contents do not depend on when the page was built

Rebuild the same day twice, with no change to that day’s history, and the page must say the same thing.

This criterion fails today. It is the one that blocks 1.0.0.

Measure the field case. Issue #114 recorded one Saturday, 2026-11-21, against real history of 60 commits in 9 repositories. Same page, same underlying day, read three times in one day.

timebuilt bypage claimed
11:2xcerebro build --fresh9 projects / 57 commits
~22:0xread again8 projects / 47 commits
23:59the 59 23 * * * cron8 projects / 27 commits

Nothing about Saturday changed between those readings. The clock moved, so the record got smaller.

Measure it yourself. The live page for the same day has not recovered.

grep -m1 '^\*\*Activity' "$HOME/Projects/cortex/content/journal/2026/11/21.md"

Result. **Activity:** 8 projects | 0 sessions | 27 commits. Other builds on this machine rewrote that page twice while this document was being written, at 08:00:09 and at 09:13:29, and both rewrites printed the same claim. The day holds 63 commits authored in the configured zone (see criterion 5 for that recipe). Two of the commits the #113 investigation pinned, 2d849d3 in zine-planner at 20:51 and dbde4c4 in listsome at 18:59, are ancestors of their HEAD and appear on no page anywhere under content/. grep -rl 2d849d3 "$HOME/Projects/cortex/content/" returns nothing.

Reproduce it in a sandbox. This is the check that does not depend on shared state. It adds five commits dated Saturday, builds, then adds seventeen commits dated Monday and builds again. Nothing about Saturday changes in between.

SB=$(mktemp -d)/cap; mkdir -p "$SB/repo" "$SB/content" "$SB/home"
cd "$SB/repo" && git init -q
git config user.name probe && git config user.email probe@example.invalid
put() { echo "$2" >> work.txt; git add -A
        GIT_AUTHOR_DATE="$1" GIT_COMMITTER_DATE="$1" git commit -qm "$2"; }
for i in 1 2 3 4 5; do put "$(printf '2026-11-21T10:%02d:00-05:00' "$i")" "saturday work $i"; done
cat > "$SB/config.toml" <<TOML
[settings]
output_dir = "$SB/content"
timezone = "America/New_York"

[[projects]]
name = "probe"
repo_path = "$SB/repo"
active = true
TOML
HOME="$SB/home" cerebro -c "$SB/config.toml" build --fresh
grep -m1 '^\*\*Activity' "$SB/content/journal/2026/11/21.md"
for i in $(seq -w 1 17); do put "$(printf '2026-11-23T10:%s:00-05:00' "$i")" "monday work $i"; done
HOME="$SB/home" cerebro -c "$SB/config.toml" build --fresh
grep -m1 '^\*\*Activity' "$SB/content/journal/2026/11/21.md"

Result. The first build prints 1 projects | 0 sessions | 5 commits. The second prints 1 projects | 0 sessions | 3 commits, while git log --pretty=%ad --date=format-local:%Y-%m-%d | grep -cx 2026-11-21 still answers 5. A busy day is also capped at 20 no matter when it is built, which is why zine-planner’s 21 commits on 2026-11-21 could never all appear.

There is a second mode, and it is worse for a record. Keep adding Monday commits until the collector returns nothing for Saturday, then build. The Saturday page is not rewritten and not pruned. It keeps the total from an earlier build, so the number on disk describes a build that no longer happened.

cd "$SB/repo"
for i in $(seq -w 1 20); do put "$(printf '2026-11-23T14:%s:00-05:00' "$i")" "monday afternoon $i"; done
stat -f '%Sm %N' -t '%F %T' "$SB/content/journal/2026/11/21.md"
HOME="$SB/home" cerebro -c "$SB/config.toml" build --fresh
stat -f '%Sm %N' -t '%F %T' "$SB/content/journal/2026/11/21.md"
grep -m1 '^\*\*Activity' "$SB/content/journal/2026/11/21.md"

Result. Both stat lines printed 2026-11-23 08:18:57, the modification time of the earlier build, and the page still claimed 3 commits after the current build found none for that day. Fixing #114 stops new loss. It does not restore pages that older builds already shrank, so the recorded history needs a decision of its own. See Open questions.

4. Hand-written notes reach the page intact

A second-level heading in a manual note survives the fold into the generated project page.

Measure. Reuse the sandbox from criterion 3.

mkdir -p "$SB/content/notes/projects"
printf '# probe\n\n## Roadmap\n\nCut the exit predicate.\n\n## Catalog\n\nNot a journal.\n' > "$SB/content/notes/projects/probe.md"
HOME="$SB/home" cerebro -c "$SB/config.toml" build --fresh
grep -n '^##\|^Cut the exit\|^Not a journal' "$SB/content/projects/probe.md"

Result. Pass for the unknown heading. The generated page carries ## Roadmap inside the Status section with its body under it, which is the fix issue #112 asked for. The grep line numbers put ## Roadmap before the body it names.

One shape is still lossy. A heading that matches a routing keyword by substring is consumed, because parse_manual_notes tests contains rather than an exact heading. The ## Catalog section in that same note moves its prose under ## Journal and loses its own label, which the same grep shows. Not a journal. sits below a ## Journal heading, and no ## Catalog heading exists in the output. The live cortex cannot show that case, because the notes named in the #112 report were rewritten by hand before the fix landed. content/notes/projects/posty.md now carries those sections at third level.

5. Answering “what did I work on yesterday” needs no re-derivation

The dashboard must be the first place you look, and the answer must stand.

Measure. Compare what the page claims to what git says about the day.

DAY=2026-11-21
total=0; repos=0
while IFS= read -r p; do
  n=$(TZ=America/New_York git -C "$p" log --pretty=%ad --date=format-local:%Y-%m-%d 2>/dev/null |
      grep -cx "$DAY")
  if [ "$n" -gt 0 ]; then repos=$((repos + 1)); total=$((total + n)); printf '%4d  %s\n' "$n" "$(basename "$p")"; fi
done <<< "$(python3 -c 'import tomllib,os
c = tomllib.load(open(os.path.expanduser("~/.config/cerebro/config.toml"), "rb"))
print("\n".join(os.path.expanduser(x["repo_path"]) for x in c["projects"] if x.get("active", True)))')"
echo "git: $total commits across $repos repos for $DAY"
grep -m1 '^\*\*Activity' "$HOME/Projects/cortex/content/journal/2026/11/21.md"

Result. Fail. git answers 63 commits across 9 repositories and the page answers 8 projects and 27 commits. The gap is uneven, so no single correction factor fixes it.

repositoryauthored on 2026-11-21on the page
zine-planner212
fretsome112
listsome11section absent
activitypub-habits69
cortex66
cerebro33
following-function22
project-plan22
yourPalRyan11

activitypub-habits reads high for the same reason the others read low. The collector sorts by the committer instant, so work committed later lands on a different day than the day it was authored. The audit that produced issue #114 counted 60 commits for that Saturday and this recipe prints 63 today, which is the same instability seen from the other side. Ground truth moves when branches move, and the page moves when the clock moves.

6. Coverage is stated honestly

Every directory cerebro discover classifies as unregistered is registered, denied by name, or written down as out of scope. Nothing sits in the gap between “the dashboard ignores it” and “nobody decided that was fine”.

Measure.

cerebro status | grep -A 4 'Project coverage'
cerebro discover | grep -A 8 'Unregistered, proposed'

Result. Partial, and the gap is small enough to name in one sitting.

Config registers 134 projects; 203 directories under /Users/ryan/Projects
Unregistered directories: 72 (5 proposed, 17 upstream clones without your commits, 26 worktrees, 15 empty, 9 denied, 0 name conflicts)
Stale config entries (path gone): 3 (cerebro-ci, cerebro-fix, rpdc.fix-logging-env-hardening)

The 17 upstream clones, 26 worktrees, 15 empty repositories, and 9 denied names are classified by ADR-0015 and each one has a reason attached, so those are honest. The 5 proposed directories and the 3 stale entries are not. None of the five are git repositories, which is why they stay proposals rather than registrations, and the three stale entries are config lines pointing at paths that no longer exist.

Coverage numbers move between runs. The audit behind issue #121 measured 207 directories, 74 unregistered, 4 proposed, 29 worktrees, and 1 stale entry, and this run measures 203, 72, 5, 26, and 3. Worktrees appear and disappear as branches are cut and removed. That is the reason this criterion is a command and not a quoted figure.

What is known to fail

  • Criterion 3, in full. Day pages are a function of build time. Issue #114 is open, the 20-commit cap is still on main at crates/cerebro-core/src/storage.rs:120, and the loss compounds because every rebuild overwrites an accurate page with one that holds fewer commits.
  • Criterion 5. The 2026-11-21 page claims 27 commits for a day that holds 63, and the numbers had to be re-derived with git log to write this page.
  • Criterion 6, in part. Five proposed directories and three stale config entries are classified but not resolved.
  • Criterion 2, in the general case. It passes on the shipped shape and breaks for an output_dir that does not end in content.
  • Issue #111, latent. discover cannot see two independent clones of one repository registered as two projects. Measured today there are no duplicate remote URLs in the config, so this is an undetected class rather than a live error. It still contradicts the coverage promise in criterion 6, because “0 name conflicts” is a true answer to the wrong question.

Criteria 1, 2, and 4 pass. Each carries a caveat that belongs to the maintainer rather than to this document.

Explicit non-goals

This definition covers the journal, the readers of the journal, the note fold, and coverage reporting. It does not cover:

  • The TUI. cerebro tui reads the same generated tree, so criterion 3 reaches it, but no criterion here tests rendering or navigation.
  • cerebro serve and mdbook. Serving is a convenience. Whether the pages are right is the predicate.
  • cerebro discover --sync-config. Criterion 6 asks whether coverage is stated honestly, not whether the apply path is safe to run unattended.
  • MCP breadth. Criterion 2 checks one read tool against the file it claims to read. It does not check the other six tools.
  • Stats, TODO accuracy, and AI session collection. No criterion measures them, so no criterion claims them.
  • Acceptance. The definition is accepted; the milestone is not met. Two criteria fail.
  • The day frame. America/New_York, permanently. Cerebro serves one operator, in Eastern time, and settings.timezone exists to pin that frame down so a build on another machine cannot silently re-date the record. It is not an invitation to treat which day work belongs to as a matter of taste. Nothing in this definition or in #114’s fix should widen that.

If any of those belong under the same predicate, that is a scope decision. It is listed below rather than folded in silently.

Open questions for the maintainer

  1. Is 1.0.0 gated on criterion 3 alone, since #114 is the only open bug among them, or on all six criteria passing together?
  2. Should the author instant or the committer instant own a day? Issue #113 deferred it and issue #114 lists it as fix option 3. The measured difference for 2026-11-21 is 63 authored commits against 65 committed ones.
  3. Do the TUI, cerebro serve, and cerebro discover belong under the same exit predicate, or does 1.0.0 describe the generator and its readers only?
  4. Is “output_dir ends in a directory named content” a supported-shape contract that the docs should state, or should the readers follow settings.output_dir exactly and take criterion 2’s general form?
  5. Does 1.0.0 require repairing recorded history? Fixing #114 protects future days. Pages that older builds already shrank, including 2026-11-21 at 27 commits against 63, stay wrong unless something backfills them, and a backfill needs the fix first.
  6. What does “documented as out of scope” mean for coverage? Registering the 5 proposed directories, naming them in settings.discovery_deny, and writing a sentence in the cortex notes are three different answers with the same effect on cerebro status.
  7. Is the accuracy bar exact equality with git log, or a stated bound? One workable bound is a day page that lists every commit the collector read and names the cap when the cap binds, which is fix option 2 of #114. That option prints the cap and keeps the loss.
  8. Should --fresh prune day pages it can no longer source, or is an orphan page that reports a stale total acceptable? Criterion 3’s second failure mode depends on this answer.
  9. Who cuts the tag, and with what opt-in, once #120’s clamp lands? This page proposes that the answer is a deliberate command, not a commit marker.

Version policy

The rule that pairs with this document lives in issue #120 and in Release process: below 1.0.0 a ! in a commit subject is an incompatibility notice, not a major. Cargo’s convention turns 0.5.0 plus ! into 0.6.0, and a major stays a human act.

The gap is measurable right now.

just release-status      # run from the repository root

It reports 0.5.0 as current and 1.0.0 as proposed. The proposal is a major because fix(deps)!: migrate chrono to jiff carries a !. Until #120’s clamp lands, just release would cut a 1.0.0 tag for a change that has nothing to do with the journal being right. That is the accident this page and that fix are meant to prevent together. The definition says what 1.0.0 means, and the clamp keeps a commit marker from meaning it.