Compare commits

...

1 Commits

Author SHA1 Message Date
HAL9000 f2291ea1d2 fix(cli): replace private _commit_plan with public save_plan API
Resolve the SOLID principle violation where CLI commands accessed the
private _lifecycle._commit_plan() method directly, breaking encapsulation.
All four call sites in cli/commands/plan.py (use_action, execute_plan, and
error recovery paths) now use the public save_plan() service method.

Also update CHANGELOG.md with [Unreleased] entry and CONTRIBUTORS.md.

ISSUES CLOSED: #8628
2026-05-08 15:04:11 +00:00
3 changed files with 7 additions and 4 deletions
+2
View File
@@ -13,6 +13,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
traceback in the structlog warning entry. Removed `@tdd_expected_fail` tag
from the TDD test so both scenarios run as normal regression guards. (#988)
- **Replaced private `_commit_plan` with public `save_plan` in CLI plan commands** (#8661): Resolved the SOLID principle violation where the CLI command layer directly accessed `_lifecycle._commit_plan()`, breaking encapsulation. All call sites in `cli/commands/plan.py` (use_action, execute_plan, and error recovery paths) now use the public `save_plan()` service method as intended by the API design.
### Fixed
- **Actor CLI NAME argument made optional, derived from YAML config** (#4186): The
`agents actor add` positional ``NAME`` argument is now optional (defaults to
+1
View File
@@ -14,6 +14,7 @@ Below are some of the specific details of various contributions.
* Jeffrey Phillips Freeman has acted as Lead Developer, daily contributor, and Project Owner.
* Brent E. Edwards has contributed quality assurance, test coverage, and CI pipeline improvements.
* **HAL 9000** — CLI plan command refactoring (PR #8661): Replaced private `_commit_plan` method calls with the public `save_plan()` service API in CLI plan commands, resolving a SOLID encapsulation violation.
* HAL 9000 has contributed automated implementation, bug fixes, and feature development as part of the CleverAgents automation pool.
* HAL 9000 has contributed concurrency safety improvements, including thread-safe context tier management (issue #7547) for parallel plan execution.
* HAL 9000 has contributed the plan concurrency race-condition fix (#7989): wired `LockService` into the plan lifecycle, guarding `execute_plan()` and `apply_plan()` with plan-level advisory locks and unique per-invocation owner identities to prevent silent concurrent state corruption.
+4 -4
View File
@@ -1131,7 +1131,7 @@ def _recover_errored_execute_plan(
current_plan.error_details = {
"strategy_decisions_json": strategy_json,
}
service._commit_plan(current_plan)
service.save_plan(current_plan)
current_plan = service.get_plan(plan_id)
if current_plan is None:
console.print(
@@ -1183,7 +1183,7 @@ def _recover_errored_execute_plan(
"prior_error_type": error_type,
"prior_error_details": json.dumps(prior_errors),
}
service._commit_plan(current_plan)
service.save_plan(current_plan)
# If reversion succeeded, re-run strategize with error findings
if current_plan.phase == PlanPhase.STRATEGIZE:
@@ -1842,7 +1842,7 @@ def use_action(
execution_environment,
]
):
service._commit_plan(plan)
service.save_plan(plan)
if fmt != OutputFormat.RICH.value:
data = _plan_spec_dict(plan)
@@ -1975,7 +1975,7 @@ def execute_plan(
pre = service.get_plan(plan_id)
if pre is not None:
pre.execution_environment = execution_environment.lower()
service._commit_plan(pre)
service.save_plan(pre)
# Create per-resource sandboxes (spec §19310) and build the
# executor with the sandbox path.