feat(acms): add skeleton compressor #525

Merged
freemo merged 1 commit from feature/m6-acms-skeleton-compress into master 2026-03-03 03:41:13 +00:00
Owner

Summary

Implements the ACMS skeleton compressor service for context inheritance between parent and child plans.

Closes #194

Approach

  • SkeletonMetadata (frozen Pydantic model): records compression ratio, original/compressed token counts, and source decision IDs for auditability. Persisted on the Plan model as skeleton_metadata.
  • SkeletonCompressorService: stateless service that accepts context fragments and a skeleton_ratio in [0.0, 1.0], sorts fragments by relevance (descending, stable), and greedily selects fragments within a token budget of original_tokens * (1 - ratio).
  • Ratio semantics: 0.0 = pass-through, 1.0 = max compression (single top fragment), default = 0.3.
  • Deterministic ordering: stable sort on (-relevance, fragment_id) ensures identical inputs always produce identical output.
  • DI registration: skeleton_compressor_service singleton in the container.

Changes

New files (8)

  • src/cleveragents/domain/models/core/skeleton_metadata.py
  • src/cleveragents/application/services/skeleton_compressor.py
  • docs/reference/skeleton_compressor.md
  • features/skeleton_compressor.feature (22 scenarios)
  • features/steps/skeleton_compressor_steps.py
  • robot/skeleton_compressor.robot (6 smoke tests)
  • robot/helper_skeleton_compressor.py
  • benchmarks/skeleton_compressor_bench.py

Modified files (6)

  • src/cleveragents/domain/models/core/plan.py — added skeleton_metadata field
  • src/cleveragents/domain/models/core/__init__.py — exported SkeletonMetadata
  • src/cleveragents/application/services/__init__.py — exported service symbols
  • src/cleveragents/application/container.py — registered service
  • vulture_whitelist.py — added public API entries
  • CHANGELOG.md — added entry

Quality Gates

  • Lint: passed
  • Typecheck: 0 errors (Pyright strict)
  • Unit tests: 22/22 skeleton scenarios pass
  • Integration tests: 6/6 Robot tests pass
  • Coverage: 97% (meets threshold)
  • Benchmarks: validated at 10/100/1000 fragment scales
## Summary Implements the ACMS skeleton compressor service for context inheritance between parent and child plans. Closes #194 ## Approach - **SkeletonMetadata** (frozen Pydantic model): records compression ratio, original/compressed token counts, and source decision IDs for auditability. Persisted on the `Plan` model as `skeleton_metadata`. - **SkeletonCompressorService**: stateless service that accepts context fragments and a `skeleton_ratio` in [0.0, 1.0], sorts fragments by relevance (descending, stable), and greedily selects fragments within a token budget of `original_tokens * (1 - ratio)`. - **Ratio semantics**: 0.0 = pass-through, 1.0 = max compression (single top fragment), default = 0.3. - **Deterministic ordering**: stable sort on `(-relevance, fragment_id)` ensures identical inputs always produce identical output. - **DI registration**: `skeleton_compressor_service` singleton in the container. ## Changes ### New files (8) - `src/cleveragents/domain/models/core/skeleton_metadata.py` - `src/cleveragents/application/services/skeleton_compressor.py` - `docs/reference/skeleton_compressor.md` - `features/skeleton_compressor.feature` (22 scenarios) - `features/steps/skeleton_compressor_steps.py` - `robot/skeleton_compressor.robot` (6 smoke tests) - `robot/helper_skeleton_compressor.py` - `benchmarks/skeleton_compressor_bench.py` ### Modified files (6) - `src/cleveragents/domain/models/core/plan.py` — added `skeleton_metadata` field - `src/cleveragents/domain/models/core/__init__.py` — exported `SkeletonMetadata` - `src/cleveragents/application/services/__init__.py` — exported service symbols - `src/cleveragents/application/container.py` — registered service - `vulture_whitelist.py` — added public API entries - `CHANGELOG.md` — added entry ## Quality Gates - Lint: passed - Typecheck: 0 errors (Pyright strict) - Unit tests: 22/22 skeleton scenarios pass - Integration tests: 6/6 Robot tests pass - Coverage: 97% (meets threshold) - Benchmarks: validated at 10/100/1000 fragment scales
freemo added this to the v3.4.0 milestone 2026-03-03 02:27:46 +00:00
freemo force-pushed feature/m6-acms-skeleton-compress from 46f585e1d8
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m57s
CI / docker (pull_request) Successful in 37s
CI / integration_tests (pull_request) Successful in 3m52s
CI / coverage (pull_request) Successful in 3m40s
CI / benchmark-regression (pull_request) Successful in 23m30s
to e9ef585800
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 34s
CI / security (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m26s
CI / docker (pull_request) Successful in 47s
CI / integration_tests (pull_request) Successful in 3m22s
CI / coverage (pull_request) Successful in 3m45s
CI / benchmark-regression (pull_request) Has been cancelled
2026-03-03 03:11:20 +00:00
Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-03 03:11:35 +00:00
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-03 03:11:48 +00:00
freemo force-pushed feature/m6-acms-skeleton-compress from e9ef585800
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 34s
CI / security (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m26s
CI / docker (pull_request) Successful in 47s
CI / integration_tests (pull_request) Successful in 3m22s
CI / coverage (pull_request) Successful in 3m45s
CI / benchmark-regression (pull_request) Has been cancelled
to 0bafa7b9f9
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 19s
CI / build (pull_request) Successful in 15s
CI / security (pull_request) Successful in 51s
CI / typecheck (pull_request) Successful in 1m0s
CI / unit_tests (pull_request) Successful in 2m14s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m9s
CI / coverage (pull_request) Successful in 3m47s
CI / benchmark-regression (pull_request) Has been cancelled
2026-03-03 03:30:52 +00:00
Compare
freemo force-pushed feature/m6-acms-skeleton-compress from 0bafa7b9f9
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 19s
CI / build (pull_request) Successful in 15s
CI / security (pull_request) Successful in 51s
CI / typecheck (pull_request) Successful in 1m0s
CI / unit_tests (pull_request) Successful in 2m14s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m9s
CI / coverage (pull_request) Successful in 3m47s
CI / benchmark-regression (pull_request) Has been cancelled
to 711e867112
Some checks failed
CI / quality (pull_request) Successful in 18s
CI / lint (pull_request) Successful in 26s
CI / benchmark-publish (pull_request) Has been skipped
CI / security (pull_request) Successful in 34s
CI / build (pull_request) Successful in 15s
CI / typecheck (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 3m3s
CI / docker (pull_request) Successful in 36s
CI / integration_tests (pull_request) Successful in 4m1s
CI / coverage (pull_request) Successful in 3m44s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 15s
CI / security (push) Successful in 29s
CI / typecheck (push) Successful in 40s
CI / build (push) Successful in 22s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m3s
CI / docker (push) Successful in 40s
CI / integration_tests (push) Successful in 3m1s
CI / coverage (push) Successful in 3m42s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 24m33s
2026-03-03 03:36:33 +00:00
Compare
freemo merged commit 711e867112 into master 2026-03-03 03:41:13 +00:00
freemo deleted branch feature/m6-acms-skeleton-compress 2026-03-03 03:41:14 +00:00
Sign in to join this conversation.
No reviewers
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!525
No description provided.