# AWP I0 Development Agent 1 — Launch Prompt

**Purpose:** copy/paste this into the first development conversation.  
**Lane:** A0 -> A, Bootstrap + Core Domain/Persistence/Application.  
**Do not launch provider/execution/UI code lanes until this agent lands Convergence Point C0.**

---

## Prompt

You are Development Agent 1 for AWP.

Repository:

```text
platform-modules/awp
```

Canonical branch:

```text
main
```

Your implementation lane is:

```text
I0-A0 Bootstrap
then
I0-A Core Domain / Persistence / Application
```

AWP is currently documentation-first and has not materially started implementation. Your job is to create the **first production-quality implementation foundation**, not a disposable prototype.

### Mandatory context — read before coding

Read these files from current `main`, in this order:

```text
README.md

docs/plans/AWP-SPECIFICATION-FINALIZATION-2026-08-20.md
docs/plans/AWP-I0-I1-PARALLEL-IMPLEMENTATION-PLAN.md
docs/plans/AWP-INCREMENTAL-DELIVERY-PLAN.md
docs/plans/AWP-INCREMENT-REALIZATION-MATRIX.md
docs/plans/STEP-0-PREPARATION-DEPENDENCIES.md
docs/plans/AWP-I0-I1-IMPLEMENTATION-READINESS.md
docs/plans/AWP-I0-I1-REUSE-PREFLIGHT.md
docs/plans/AWP-I0-I1-THREAT-MODEL.md

docs/plans/AWP-ARCHITECTURE-BASELINE.md
docs/plans/AWP-DEPLOYMENT-TOPOLOGY.md
docs/plans/AWP-FOSS-DECISIONS.md

docs/specs/architecture/principles.md
docs/specs/architecture/domain-model.md
docs/specs/architecture/module-boundaries.md
docs/specs/architecture/persistence-and-transactions.md
docs/specs/architecture/security-and-trust.md
docs/specs/architecture/configuration-and-policy.md
docs/specs/architecture/integrations-and-connections.md
docs/specs/architecture/workspace-execution.md
docs/specs/architecture/control-surfaces.md

docs/specs/domains/projects.md
docs/specs/domains/goals.md
docs/specs/domains/planning.md
docs/specs/domains/work.md
docs/specs/domains/work-queue.md
docs/specs/domains/factory.md
docs/specs/domains/agents.md
docs/specs/domains/changes.md
docs/specs/domains/reviews.md
docs/specs/domains/accounts-models-providers.md
docs/specs/domains/integrations-connections.md
docs/specs/domains/approvals-decisions.md

docs/specs/schemas/identifiers-versioning.md
docs/specs/schemas/transport-contracts.md
docs/specs/schemas/events-audit.md
docs/specs/schemas/configuration.md
docs/specs/schemas/adapters.md

docs/standards/coding-standard.md
```

Use `docs/specs/INDEX.md` to follow any required cross-links discovered while reading.

### Binding product model

Do not change this without an explicit Decision/spec amendment:

```text
ProjectVision != Goal != Plan

Goal
  current/future Project outcome

Plan
  bounded work advancing one or more Goals

Task
  executable work

hard Task dependencies
  directed acyclic graph

Queue priority
  only orders work inside dependency/policy legality

FactoryRun
  orchestration instance

AgentRun
  logical assignment

Attempt
  concrete provider/model/account/workspace execution

ChangeSet
  immutable candidate

Review
  independent exact-candidate disposition

Merge
  trusted control-plane protected action
```

`GOLIVE` is not a primitive.

### Binding architecture

```text
stateless edge/gateway
   -> authoritative modular-monolith control plane
      -> K3s execution plane
```

The gateway and control plane are separate deployable targets from day one even if co-located initially.

Normal execution agents do **not** receive reusable Git publication/merge credentials.

Provider SDK/native types do not leak into the domain layer.

### Reuse-before-build rule

Before implementing generic mechanics, check:

```text
1. existing AWP/project-native mechanism
2. exact current @platform-modules/* capability
3. exact current Overdeck capability if available
4. Node/PostgreSQL/Kubernetes native primitive
5. selected standard/FOSS/provider
6. only then custom generic mechanics
```

Current connected Platform baseline recorded by the plan is:

```text
platform-modules/mod
revision b7c7f97fa0c51a1cc2f5d87ee752a3c08a08495a
Node 22.x
pnpm 9.7.0
```

Verify rather than silently assuming it remains current in your implementation environment.

If exact Overdeck source is unavailable to you, record the evidence gate as blocked. Do not invent paths/commits and do not replace a potentially existing capability merely because source access is absent.

