feat(acms): implement DepthReductionCompressor for skeleton compression pipeline stage #919

Closed
opened 2026-03-14 00:05:10 +00:00 by freemo · 6 comments
Owner

Background

The ACMS Context Assembly Pipeline has 10 components across 3 phases. All 10 have protocol interfaces and default (no-op) stubs. 9 of 10 have production implementations. The sole gap is the SkeletonCompressor stage.

The spec (line 44927) defines DepthReductionCompressor as the default SkeletonCompressor implementation that "re-renders all parent context fragments at depth 0-1" using the UKO DetailLevelMap inheritance chain.

Current state:

  • Protocol: SkeletonCompressor exists at acms_service.py:355
  • Default stub: DefaultSkeletonCompressor at acms_service.py:542 (no-op, returns fragments unchanged)
  • Config reference: config_service.py:859 registers "builtin:DepthReductionCompressor"
  • No DepthReductionCompressor class exists anywhere in the codebase
  • A related SkeletonCompressorService exists at skeleton_compressor.py:53 but uses budget-ratio selection (not depth re-rendering) and doesn't implement the pipeline Protocol

Acceptance Criteria

  • DepthReductionCompressor class implements the SkeletonCompressor protocol from acms_service.py
  • Re-renders parent context fragments at reduced detail depths (0-1) per spec
  • Uses UKO DetailLevelMap inheritance chain for depth reduction
  • Registered as "builtin:DepthReductionCompressor" and resolvable by config
  • Integrated into the ContextAssemblyPipeline when configured
  • Unit tests cover depth reduction behavior
  • Existing pipeline tests pass

Dependencies

  • Related to #891 (UKO runtime operationalization)

Metadata

  • Suggested commit message: feat(acms): implement DepthReductionCompressor for skeleton compression
  • Suggested branch name: feat/depth-reduction-compressor

Definition of Done

Code merged to main, all 10 ACMS pipeline components have production implementations.

## Background The ACMS Context Assembly Pipeline has 10 components across 3 phases. All 10 have protocol interfaces and default (no-op) stubs. 9 of 10 have production implementations. The sole gap is the **SkeletonCompressor** stage. The spec (line 44927) defines `DepthReductionCompressor` as the default `SkeletonCompressor` implementation that "re-renders all parent context fragments at depth 0-1" using the UKO DetailLevelMap inheritance chain. Current state: - Protocol: `SkeletonCompressor` exists at `acms_service.py:355` - Default stub: `DefaultSkeletonCompressor` at `acms_service.py:542` (no-op, returns fragments unchanged) - Config reference: `config_service.py:859` registers `"builtin:DepthReductionCompressor"` - **No `DepthReductionCompressor` class exists anywhere in the codebase** - A related `SkeletonCompressorService` exists at `skeleton_compressor.py:53` but uses budget-ratio selection (not depth re-rendering) and doesn't implement the pipeline Protocol ## Acceptance Criteria - [x] `DepthReductionCompressor` class implements the `SkeletonCompressor` protocol from `acms_service.py` - [x] Re-renders parent context fragments at reduced detail depths (0-1) per spec - [x] Uses UKO DetailLevelMap inheritance chain for depth reduction - [x] Registered as `"builtin:DepthReductionCompressor"` and resolvable by config - [x] Integrated into the `ContextAssemblyPipeline` when configured - [x] Unit tests cover depth reduction behavior - [x] Existing pipeline tests pass ## Dependencies - Related to #891 (UKO runtime operationalization) ## Metadata - **Suggested commit message:** `feat(acms): implement DepthReductionCompressor for skeleton compression` - **Suggested branch name:** `feat/depth-reduction-compressor` ## Definition of Done Code merged to `main`, all 10 ACMS pipeline components have production implementations.
freemo added this to the v3.5.0 milestone 2026-03-14 00:06:14 +00:00
Author
Owner

Dependencies:

  • Depends on #891 (UKO runtime operationalization — DepthReductionCompressor uses UKO DetailLevelMap)
**Dependencies:** - Depends on #891 (UKO runtime operationalization — DepthReductionCompressor uses UKO DetailLevelMap)
Member

Starting implementation on branch feat/depth-reduction-compressor.

Initial intake notes:

  • The current ACMS pipeline exposes the SkeletonCompressor protocol and defaults config to builtin:DepthReductionCompressor, but no such implementation is present.
  • The existing SkeletonCompressorService is a separate ratio-based service and does not satisfy the pipeline protocol for this issue.
  • I will implement the pipeline-facing compressor, wire it into the built-in service exports, and add behavior-focused tests around depth reduction and budget handling.
  • The issue notes a dependency on #891; I will keep the change scoped to the current protocol and available UKO DetailLevelMap chain in the repository.
Starting implementation on branch `feat/depth-reduction-compressor`. Initial intake notes: - The current ACMS pipeline exposes the `SkeletonCompressor` protocol and defaults config to `builtin:DepthReductionCompressor`, but no such implementation is present. - The existing `SkeletonCompressorService` is a separate ratio-based service and does not satisfy the pipeline protocol for this issue. - I will implement the pipeline-facing compressor, wire it into the built-in service exports, and add behavior-focused tests around depth reduction and budget handling. - The issue notes a dependency on #891; I will keep the change scoped to the current protocol and available UKO DetailLevelMap chain in the repository.
Member

Progress update:

  • Added a production DepthReductionCompressor in application.services.acms_phase3.
  • The compressor now re-renders inherited fragments to overview depths 0-1 using the effective UKO DetailLevelMap chain for code, OO/language specializations, documents, data, and infrastructure fragments.
  • Exported the compressor through application.services so the configured builtin name is available alongside the other production pipeline components.
  • Updated ContextAssemblyPipeline to default to DepthReductionCompressor instead of the no-op skeleton compressor.
  • Added BDD coverage for compressor behavior and for the pipeline default component wiring.

