First 7 PRs — Phase 0 Bootstrap Sequence

⚠ Heritage numbers in the inline prompts below. This file was drafted against the pre-R74.5 PR sequence, and the ready-to-paste agent prompts still mention the old donor-schema targets (78 tables, ~85 env vars, AMS_TRANSPORT, AMS_WATCH_MODE, 7 states). The authoritative Phase 0 facts are in task-breakdown.md and ../../3-world/execution/task-pipeline.md:

  • Exactly 19 MCP tools, not ~85 env vars of tooling (ADR-004).
  • Low-teens SQLite tables in data/colibri.db, not 78 tables. The 78 tables number is the AMS donor schema, deleted R53, and must not be used as a Phase 0 target.
  • 8-state β FSM: INIT → GATHER → ANALYZE → PLAN → APPLY → VERIFY → DONE plus CANCELLED. The backlog | todo | in_progress | blocked | review | done | cancelled list below is the donor 7-state GSD machine — it is wrong for Phase 0 and is kept here only as heritage.
  • Env namespace is COLIBRI_* only (S17 §3). AMS_TRANSPORT and AMS_WATCH_MODE below are heritage donor variables and must not be read by Phase 0 code. The Phase 0 transport is stdio-only (S17 §2); an HTTP transport is not in the 19-tool surface.
  • 5-stage α middleware chain (tool-lock → schema-validate → audit-enter → dispatch → audit-exit), not the 11-middleware donor chain.
  • Entry point target: src/server.ts (P0.2.1). The donor src/server.js was deleted in R53.

When you pick up one of these PRs, cross-check every acceptance criterion against task-breakdown.md before copying a prompt into a worktree. This file is an ordering guide, not a spec.

What This Document Is

This is the explicit ordering of the first 7 PRs that transform Colibri from “empty repo” to “working MCP server with task pipeline + audit trail”. These 7 PRs are the critical path that unblock everything else in Phase 0.

After PR-7 merges, Colibri is bootstrapped. Agents can use task_create, task_update, thought_record, and merkle_finalize tools. Phase 0 transitions from manual bootstrap to full dogfooding mode.


Quick Reference: 7 PRs at a Glance

PR # Task ID Title Effort Unblocks Criteria
1 P0.1.1 Package setup S (1-2h) P0.1.2, P0.1.4 npm test, npm run lint, npm run build all pass; zero errors
2 P0.1.2 Test runner + linter S (2-3h) P0.1.3, P0.2.1 Jest runs, ESLint runs, smoke test passes, coverage report generated
3 P0.1.4 Environment validation S (2-3h) P0.2.2 Zod schema validates env vars; missing var → readable error; typed defaults
4 P0.2.1 MCP server bootstrap M (4-8h) P0.2.3, P0.3.4, P0.4.4 Server starts; stdio and http transports work; server/ping tool responds
5 P0.2.2 SQLite initialization L (1-2d) P0.2.3, P0.3.1 initDb() idempotent; 78 tables created; WAL + FK enabled; test passes
6 P0.2.3 Two-phase startup M (6-10h) P0.2.4, P0.3.4 Phase 1 (transport) → Phase 2 (DB+domains); startup time logged; clean shutdown
7 P0.3.1 GSD state machine S (2-4h) P0.3.2, P0.3.4 7 states; invalid transition → error; 100% branch coverage

PR-1: Package Setup (P0.1.1)

Task ID: P0.1.1
Branch name: feature/P0.1.1-package-setup
Effort: S (1-2h)

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.1.1-package-setup -b feature/P0.1.1-package-setup origin/main
cd .worktrees/claude/P0.1.1-package-setup

Files This PR Creates

  • package.json — ESM-first, Node 20+, @modelcontextprotocol/sdk, zod, better-sqlite3
  • tsconfig.json — strict: true, target: ES2022, module: NodeNext
  • .eslintrc.json — Standard ESLint config
  • .prettierrc — Formatting rules
  • .env.example — ~85 env vars documented
  • .gitignore — node_modules/, dist/, .env, data/ams.db
  • src/__tests__/smoke.test.ts — Smoke test: 1 + 1 === 2

