fix(cleanup): remove ghost acp/ package and orphaned .pyc files #947

Closed
opened 2026-03-14 03:15:58 +00:00 by freemo · 3 comments
Owner

Metadata

  • Commit Message: fix(cleanup): remove ghost acp/ package and orphaned .pyc files
  • Branch: fix/m7-remove-acp-ghost-package

Background and Context

The src/cleveragents/acp/ directory is a ghost package: it contains only a __pycache__/ directory with 9 orphaned .pyc files and zero .py source files. The ACP (Agent Communication Protocol) module was superseded by the A2A protocol adoption (ADR-047) but was never properly cleaned up. The .pyc files are stale build artifacts from before the migration.

Additionally, orphaned .pyc files without corresponding .py sources may exist elsewhere in the source tree.

Current Behavior

  • src/cleveragents/acp/ exists as a directory with only __pycache__/ containing 9 .pyc files
  • No .py source files exist in the package
  • The directory occupies namespace and may confuse IDE indexing and import resolution
  • Stale .pyc files could theoretically be imported by Python in edge cases

Expected Behavior

  • The acp/ directory is completely removed from the source tree
  • No orphaned .pyc files exist anywhere in the source tree without corresponding .py files
  • All import references to cleveragents.acp (if any) are removed or updated

Acceptance Criteria

  • src/cleveragents/acp/ directory is fully deleted (including __pycache__/)
  • Grep confirms zero remaining imports of cleveragents.acp or from cleveragents.acp in source and test code
  • A sweep of the entire source tree confirms no other .pyc files exist without corresponding .py files
  • nox passes (all default sessions) after removal

Subtasks

  • Delete src/cleveragents/acp/ directory and all contents
  • Search for and remove any imports referencing cleveragents.acp
  • Sweep source tree for other orphaned .pyc files and remove them
  • Tests (Behave): Verify no existing scenarios reference ACP imports
  • Run nox (all default sessions), fix any errors
  • Verify coverage >=97% via nox -s coverage_report

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, 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.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `fix(cleanup): remove ghost acp/ package and orphaned .pyc files` - **Branch**: `fix/m7-remove-acp-ghost-package` ## Background and Context The `src/cleveragents/acp/` directory is a ghost package: it contains only a `__pycache__/` directory with 9 orphaned `.pyc` files and zero `.py` source files. The ACP (Agent Communication Protocol) module was superseded by the A2A protocol adoption (ADR-047) but was never properly cleaned up. The `.pyc` files are stale build artifacts from before the migration. Additionally, orphaned `.pyc` files without corresponding `.py` sources may exist elsewhere in the source tree. ## Current Behavior - `src/cleveragents/acp/` exists as a directory with only `__pycache__/` containing 9 `.pyc` files - No `.py` source files exist in the package - The directory occupies namespace and may confuse IDE indexing and import resolution - Stale `.pyc` files could theoretically be imported by Python in edge cases ## Expected Behavior - The `acp/` directory is completely removed from the source tree - No orphaned `.pyc` files exist anywhere in the source tree without corresponding `.py` files - All import references to `cleveragents.acp` (if any) are removed or updated ## Acceptance Criteria - [x] `src/cleveragents/acp/` directory is fully deleted (including `__pycache__/`) - [x] Grep confirms zero remaining imports of `cleveragents.acp` or `from cleveragents.acp` in source and test code - [x] A sweep of the entire source tree confirms no other `.pyc` files exist without corresponding `.py` files - [x] `nox` passes (all default sessions) after removal ## Subtasks - [x] Delete `src/cleveragents/acp/` directory and all contents - [x] Search for and remove any imports referencing `cleveragents.acp` - [x] Sweep source tree for other orphaned `.pyc` files and remove them - [x] Tests (Behave): Verify no existing scenarios reference ACP imports - [x] Run `nox` (all default sessions), fix any errors - [x] Verify coverage >=97% via `nox -s coverage_report` ## 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, 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. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v3.2.0 milestone 2026-03-16 16:09:20 +00:00
Member

Implementation Notes — Phase 2: Investigation & Cleanup

