Commit Graph

2 Commits

Author SHA1 Message Date
freemo f2232eec09 fix(acms): align SkeletonCompressorService.compress() with SkeletonCompressor protocol
CI / push-validation (pull_request) Successful in 32s
CI / helm (pull_request) Successful in 42s
CI / build (pull_request) Successful in 45s
CI / lint (pull_request) Successful in 1m13s
CI / quality (pull_request) Successful in 1m14s
CI / typecheck (pull_request) Successful in 1m27s
CI / security (pull_request) Successful in 1m28s
CI / unit_tests (pull_request) Successful in 7m6s
CI / docker (pull_request) Successful in 1m53s
CI / integration_tests (pull_request) Successful in 21m26s
CI / coverage (pull_request) Successful in 13m44s
CI / status-check (pull_request) Successful in 3s
- Updated SkeletonCompressorService.compress() to accept
  (fragments: tuple[ContextFragment, ...], skeleton_budget: int)
  -> tuple[ContextFragment, ...], matching the SkeletonCompressor protocol
- Removed skeleton_ratio and CompressionResult from the public API
- Added @runtime_checkable to SkeletonCompressor protocol in acms_service.py
- Added structural subtype assertion at module level to prevent future
  protocol drift
- Rewrote all Behave feature scenarios and step definitions to use
  skeleton_budget
- Updated benchmarks and robot helpers to use absolute token budgets
- Removed CompressionResult export from services __init__.py and
  vulture_whitelist.py
- The depth_breadth_projection.py call site already correctly computed
  and passed skeleton_budget

ISSUES CLOSED: #2925
2026-05-30 08:29:22 -04:00
freemo 711e867112 feat(acms): add skeleton compressor
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
Implemented SkeletonCompressorService for ACMS context inheritance, producing
compressed context representations for propagation from parent plans to child
plans. Key design decisions and implementation details:

- SkeletonMetadata (frozen Pydantic model): records ratio, original_tokens,
  compressed_tokens, and source_decision_ids for full auditability of each
  compression pass. Persisted on Plan.skeleton_metadata.

- SkeletonCompressorService: stateless service accepting a list of
  ContextFragment objects and a skeleton_ratio in [0.0, 1.0]. Fragments are
  sorted by relevance descending with a stable secondary sort on fragment_id
  to guarantee deterministic output. Token budget is original_tokens*(1-ratio);
  fragments are greedily selected until budget is exhausted.

- Ratio semantics: 0.0 = no compression (pass-through), 1.0 = maximum
  compression (single top fragment only), None = default 0.3.

- Integration: Plan model gains optional skeleton_metadata field exposed in
  as_cli_dict() under the 'skeleton' key. Service registered in DI container
  as skeleton_compressor_service (Singleton, stateless).

- Tests: 22 BDD scenarios (features/skeleton_compressor.feature) covering
  ratio validation, stable ordering, metadata correctness, edge cases, and
  plan model integration. 6 Robot Framework smoke tests. ASV benchmark suites
  at 10/100/1000 fragment scales.

- Documentation: docs/reference/skeleton_compressor.md with ratio table,
  algorithm description, metadata schema, and multi-decision plan example.

ISSUES CLOSED: #194
2026-03-03 03:36:33 +00:00