Files This PR Does NOT Touch

  • src/server.ts (created in P0.2.1, not here)
  • .github/workflows/ci.yml (created in P0.1.3)
  • ❌ Database files (created in P0.2.2)
  • ❌ Any existing main-checkout files

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.1.1:

  • package.json: "type": "module", "engines": {"node": ">=20"}, ESM-first
  • TypeScript 5.3+: strict: true, target: ES2022, module: NodeNext
  • ts-node or tsx for dev; tsc for production build
  • .env.example documents all ~85 env vars
  • .gitignore excludes node_modules/, dist/, .env, data/ams.db

Ready-to-Paste Agent Prompt

You are building P0.1.1 (Package Setup) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.1.1

Create:
- package.json with "type": "module", engines: {node: >=20}
- tsconfig.json with strict: true, target: ES2022
- .eslintrc.json (standard ESLint config)
- .prettierrc (printWidth: 100, tabWidth: 2)
- .env.example (copy the 85 vars from the spec)
- .gitignore (node_modules/, dist/, .env, data/ams.db)
- src/__tests__/smoke.test.ts (smoke test: 1+1===2)

Run: npm install && npm test && npm run lint && npm run build

All must pass. Commit. Create PR.

Verification Checklist

  • npm test passes (smoke test: 1+1===2)
  • npm run lint passes (0 errors)
  • npm run build compiles to dist/ (even if empty)
  • All acceptance criteria from task-breakdown.md are met
  • .env.example contains at least 80 documented vars
  • Branch name is exactly feature/P0.1.1-package-setup

Writeback Requirement

Create docs/packets/P0.1.1-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.1.1-package-setup
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (1 passed, 0 failed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] package.json: "type": "module"
  - [x] package.json: "engines": {"node": ">=20"}
  - [x] TypeScript 5.3+ with strict: true
  - [x] .env.example documents all required vars
  - [x] .gitignore excludes node_modules/, dist/, .env, data/ams.db
- **Blockers found:** none
- **Notes:** Ready for P0.1.2

What This Unblocks

  • P0.1.2 (Test Runner + Linter) — depends on P0.1.1
  • P0.1.4 (Environment Validation) — depends on P0.1.1

PR-2: Test Runner + Linter (P0.1.2)

Task ID: P0.1.2
Branch name: feature/P0.1.2-test-runner
Effort: S (2-3h)

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.1.2-test-runner -b feature/P0.1.2-test-runner origin/main
cd .worktrees/claude/P0.1.2-test-runner

Files This PR Creates

  • jest.config.ts — ESM transform, coverage config
  • eslint.config.ts — TypeScript support, strict rules
  • Update src/__tests__/smoke.test.ts (if needed for config validation)
  • Add: src/__tests__/config.test.ts (sample test proving harness works)

Files This PR Does NOT Touch

  • package.json (already done in P0.1.1)
  • src/server.ts (not yet)
  • ❌ Config implementation (that’s P0.1.4)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.1.2:

  • npm test runs Jest with ESM transform
  • npm run lint runs ESLint with zero errors on empty codebase
  • npm run build compiles TypeScript to dist/ with no errors
  • Smoke test: smoke.test.ts asserts 1 + 1 === 2 (verifies test harness works)
  • Code coverage report generated (--coverage flag)

Ready-to-Paste Agent Prompt

You are building P0.1.2 (Test Runner + Linter) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.1.2

Create:
- jest.config.ts with ESM preset, coverage config
- eslint.config.ts with TypeScript support
- Update src/__tests__/smoke.test.ts if needed

Run: npm test && npm run lint && npm run build

All must pass. Coverage report must be generated (check coverage/ or .coverage/).

Commit. Create PR.

