feat(domain): rebaseline plan phases and apply states #235

Closed
opened 2026-02-22 23:40:23 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit: feat(domain): rebaseline plan phases and apply states
  • Branch: feature/m1-plan-phase-rebaseline

Subtasks

  • Update PlanPhase to include ACTION and remove APPLIED as a phase; keep phases strictly action/strategize/execute/apply per spec.
  • Expand processing_state (or introduce apply_state mapping) to represent Apply terminal outcomes (applied, constrained, errored, cancelled) and keep non-Apply states (queued, processing, complete) for Strategize/Execute.
  • Update Plan model validators to allow namespaced names for top-level plans and ULID-only identifiers for subplans; enforce ULID-only for subplans in hierarchy validators.
  • Update Plan.as_cli_dict() + CLI formatting to show Action phase, apply terminal outcome (explicit field), and phase/processing_state alignment.
  • Update PlanLifecycleService to create plans in Action phase, transition to Strategize on plan use, and set Apply terminal outcomes on plan apply (including constrained for spec-defined reversion cases).
  • Update docs/reference/plan_model.md and docs/reference/plan_lifecycle_service.md with Action phase semantics, apply terminal outcomes, and reversion rules (Execute/Apply → Strategize).
  • Tests (Behave): Add/adjust scenarios for Action phase creation, Strategize entry, Apply terminal outcomes, and reversion preconditions.
  • Tests (Robot): Update lifecycle Robot suites to assert Action phase visibility and Apply terminal outcome fields in status output.
  • Tests (ASV): Add benchmarks/plan_phase_bench.py for phase transition validation overhead.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.

Section: #### Section 3 Notes
Status: Completed

## Metadata - **Commit**: `feat(domain): rebaseline plan phases and apply states` - **Branch**: `feature/m1-plan-phase-rebaseline` ## Subtasks - [x] Update `PlanPhase` to include `ACTION` and remove `APPLIED` as a phase; keep phases strictly `action/strategize/execute/apply` per spec. - [x] Expand `processing_state` (or introduce `apply_state` mapping) to represent Apply terminal outcomes (`applied`, `constrained`, `errored`, `cancelled`) and keep non-Apply states (`queued`, `processing`, `complete`) for Strategize/Execute. - [x] Update `Plan` model validators to allow namespaced names for top-level plans and ULID-only identifiers for subplans; enforce ULID-only for subplans in hierarchy validators. - [x] Update `Plan.as_cli_dict()` + CLI formatting to show Action phase, apply terminal outcome (explicit field), and phase/processing_state alignment. - [x] Update `PlanLifecycleService` to create plans in Action phase, transition to Strategize on `plan use`, and set Apply terminal outcomes on `plan apply` (including `constrained` for spec-defined reversion cases). - [x] Update `docs/reference/plan_model.md` and `docs/reference/plan_lifecycle_service.md` with Action phase semantics, apply terminal outcomes, and reversion rules (Execute/Apply → Strategize). - [x] Tests (Behave): Add/adjust scenarios for Action phase creation, Strategize entry, Apply terminal outcomes, and reversion preconditions. - [x] Tests (Robot): Update lifecycle Robot suites to assert Action phase visibility and Apply terminal outcome fields in status output. - [x] Tests (ASV): Add `benchmarks/plan_phase_bench.py` for phase transition validation overhead. - [x] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes. - [x] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. **Section**: #### Section 3 Notes **Status**: Completed
freemo added this to the v3.0.0 milestone 2026-02-22 23:40:23 +00:00
freemo self-assigned this 2026-02-22 23:40:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#235
No description provided.