UAT: A2A facade _cleveragents/plan/explain is a complete stub — never queries DecisionService, always returns "Not yet implemented" #3214

Closed
opened 2026-04-05 07:53:38 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/m6-a2a-facade-plan-explain-stub
  • Commit Message: fix(a2a): implement _handle_plan_explain to delegate to DecisionService
  • Milestone: v3.5.0
  • Parent Epic: #397

Background and Context

The A2A facade handler _handle_plan_explain in src/cleveragents/a2a/facade.py (cleveragents.a2a.facade.A2aLocalFacade._handle_plan_explain) is a complete stub. It was never implemented — it always returns {"explanation": "Not yet implemented", "stub": True} regardless of the plan_id or decision_id provided, and it never queries DecisionService at all.

This is a v3.5.0 M6 Autonomy Hardening deliverable. The milestone acceptance criterion explicitly states: "A2A facade session and plan lifecycle operations functional via CLI." A stub that returns "Not yet implemented" for _cleveragents/plan/explain directly violates this criterion.

This bug is distinct from #3174, which covers the CLI agents plan explain command's JSON/YAML output format. This issue is about the A2A facade handler itself being unimplemented.

Current Behavior

def _handle_plan_explain(self, params: dict[str, Any]) -> dict[str, Any]:
    plan_id = params.get("plan_id", "")
    decision_id = params.get("decision_id", "")
    return {
        "plan_id": plan_id,
        "decision_id": decision_id,
        "explanation": "Not yet implemented",
        "stub": True,
    }

Any A2A client dispatching _cleveragents/plan/explain with a valid plan_id or decision_id receives {"explanation": "Not yet implemented", "stub": True}. The DecisionService is never consulted.

Expected Behavior

Per docs/specification.md §Plan Lifecycle, the _cleveragents/plan/explain operation must return full decision details including:

  • The question posed
  • The chosen option
  • Confidence score
  • Alternatives considered
  • Rationale
  • Actor reasoning

The working reference implementation is the CLI agents plan explain command at cleveragents.cli.commands.plan (lines 3493–3562), which delegates to DecisionService.get_decision() and DecisionService.list_decisions(). The A2A facade handler must do the same.

Acceptance Criteria

  • _handle_plan_explain queries DecisionService.get_decision(decision_id) when decision_id is provided
  • _handle_plan_explain queries DecisionService.list_decisions(plan_id) when only plan_id is provided
  • The response includes: question, chosen_option, confidence, alternatives, rationale, and actor_reasoning fields
  • A missing or unknown decision_id/plan_id returns a structured error response (not a stub)
  • stub field is removed from the response
  • All existing A2A facade tests continue to pass
  • New BDD scenarios cover the _cleveragents/plan/explain A2A operation end-to-end

Supporting Information

  • Stub location: cleveragents.a2a.facade.A2aLocalFacade._handle_plan_explain
  • Working service methods: cleveragents.application.services.decision_service.DecisionService.get_decision, DecisionService.list_decisions
  • CLI reference implementation: cleveragents.cli.commands.plan (the agents plan explain command)
  • Related issue (distinct): #3174 — CLI agents plan explain JSON/YAML output format

Steps to Reproduce

  1. Wire a PlanLifecycleService and DecisionService into A2aLocalFacade
  2. Create a plan with decisions recorded
  3. Dispatch _cleveragents/plan/explain with plan_id or decision_id via the A2A facade
  4. Observe that explanation is always "Not yet implemented" and stub is True