Verification Checklist

  • npm test runs with Jest (check test output)
  • Coverage report generated (files/ or coverage/ directory exists)
  • npm run lint passes (0 errors on empty codebase)
  • npm run build produces dist/ folder (can be empty)
  • Smoke test verifies 1 + 1 === 2

Writeback Requirement

Create docs/packets/P0.1.2-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.1.2-test-runner
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (smoke test passed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] npm test runs Jest with ESM transform
  - [x] npm run lint runs ESLint with zero errors
  - [x] npm run build compiles TypeScript to dist/
  - [x] Smoke test asserts 1 + 1 === 2
  - [x] Code coverage report generated
- **Blockers found:** none
- **Notes:** Ready for P0.1.3 and P0.2.1

What This Unblocks

  • P0.1.3 (CI Pipeline) — depends on P0.1.2
  • P0.2.1 (MCP Server Bootstrap) — depends on P0.1.2

PR-3: Environment Validation (P0.1.4)

Task ID: P0.1.4
Branch name: feature/P0.1.4-env-validation
Effort: S (2-3h)

Note: This is P0.1.4, not P0.1.3. P0.1.3 (CI Pipeline) can wait; environment validation unblocks the server core.

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.1.4-env-validation -b feature/P0.1.4-env-validation origin/main
cd .worktrees/claude/P0.1.4-env-validation

Files This PR Creates

  • src/config.ts — Zod schema for all ~85 env vars; export config object
  • tests/config.test.ts — Test: missing required var → error with key name; optional vars have defaults

Files This PR Does NOT Touch

  • package.json
  • jest.config.ts or eslint.config.ts
  • ❌ Server implementation (not yet)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.1.4:

  • Zod schema validates all required env vars on startup
  • Missing required var → throws with human-readable message listing the missing key
  • Optional vars have typed defaults
  • AMS_WATCH_MODE accepted values: none | polling | native
  • NODE_ENV accepted values: development | test | production
  • Export config object (typed, not raw process.env)

Ready-to-Paste Agent Prompt

You are building P0.1.4 (Environment Validation) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.1.4

Input: docs/reference/extractions/alpha-system-core-extraction.md (config section)

Create:
- src/config.ts with Zod schema for ~85 env vars
- AMS_WATCH_MODE: 'none' | 'polling' | 'native' (default: 'none')
- NODE_ENV: 'development' | 'test' | 'production' (default: 'development')
- Missing required var → error with key name
- Optional vars have typed defaults
- Export typed config object

Create tests/config.test.ts:
- Test missing required var → throws with key name
- Test valid env → config object created
- Test optional vars have defaults

Run: npm test && npm run lint && npm run build

All must pass. Commit. Create PR.

Verification Checklist

  • src/config.ts exports a config object (typed)
  • npm test passes (config.test.ts passes)
  • Missing required var → error message includes the var name
  • AMS_WATCH_MODE has 3 valid values
  • NODE_ENV has 3 valid values
  • Optional vars have defaults (not undefined)

Writeback Requirement

Create docs/packets/P0.1.4-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.1.4-env-validation
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (config.test.ts passed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] Zod schema validates all required env vars
  - [x] Missing var → error with key name
  - [x] Optional vars have typed defaults
  - [x] AMS_WATCH_MODE validated (none|polling|native)
  - [x] NODE_ENV validated (development|test|production)
  - [x] Export typed config object
- **Blockers found:** none
- **Notes:** Ready for P0.2.2 (SQLite Initialization)

What This Unblocks

  • P0.2.2 (SQLite Initialization) — depends on P0.1.4

PR-4: MCP Server Bootstrap (P0.2.1)

Task ID: P0.2.1
Branch name: feature/P0.2.1-mcp-server-bootstrap
Effort: M (4-8h)

UNBLOCK POINT — First running server.

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.2.1-mcp-server-bootstrap -b feature/P0.2.1-mcp-server-bootstrap origin/main
cd .worktrees/claude/P0.2.1-mcp-server-bootstrap

