UAT: # type: ignore[return-value] suppressions in src/cleveragents/a2a/facade.py violate CONTRIBUTING.md strict no-suppression rule #2860

Open
opened 2026-04-04 21:01:36 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: fix(a2a): remove type: ignore suppressions from facade service accessors
  • Branch: fix/a2a-facade-type-ignore-suppressions
  • Milestone: v3.4.0
  • Parent Epic: #933

Background and Context

CONTRIBUTING.md enforces a strict no-suppression rule for type checking:

No Type Suppression: The use of # type: ignore or any other mechanism to suppress or disable type checking is strictly forbidden.

All code must pass nox -e typecheck (Pyright) without any suppression comments. During UAT testing of the A2A Protocol feature area, src/cleveragents/a2a/facade.py was found to contain 5 # type: ignore[return-value] suppressions in its service accessor properties — a direct violation of this rule.

The A2aLocalFacade (per spec §Architecture) is the in-process facade that resolves platform operations when running in local mode. Its service accessor properties are typed to return specific service types, but the underlying _services dict is typed as dict[str, Any], causing Pyright type mismatches that have been suppressed rather than fixed.

Current Behavior

src/cleveragents/a2a/facade.py contains 5 # type: ignore[return-value] suppressions in the service accessor properties:

# Line 137:
return self._services.get("session_service")  # type: ignore[return-value]

# Line 142:
return svc  # type: ignore[return-value]

# Line 146:
return self._services.get("tool_registry")  # type: ignore[return-value]

# Line 151:
return svc  # type: ignore[return-value]

# Line 155:
return self._services.get("event_queue")  # type: ignore[return-value]

These suppressions appear in the _session_service, _plan_lifecycle_service, _tool_registry, _resource_registry_service, and _event_queue property accessors.

Root Cause: The _services dict is typed as dict[str, Any], so .get() returns Any | None. The properties are typed to return specific service types (e.g., SessionService | None), causing a Pyright type mismatch that is suppressed instead of fixed.

Expected Behavior

All # type: ignore comments must be removed from src/cleveragents/a2a/facade.py. The code must be refactored to be fully type-safe so that nox -e typecheck passes without any suppressions. Acceptable approaches include:

  1. Retype _services using a TypedDict that maps each service key to its concrete type
  2. Use a Protocol for the services container
  3. Add explicit isinstance checks before returning from each accessor

Acceptance Criteria

  • All 5 # type: ignore[return-value] comments are removed from src/cleveragents/a2a/facade.py
  • nox -e typecheck passes with zero Pyright errors or suppressions on the file
  • The service accessor properties (_session_service, _plan_lifecycle_service, _tool_registry, _resource_registry_service, _event_queue) are fully type-safe without any casting workarounds that merely defer the problem
  • No new # type: ignore comments are introduced anywhere in the file
  • All existing Behave unit test scenarios for facade.py continue to pass (nox -e unit_tests)
  • Coverage remains ≥97% (nox -e coverage_report)

Supporting Information

  • File: src/cleveragents/a2a/facade.py
  • Lines affected: 137, 142, 146, 151, 155
  • Violation: CONTRIBUTING.md "No Type Suppression" rule
  • Detected during: UAT testing of Epic #933 (A2A Protocol Compliance)
  • Runtime impact: None — this is a static typing standards violation only
  • Related nox session: nox -e typecheck

Subtasks

  • Inspect _services dict declaration and all service accessor properties in facade.py
  • Design a type-safe replacement (e.g., TypedDict, Protocol, or explicit isinstance guards)
  • Refactor _services and all 5 accessor properties to eliminate the type mismatches
  • Remove all 5 # type: ignore[return-value] suppression comments
  • Run nox -e typecheck and confirm zero errors on facade.py
  • Run nox -e unit_tests and confirm all existing scenarios pass
  • Verify coverage ≥97% via nox -e coverage_report
  • Run nox (all default sessions) and fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • All 5 # type: ignore[return-value] suppressions have been removed from src/cleveragents/a2a/facade.py.
  • nox -e typecheck passes with zero errors or warnings on the affected file.
  • All nox default sessions pass without errors.
  • Coverage remains ≥97%.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(a2a): remove type: ignore suppressions from facade service accessors), followed by a blank line, then additional lines describing the implementation.
  • The commit is pushed to the remote on branch fix/a2a-facade-type-ignore-suppressions.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

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

