fix(plan-lifecycle): gate Apply phase on Definition-of-Done evaluation #8299

Merged
HAL9000 merged 4 commits from fix/7927-apply-phase-dod-gating into master 2026-06-02 09:30:14 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 37ce45c3bd fix(plan-lifecycle): correct _commit_plan typo to commit_plan in _evaluate_dod
CI / push-validation (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 33s
CI / build (pull_request) Successful in 43s
CI / lint (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 58s
CI / typecheck (pull_request) Successful in 1m8s
CI / security (pull_request) Successful in 1m17s
CI / unit_tests (pull_request) Successful in 6m37s
CI / docker (pull_request) Successful in 1m28s
CI / integration_tests (pull_request) Successful in 9m40s
CI / coverage (pull_request) Successful in 8m22s
CI / status-check (pull_request) Successful in 4s
`_evaluate_dod` called `self._commit_plan(plan)` which does not exist,
causing an AttributeError at runtime for any plan with DoD criteria and
a Pyright error during typecheck. The correct public method is
`self.commit_plan(plan)` (defined at line 792), which persists the
updated plan when a UnitOfWork is wired and is a no-op in in-memory
mode — matching the pattern used in `apply_plan` and `execute_plan`.

ISSUES CLOSED: #7927
2026-06-02 05:14:43 -04:00
HAL9000 419775b0d1 fix(plan-lifecycle): correct DoD gating test assertions
The test scenario 'validation_summary is populated after DoD evaluation'
was expecting 'total' and 'required_passed' keys which are not added by
the DoD evaluation. These keys are only present when the plan goes through
the Execute phase validation gate. The DoD evaluation only adds
'dod_evaluated', 'dod_all_passed', and 'dod' keys.

Updated the test to check for the 'dod' key instead, which correctly
reflects the structure of the validation_summary after DoD evaluation.

ISSUES CLOSED: #7927
2026-06-02 05:14:43 -04:00
HAL9000 de1fd49594 fix(plan-lifecycle): fix integration test regressions from DoD gating
Update integration test helpers to use definition_of_done values that
satisfy the new TextMatchEvaluator gate (criterion text must appear as
a substring of a plan argument key or value).  Also fix _evaluate_dod
to merge DoD metadata into plan.validation_summary without overwriting
Execute-phase validation counts, preserving the coverage/tool-validation
gate used by apply_with_validation_gate.  Update CONTRIBUTORS.md.

Fixes: wf02, wf04, wf06, wf07 integration test suites.

ISSUES CLOSED: #7927
2026-06-02 05:14:43 -04:00
HAL9000 0dcf7bf152 fix(plan-lifecycle): gate Apply phase on Definition-of-Done evaluation
Before transitioning to the Apply phase, PlanLifecycleService.apply_plan
now evaluates the plan's definition_of_done criteria using DoDEvaluator
(TextMatchEvaluator). If any required criteria fail, a DoDGatingError is
raised and the plan remains in Execute/COMPLETE state. The evaluation
result is stored in plan.validation_summary with dod_evaluated=True and
dod_all_passed reflecting the outcome. Plans with no DoD text skip
evaluation and proceed normally.

Adds DoDGatingError exception class and _evaluate_dod() helper method.
Adds BDD feature file and step definitions for DoD gating scenarios.

ISSUES CLOSED: #7927
2026-06-02 05:14:43 -04:00