Files This PR Creates

  • src/server.ts — McpServer instance; stdio + http transport selection; registerTool() helper
  • src/tools/ping.tsserver/ping tool: { status: "ok", version }
  • tests/server.test.ts — Integration test: handshake + ping tool call

Files This PR Does NOT Touch

  • ❌ Database files (created in P0.2.2)
  • ❌ Config (already done in P0.1.4)
  • ❌ Startup logic (created in P0.2.3)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.2.1:

  • McpServer created with name: "colibri", version from package.json
  • StdioServerTransport for local clients; StreamableHTTPServerTransport for remote
  • [ ] Transport selected by AMS_TRANSPORT env var (stdio http)
  • Server exports registerTool(name, schema, handler) helper
  • At least 1 registered tool: server/ping → returns { status: "ok", version }
  • npm test passes with MCP handshake integration test

Ready-to-Paste Agent Prompt

You are building P0.2.1 (MCP Server Bootstrap) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.2.1

Input: docs/reference/extractions/alpha-system-core-extraction.md (server section)

Create:
- src/server.ts with McpServer instance
  - name: "colibri"
  - version from package.json
  - Transport selection: AMS_TRANSPORT env var (stdio | http)
  - registerTool() helper function
- src/tools/ping.ts: server/ping tool returns {status: "ok", version}
- tests/server.test.ts: MCP handshake test + ping tool call

Run: npm run build && npm test && npm run lint

All must pass. Commit. Create PR.

Verification Checklist

  • src/server.ts creates McpServer with name “colibri”
  • Transport selection based on AMS_TRANSPORT env var
  • server/ping tool is registered
  • npm test includes MCP handshake integration test
  • Server can be started without error (dry-run: npm run build)

Writeback Requirement

Create docs/packets/P0.2.1-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.2.1-mcp-server-bootstrap
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (MCP handshake test passed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] McpServer created with name "colibri" and version
  - [x] stdio and http transports available
  - [x] Transport selection via AMS_TRANSPORT env var
  - [x] registerTool() helper exported
  - [x] server/ping tool registered and responds
  - [x] MCP handshake integration test passes
- **Blockers found:** none
- **Notes:** UNBLOCK POINT — Server is now running. Ready for P0.2.3 (Two-Phase Startup) and P0.3.4 (Task Tools).

What This Unblocks

  • P0.2.3 (Two-Phase Startup) — depends on P0.2.1
  • P0.3.4 (Task Tools) — depends on P0.2.1
  • P0.4.4 (Lifecycle Tools) — depends on P0.2.1

PR-5: SQLite Initialization (P0.2.2)

Task ID: P0.2.2
Branch name: feature/P0.2.2-sqlite-init
Effort: L (1-2d)

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.2.2-sqlite-init -b feature/P0.2.2-sqlite-init origin/main
cd .worktrees/claude/P0.2.2-sqlite-init

Files This PR Creates

  • src/db/index.tsinitDb(path) function; returns Database instance
  • src/db/schema.sql — 78 tables matching AMS donor schema (idempotent)
  • tests/db/init.test.ts — Test: fresh DB has correct table count; idempotent calls

Files This PR Does NOT Touch

  • ❌ Server implementation
  • ❌ Config
  • ❌ Startup logic (created in P0.2.3)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.2.2:

  • Uses better-sqlite3 (sync API)
  • schema.sql creates all required tables (target: 78 tables matching AMS donor schema)
  • initDb(path) function: creates DB if not exists, applies schema, returns Database instance
  • Idempotent: calling initDb() twice does not fail or duplicate data
  • WAL mode enabled: PRAGMA journal_mode=WAL
  • Foreign keys enabled: PRAGMA foreign_keys=ON
  • Test: fresh DB has correct table count

Ready-to-Paste Agent Prompt

You are building P0.2.2 (SQLite Initialization) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.2.2

