Done Work Item
Exchange record schema and typed contracts — normalized exchange_record with canonical lane model
Define the canonical exchange record schema and TypeScript contracts for the Capability Exchange Engine (Slice 6). Create: lib/contracts/exchange-record.ts (ExchangeRecord interface: id, kind [promote|harvest], state, candidateId, sourceRepo, targetRepo, title, summary, packagedAt, appliedAt, verifiedAt, rejectedAt, createdAt, updatedAt, createdBy), lib/contracts/exchange-lane.ts (ExchangeLane enum: candidate, triage, approved, packaged, applied, verified, blocked, rejected, superseded), lib/contracts/registry-entry.ts (RegistryEntry: id, exchangeId, capability, version, tags, lineageRefs). Add schema to BF-213 ORM schema. Create IExchangeRepository implementation. All contracts must be promotable to template later.
Execution Context
- ID
- wi-BF-221
- Branch
- bf/BF-221-exchange-record-schema-contracts
- Validation
- ./scripts/validate-local.ps1
- PR
- https://github.com/SingletonTheory/build-factory-bootstrap/pull/279
Lifecycle Metadata
- Lane
- Done
- Work type
- feature
- Source
- done
- Status
- done
- State
- done
- Done criteria
- 8
Queue Truth
Freshness: Fresh (snapshot age 0s)
Drift: none.
Reconciliation Guidance
- No reconciliation required; item truth signals are consistent.
Prompt Context
./work-items/prompts/wi-BF-221.prompt.md
Define the canonical exchange record schema and TypeScript contracts for the Capability Exchange Engine (Slice 6). Create: lib/contracts/exchange-record.ts (ExchangeRecord interface: id, kind [promote|harvest], state, candidateId, sourceRepo, targetRepo, title, summary, packagedAt, appliedAt, verifiedAt, rejectedAt, createdAt, updatedAt, createdBy), lib/contracts/exchange-lane.ts (ExchangeLane enum: candidate, triage, approved, packaged, applied, verified, blocked, rejected, superseded), lib/contracts/registry-entry.ts (RegistryEntry: id, exchangeId, capability, version, tags, lineageRefs). Add schema to BF-213 ORM schema. Create IExchangeRepository implementation. All contracts must be promotable to template later.
Available Actions
- Start executionBlocked
Queue execution handoff for this work item.
Recovery guidance
- Cause
- Done items stay closed; Start execution cannot move them backward.
- Policy context
- Lane transition policy blocks Start execution when the item is already Done.
- Next step
- Create a net-new work item if more delivery is needed instead of reopening this one.
- Safe retry
- Do not retry Start execution on a done item.
identity: start-execution
permission: factory.work-item.execute
policy gate lane-transition: blocked (Done items stay closed; Start execution cannot move them backward.)
POST /api/control-plane/items/wi-BF-221/actions/start-execution
- Request reviewBlocked
Mark this item ready for review lane handoff.
Recovery guidance
- Cause
- Done items stay closed; Request review cannot move them backward.
- Policy context
- Lane transition policy blocks Request review when the item is already Done.
- Next step
- Create a net-new work item if more delivery is needed instead of reopening this one.
- Safe retry
- Do not retry Request review on a done item.
identity: request-review
permission: factory.work-item.request-review
policy gate lane-transition: blocked (Done items stay closed; Request review cannot move them backward.)
POST /api/control-plane/items/wi-BF-221/actions/request-review
- Prepare releaseEnabled
Run release-preparation checks for the work item.
identity: prepare-release
permission: factory.work-item.prepare-release
policy gate lane-eligibility: pass
policy gate pull-request: pass
POST /api/control-plane/items/wi-BF-221/actions/prepare-release
- Record historyEnabled
Capture history snapshots for audit and validation views.
identity: record-history
permission: factory.work-item.record-history
policy gate context-visibility: pass
POST /api/control-plane/items/wi-BF-221/actions/record-history