## Worktree / branch rules

Create a fresh isolated worktree/branch from current `origin/main`:

```text
impl/i0-a-bootstrap
```

Do not implement in a shared checkout.

Do not force-push another agent's branch.

You own the initial root/runtime skeleton until C0 is landed.

Create immediately:

```text
docs/progress/i0-a-core.md
```

Record:

```text
branch/worktree
base commit
owned paths
completed tasks
current task
tests/commands + results
new evidence/Decisions
blockers
next exact task
latest pushed commit
```

Update and push it at every meaningful checkpoint.

## Phase A0 — Bootstrap / C0

This phase is deliberately single-writer because future lanes depend on the repository layout.

### Establish the implementation workspace

Create a clean TypeScript/Node/pnpm workspace compatible with the canonical architecture.

Target shape:

```text
apps/
  gateway/
  control-plane/
  web/                     placeholder package only; UI agent owns implementation later

packages/
  contracts/
  domain/
  application/
  persistence/
  config/
  observability/
  providers/               package directories may be placeholders only

infra/
  k8s/
  arc/

tests/
  architecture/
  integration/
  security/

tools/
  preflight/

docs/
  progress/
```

Use workspace globs that allow later agents to create owned provider/UI packages without editing root configuration unnecessarily.

### Root tooling

Establish and pin:

```text
Node version compatible with current Platform consumer requirements
pnpm version
TypeScript version
ESM policy
lint
format
unit test runner
integration-test convention
build
typecheck
architecture dependency checks
```

Do not select package versions from memory. Verify current compatibility and record exact pins.

### Architecture conformance

Add executable dependency-boundary checks that prove at minimum:

```text
gateway -> contracts only
web -> contracts/application client seam only
control-plane -> contracts + application + domain + provider composition

domain -X-> Hono
domain -X-> Kubernetes
domain -X-> GitHub
domain -X-> Fabro
domain -X-> ACP
domain -X-> DBOS provider types

gateway -X-> persistence repositories
gateway -X-> Kubernetes adapters
gateway -X-> DBOS workflow implementation
```

Use the canonical module-boundary spec as authority.

### Final identity skeleton

Implement final opaque ID/value types needed by later lanes for:

```text
ProjectId
ProjectVisionVersionId / version identity as specified
GoalId
PlanId / PlanRevisionId
TaskId
FactoryRunId
AgentRunId
AttemptId
WorkspaceId
ChangeSetId
ReviewId
DecisionId / ApprovalId where required by I0 gates
ConnectionId / CredentialReferenceId
```

Do not use provider-native IDs as business identity.

### Provider interfaces only

Create the minimum **AWP-owned interfaces/test seams** needed so later lanes can compile independently, but do not implement their SDK/provider mechanics in this lane.

Examples according to canonical adapter specs:

```text
AccountProvider
VcsProvider / TrustedPublisher boundary
FactoryProvider
AgentProvider
DurableWorkflowProvider
WorkspaceProvider
CIProvider
SecretStore
Clock / Id generator where useful for deterministic tests
```

Keep provider-specific request/response types outside domain packages.

### Persistence skeleton

Set up PostgreSQL + Drizzle ownership/migration conventions and enough repositories/transaction infrastructure for the I0/I1 identities.

Required pattern:

```text
application command
  -> transaction
      authoritative state mutation
      business event
      required audit record
  -> commit together
```

Do not implement a second event-sourcing architecture unless the specs explicitly call for it.

### C0 acceptance

Do not declare C0 until all intended baseline commands pass:

```text
pnpm install --frozen-lockfile   (after lock exists)
pnpm typecheck
pnpm lint
pnpm test
pnpm build
architecture boundary tests
```

Also verify:

```text
no production implementation depends on workstation-local paths
no provider SDK imported by domain
no reusable publication secret architecture in AgentRun
workspace globs support later path-owned lanes
progress file current and pushed
```

Commit/push C0 and open the normal landing PR.

Do **not** merge your own work by bypassing repository policy. Use the repository's normal trusted landing path.

Report the exact C0 commit in `docs/progress/i0-a-core.md`.

## Phase A — Core Domain / Application / Persistence

Continue after C0 according to the parallel plan. If other lanes have already branched from landed C0, create/continue a clean `impl/i0-a-core` branch from that landed baseline rather than rewriting C0 history.

### Your exclusive write ownership

```text
packages/contracts/**
packages/domain/**
packages/application/**
packages/persistence/**
packages/config/** for domain/application configuration semantics
tests/domain/**
tests/application/**
tests/persistence/**
docs/progress/i0-a-core.md
```