Input: docs/reference/extractions/alpha-system-core-extraction.md (database schema section)

Create:
- src/db/index.ts with initDb(path) function
  - Creates DB if not exists
  - Applies schema.sql
  - Returns Database instance
  - Idempotent (can call twice safely)
- src/db/schema.sql with 78 tables from AMS donor schema
  - WAL mode: PRAGMA journal_mode=WAL
  - Foreign keys: PRAGMA foreign_keys=ON
  - Idempotent (CREATE TABLE IF NOT EXISTS)
- tests/db/init.test.ts
  - Test: fresh DB → correct table count
  - Test: idempotent (initDb twice, no errors)

Run: npm test && npm run lint && npm run build

All must pass. Commit. Create PR.

Verification Checklist

  • initDb() function exists in src/db/index.ts
  • schema.sql has at least 70+ CREATE TABLE statements
  • npm test includes table count test
  • Calling initDb() twice does not fail
  • WAL mode and foreign keys are enabled in schema

Writeback Requirement

Create docs/packets/P0.2.2-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.2.2-sqlite-init
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (db init test passed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] better-sqlite3 sync API used
  - [x] schema.sql creates 78 tables
  - [x] initDb() is idempotent
  - [x] WAL mode enabled
  - [x] Foreign keys enabled
  - [x] Test: fresh DB has correct table count
- **Blockers found:** none
- **Notes:** Ready for P0.2.3 (Two-Phase Startup) and P0.3.1 (GSD State Machine).

What This Unblocks

  • P0.2.3 (Two-Phase Startup) — depends on P0.2.2
  • P0.3.1 (GSD State Machine) — depends on P0.2.2

PR-6: Two-Phase Startup (P0.2.3)

Task ID: P0.2.3
Branch name: feature/P0.2.3-two-phase-startup
Effort: M (6-10h)

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.2.3-two-phase-startup -b feature/P0.2.3-two-phase-startup origin/main
cd .worktrees/claude/P0.2.3-two-phase-startup

Files This PR Creates

  • src/startup.tsstartup() function; Phase 1 (transport) → Phase 2 (heavy init)
  • tests/startup.test.ts — Test: Phase 2 failure → clean shutdown; timing logged

Files This PR Does NOT Touch

  • ❌ Server (already done in P0.2.1)
  • ❌ Database (already done in P0.2.2)
  • ❌ Health check tool (created in P0.2.4)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.2.3:

  • Phase 1 (transport): MCP transport ready, health check responds, DB not yet loaded
  • Phase 2 (heavy init): DB initialized, all tools registered, all domains loaded
  • startup() returns only after Phase 2 completes
  • If Phase 2 fails, server shuts down gracefully (no hanging process)
  • Startup time logged: console.error("Startup complete in {ms}ms")
  • Test: mock Phase 2 failure → verify clean shutdown

Ready-to-Paste Agent Prompt

You are building P0.2.3 (Two-Phase Startup) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.2.3

Input:
- docs/reference/extractions/alpha-system-core-extraction.md (startup section)
- docs/reference/extractions/gamma-server-lifecycle-extraction.md

Create:
- src/startup.ts with startup() function
  - Phase 1: transport ready (from P0.2.1 server)
  - Phase 2: DB init (from P0.2.2), tools registered, domains loaded
  - Log startup time: "Startup complete in Xms"
  - Return only after Phase 2 completes
  - If Phase 2 fails: shut down gracefully, don't hang
- tests/startup.test.ts
  - Test: mock Phase 2 failure → clean shutdown
  - Test: timing is logged

Run: npm test && npm run lint && npm run build

All must pass. Commit. Create PR.

Verification Checklist

  • startup() function exists in src/startup.ts
  • Phase 1 and Phase 2 are clearly separated
  • Startup time is logged to console.error()
  • npm test includes Phase 2 failure test
  • No hanging processes on failure

Writeback Requirement