Subtasks

  • Inject DecisionService into A2aLocalFacade via constructor (dependency injection)
  • Implement _handle_plan_explain to call DecisionService.get_decision(decision_id) when decision_id is provided
  • Implement _handle_plan_explain to call DecisionService.list_decisions(plan_id) when only plan_id is provided
  • Map DecisionService response fields to the A2A response schema (question, chosen_option, confidence, alternatives, rationale, actor_reasoning)
  • Return a structured error (not a stub) for unknown/missing IDs
  • Remove stub: True from the response
  • Tests (Behave): Add BDD scenarios for _cleveragents/plan/explain via A2A facade — happy path (by decision_id), happy path (by plan_id), and not-found error case
  • Tests (Robot): Add integration test exercising the A2A facade plan/explain operation end-to-end
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • _handle_plan_explain delegates to DecisionService and returns real decision data — the stub field is gone and explanation is never "Not yet implemented".
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(a2a): implement _handle_plan_explain to delegate to DecisionService), followed by a blank line, then additional lines providing relevant implementation details.
  • The commit is pushed to the remote on the branch fix/m6-a2a-facade-plan-explain-stub.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/m6-a2a-facade-plan-explain-stub` - **Commit Message**: `fix(a2a): implement _handle_plan_explain to delegate to DecisionService` - **Milestone**: v3.5.0 - **Parent Epic**: #397 ## Background and Context The A2A facade handler `_handle_plan_explain` in `src/cleveragents/a2a/facade.py` (`cleveragents.a2a.facade.A2aLocalFacade._handle_plan_explain`) is a complete stub. It was never implemented — it always returns `{"explanation": "Not yet implemented", "stub": True}` regardless of the `plan_id` or `decision_id` provided, and it never queries `DecisionService` at all. This is a v3.5.0 M6 Autonomy Hardening deliverable. The milestone acceptance criterion explicitly states: **"A2A facade session and plan lifecycle operations functional via CLI."** A stub that returns `"Not yet implemented"` for `_cleveragents/plan/explain` directly violates this criterion. This bug is **distinct from #3174**, which covers the CLI `agents plan explain` command's JSON/YAML output format. This issue is about the A2A facade handler itself being unimplemented. ## Current Behavior ```python def _handle_plan_explain(self, params: dict[str, Any]) -> dict[str, Any]: plan_id = params.get("plan_id", "") decision_id = params.get("decision_id", "") return { "plan_id": plan_id, "decision_id": decision_id, "explanation": "Not yet implemented", "stub": True, } ``` Any A2A client dispatching `_cleveragents/plan/explain` with a valid `plan_id` or `decision_id` receives `{"explanation": "Not yet implemented", "stub": True}`. The `DecisionService` is never consulted. ## Expected Behavior Per `docs/specification.md` §Plan Lifecycle, the `_cleveragents/plan/explain` operation must return full decision details including: - The question posed - The chosen option - Confidence score - Alternatives considered - Rationale - Actor reasoning The working reference implementation is the CLI `agents plan explain` command at `cleveragents.cli.commands.plan` (lines 3493–3562), which delegates to `DecisionService.get_decision()` and `DecisionService.list_decisions()`. The A2A facade handler must do the same. ## Acceptance Criteria - [ ] `_handle_plan_explain` queries `DecisionService.get_decision(decision_id)` when `decision_id` is provided - [ ] `_handle_plan_explain` queries `DecisionService.list_decisions(plan_id)` when only `plan_id` is provided - [ ] The response includes: `question`, `chosen_option`, `confidence`, `alternatives`, `rationale`, and `actor_reasoning` fields - [ ] A missing or unknown `decision_id`/`plan_id` returns a structured error response (not a stub) - [ ] `stub` field is removed from the response - [ ] All existing A2A facade tests continue to pass - [ ] New BDD scenarios cover the `_cleveragents/plan/explain` A2A operation end-to-end ## Supporting Information - **Stub location**: `cleveragents.a2a.facade.A2aLocalFacade._handle_plan_explain` - **Working service methods**: `cleveragents.application.services.decision_service.DecisionService.get_decision`, `DecisionService.list_decisions` - **CLI reference implementation**: `cleveragents.cli.commands.plan` (the `agents plan explain` command) - **Related issue (distinct)**: #3174 — CLI `agents plan explain` JSON/YAML output format ## Steps to Reproduce 1. Wire a `PlanLifecycleService` and `DecisionService` into `A2aLocalFacade` 2. Create a plan with decisions recorded 3. Dispatch `_cleveragents/plan/explain` with `plan_id` or `decision_id` via the A2A facade 4. Observe that `explanation` is always `"Not yet implemented"` and `stub` is `True` ## Subtasks - [ ] Inject `DecisionService` into `A2aLocalFacade` via constructor (dependency injection) - [ ] Implement `_handle_plan_explain` to call `DecisionService.get_decision(decision_id)` when `decision_id` is provided - [ ] Implement `_handle_plan_explain` to call `DecisionService.list_decisions(plan_id)` when only `plan_id` is provided - [ ] Map `DecisionService` response fields to the A2A response schema (`question`, `chosen_option`, `confidence`, `alternatives`, `rationale`, `actor_reasoning`) - [ ] Return a structured error (not a stub) for unknown/missing IDs - [ ] Remove `stub: True` from the response - [ ] Tests (Behave): Add BDD scenarios for `_cleveragents/plan/explain` via A2A facade — happy path (by `decision_id`), happy path (by `plan_id`), and not-found error case - [ ] Tests (Robot): Add integration test exercising the A2A facade `plan/explain` operation end-to-end - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - `_handle_plan_explain` delegates to `DecisionService` and returns real decision data — the `stub` field is gone and `explanation` is never `"Not yet implemented"`. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(a2a): implement _handle_plan_explain to delegate to DecisionService`), followed by a blank line, then additional lines providing relevant implementation details. - The commit is pushed to the remote on the branch `fix/m6-a2a-facade-plan-explain-stub`. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.5.0 milestone 2026-04-05 07:54:56 +00:00
Author
Owner

Closing as duplicate of #3147. Both issues describe the same bug: _handle_plan_explain in src/cleveragents/a2a/facade.py unconditionally returns a stub response instead of delegating to DecisionService. #3147 was triaged and verified in cycle 2 with MoSCoW/Should Have, assigned to v3.5.0.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Closing as duplicate of #3147. Both issues describe the same bug: `_handle_plan_explain` in `src/cleveragents/a2a/facade.py` unconditionally returns a stub response instead of delegating to `DecisionService`. #3147 was triaged and verified in cycle 2 with MoSCoW/Should Have, assigned to v3.5.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo removed this from the v3.5.0 milestone 2026-04-06 21:05:26 +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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3214
No description provided.