# I0-A Core Progress

- Lane: Development Agent 2 — Lane A, Core Domain / Persistence / Application
- Branch: `impl/i0-a-core`
- Worktree: `/home/user/Projects/.worktrees/awp-i0-a-core`
- Required branch base: `origin/main` at `75d80546d78380e7ee317a9df46964d951832ac1`
- Recorded C0 implementation baseline: `114b57a4ad37f9178b9c6309497c39663d4580e9`
- State: C1 implementation complete; complete repository gate green; publication pending

## C1 scope delivered

### Domain and contracts

- Finalized I0/I1 fields and lifecycle state for Project, ProjectVisionVersion, Goal, Plan, PlanRevision, Task, FactoryRun, AgentRun, Attempt, Workspace, ChangeSet and Review.
- Added hard Task dependency DAG validation with rejection of unknown/cross-Project prerequisites and readable cycle paths.
- Added dependency-safe Queue projection, exact unsatisfied prerequisite reporting, dispatch eligibility, legal placement ranges and authoritative reorder rejection using stable `QUEUE_ORDER_CONSTRAINT` errors.
- Added explicit lifecycle transition functions for Project, Task, FactoryRun, AgentRun, ChangeSet and Review, including terminal-state protection and I1 recovery/correction paths.
- Strengthened Principal/capability narrowing: an AuthorityContext cannot request capabilities outside the Principal ceiling.
- Strengthened Connection/CredentialReference semantics with project binding validation that rejects capability/resource broadening.

### Application contracts

- Expanded transaction-scoped repositories across the I1 lifecycle: Project, ProjectVisionVersion, Goal, Plan, PlanRevision, Task, FactoryRun, AgentRun, Workspace, Attempt, ChangeSet and Review, plus business event/audit/outbox repositories.
- Added deterministic I1 Project/Goal/Plan/Task/FactoryRun fixtures for UI/provider consumers.
- Added deterministic I1 Project Overview read-model construction against canonical domain state and Queue legality.
- Added a Queue reorder command contract that validates domain legality before transactionally appending the business event, audit record and outbox message.

### Persistence

- Expanded Drizzle mappings for I1 domain state: names/titles/status, Goal criteria, Task dependency/Goal links, run/attempt provenance, ChangeSet revision/status and Review status/disposition/reviewer.
- Implemented transaction-scoped PostgreSQL mappings for ProjectVisionVersion, PlanRevision, Workspace, AgentRun and Attempt in addition to Project/Goal/Plan/Task/FactoryRun/ChangeSet/Review.
- Regenerated the pre-release initial Drizzle snapshot so the repository's existing migration integration gate applies the complete C1 baseline.
- Preserved the atomic state + business-event + audit + outbox transaction pattern from C0.

## Tests added

- `tests/domain/dependencies.test.ts`: legal DAG, readable cycle rejection, unknown dependency rejection.
- `tests/domain/queue.test.ts`: readiness, dispatch eligibility, legal placement range, illegal reorder rejection.
- `tests/domain/lifecycle.test.ts`: forward/recovery transitions and terminal-state protection.
- `tests/application/security.test.ts`: Principal and Connection binding ceiling enforcement.
- `tests/application/read-models.test.ts`: deterministic UI contract fixture/read model.
- `tests/application/commands.test.ts`: legal Queue mutation emits event/audit/outbox; illegal reorder emits none.
- `tests/persistence/schema.test.ts`: required I1 lifecycle/dependency persistence columns.
- Existing PostgreSQL atomic commit/rollback integration tests continue to pass against the regenerated C1 migration baseline.

## Boundaries preserved

- No provider SDK implementation.
- No Kubernetes, DBOS or ARC implementation.
- No UI implementation.
- No provider-native type is made authoritative in the domain.
- Trusted publication remains separate from AgentRun/AgentProvider authority.

## Validation environment

Repository engine contract is Node 22.x / pnpm 9.7.0. The local VM has Node 24, so gates are run on authorized buildbox `debian1` using a user-local Node `v22.18.0` and pnpm `9.7.0`; the repository engine constraint is not weakened.

Final C1 gate evidence on `debian1`:

- `node --version` -> `v22.18.0`.
- `pnpm --version` -> `9.7.0`.
- `pnpm check` -> PASS.
- `pnpm typecheck` -> PASS.
- `pnpm lint` -> PASS.
- `pnpm test` -> PASS, 11 files / 25 tests.
- `pnpm build` -> PASS.
- `pnpm test:architecture` -> PASS; 6 architecture tests and dependency-cruiser reports 0 violations across 37 modules / 46 dependencies.
- `pnpm format:check` -> PASS.
- Existing PostgreSQL PGlite commit/rollback integration tests -> PASS.

## C1 stable contract signal

The exact commit establishing the stable deterministic I1 read-model/fixture contract is `fa6c7d95fbef9194fb9b3b90767b347f87dc11b6`. Lane D must branch/consume from that exact C1 commit, not from the later docs-only handoff commit or an intermediate working-tree state.

## Stop condition

Stop at C1. Do not implement provider SDKs, durable execution infrastructure, Kubernetes/ARC/DBOS mechanics or UI in this lane.