Investigation Findings

  1. src/cleveragents/acp/ does not exist in git. The ACP module was properly renamed to src/cleveragents/a2a/ in commit ec0b7631 ("refactor(a2a): rename ACP module and symbols to A2A standard", closing #688). The __pycache__/ directory with 9 orphaned .pyc files described in this issue exists only on developer machines as stale build artifacts — these files were never tracked by git.

  2. No .pyc files are tracked by git anywhere in the repository. Verified via git ls-files --cached | grep "\.pyc$" — zero results.

  3. No source/test imports reference cleveragents.acp. Comprehensive search of all .py, .feature, .robot, .toml, .yaml, .yml, and .json files — zero results.

  4. Remaining "acp" references are documentation-only and appropriate to keep:

    • docs/specification.md — Historical context describing ACP deprecation and A2A adoption
    • docs/timeline.md — Historical record of the ACP → A2A rename (#688, #689)
    • mkdocs.yml — Reference to ADR-047 filename (ADR-047-acp-standard-adoption.md)
    • docs/adr/ADR-047-acp-standard-adoption.md — The ADR itself (filename contains "acp" by design)
  5. .gitignore already covers __pycache__/ and *.py[cod] — preventing stale build artifacts from being tracked.

Changes Made

  • Added explicit .gitignore entry for src/cleveragents/acp/ to prevent accidental re-introduction of the deprecated package path, with a comment referencing ADR-047.

Design Decision

The ghost acp/ directory is a local filesystem artifact (stale __pycache__/ from before the rename), not a version control issue. The explicit .gitignore entry serves as both a safeguard against accidental commits of that path and as documentation that it was intentionally deprecated.

## Implementation Notes — Phase 2: Investigation & Cleanup ### Investigation Findings 1. **`src/cleveragents/acp/` does not exist in git.** The ACP module was properly renamed to `src/cleveragents/a2a/` in commit `ec0b7631` ("refactor(a2a): rename ACP module and symbols to A2A standard", closing #688). The `__pycache__/` directory with 9 orphaned `.pyc` files described in this issue exists only on developer machines as stale build artifacts — these files were never tracked by git. 2. **No `.pyc` files are tracked by git anywhere in the repository.** Verified via `git ls-files --cached | grep "\.pyc$"` — zero results. 3. **No source/test imports reference `cleveragents.acp`.** Comprehensive search of all `.py`, `.feature`, `.robot`, `.toml`, `.yaml`, `.yml`, and `.json` files — zero results. 4. **Remaining "acp" references are documentation-only and appropriate to keep:** - `docs/specification.md` — Historical context describing ACP deprecation and A2A adoption - `docs/timeline.md` — Historical record of the ACP → A2A rename (#688, #689) - `mkdocs.yml` — Reference to ADR-047 filename (`ADR-047-acp-standard-adoption.md`) - `docs/adr/ADR-047-acp-standard-adoption.md` — The ADR itself (filename contains "acp" by design) 5. **`.gitignore` already covers `__pycache__/` and `*.py[cod]`** — preventing stale build artifacts from being tracked. ### Changes Made - **Added explicit `.gitignore` entry for `src/cleveragents/acp/`** to prevent accidental re-introduction of the deprecated package path, with a comment referencing ADR-047. ### Design Decision The ghost `acp/` directory is a local filesystem artifact (stale `__pycache__/` from before the rename), not a version control issue. The explicit `.gitignore` entry serves as both a safeguard against accidental commits of that path and as documentation that it was intentionally deprecated.
Member

Quality Gate Results — Phase 3

All nox sessions pass on branch fix/m7-remove-acp-ghost-package:

Session Result
lint Pass
format Pass
typecheck Pass
security_scan Pass
dead_code Pass
unit_tests-3.13 Pass (7 min)
integration_tests-3.13 Pass (38 min)
docs Pass
build-3.13 Pass
benchmark Pass (24 min, 1905 benchmarks)
coverage_report Pass — 98.7% (threshold: 97%)
## Quality Gate Results — Phase 3 All nox sessions pass on branch `fix/m7-remove-acp-ghost-package`: | Session | Result | |---------|--------| | `lint` | ✅ Pass | | `format` | ✅ Pass | | `typecheck` | ✅ Pass | | `security_scan` | ✅ Pass | | `dead_code` | ✅ Pass | | `unit_tests-3.13` | ✅ Pass (7 min) | | `integration_tests-3.13` | ✅ Pass (38 min) | | `docs` | ✅ Pass | | `build-3.13` | ✅ Pass | | `benchmark` | ✅ Pass (24 min, 1905 benchmarks) | | `coverage_report` | ✅ Pass — **98.7%** (threshold: 97%) |
Author
Owner

PR #1256 reviewed, approved, and merged. The .gitignore exclusion for src/cleveragents/acp/ is now in place per ADR-047.

PR #1256 reviewed, approved, and merged. The `.gitignore` exclusion for `src/cleveragents/acp/` is now in place per ADR-047.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#947
No description provided.