Targeted validation so far:

  • nox -e unit_tests -- features/acms_pipeline_phase3.feature --tags=@compressor
  • nox -e unit_tests -- features/acms_pipeline_orchestrator.feature --tags=@pipeline

Next step is to run the full required quality gates and fix anything they surface.

Progress update: - Added a production `DepthReductionCompressor` in `application.services.acms_phase3`. - The compressor now re-renders inherited fragments to overview depths 0-1 using the effective UKO `DetailLevelMap` chain for code, OO/language specializations, documents, data, and infrastructure fragments. - Exported the compressor through `application.services` so the configured builtin name is available alongside the other production pipeline components. - Updated `ContextAssemblyPipeline` to default to `DepthReductionCompressor` instead of the no-op skeleton compressor. - Added BDD coverage for compressor behavior and for the pipeline default component wiring. Targeted validation so far: - `nox -e unit_tests -- features/acms_pipeline_phase3.feature --tags=@compressor` ✅ - `nox -e unit_tests -- features/acms_pipeline_orchestrator.feature --tags=@pipeline` ✅ Next step is to run the full required quality gates and fix anything they surface.
Member

Validation update:

Completed local quality checks relevant to this change:

  • nox -e lint
  • nox -e typecheck
  • nox -e unit_tests
  • nox -e integration_tests
  • nox -e coverage_report (97.47%)

Local blocker:

  • nox -e e2e_tests
    • The failing cases are robot/e2e/m1_acceptance.robot and robot/e2e/m2_acceptance.robot.
    • These suites require real LLM provider credentials and currently fail in this environment during plan execute because no OPENAI_API_KEY / ANTHROPIC_API_KEY values are present.
    • The new ACMS compressor scenarios and ACMS integration suites passed; the remaining e2e failure is environment-driven rather than specific to the compressor change.

I have kept the issue in State/In Progress until the final gate can be re-run in an environment with the required E2E credentials.

Validation update: Completed local quality checks relevant to this change: - `nox -e lint` ✅ - `nox -e typecheck` ✅ - `nox -e unit_tests` ✅ - `nox -e integration_tests` ✅ - `nox -e coverage_report` ✅ (`97.47%`) Local blocker: - `nox -e e2e_tests` ❌ - The failing cases are `robot/e2e/m1_acceptance.robot` and `robot/e2e/m2_acceptance.robot`. - These suites require real LLM provider credentials and currently fail in this environment during `plan execute` because no `OPENAI_API_KEY` / `ANTHROPIC_API_KEY` values are present. - The new ACMS compressor scenarios and ACMS integration suites passed; the remaining e2e failure is environment-driven rather than specific to the compressor change. I have kept the issue in `State/In Progress` until the final gate can be re-run in an environment with the required E2E credentials.
Member

Opened PR #1170 for review: #1170

PR metadata aligned with the issue:

  • branch: feat/depth-reduction-compressor
  • milestone: v3.5.0
  • type label: Type/Feature
  • issue moved to State/In Review

The issue acceptance checklist is marked complete. I am leaving CI follow-through pending on the PR checks.

Opened PR #1170 for review: https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/1170 PR metadata aligned with the issue: - branch: `feat/depth-reduction-compressor` - milestone: `v3.5.0` - type label: `Type/Feature` - issue moved to `State/In Review` The issue acceptance checklist is marked complete. I am leaving CI follow-through pending on the PR checks.
Member

Review follow-up for PR #1170:

  • extracted the DepthReductionCompressor render visitors into src/cleveragents/application/services/acms_skeleton_renderers.py to keep the compressor implementation smaller and easier to review
  • hardened ComponentResolver builtin imports with an explicit allowlist and added BDD coverage for rejecting non-component builtin service names
  • restored DepthBreadthProjector projected metadata values to native int/bool types so the compressor work does not introduce a downstream metadata type change
  • rebased feat/depth-reduction-compressor onto the latest master and force-pushed the updated PR branch

Targeted validation used for the review round:

  • TEST_PROCESSES=9 nox -e unit_tests -- features/component_resolver.feature features/depth_breadth_projection.feature features/acms_pipeline_phase3.feature features/acms_pipeline_orchestrator.feature
  • TEST_PROCESSES=9 nox -e coverage_report -- features/component_resolver.feature features/depth_breadth_projection.feature features/acms_pipeline_phase3.feature features/acms_pipeline_orchestrator.feature
Review follow-up for PR #1170: - extracted the `DepthReductionCompressor` render visitors into `src/cleveragents/application/services/acms_skeleton_renderers.py` to keep the compressor implementation smaller and easier to review - hardened `ComponentResolver` builtin imports with an explicit allowlist and added BDD coverage for rejecting non-component builtin service names - restored `DepthBreadthProjector` projected metadata values to native `int`/`bool` types so the compressor work does not introduce a downstream metadata type change - rebased `feat/depth-reduction-compressor` onto the latest `master` and force-pushed the updated PR branch Targeted validation used for the review round: - `TEST_PROCESSES=9 nox -e unit_tests -- features/component_resolver.feature features/depth_breadth_projection.feature features/acms_pipeline_phase3.feature features/acms_pipeline_orchestrator.feature` - `TEST_PROCESSES=9 nox -e coverage_report -- features/component_resolver.feature features/depth_breadth_projection.feature features/acms_pipeline_phase3.feature features/acms_pipeline_orchestrator.feature`
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.

Dependencies

No dependencies set.

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