Add lifecycle renormalization consistency repair

This commit is contained in:
2026-05-23 16:54:38 +02:00
parent 6496ef851a
commit 0aa02d9117
4 changed files with 284 additions and 7 deletions

View File

@@ -84,6 +84,10 @@ Progress 2026-05-23: added `api.services.lifecycle` with shared status
normalization and parent-activation helpers. The task API now uses the helper;
consistency tooling and future UI actions still need to adopt the shared layer.
Progress 2026-05-23: consistency tooling now uses the shared lifecycle helper
to detect and repair planning-state workplans with active tasks. Future UI
actions still need to route through the shared transition layer.
## T03 - Auto-Advance Workstream On Task Start
```task
@@ -128,7 +132,7 @@ state entry assertions pass.
```task
id: STATE-WP-0047-T05
status: todo
status: done
priority: high
state_hub_task_id: "611f0c22-34bc-494e-b520-068b4c3f0fec"
```
@@ -140,6 +144,12 @@ the `proposed workstream with in_progress task` case.
Done when direct DB or file manipulation that breaks lifecycle invariants is
caught by a repeatable repair path.
Result 2026-05-23: added consistency rule C-23 for the
`proposed`/`ready`/`backlog` workplan with an `in_progress` or `blocked` task
case. The repair updates the DB workstream to `active`, patches workplan
frontmatter to `status: active`, commits the writeback, and pushes through the
existing consistency sync loop.
## T06 - Record Drift As Learning Input
```task
@@ -177,6 +187,10 @@ and consistency repair tests.
Progress 2026-05-23: added engine and router coverage proving flow advancement
honors current exit assertions before moving to the target workstation.
Progress 2026-05-23: added consistency checker coverage for lifecycle
renormalization detection and repair, including a guard that C-23 takes
precedence over generic C-04 status drift.
## Acceptance Criteria
- Starting task work deterministically activates the parent workstream.