## Metadata - **Commit Message**: `fix(a2a): remove type: ignore suppressions from facade service accessors` - **Branch**: `fix/a2a-facade-type-ignore-suppressions` - **Milestone**: v3.4.0 - **Parent Epic**: #933 ## Background and Context CONTRIBUTING.md enforces a **strict no-suppression rule** for type checking: > **No Type Suppression**: The use of `# type: ignore` or any other mechanism to suppress or disable type checking is strictly forbidden. All code must pass `nox -e typecheck` (Pyright) without any suppression comments. During UAT testing of the A2A Protocol feature area, `src/cleveragents/a2a/facade.py` was found to contain **5 `# type: ignore[return-value]` suppressions** in its service accessor properties — a direct violation of this rule. The `A2aLocalFacade` (per spec §Architecture) is the in-process facade that resolves platform operations when running in local mode. Its service accessor properties are typed to return specific service types, but the underlying `_services` dict is typed as `dict[str, Any]`, causing Pyright type mismatches that have been suppressed rather than fixed. ## Current Behavior `src/cleveragents/a2a/facade.py` contains 5 `# type: ignore[return-value]` suppressions in the service accessor properties: ```python # Line 137: return self._services.get("session_service") # type: ignore[return-value] # Line 142: return svc # type: ignore[return-value] # Line 146: return self._services.get("tool_registry") # type: ignore[return-value] # Line 151: return svc # type: ignore[return-value] # Line 155: return self._services.get("event_queue") # type: ignore[return-value] ``` These suppressions appear in the `_session_service`, `_plan_lifecycle_service`, `_tool_registry`, `_resource_registry_service`, and `_event_queue` property accessors. **Root Cause**: The `_services` dict is typed as `dict[str, Any]`, so `.get()` returns `Any | None`. The properties are typed to return specific service types (e.g., `SessionService | None`), causing a Pyright type mismatch that is suppressed instead of fixed. ## Expected Behavior All `# type: ignore` comments must be removed from `src/cleveragents/a2a/facade.py`. The code must be refactored to be fully type-safe so that `nox -e typecheck` passes without any suppressions. Acceptable approaches include: 1. Retype `_services` using a `TypedDict` that maps each service key to its concrete type 2. Use a `Protocol` for the services container 3. Add explicit `isinstance` checks before returning from each accessor ## Acceptance Criteria - [ ] All 5 `# type: ignore[return-value]` comments are removed from `src/cleveragents/a2a/facade.py` - [ ] `nox -e typecheck` passes with zero Pyright errors or suppressions on the file - [ ] The service accessor properties (`_session_service`, `_plan_lifecycle_service`, `_tool_registry`, `_resource_registry_service`, `_event_queue`) are fully type-safe without any casting workarounds that merely defer the problem - [ ] No new `# type: ignore` comments are introduced anywhere in the file - [ ] All existing Behave unit test scenarios for `facade.py` continue to pass (`nox -e unit_tests`) - [ ] Coverage remains ≥97% (`nox -e coverage_report`) ## Supporting Information - **File**: `src/cleveragents/a2a/facade.py` - **Lines affected**: 137, 142, 146, 151, 155 - **Violation**: CONTRIBUTING.md "No Type Suppression" rule - **Detected during**: UAT testing of Epic #933 (A2A Protocol Compliance) - **Runtime impact**: None — this is a static typing standards violation only - **Related nox session**: `nox -e typecheck` ## Subtasks - [ ] Inspect `_services` dict declaration and all service accessor properties in `facade.py` - [ ] Design a type-safe replacement (e.g., `TypedDict`, `Protocol`, or explicit `isinstance` guards) - [ ] Refactor `_services` and all 5 accessor properties to eliminate the type mismatches - [ ] Remove all 5 `# type: ignore[return-value]` suppression comments - [ ] Run `nox -e typecheck` and confirm zero errors on `facade.py` - [ ] Run `nox -e unit_tests` and confirm all existing scenarios pass - [ ] Verify coverage ≥97% via `nox -e coverage_report` - [ ] Run `nox` (all default sessions) and fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - All 5 `# type: ignore[return-value]` suppressions have been removed from `src/cleveragents/a2a/facade.py`. - `nox -e typecheck` passes with zero errors or warnings on the affected file. - All nox default sessions pass without errors. - Coverage remains ≥97%. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(a2a): remove type: ignore suppressions from facade service accessors`), followed by a blank line, then additional lines describing the implementation. - The commit is pushed to the remote on branch `fix/a2a-facade-type-ignore-suppressions`. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.4.0 milestone 2026-04-04 21:01:40 +00:00
freemo removed this from the v3.4.0 milestone 2026-04-06 21:01:40 +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#2860
No description provided.