[AUTO-GUARD-1] Refactor: Address TODO/FIXME comments in the codebase #9022

Open
opened 2026-04-14 05:33:05 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: refactor(codebase): address TODO/FIXME comments across application and CLI layers
  • Branch: refactor/auto-guard-1-address-todo-fixme-comments

Background and Context

The Architecture Guard automated scan identified 17 TODO and FIXME comments scattered across the codebase. These comments represent deferred implementation decisions, incomplete wiring, placeholder logic, and known design issues that have not yet been resolved. Leaving these in place creates technical debt, reduces code clarity, and may mask functional gaps (e.g., stub actors never dispatched, DB sessions never wired, response formats never applied).

The comments span multiple layers — CLI commands, application services, tool runner, MCP adapter, A2A facade, and indexer internals — indicating a broad pattern of deferred work that should be systematically addressed.

List of comments to address:

  • src/cleveragents/cli/commands/plan.py# TODO: derive strategy from plan's actual sandbox configuration (×2, lines 367 and 377)
  • src/cleveragents/cli/commands/plan.py# TODO: Migrate to EstimationResult.as_display_dict() to reduce duplication (line 1729)
  • src/cleveragents/application/services/plan_lifecycle_service.py# TODO: Replace EstimationStubActor with real actor dispatch (line 354)
  • src/cleveragents/application/services/cleanup_service.py# TODO(CONC3): Wire DB session query when Container is (line 311)
  • src/cleveragents/application/services/cleanup_service.py# TODO(CONC3): Wire DB session deletion when Container is (line 319)
  • src/cleveragents/tool/runner.py# TODO: pass pref.target_resource to the resolver (line 295)
  • src/cleveragents/application/services/llm_actors.py# TODO(#650): Wire actor-configured response_format into provider calls (×2, lines 150 and 393)
  • src/cleveragents/a2a/facade.py# TODO: Wire to ACMS ContextAssemblyPipeline once available. (line 477)
  • src/cleveragents/application/services/correction_service.py# TODO: affected_files and artifacts_to_archive use synthetic (line 282)
  • src/cleveragents/mcp/adapter.py# TODO(#882): resource_slots are stored in source_metadata but (line 611)
  • src/cleveragents/application/services/uko_indexer_internals.py# TODO(#578): integrate real embedding model — placeholder vector (line 333)
  • src/cleveragents/cli/commands/skill.py# TODO: When MCP adapter integration is available, call (line 1023)
  • src/cleveragents/application/services/service_retry_wiring.py# TODO: This class conflates factory/config, execution, and caching (line 96)
  • src/cleveragents/application/services/phase_gating.py# TODO(pg-migration): TOCTOU — The phase is read here but the (line 79)
  • src/cleveragents/application/services/uko_loader.py# TODO(perf): precompute layer index when scaling demands it. (line 331)

Expected Behavior

All 17 TODO/FIXME comments are resolved. Each comment is either:

  1. Replaced with a real implementation (where the referenced feature is now available), or
  2. Converted into a tracked issue (if the work is non-trivial and out of scope for this commit), or
  3. Removed with a clear code comment explaining why the deferred work is no longer needed.

No TODO or FIXME comments remain in the listed locations after this issue is resolved.

Acceptance Criteria

  • All 17 listed TODO/FIXME comments are addressed (implemented, converted to issues, or removed with justification)
  • src/cleveragents/cli/commands/plan.py lines 367 and 377: sandbox strategy derivation is wired to the plan's actual sandbox configuration
  • src/cleveragents/cli/commands/plan.py line 1729: EstimationResult.as_display_dict() is used instead of duplicated display logic
  • src/cleveragents/application/services/plan_lifecycle_service.py line 354: EstimationStubActor is replaced with real actor registry dispatch
  • src/cleveragents/application/services/cleanup_service.py lines 311 and 319: DB session query and deletion are wired for Container cleanup
  • src/cleveragents/tool/runner.py line 295: pref.target_resource is passed to the resolver
  • src/cleveragents/application/services/llm_actors.py lines 150 and 393: actor-configured response_format is wired into provider calls
  • src/cleveragents/a2a/facade.py line 477: ACMS ContextAssemblyPipeline is wired (or a tracked issue is created)
  • src/cleveragents/application/services/correction_service.py line 282: affected_files and artifacts_to_archive use real data (not synthetic)
  • src/cleveragents/mcp/adapter.py line 611: resource_slots from source_metadata is properly handled
  • src/cleveragents/application/services/uko_indexer_internals.py line 333: real embedding model is integrated (or placeholder is tracked)
  • src/cleveragents/cli/commands/skill.py line 1023: MCP adapter integration is called when available
  • src/cleveragents/application/services/service_retry_wiring.py line 96: class responsibilities are separated (factory/config, execution, caching)
  • src/cleveragents/application/services/phase_gating.py line 79: TOCTOU race condition is resolved
  • src/cleveragents/application/services/uko_loader.py line 331: layer index precomputation is implemented or deferred with justification
  • All existing tests pass (nox default sessions)
  • Test coverage remains ≥ 97%
  • No new TODO/FIXME comments are introduced

