Files
ai-engineering/docs/plan-consolidation.md
T
bquarkz f5d5db73c2
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/AI Engineering/pipeline/head There was a failure building this commit
build / jvm (push) Canceled after 0s
build / native (macos-15, macos-arm64) (push) Canceled after 0s
build / native (ubuntu-24.04, linux-x86_64) (push) Canceled after 0s
build / native (windows-2025, windows-x86_64) (push) Canceled after 0s
feat: add Work guidance and adaptive Plan experiments
Persist explicit human discussion choices, DEC requests and approval policies. Add optional evidence-backed Plan experiments and align context, adapters and next actions under protocol contract 3.

Include WRK-000B decisions, plan history and verification evidence: 167 JVM tests, 25 focused checks, Jenkins fixtures and native smoke coverage.
2026-11-16 17:33:24 +00:00

3.3 KiB

Deterministic Plan consolidation

WRK-0002/DEC-0001 defines Step → Plan → Work consolidation. A completed last required step completes its Plan; each completed Plan rechecks all Plans owned by the Work. Completion checks never invoke an agent. Acceptance criteria remain in the Plans/steps, with their existing results, evidence and decision approvals.

The required set must contain a real completed delivery. Empty Works/Plans remain open. OPEN/ACTIVE steps or Plans, unresolved questions/surveys, empty surveys and draft decisions remain pending. In guided Works, missing conduct, absent applicable DEC approval, open experiments and unresolved DEC concerns also remain pending. Explicit BLOCKED/CANCELLED states require explicit resumption. Cancelling an item does not deliver it: plan exclude WRK PLN [--step TSK] --by NAME --reason TEXT records a scope review of a cancelled item, retains it and its history, and excludes only the reviewed content from the required set. Changing that content invalidates its exclusion. Dependencies still require actual completion; an exclusion does not satisfy a dependency.

work reconcile WRK [--requester NAME] [--request-id KEY] recovers missed coordination. Mutation commands call the same coordination API. work check, status, next-actions and context are read-only. Context/JSON and mutation reports expose consolidation state and pending Plans, plus the existing EPIC report.

Planning owns optional versioned exclusions[] on a Plan, with target, content hash, actor, reason and timestamp. Verification owns coordination and receipts; Planning never imports Verification. A new SYSTEM_PLANS Work completion has humanApproved=false, by=system:plans and optional aggregation provenance naming an owned ART receipt, input digest, requester and request ID. The receipt identifies the exact Plan revisions/hashes, including reviewed cancellations. Work prose criteria may be automatically linked to this aggregate receipt for compatibility; this records execution aggregation, not semantic proof of prose or a new human approval. No manual Work-level criterion mapping is required.

Receipts use origin ai-engineering:plans:<receipt-sha256>. Their input hash omits framework receipts so a published receipt can be reused after interruption. Final completion freezes the full scope including the receipt. Recovery validates integrity/history, consolidates Plans, publishes/reuses a receipt, records completion and invokes existing EPIC reconciliation. Publication is atomic per file; malformed or orphan records require explicit repair rather than silent deletion.

Existing completed Works and legacy serialized hashes remain unchanged. New optional fields are omitted when absent. Manual completion remains available for inspection-only Works without Plans. Adding a Plan to a completed Work requires explicit reopening; unchanged old Plans do not immediately reclose a reopened Work. Existing EPIC policy/authorization continues to govern EPIC completion.

Acceptance tests use disposable fixtures and a configured adapter that fails if called. Required cases cover multiple Plans, last-step completion, explicit Plan completion, cancellations/scope revisions, unresolved discussion/surveys/DECs, empty sets, reopening, interrupted publication/replay, legacy data, corruption, EPIC propagation and independent-process/native continuity.