What exists now?
- Approved problem and requirements
- Architecture and design commitments
- Implementation and review reports
- Canonical feature summary
docs/briefs/001-feature/Evidence layer / Agent logging
Artifacts show what the pipeline produced. The agent log records how it got there: decisions, alternatives, findings, struggles, assumptions, and whether expected outcomes actually happened.
structured evidence across otherwise stateless sessions
Interactive record anatomy
Links one specialist session to an agent, feature, status, quality score, and output summary.
RUN_ID=$(bin/agent-log run start \
--agent-name engineer \
--feature-id 001 \
--input-summary "Build sync status")01 / Two evidence systems
You need both. Collapsing them either bloats the handoff documents or leaves the learning layer unable to see why an apparently successful result happened.
docs/briefs/001-feature/db/agent_log.sqlite3The Markdown artifacts are the pipeline API. The database is the longitudinal evidence layer. A future agent may read both, but neither replaces the other.
02 / Lifecycle protocol
The shared logging skill owns the lifecycle. Each agent definition supplies only role-specific criteria: what counts as a meaningful decision, finding, or gap.
First action
Create the UUID that correlates every record in this session.
run startDuring judgment
Log material decisions, meaningful events, and review findings—not narration.
decision · event · findingBefore artifact
Query reflections so gaps become visible in the agent’s report.
query reflectionsBefore close
Name genuine struggles and targeted skill gaps when they occurred.
reflectionLast action
Persist status, quality score, and a concise output summary.
run endAfter delivery
Compare an earlier expected result with what actually happened.
outcome03 / Five-table data model
A generic event stream is easy to write and hard to learn from. Typed records preserve the distinctions the analyst needs later.
Agent, feature, input mode, status, quality score, timing, output summary.
one row / specialist sessionTitle, rationale, alternatives, type, expected outcome, observed outcome.
hypothesis → resultTest runs, significant commands, and artifacts written.
test_run · bash · file_writeStable category, severity, file, line, and description.
AUTH_SCOPE · N+1 · MISSING_TESTAssumptions, struggles, and specific missing knowledge.
assumption · struggle · skill_gap04 / Signal discipline
The database becomes useful only when each row carries analytical signal. More telemetry is not automatically more observability.
“If no future decision can use the record, it is noise.”
05 / The silent failure mode
A relative database path creates one database per worktree. Those records disappear from analysis when the worktree is removed.
/project/db/agent_log.sqlite3All features and agents accumulate here.
AGENT_LOG_DB←/001-sync-status/Every launch receives the absolute shared path.
cd {WORKTREE_DIR}
export AGENT_LOG_DB={PROJECT_ROOT}/db/agent_log.sqlite3Logging failure should not destroy feature work. Continue the task, surface the evidence gap in the final artifact, and never pretend the record exists.
06 / Questions the data can answer
These are the queries that justify the system. If your schema cannot answer them, you are collecting activity rather than learning evidence.
GROUP BY title HAVING COUNT(*) > 1COUNT(DISTINCT feature_id)expected_outcome ≠ observed_outcomedecision_type = 'gap'reflection.type = 'skill_gap'quality_score ≥ 807 / Portable implementation
The CLI validates fields, assigns IDs, timestamps rows, and persists transactions. Agents decide which moments are meaningful and write concise rationales. The analyst later interprets patterns across runs.
Read the source documentation