Subtasks

  • Audit each TODO/FIXME comment and classify: implement now, create sub-issue, or remove with justification
  • Fix plan.py lines 367/377: derive sandbox strategy from plan's actual sandbox configuration
  • Fix plan.py line 1729: migrate to EstimationResult.as_display_dict()
  • Fix plan_lifecycle_service.py line 354: replace EstimationStubActor with real actor dispatch
  • Fix cleanup_service.py lines 311/319: wire DB session query and deletion for Container
  • Fix tool/runner.py line 295: pass pref.target_resource to the resolver
  • Fix llm_actors.py lines 150/393: wire actor-configured response_format into provider calls
  • Fix a2a/facade.py line 477: wire ACMS ContextAssemblyPipeline or create tracked issue
  • Fix correction_service.py line 282: use real affected_files and artifacts_to_archive
  • Fix mcp/adapter.py line 611: handle resource_slots from source_metadata
  • Fix uko_indexer_internals.py line 333: integrate real embedding model or create tracked issue
  • Fix skill.py line 1023: call MCP adapter integration when available
  • Fix service_retry_wiring.py line 96: separate class responsibilities
  • Fix phase_gating.py line 79: resolve TOCTOU race condition
  • Fix uko_loader.py line 331: implement or defer layer index precomputation
  • Tests (Behave): add/update scenarios covering changed behaviour
  • Tests (Robot): add/update integration tests for affected services
  • 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.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (refactor(codebase): address TODO/FIXME comments across application and CLI layers), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (refactor/auto-guard-1-address-todo-fixme-comments).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `refactor(codebase): address TODO/FIXME comments across application and CLI layers` - **Branch**: `refactor/auto-guard-1-address-todo-fixme-comments` ## Background and Context The Architecture Guard automated scan identified 17 `TODO` and `FIXME` comments scattered across the codebase. These comments represent deferred implementation decisions, incomplete wiring, placeholder logic, and known design issues that have not yet been resolved. Leaving these in place creates technical debt, reduces code clarity, and may mask functional gaps (e.g., stub actors never dispatched, DB sessions never wired, response formats never applied). The comments span multiple layers — CLI commands, application services, tool runner, MCP adapter, A2A facade, and indexer internals — indicating a broad pattern of deferred work that should be systematically addressed. **List of comments to address:** - `src/cleveragents/cli/commands/plan.py` — `# TODO: derive strategy from plan's actual sandbox configuration` (×2, lines 367 and 377) - `src/cleveragents/cli/commands/plan.py` — `# TODO: Migrate to EstimationResult.as_display_dict() to reduce duplication` (line 1729) - `src/cleveragents/application/services/plan_lifecycle_service.py` — `# TODO: Replace EstimationStubActor with real actor dispatch` (line 354) - `src/cleveragents/application/services/cleanup_service.py` — `# TODO(CONC3): Wire DB session query when Container is` (line 311) - `src/cleveragents/application/services/cleanup_service.py` — `# TODO(CONC3): Wire DB session deletion when Container is` (line 319) - `src/cleveragents/tool/runner.py` — `# TODO: pass pref.target_resource to the resolver` (line 295) - `src/cleveragents/application/services/llm_actors.py` — `# TODO(#650): Wire actor-configured response_format into provider calls` (×2, lines 150 and 393) - `src/cleveragents/a2a/facade.py` — `# TODO: Wire to ACMS ContextAssemblyPipeline once available.` (line 477) - `src/cleveragents/application/services/correction_service.py` — `# TODO: affected_files and artifacts_to_archive use synthetic` (line 282) - `src/cleveragents/mcp/adapter.py` — `# TODO(#882): resource_slots are stored in source_metadata but` (line 611) - `src/cleveragents/application/services/uko_indexer_internals.py` — `# TODO(#578): integrate real embedding model — placeholder vector` (line 333) - `src/cleveragents/cli/commands/skill.py` — `# TODO: When MCP adapter integration is available, call` (line 1023) - `src/cleveragents/application/services/service_retry_wiring.py` — `# TODO: This class conflates factory/config, execution, and caching` (line 96) - `src/cleveragents/application/services/phase_gating.py` — `# TODO(pg-migration): TOCTOU — The phase is read here but the` (line 79) - `src/cleveragents/application/services/uko_loader.py` — `# TODO(perf): precompute layer index when scaling demands it.` (line 331) ## Expected Behavior All 17 `TODO`/`FIXME` comments are resolved. Each comment is either: 1. Replaced with a real implementation (where the referenced feature is now available), or 2. Converted into a tracked issue (if the work is non-trivial and out of scope for this commit), or 3. Removed with a clear code comment explaining why the deferred work is no longer needed. No `TODO` or `FIXME` comments remain in the listed locations after this issue is resolved. ## Acceptance Criteria - [ ] All 17 listed `TODO`/`FIXME` comments are addressed (implemented, converted to issues, or removed with justification) - [ ] `src/cleveragents/cli/commands/plan.py` lines 367 and 377: sandbox strategy derivation is wired to the plan's actual sandbox configuration - [ ] `src/cleveragents/cli/commands/plan.py` line 1729: `EstimationResult.as_display_dict()` is used instead of duplicated display logic - [ ] `src/cleveragents/application/services/plan_lifecycle_service.py` line 354: `EstimationStubActor` is replaced with real actor registry dispatch - [ ] `src/cleveragents/application/services/cleanup_service.py` lines 311 and 319: DB session query and deletion are wired for Container cleanup - [ ] `src/cleveragents/tool/runner.py` line 295: `pref.target_resource` is passed to the resolver - [ ] `src/cleveragents/application/services/llm_actors.py` lines 150 and 393: actor-configured `response_format` is wired into provider calls - [ ] `src/cleveragents/a2a/facade.py` line 477: ACMS `ContextAssemblyPipeline` is wired (or a tracked issue is created) - [ ] `src/cleveragents/application/services/correction_service.py` line 282: `affected_files` and `artifacts_to_archive` use real data (not synthetic) - [ ] `src/cleveragents/mcp/adapter.py` line 611: `resource_slots` from `source_metadata` is properly handled - [ ] `src/cleveragents/application/services/uko_indexer_internals.py` line 333: real embedding model is integrated (or placeholder is tracked) - [ ] `src/cleveragents/cli/commands/skill.py` line 1023: MCP adapter integration is called when available - [ ] `src/cleveragents/application/services/service_retry_wiring.py` line 96: class responsibilities are separated (factory/config, execution, caching) - [ ] `src/cleveragents/application/services/phase_gating.py` line 79: TOCTOU race condition is resolved - [ ] `src/cleveragents/application/services/uko_loader.py` line 331: layer index precomputation is implemented or deferred with justification - [ ] All existing tests pass (`nox` default sessions) - [ ] Test coverage remains ≥ 97% - [ ] No new `TODO`/`FIXME` comments are introduced ## Subtasks - [ ] Audit each TODO/FIXME comment and classify: implement now, create sub-issue, or remove with justification - [ ] Fix `plan.py` lines 367/377: derive sandbox strategy from plan's actual sandbox configuration - [ ] Fix `plan.py` line 1729: migrate to `EstimationResult.as_display_dict()` - [ ] Fix `plan_lifecycle_service.py` line 354: replace `EstimationStubActor` with real actor dispatch - [ ] Fix `cleanup_service.py` lines 311/319: wire DB session query and deletion for Container - [ ] Fix `tool/runner.py` line 295: pass `pref.target_resource` to the resolver - [ ] Fix `llm_actors.py` lines 150/393: wire actor-configured `response_format` into provider calls - [ ] Fix `a2a/facade.py` line 477: wire ACMS `ContextAssemblyPipeline` or create tracked issue - [ ] Fix `correction_service.py` line 282: use real `affected_files` and `artifacts_to_archive` - [ ] Fix `mcp/adapter.py` line 611: handle `resource_slots` from `source_metadata` - [ ] Fix `uko_indexer_internals.py` line 333: integrate real embedding model or create tracked issue - [ ] Fix `skill.py` line 1023: call MCP adapter integration when available - [ ] Fix `service_retry_wiring.py` line 96: separate class responsibilities - [ ] Fix `phase_gating.py` line 79: resolve TOCTOU race condition - [ ] Fix `uko_loader.py` line 331: implement or defer layer index precomputation - [ ] Tests (Behave): add/update scenarios covering changed behaviour - [ ] Tests (Robot): add/update integration tests for affected services - [ ] 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. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`refactor(codebase): address TODO/FIXME comments across application and CLI layers`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`refactor/auto-guard-1-address-todo-fixme-comments`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.6.0 milestone 2026-04-14 05:58:07 +00:00
Author
Owner

Verified — Refactor: address TODO/FIXME comments in the codebase. MoSCoW: Should-have. Priority: Medium — technical debt reduction.


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

✅ **Verified** — Refactor: address TODO/FIXME comments in the codebase. MoSCoW: Should-have. Priority: Medium — technical debt reduction. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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.

Dependencies

No dependencies set.

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