Do not modify another lane's provider/Kubernetes/UI implementation paths.

### Implement I0/I1-compatible domain foundations

Implement/test at minimum:

#### Project / ProjectVision / Goal

- stable identities;
- current/version relationships required by I1;
- Goal lifecycle subset needed by I1;
- Goal/Plan linkage;
- no `GOLIVE` type.

#### Plan / Task

- Plan / PlanRevision identities;
- Task ownership and states needed by I1;
- hard Task dependency relation;
- cross-Plan dependency support inside one Project where specified.

#### Dependency DAG

Required tests:

```text
add legal dependency
reject self-dependency
reject direct cycle
reject transitive cycle with readable cycle path
cross-Plan dependency in same Project
reject invalid cross-Project dependency
completed prerequisite re-evaluates dependent readiness
```

#### Queue legality

Implement authoritative legal ordering semantics:

```text
dependency legality first
policy/approval/resource legality next
manual priority only among legal candidates
```

Required tests:

```text
ready Task before dependent is legal
moving dependent before prerequisite is rejected
moving prerequisite after dependent is rejected
legal movement range calculation
cross-Plan prerequisite constrains range
client-proposed invalid target cannot bypass application validation
completion of prerequisite can make dependent READY
priority never makes blocked Task dispatch-eligible
```

#### Factory / Agent identity subset

Implement state/identity structures required so provider lanes can map to:

```text
FactoryRun
AgentRun
Attempt
Workspace reference
```

Do not implement Fabro/ACP/Kubernetes mechanics.

#### ChangeSet / Review subset

Implement exact-candidate identity structures required for I1:

```text
base identity
candidate identity/digest
producer provenance
Review binds exactly one candidate revision
new candidate does not silently inherit stale Review/evidence
trusted MergeGate input shape
```

Trusted Git provider mechanics remain Lane B.

#### Principal / capability / Connection skeleton

Implement canonical authorization inputs and narrowing semantics required by I0/I1. Prompt text/page context/provider metadata cannot grant authority.

### Persistence

Add Drizzle schemas/repositories/migrations and transaction tests for the implemented authoritative state.

Preserve clean domain/application boundaries. Do not put SQL/Drizzle objects into domain APIs.

### Business events / audit

Implement the minimal event envelope/correlation/causation/audit transaction behavior required by I0/I1.

Write tests that prove required state mutation and audit/event persistence cannot silently diverge under transaction failure.

## Do not implement in this lane

Do not implement:

- Subrouter provider mechanics;
- GitHub SDK/provider logic;
- Fabro runtime adapter;
- ACP runtime adapter;
- DBOS runtime implementation;
- Kubernetes WorkspaceProvider;
- ARC;
- React UI;
- I2 rich Planning;
- I3 Advisor/Search/Decision UX depth;
- I5 full CI control plane;
- I6 release/deployment;
- I7 cluster UI;
- I8 incident product;
- I9 enterprise/reliability productization.

Do not edit approved U1–U6 visual authority except for an explicit owner-approved design amendment.

## Testing quality

Write behavior tests against canonical invariants, not only getters/constructors.

Prefer deterministic unit tests for domain/application logic and focused repository integration tests for transaction/migration behavior.

Do not skip or delete failing tests to make the gate green.

## Evidence / spec amendment rule

If implementation uncovers a real contradiction:

```text
1. stop the conflicting implementation
2. record evidence in the progress file
3. open/update a Decision/spec amendment in the same branch
4. explain affected downstream lanes
5. proceed only after the target authority is explicit
```

Do not silently change architecture/product behavior in code.

## Completion definition for your lane

Your lane is complete when:

```text
C0 bootstrap landed
core I0/I1 business identities compile and persist
DAG/Queue legality is fully tested
application transaction/event/audit pattern is proven
Principal/capability/Connection skeleton exists
provider lanes can consume stable interfaces without domain leakage
UI lane can consume stable contract/read-model fixtures
all owned tests/build/typecheck/lint pass
architecture checks pass
progress record is current
all work committed and pushed
normal landing PR is ready/landed according to repository policy
```

At completion, report:

```text
landed commits/PRs
commands and results
exact remaining blockers
contract handoffs for lanes B/C/D
any spec Decisions/amendments
```

Do not start I2+ work.

---

## Coordinator note

Once this agent lands C0, the coordinator may launch the provider, execution and UI conversations in parallel from the exact C0/main convergence commit using [`AWP-I0-I1-PARALLEL-IMPLEMENTATION-PLAN.md`](AWP-I0-I1-PARALLEL-IMPLEMENTATION-PLAN.md).