Refactor: 17 TODO comments in production code indicate unimplemented stubs and deferred work #10296

Open
opened 2026-04-18 08:25:22 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit message: refactor(application): resolve or track all TODO comments in production source code
  • Branch name: feature/refactor-resolve-todo-comments

Background and Context

An automated architecture guard scan on 2026-04-18 found 17 TODO comments in production source code under src/cleveragents/. These represent deferred work, unimplemented stubs, and known technical debt that has not been formally tracked as issues. The CONTRIBUTING.md prohibits half-done work and requires all work to be tracked.

Complete list of TODO comments found:

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

Particularly critical TODOs:

  • plan_lifecycle_service.py:354EstimationStubActor is a placeholder stub in production code; real actor dispatch is not implemented
  • uko_indexer_internals.py:333 — placeholder vector (not a real embedding model) is being used in production
  • phase_gating.py:79 — TOCTOU race condition is acknowledged but not fixed

Current Behavior

Production code contains inline TODO comments representing:

  1. Unimplemented stubsEstimationStubActor, placeholder embedding vectors
  2. Known race conditions — TOCTOU in phase gating
  3. Deferred wiring — DB session wiring, response_format wiring, MCP adapter integration
  4. Refactoring debtservice_retry_wiring.py class conflation, display dict duplication

These are not tracked as formal issues and have no acceptance criteria or definition of done.

Expected Behavior

Every TODO comment should either:

  1. Be resolved immediately (if the fix is straightforward), or
  2. Be converted into a formal tracked issue with acceptance criteria, then the TODO comment replaced with a reference to the issue number

No TODO comments should remain in production source code.

Acceptance Criteria

  • All 17 TODO comments in src/cleveragents/ are either resolved or converted to tracked issues
  • EstimationStubActor is replaced with real actor dispatch or a formal issue is created and the TODO replaced with # See issue #N
  • The placeholder embedding vector in uko_indexer_internals.py is replaced with a real model or formally tracked
  • The TOCTOU race condition in phase_gating.py is fixed or formally tracked as a bug
  • No TODO or FIXME comments remain in src/cleveragents/
  • All existing Behave scenarios continue to pass
  • Coverage remains ≥ 97%