Create docs/packets/P0.2.3-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.2.3-two-phase-startup
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test (Phase 2 failure test passed)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] Phase 1: transport ready
  - [x] Phase 2: DB + domains loaded
  - [x] startup() returns after Phase 2 completes
  - [x] Phase 2 failure → graceful shutdown
  - [x] Startup time logged
  - [x] Test: clean shutdown on failure
- **Blockers found:** none
- **Notes:** Ready for P0.2.4 (Health Check Tool) and P0.3.4 (Task Tools).

What This Unblocks

  • P0.2.4 (Health Check Tool) — depends on P0.2.3
  • P0.3.4 (Task Tools) — depends on P0.2.3

PR-7: GSD State Machine (P0.3.1)

Task ID: P0.3.1
Branch name: feature/P0.3.1-gsd-state-machine
Effort: S (2-4h)

BOOTSTRAP COMPLETE — After this PR, Colibri can host business logic.

Worktree Command

git fetch origin
git worktree add .worktrees/claude/P0.3.1-gsd-state-machine -b feature/P0.3.1-gsd-state-machine origin/main
cd .worktrees/claude/P0.3.1-gsd-state-machine

Files This PR Creates

  • src/domains/tasks/state-machine.tstransition(), canTransition() functions
  • tests/domains/tasks/state-machine.test.ts — All 7 states; all valid + invalid transitions; 100% branch coverage

Files This PR Does NOT Touch

  • ❌ Server
  • ❌ Database (uses better-sqlite3 in later tasks)
  • ❌ Task CRUD (created in P0.3.2)

Success Criteria

From docs/guides/implementation/task-breakdown.md §P0.3.1:

  • 7 states defined: backlog | todo | in_progress | blocked | review | done | cancelled
  • Valid transitions map (e.g., backlog → todo, todo → in_progress, in_progress → blocked)
  • Invalid transition throws InvalidTransitionError with {from, to, taskId}
  • transition(task, newState) → returns updated task or throws
  • canTransition(from, to) → boolean (no side effects)
  • 100% branch coverage (all valid + invalid transitions tested)

Ready-to-Paste Agent Prompt

You are building P0.3.1 (GSD State Machine) for Colibri.

Spec: docs/guides/implementation/task-breakdown.md §P0.3.1

Input: docs/reference/extractions/beta-task-pipeline-extraction.md (state machine section)

Create:
- src/domains/tasks/state-machine.ts
  - 7 states: backlog, todo, in_progress, blocked, review, done, cancelled
  - transition(task, newState) → updated task or throws
  - canTransition(from, to) → boolean
  - Invalid transition → throws InvalidTransitionError {from, to, taskId}
- tests/domains/tasks/state-machine.test.ts
  - Test all valid transitions
  - Test all invalid transitions
  - 100% branch coverage

Run: npm test -- --coverage && npm run lint && npm run build

Coverage must be 100% for state-machine.test.ts. All tests pass. Commit. Create PR.

Verification Checklist

  • 7 states are defined as constants or enums
  • Valid transitions exist (backlog→todo, todo→in_progress, etc.)
  • Invalid transition throws with {from, to, taskId}
  • npm test -- --coverage shows 100% branch coverage on state machine
  • canTransition() is a pure function (no side effects)

Writeback Requirement

Create docs/packets/P0.3.1-packet.md with:

## Completion Record

- **Status:** done
- **Date:** 2026-04-09
- **Branch:** feature/P0.3.1-gsd-state-machine
- **Commit SHA:** [actual commit SHA]
- **Tests run:** npm test -- --coverage (state machine test passed, 100% coverage)
- **Lint:** npm run lint (0 errors)
- **Build:** npm run build (success)
- **Acceptance criteria:**
  - [x] 7 states defined (backlog, todo, in_progress, blocked, review, done, cancelled)
  - [x] Valid transition map implemented
  - [x] Invalid transition throws InvalidTransitionError
  - [x] transition() function returns updated task or throws
  - [x] canTransition() is pure (no side effects)
  - [x] 100% branch coverage on state-machine.test.ts
