Cycle docs and traceability
Plan work in cycle docs, cite them from pull requests, validate the trailers, and prove acceptance criteria with evidence.
A cycle doc is a plan with acceptance criteria, committed beside your code.
Pull requests cite the cycle or issue they implement, cyclone validate checks
the citation, and cyclone prove reports which acceptance criteria the
change's evidence proves. Every step is a cyclone command, so it runs the same
on your workstation and in CI.
Where cycle docs live
Cycle docs are files named cycle<N>-<slug>.md, such as
cycle1-adopt-cerebe.md. By default they live in docs/roadmap/cycles/, then
docs/cycles/. To use another directory, set it in cerebe.yaml:
docs:
cycleDocsDir: specs/cyclesOnly the top level of that directory is read. Two live cycle docs that claim the same number fail validation. Point any CI path filters at the same directory.
Write a cycle doc
cyclone doc scaffolds a document and validates it before writing. It calls no
model: you, or your agent, fill in the skeleton.
# Print the skeleton and its authoring rules.
cyclone doc scaffold --type cycle-doc --id 1 --title "Adopt Cerebe"
# Validate the filled document and write it only if it is valid.
cyclone doc write --type cycle-doc --path docs/roadmap/cycles/cycle1-adopt-cerebe.md --file draft.mdA cycle doc has YAML frontmatter (cycle, title, status, priority,
created, updated, started, completed, owner, parent,
related_repos, tags), an H1 of the form # Cycle <N> — <title>, and its
required sections in order, including Exit criteria with at least one
- [ ] checkbox. scaffold prints the current rules. write refuses a
malformed document with the errors and writes nothing.
ADRs work the same way with --type adr. Other commands:
cyclone doc list # every registered doc type and its directory
cyclone doc resolve --type cycle-doc --ref 1 --json
cyclone doc install --type cycle-doc # copy the template into cerebe/doctypes/ to customize itYour own doc types
A doc type is a Markdown template in cerebe/doctypes/<kind>.md. Its
frontmatter cerebe: block names the type (kind), its directory (dir), and
which parts carry identity, status, and acceptance criteria. Its headings are
the required structure. A type dropped in that directory is available to
cyclone doc, the MCP doc tools, and objectives, with no other change.
Status
A cycle doc's status is one of the open values draft, active,
in-progress, partial-done, and plan-review, or a terminal value:
completed, complete, superseded, abandoned, or absorbed. done is not
a status. A doc type can declare its own terminal list.
A pull request cannot cite a cycle whose status is terminal.
Cite the work from a pull request
Each pull request carries a trailer that names what it implements:
Cycle: 1
Issue: #42A code change cites Cycle: <N> or Issue: #<N>; a closing keyword such as
Closes #42 also counts as the issue. A trailer is a Key: Value line that
starts at the beginning of the line. Indented lines are prose. The validator
reads every commit message in the pull request, then the pull request body, and
when a key repeats, the last one wins, so the body overrides the commits.
Plan, code, and retirement pull requests
cyclone admit-pr classifies a pull request from its changed files:
gh pr view 123 --json files --jq '.files[].path' | cyclone admit-pr --files-stdinIt prints plan when at least one file is a cycle doc and every file is
documentation, and code otherwise. A path is documentation when it has a
docs segment (docs/…, platform/docs/…) or is an AGENTS.md, CLAUDE.md,
or GEMINI.md. If your documentation lives elsewhere, list every tree yourself:
docs:
roots:
- handbook
- platform/docsroots replaces the docs-segment rule.
- A plan pull request changes one cycle doc and cites it with
Cycle: <N>. - A code pull request cites its cycle or issue. It may edit a cycle doc, but it may not close one: the pull request that implements a cycle does not also mark it complete.
- A retirement pull request only moves cycle docs to a terminal status. It
omits
Cycle:, because it would cite a closed cycle, and anchors withIssue: #<N>instead.
Run the validator in CI
cyclone validate checks a live pull request. It reads the pull request's
changed files through gh, so it needs a token that can read the pull request.
Every flag also reads an environment variable:
| Flag | Environment |
|---|---|
--pr-number | PR_NUMBER |
--repo | REPO, then GITHUB_REPOSITORY |
--title | PR_TITLE |
--body | PR_BODY |
--labels-json | PR_LABELS |
--gh-token | GH_TOKEN, then GITHUB_TOKEN |
--base-ref | PR_BASE_SHA, then PR_BASE_REF |
--head-ref | PR_HEAD_SHA |
It exits 0 on a pass and 1 on a validation failure. If it cannot list the
changed files, it fails rather than guess the pull request's kind.
Prove the acceptance criteria
For work that spans more than one pull request, turn a cycle's exit criteria into objectives and bind each one to the evidence that proves it.
cyclone objectives derive --cycle 1 --applyderive writes cerebe/objectives.yaml with one objective per exit criterion,
each bound to a hash of the criterion's text. Edit each objective's attestedBy
to name its evidence: a test, a verification route,
or the critic's verdict. --issue owner/repo#42 derives from an issue's
acceptance criteria instead. cyclone objectives check confirms the text
hashes still match their sources.
At closeout, read the proof:
cyclone prove # every objective: proven, pending, or failed
cyclone prove --cycle 1 # only this cycle's objectives; exits 1 unless all are proven
cyclone prove --strict # fail on any objective that is not provenEach status comes from evidence bound to the commit and its diff, not from a claim that the work is done. A route that runs a whole suite cannot prove an objective on its own, so bind a criterion to a test or route that checks that criterion. A binding to the critic's verdict proves the gate passed, not the criterion.
To see the proof on every push, run cyclone prove from a pre-push hook you own.
cerebe init rewrites the pre-push hook it manages, so do not edit that one.