Supporting Information

  • Scan date: 2026-04-18
  • Scan tool: Architecture Guard Worker (automated)
  • Total TODO count: 17 in src/cleveragents/
  • Most critical: plan_lifecycle_service.py:354 (stub actor in production), uko_indexer_internals.py:333 (placeholder vector), phase_gating.py:79 (TOCTOU race)
  • Some TODOs reference existing issue numbers (#650, #578, #882) — verify those issues exist and are still open

Subtasks

  • Triage all 17 TODO comments: categorize as (a) fix now, (b) create issue and reference, or (c) remove if obsolete
  • Create formal issues for TODOs that represent significant work (EstimationStubActor, placeholder embedding, TOCTOU)
  • Fix or formally track TODO(CONC3) items in cleanup_service.py
  • Verify issues #650, #578, #882 exist and are open; update TODO references accordingly
  • Replace all remaining TODO comments with either the fix or # Tracked in issue #N
  • Remove all TODO/FIXME comments from src/cleveragents/
  • Tests (Behave): Verify all existing scenarios pass after changes
  • 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.
  • grep -r "TODO\|FIXME" src/cleveragents/ returns zero results.
  • All significant deferred work items have formal tracked issues.
  • A Git commit is created where the first line matches the Commit Message in Metadata exactly, followed by a blank line, then additional details.
  • The commit is pushed to the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by Architecture Guard Worker — scan date 2026-04-18


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message:** `refactor(application): resolve or track all TODO comments in production source code` - **Branch name:** `feature/refactor-resolve-todo-comments` ## Background and Context An automated architecture guard scan on 2026-04-18 found 17 `TODO` comments in production source code under `src/cleveragents/`. These represent deferred work, unimplemented stubs, and known technical debt that has not been formally tracked as issues. The CONTRIBUTING.md prohibits half-done work and requires all work to be tracked. **Complete list of TODO comments found:** | File | Line | Comment | |------|------|---------| | `a2a/facade.py` | 477 | `# TODO: Wire to ACMS ContextAssemblyPipeline once available.` | | `application/services/cleanup_service.py` | 311 | `# TODO(CONC3): Wire DB session query when Container is` | | `application/services/cleanup_service.py` | 319 | `# TODO(CONC3): Wire DB session deletion when Container is` | | `application/services/correction_service.py` | 282 | `# TODO: affected_files and artifacts_to_archive use synthetic` | | `application/services/llm_actors.py` | 150 | `# TODO(#650): Wire actor-configured response_format into provider calls` | | `application/services/llm_actors.py` | 393 | `# TODO(#650): Wire actor-configured response_format into provider calls` | | `application/services/phase_gating.py` | 79 | `# TODO(pg-migration): TOCTOU — The phase is read here but the` | | `application/services/plan_lifecycle_service.py` | 354 | `# TODO: Replace EstimationStubActor with real actor dispatch` | | `application/services/service_retry_wiring.py` | 96 | `# TODO: This class conflates factory/config, execution, and caching` | | `application/services/uko_indexer_internals.py` | 333 | `# TODO(#578): integrate real embedding model — placeholder vector` | | `application/services/uko_loader.py` | 331 | `# TODO(perf): precompute layer index when scaling demands it.` | | `cli/commands/plan.py` | 370 | `# TODO: derive strategy from plan's actual sandbox configuration` | | `cli/commands/plan.py` | 380 | `# TODO: derive strategy from plan's actual sandbox configuration` | | `cli/commands/plan.py` | 1840 | `# TODO: Migrate to EstimationResult.as_display_dict() to reduce duplication` | | `cli/commands/skill.py` | 1023 | `# TODO: When MCP adapter integration is available, call` | | `mcp/adapter.py` | 611 | `# TODO(#882): resource_slots are stored in source_metadata but` | | `tool/runner.py` | 295 | `# TODO: pass pref.target_resource to the resolver /` | **Particularly critical TODOs:** - `plan_lifecycle_service.py:354` — `EstimationStubActor` is a placeholder stub in production code; real actor dispatch is not implemented - `uko_indexer_internals.py:333` — placeholder vector (not a real embedding model) is being used in production - `phase_gating.py:79` — TOCTOU race condition is acknowledged but not fixed ## Current Behavior Production code contains inline TODO comments representing: 1. **Unimplemented stubs** — `EstimationStubActor`, placeholder embedding vectors 2. **Known race conditions** — TOCTOU in phase gating 3. **Deferred wiring** — DB session wiring, response_format wiring, MCP adapter integration 4. **Refactoring debt** — `service_retry_wiring.py` class conflation, display dict duplication These are not tracked as formal issues and have no acceptance criteria or definition of done. ## Expected Behavior Every TODO comment should either: 1. Be resolved immediately (if the fix is straightforward), or 2. Be converted into a formal tracked issue with acceptance criteria, then the TODO comment replaced with a reference to the issue number No TODO comments should remain in production source code. ## Acceptance Criteria - [ ] All 17 TODO comments in `src/cleveragents/` are either resolved or converted to tracked issues - [ ] `EstimationStubActor` is replaced with real actor dispatch or a formal issue is created and the TODO replaced with `# See issue #N` - [ ] The placeholder embedding vector in `uko_indexer_internals.py` is replaced with a real model or formally tracked - [ ] The TOCTOU race condition in `phase_gating.py` is fixed or formally tracked as a bug - [ ] No `TODO` or `FIXME` comments remain in `src/cleveragents/` - [ ] All existing Behave scenarios continue to pass - [ ] Coverage remains ≥ 97% ## Supporting Information - Scan date: 2026-04-18 - Scan tool: Architecture Guard Worker (automated) - Total TODO count: 17 in `src/cleveragents/` - Most critical: `plan_lifecycle_service.py:354` (stub actor in production), `uko_indexer_internals.py:333` (placeholder vector), `phase_gating.py:79` (TOCTOU race) - Some TODOs reference existing issue numbers (#650, #578, #882) — verify those issues exist and are still open ## Subtasks - [ ] Triage all 17 TODO comments: categorize as (a) fix now, (b) create issue and reference, or (c) remove if obsolete - [ ] Create formal issues for TODOs that represent significant work (EstimationStubActor, placeholder embedding, TOCTOU) - [ ] Fix or formally track `TODO(CONC3)` items in `cleanup_service.py` - [ ] Verify issues #650, #578, #882 exist and are open; update TODO references accordingly - [ ] Replace all remaining TODO comments with either the fix or `# Tracked in issue #N` - [ ] Remove all TODO/FIXME comments from `src/cleveragents/` - [ ] Tests (Behave): Verify all existing scenarios pass after changes - [ ] 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. - `grep -r "TODO\|FIXME" src/cleveragents/` returns zero results. - All significant deferred work items have formal tracked issues. - A Git commit is created where the first line matches the Commit Message in Metadata exactly, followed by a blank line, then additional details. - The commit is pushed to the branch matching the Branch in Metadata exactly. - The commit is submitted as a pull request to `master`, reviewed, and merged before this issue is marked done. --- *Automated by Architecture Guard Worker — scan date 2026-04-18* --- **Automated by CleverAgents Bot** Agent: new-issue-creator
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#10296
No description provided.