- **Blockers found:** none
- **Notes:** BOOTSTRAP COMPLETE — Colibri can now host business logic. Ready for P0.3.2+ and full Phase 0 expansion.

What This Unblocks

  • P0.3.2 (Task CRUD) — depends on P0.3.1
  • All remaining Phase 0 tasks (P0.3.2+, P0.4+, P0.5+, P0.6+, P0.7+, P0.8+, P0.9+)

After PR-7: Transition to Full Dogfooding

Once PR-7 (P0.3.1) is merged:

What’s Now Available

  1. MCP Server is runningsrc/server.ts exists and responds to tool calls
  2. Database is initialized — 78 tables, WAL mode, foreign keys enabled
  3. Two-phase startup works — Phase 1 (transport) → Phase 2 (heavy init)
  4. Task state machine works — 7 states, transitions, validation
  5. Bootstrap is complete — Colibri can host business logic

Remaining Phase 0 Tasks (20 tasks)

From this point, the remaining 20 tasks can proceed in parallel across multiple axes:

  • P0.3.2–P0.3.4 (β Task Pipeline) — CRUD, writeback enforcement, MCP task tools
  • P0.4.1–P0.4.4 (γ Server Lifecycle) — modes, shutdown, watchdog, lifecycle tools
  • P0.5.1–P0.5.3 (δ Model Router) — intent scoring, model fallback chain, routing tools
  • P0.6.1–P0.6.3 (ε Skill Registry) — skill schema, CRUD, agent spawning
  • P0.7.1–P0.7.3 (ζ Decision Trail) — hash chain, thought records, verification tools
  • P0.8.1–P0.8.3 (η Proof Store) — Merkle tree, retention zones, finalization
  • P0.9.1–P0.9.3 (ν Integrations) — MCP bridge, Claude API, notifications

How Agents Will Operate

  1. Agent calls task_next_actions tool (now available!) to see unblocked tasks
  2. Agent picks an unblocked task
  3. Agent creates a worktree: git worktree add .worktrees/claude/{task-slug} ...
  4. Agent implements the task
  5. Agent calls task_update(status="done") + thought_record(...) tools for writeback
  6. Agent creates a PR
  7. Human reviews and merges
  8. Doc-loop agent updates PHASE-0-PROGRESS.md and identifies next unblocked tasks

Dogfooding Loop

This is the self-build loop — Colibri agents building Colibri using Colibri’s own tools. See docs/guides/self-build-loop.md for the full specification.


Summary

PR # Task Title Status
1 P0.1.1 Package Setup Execute
2 P0.1.2 Test Runner + Linter Execute after PR-1 merges
3 P0.1.4 Environment Validation Execute after PR-1 merges (in parallel with PR-2)
4 P0.2.1 MCP Server Bootstrap Execute after PR-2 merges (UNBLOCK POINT A)
5 P0.2.2 SQLite Initialization Execute after PR-3 merges (UNBLOCK POINT B)
6 P0.2.3 Two-Phase Startup Execute after PR-4 + PR-5 merge
7 P0.3.1 GSD State Machine Execute after PR-5 merges (BOOTSTRAP COMPLETE)

See Also

  • [[./PHASE-0-EXECUTION-GUIDE.md]] — Full Phase 0 roadmap
  • [[./task-breakdown.md]] — Complete 28-task specification
  • [[./task-dependency-graph.md]] — Dependency visualization
  • [[./pre-mcp-bootstrap-sequence.md]] — Manual task tracking during pre-MCP period
  • [[../agent-bootstrap.md]] — Copy-paste agent bootstrap prompt
  • [[./self-build-loop.md]] — How Colibri builds Colibri (dogfooding)

Back to top

Colibri — documentation-first MCP runtime. Apache 2.0 + Commons Clause.

This site uses Just the Docs, a documentation theme for Jekyll.