- Goal
- 1. New repository: usecoherence/coherence-bootstrap-demos
- 2. llms.txt content
- 3. What an intent graph is
- 4. How agents should work
- 5. Planning mode
- 6. Coding mode
- 7. Syncing specs with code
- 8. Tests as materialized intent
- 9. Installation and packaging
- 10. CLI cleanup
- 11. TUI for humans
- 12. Beads task format
- 13. Beads tasks
- 14. Execution order
Create a clean public onboarding path for Coherence.
coherence-bootstrap remains the engine/tooling repository.
A new repository, usecoherence/coherence-bootstrap-demos, becomes the demo/onboarding surface where humans and agents can see how Coherence is supposed to work on real projects.
The core demo should show this workflow:
vague user intent
-> agent inspects repo/spec/task state
-> agent proposes specs + AC changelist
-> human reviews in TUI / DSL
-> agent implements one local task
-> agent produces evidence linked to spec/ACThis is dogfooding. The demo repository must contain its own .coherence/ specs, acceptance criteria, and intent graph.
Create a separate repository for demos.
This repo is not the engine. It is the onboarding surface.
It should contain:
- demo projects
- seed specs
- expected outputs
- agent instructions
- prompts
llms.txt- its own
.coherence/graph describing the intent of the demo repo itself
coherence-bootstrap-demos/
.coherence/
specs.jsonl
README.md
llms.txt
demos/
xrun-probe/
README.md
AGENTS.md
prompt.md
expected/
specs.jsonl
tree.txt
seed/
.coherence/
specs.jsonl
url-shortener/
README.md
AGENTS.md
prompt.md
expected/
specs.jsonl
tree.txt
seed/
.coherence/
specs.jsonlThe demos repo must describe itself using Coherence.
Minimum specs:
Product
coherence-bootstrap-demos
- provides runnable demos for agents and humans
- demonstrates intent -> spec -> AC -> code/evidence workflow
System
demo-layout
- each demo has README, AGENTS.md, prompt.md, expected output, seed specs
System
llms-onboarding
- llms.txt gives compressed instructions for agents
System
dogfood-specs
- the demo repository tracks its own intent using .coherence/specs.jsonlPurpose:
Show Coherence working on a real, non-trivial, low-level Linux/audio problem.
User requirement example:
Let's write a tool that detects XRUNs and prints them somewhere so we can track them and link them to applications/nodes that didn't have time to process packets in the pipeline.Expected high-level spec tree:
Product
alsa-xrun-probe
correlator-engine
deployment-packaging
output-storage
pipewire-node-monitor
Foundation
event-schema
interception-mechanism
pw-snapshot-apiPurpose:
Show Coherence on a small, familiar web app.
User requirement example:
Build a URL shortener.
It should accept long URLs, generate short slugs, redirect users, reject invalid URLs, and persist mappings.Expected spec examples:
Product
url-shortener
System
redirect-flow
url-creation-flow
Foundation
domain-model-url
slug-generation
url-validationCreate llms.txt in coherence-bootstrap-demos.
This file is the compressed manual for agents.
It should be short enough for agents to read quickly, but complete enough to explain the core model.
Coherence is a developer-native intent traceability layer.
It connects:
why -> what -> constraints -> code -> evidenceCoherence is not a replacement for code, tests, docs, issue trackers, or architecture tools.
It is the missing layer between ambiguous requirements and executable implementation.
It helps humans and agents keep product/system intent close to the codebase.
Spec
An intended outcome / future system state.
Example: "Payment API requires authenticated client."
Acceptance Criterion / AC
A granular piece of intent that can be reviewed, verified, or tested.
Example: "Unauthenticated payment requests are rejected."
Evidence
A concrete artifact proving that an AC still holds.
Example: test result, code link, log output, generated report.
Intent graph
The graph of specs, ACs, constraints, code links, and evidence.Coherence currently stores intent as structured rows.
Minimum tables/concepts:
specs
id
slug
title
level
status
description
acceptance_criteria
id
spec_id
slug
title
intent
risk
review_mode
spec_relations
from_spec_id
to_spec_id
relation_type
acceptance_criterion_concerns
ac_id
concern
code_links / evidence links
ac_id or spec_id
link_type
targetThe current portable format is JSONL:
.coherence/specs.jsonlDolt DB is the current backing database during bootstrap.
Later, Coherence may support a local embedded mode.
Specs and ACs do not replace code.
They explain why code exists, what it claims to satisfy, and what evidence proves it.
Example:
Spec:
Payment API
AC:
Requires authenticated client
Code link:
implemented_by backend/payment.rb
Evidence:
verified_by test/features/payment_auth_test.rbPreferred short binary name:
cohb doctor
cohb tui
cohb db import-jsonl .coherence/specs.jsonl
cohb db export-jsonl .coherence/specs.jsonl
cohb spec add
cohb ac add
cohb verify-spec
cohb verify-acThe full binary may remain:
coherence-bootstrapBut demos should prefer:
cohbAn intent graph is a graph of intended system states and the reasons, constraints, code links, and evidence behind them.
It is not just a knowledge graph for docs.
A knowledge graph can say what is known.
An intent graph says what the system is supposed to become, why, and how we prove the implementation still matches that intent.
Shape:
knowledge -> intent -> code/evidenceExample:
PCI DSS is knowledge.
API contract shape is knowledge.
Polish tax rules are knowledge.
backend/payment.rb is code.
Intent is the chosen synthesis:
- payment requires authenticated client
- anonymous payment is not allowed
- API rejects unauthenticated requests
- test proves this behavior still holdsGranular intent is the smallest useful unit of system intent that can be reviewed and verified.
Example:
Spec:
URL model
AC:
URL contains id, short, original, updated_atThe AC is small enough that a human can understand what needs to be true.
It is also small enough that code or tests can produce evidence for it.
A spec names the outcome.
An AC names one piece of intent required for that outcome to hold.
Spec/outcome:
URL shortener persists URLs
AC/intent:
URL has id, short, original, updated_at
URL rejects invalid original URL
URL creates unique short slugThe spec gives context.
The AC gives verifiable intent.
Specs can depend on, constrain, refine, or support other specs.
Example relations:
depends_on
Payment API depends_on Authentication
constrained_by
Payment API constrained_by PCI DSS compliance
refines
Public API refines Product requirement
implemented_by
Product behavior implemented_by module/component spec
verified_by
Spec verified_by test/evidence specSpec-to-spec links allow the graph to explain why a change matters.
If Authentication changes, Payment API may be affected.
If PCI DSS constraints change, Payment API may need review.
Minimum viable context means: provide only enough context for a human or agent to understand and verify a piece of intent.
Not too little:
"add field"Not too much:
1000 lines of unrelated specs, docs, and historical decisionsGood:
Spec:
URL model
AC:
URL contains id, short, original, updated_at
Relevant code:
app/models/url.rb
db/schema.rb
Relevant evidence:
test/models/url_test.rbThe goal is to optimize for understanding.
A changelist should be small enough to review, but meaningful enough to represent a real intentional update.
There is no full Coherence workflow engine yet.
For now, the workflow is described as protocol and convention.
Future work may integrate with workflow engines. Sayiir is a useful reference because it is Rust-based and MIT licensed:
https://docs.sayiir.dev/Do not block on workflow engine integration.
For now, implement the workflow manually in agent instructions and CLI/TUI behavior.
Before starting, assume:
- repository exists
- git exists
- task management may exist, likely beads
- Dolt DB may be installed and running
- .coherence/specs.jsonl may or may not exist
- agent may be Claude Code, Codex, opencode, etc.User may say something vague:
Build a URL shortener.or:
Write a tool to detect ALSA XRUNs and correlate them with PipeWire nodes.Do not jump straight into code.
First, inspect state.
Agent must check:
- Does code already exist?
- Is git clean?
- Are there active tasks?
- Are there existing specs?
- Is .coherence/specs.jsonl present?
- Is Dolt installed?
- Is Dolt SQL server running?
- Is the project database initialized?
- Are specs synced between DB and JSONL?Purpose:
Figure out what mode we are in.
Possible modes:
new-plan
Clean repo, no active task, new requirements arrived.
continue-task
Active task exists and repo state matches that task.
dirty-repo
Repo has uncommitted changes and no clear active task.
review-changelist
Specs/ACs changed and need human review.
idle
No task, no plan, no new requirement.Agent should:
1. inspect existing specs
2. infer missing specs/ACs from requirement
3. propose a changelist
4. ask human to review
5. wait for approval before codingAgent should:
1. inspect active task
2. inspect linked spec/AC
3. implement one local deliverable
4. show diff/evidence
5. ask human whether result matches intentAgent should not blindly continue.
Agent should explain:
- what changed
- whether changes match an active task
- whether specs/evidence are out of sync
- what needs confirmationThen ask the user what to do.
Agent should show:
- specs added
- specs changed
- specs removed
- ACs added
- ACs changed
- ACs removed
- affected code/evidence linksHuman can approve, edit, reset, or cancel.
Agent should ask:
What should we work on next?Planning mode handles new requirements.
Requirements may come from:
- user prompt
- previous evidence
- bug report
- comments
- code review feedback
- product feedback
- failing testsAgent should produce a changelist, not code.
A changelist should be:
- small enough for a human to review
- meaningful enough to represent real intent
- local to the relevant specs/ACs
- connected to expected evidenceAvoid giant changelists.
If DSL view becomes 1000+ lines, the intent is probably low-cohesion.
Split into smaller intentional updates.
When human approves a changelist, create tasks.
Each task must have deliverables that are understandable at the same level as the spec/AC.
Good task deliverables:
- code that adds the API endpoint
- test that verifies the AC
- evidence output from verify command
- updated spec/AC linkBad task deliverables:
- perform SQL update
- modify internal table X
- refactor random utilityThe problem with bad deliverables is that the human has to mentally descend from product intent into foundation mechanics.
Keep task locality close to the spec/AC.
Coding mode means there is an approved plan and an active task.
Agent should:
1. read the linked spec/AC
2. inspect relevant code
3. implement one local deliverable
4. run tests/checks
5. produce evidence
6. show diff and evidence to human
7. ask whether the result matches intentDo not silently expand scope.
If implementation reveals missing intent, stop and propose a spec/AC changelist.
Current source-of-truth flow:
Dolt DB <-> .coherence/specs.jsonlFor now, JSONL export is the portable repo artifact:
.coherence/specs.jsonlRequired commands:
cohb db import-jsonl .coherence/specs.jsonl
cohb db export-jsonl .coherence/specs.jsonlThere is no strict CI/CD enforcement yet.
Future integration can run:
cohb verifyfrom:
- GitHub Actions
- local pre-commit hooks
- workflow engines
- agent workflowsDraft specs should not block verification.
draft = skip hard verify
active = expect evidence/test
deprecated = ignore unless referenced
archived = historicalOnce a spec becomes active, it should have linked evidence.
The tests created through this process are the most important layer.
They force the human and agent to ask:
Does the system actually work the way we said it should?This is the core of Coherence:
optimize for understandingTests should be small, focused, and explain the intent.
Example AC:
slug:
domain/model/url
intent:
URL should contain fields id, short, original, updated_atA good test makes clear:
1. where the model is stored
2. where the model code is
3. what fields matter
4. how the intent is verifiedExample minimal-context evidence:
Spec:
URL model
AC:
URL contains id, short, original, updated_at
Code:
app/models/url.rb
db/schema.rb
Test:
test/models/url_test.rb
Assertion:
URL schema includes id, short, original, updated_atThe “why” belongs in the AC.
The test should focus on proving the AC.
Do not use install.sh.
Preferred path:
cargo install coherence-bootstrapExpected binary:
cohbRequired smoke commands:
cohb doctor
cohb tui
cohb db import-jsonl .coherence/specs.jsonl
cohb db export-jsonl .coherence/specs.jsonl
cohb verify-spec
cohb verify-acLong binary may remain available:
coherence-bootstrapBut public docs and demos should prefer:
cohbcohb doctor should describe project state.
It must detect:
- git present/missing
- git clean/dirty
- dolt installed/missing
- dolt sql-server running/not running
- project DB exists/missing
- .coherence/specs.jsonl exists/missing
- specs imported/exported/synced/unknown
- current Coherence profilecohb init should set up a project-scoped Coherence DB inside user-scoped Dolt DB.
Failure modes to handle:
1. Dolt is not installed
2. Dolt SQL server is not running
3. Project DB does not exist
4. .coherence/ does not exist
5. .coherence/specs.jsonl exists but DB is empty
6. DB exists but JSONL is missing
7. DB and JSONL are out of syncDo not hide failure.
Explain the state and the next command.
Current coherence-bootstrap help shows too many internal commands.
Default help should show only the main user/agent surface.
cohb init
cohb doctor
cohb tui
cohb spec
cohb ac
cohb verify
cohb db import-jsonl
cohb db export-jsonl
cohb helpHide internal/debug/bootstrap commands by default.
Show them only with:
cohb help --allor:
COHERENCE_DISPLAY_EXTRA_COMMANDS=1 cohb helpInternal examples:
m0-smoke
m1-spec-smoke
drop-isolated-test-db
evidence-sample
db-list-databases
db-pingGoal:
New users and agents should not see bootstrap internals first.
The TUI needs two primary modes and one editing plane.
normal mode
browse existing intent graph
changelist mode
browse proposed/selected intent diff
DSL view
edit/review selected slice in $EDITORDefault mode.
Purpose:
Browse all specs/ACs via tree view.
Actions:
- expand/collapse specs
- view spec detail
- view AC detail
- mark spec/AC as changelist candidate
- open DSL view for selected slice
- later: search graph quickly via fzf/fff-like interactionPurpose:
Review only selected/changed specs and ACs.
Actions:
- show filtered specs/ACs
- mark existing spec/AC for deletion
- add new spec
- add new AC
- remove new spec/AC from changelist
- reset changelist
- approve changelist
- export changelistImportant semantics:
A changelist is ephemeral until committed/synced.
For new items, “remove from changelist” means remove the proposed item.
For existing items, “mark for deletion” means the changelist proposes deletion.
Think of it like editing code under git:
uncommitted changes can be reset
approved changes can be committed
committed changes can be reverted laterPurpose:
Fastest editing/review plane.
Open selected slice in $EDITOR.
Editor fallback order:
$EDITOR
micro
nvim
vim
nanoDSL view should pull only relevant context:
- relevant specs
- relevant ACs
- relevant links
- relevant code/evidence referencesDo not dump the whole graph.
The point is to optimize for understanding.
A good changelist is:
small enough to review
large enough to be meaningful
local to the intent being changedIf DSL becomes huge, this is a signal:
- requirement is too broad
- product intent is low-cohesion
- feature should be split
- graph slice is too largeUse beads for task tracking where available.
The agent may translate this section into actual beads commands.
Each task must include:
type:
epic | task
repo:
target repository
title:
human-readable title
description:
what needs to happen and why
deliverables:
concrete artifacts expected when complete
acceptance:
how to know the task is donerepo:
usecoherence/coherence-bootstrap-demostype:
epictitle:
Create Coherence Bootstrap Demos onboarding repositorydescription:
Create a separate public repository for Coherence demos. The bootstrap repository remains engine/tooling. The demos repository becomes the onboarding surface for agents and humans.deliverables:
- new GitHub repository usecoherence/coherence-bootstrap-demos
- README.md explaining purpose
- llms.txt compressed agent manual
- demos/ directory
- .coherence/specs.jsonl for dogfooding the demo repo itselfacceptance:
- repo exists
- README explains engine vs demo split
- .coherence/specs.jsonl exists
- at least one demo directory existsrepo:
usecoherence/coherence-bootstrap-demostype:
tasktitle:
Add initial repository skeletondescription:
Create the initial directory layout for demos, expected outputs, seed specs, and repository-level Coherence dogfooding.deliverables:
- README.md
- llms.txt placeholder
- .coherence/specs.jsonl placeholder
- demos/xrun-probe/
- demos/url-shortener/acceptance:
- tree matches proposed structure
- empty directories contain placeholder files where neededrepo:
usecoherence/coherence-bootstrap-demostype:
tasktitle:
Add ALSA XRUN Probe demodescription:
Create a real-world low-level demo showing how an agent turns vague XRUN tracking requirements into specs, ACs, and expected evidence.deliverables:
- demos/xrun-probe/README.md
- demos/xrun-probe/AGENTS.md
- demos/xrun-probe/prompt.md
- demos/xrun-probe/expected/specs.jsonl
- demos/xrun-probe/expected/tree.txt
- demos/xrun-probe/seed/.coherence/specs.jsonlacceptance:
- demo can be understood without reading the whole website
- expected tree includes product and foundation specs
- AGENTS.md tells agent not to code before proposing specs/ACsrepo:
usecoherence/coherence-bootstrap-demostype:
tasktitle:
Add URL Shortener demodescription:
Create a small familiar web-app demo showing how Coherence handles product intent, model intent, validation, persistence, redirect behavior, and evidence.deliverables:
- demos/url-shortener/README.md
- demos/url-shortener/AGENTS.md
- demos/url-shortener/prompt.md
- demos/url-shortener/expected/specs.jsonl
- demos/url-shortener/expected/tree.txt
- demos/url-shortener/seed/.coherence/specs.jsonlacceptance:
- demo explains intended behavior clearly
- expected specs include URL model, slug generation, URL validation, redirect flow
- ACs are granular enough to materialize testsrepo:
usecoherence/coherence-bootstraptype:
epictitle:
Publish coherence-bootstrap installable CLIdescription:
Make the current bootstrap artifact installable via Cargo. No install.sh. Public demos should use cargo install and the cohb binary.deliverables:
- cargo package metadata cleaned up
- cargo install coherence-bootstrap works
- cohb binary works
- smoke commands documentedacceptance:
- cargo install path works locally
- cohb doctor runs after install
- cohb tui runs after installrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Add cohb binary aliasdescription:
Keep coherence-bootstrap as the full binary name, but expose cohb as the preferred short command for demos and docs.deliverables:
- Cargo.toml binary alias
- docs updated to use cohb
- old coherence-bootstrap entrypoint still worksacceptance:
- cohb help works
- coherence-bootstrap help worksrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Implement project-aware doctor commanddescription:
cohb doctor should explain the current Coherence project state and failure modes clearly.deliverables:
- detect git present/missing
- detect git clean/dirty
- detect Dolt installed/missing
- detect Dolt SQL server running/not running
- detect project DB exists/missing
- detect .coherence/specs.jsonl exists/missing
- detect sync state where possibleacceptance:
- doctor output is readable by humans
- doctor output is actionable for agents
- failure modes include next suggested commandrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Implement project-scoped init flowdescription:
cohb init should set up project-scoped Coherence state using the user-scoped Dolt SQL server.deliverables:
- create .coherence/ if missing
- create/import project DB if missing
- handle existing specs.jsonl
- explain Dolt missing/not running statesacceptance:
- new repo can run cohb init
- existing repo with specs.jsonl can run cohb init
- missing Dolt gives clear error
- stopped Dolt server gives clear errorrepo:
usecoherence/coherence-bootstraptype:
epictitle:
Simplify public CLI help surfacedescription:
Current help exposes too many bootstrap/debug commands. Make default help show the main user/agent workflow only. Hide extra commands behind help --all or COHERENCE_DISPLAY_EXTRA_COMMANDS=1.deliverables:
- default help is short
- internal commands hidden
- help --all shows everything
- env var can expose extra commandsacceptance:
- new user sees only core commands
- developer can still access bootstrap/debug commandsrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Define public CLI command groupsdescription:
Group commands into public workflow commands and internal/debug commands.deliverables:
- public command list
- internal command list
- help output designacceptance:
- command grouping is documented
- current commands are classifiedrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Hide internal commands by defaultdescription:
Default help should show only core commands. Internal commands should appear only with help --all or COHERENCE_DISPLAY_EXTRA_COMMANDS=1.deliverables:
- help --all support
- env var support
- updated help textacceptance:
- cohb help is short
- cohb help --all shows full command list
- COHERENCE_DISPLAY_EXTRA_COMMANDS=1 cohb help shows full command listrepo:
usecoherence/coherence-bootstraptype:
epictitle:
Add TUI modes for normal browsing and changelist reviewdescription:
The TUI should support human browsing of the full intent graph and focused review of proposed changelists. DSL view should open the selected graph slice in the user's editor.deliverables:
- normal mode
- changelist mode
- DSL editor view
- mark spec/AC as changelist candidate
- filtered tree view for changelistacceptance:
- user can browse full graph
- user can mark items for changelist
- user can review only changelist items
- user can open relevant DSL slice in editorrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Allow marking specs and ACs as changelist candidatesdescription:
In normal TUI mode, allow the human to browse the graph and mark relevant specs/ACs for a future changelist.deliverables:
- keybinding to mark/unmark spec
- keybinding to mark/unmark AC
- visual marker for selected candidatesacceptance:
- user can mark multiple specs/ACs
- marks persist while TUI session is open
- detail pane shows candidate staterepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Add changelist filtered tree modedescription:
Show only specs/ACs included in the current changelist candidate set.deliverables:
- changelist mode toggle
- filtered tree rendering
- empty-state message when no candidates selectedacceptance:
- changelist mode hides unrelated specs/ACs
- normal mode still shows full graphrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Open selected graph slice as DSL in editordescription:
Allow user to open the selected spec/AC slice as editable DSL in $EDITOR. This is the fastest plane for review and editing.deliverables:
- generate DSL for selected slice
- open in $EDITOR
- fallback to micro/nvim/vim/nano
- parse edited DSL back into changelist or DB draftacceptance:
- editor opens with relevant DSL only
- unrelated graph content is not dumped
- edited DSL can be parsed or produces useful errorsrepo:
usecoherence/coherence-bootstraptype:
tasktitle:
Define changelist mutation semanticsdescription:
Clarify how new, changed, and existing specs/ACs behave inside an ephemeral changelist.deliverables:
- semantics doc
- remove new item behavior
- mark existing item for deletion behavior
- reset changelist behavioracceptance:
- user can understand difference between remove-from-changelist and mark-for-deletion
- behavior mirrors git-like uncommitted change semanticsRecommended order:
1. Create coherence-bootstrap-demos repo skeleton
2. Add llms.txt compressed manual
3. Add xrun-probe demo
4. Add url-shortener demo
5. Add cohb binary alias
6. Fix cohb doctor
7. Fix cohb init DB flow
8. Simplify help output
9. Add TUI normal/changelist mode
10. Add DSL editor slice viewDo not block demo repo on perfect TUI.
The first public win is:
cargo install coherence-bootstrap
git clone coherence-bootstrap-demos
cd demos/xrun-probe
cohb doctor
cohb db import-jsonl seed/.coherence/specs.jsonl
cohb tuiThat is enough to show the idea.