fix(acms): align DEFAULT_SKELETON_RATIO default value with spec
CI / lint (pull_request) Successful in 19s
CI / quality (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 55s
CI / security (pull_request) Successful in 1m2s
CI / build (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Failing after 6m27s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 17m25s
CI / integration_tests (pull_request) Successful in 23m0s
CI / coverage (pull_request) Successful in 10m52s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 58m22s

Align all DEFAULT_SKELETON_RATIO / _DEFAULT_SKELETON_RATIO constants
to the spec-required value of 0.15 (docs/specification.md line 35294).

Previously three modules used divergent defaults:
- skeleton_compressor.py: 0.3 (2x the spec value)
- depth_breadth_projection.py: 0.2 (33% above spec)
- project_context.py: 0.2 (33% above spec)

This caused child plans to receive 2-3x more skeleton context than
intended, and produced inconsistent behaviour depending on whether
skeleton compression was invoked via the CLI or the service layer.

Changes:
- Set DEFAULT_SKELETON_RATIO = 0.15 in skeleton_compressor.py
- Set DEFAULT_SKELETON_RATIO = 0.15 in depth_breadth_projection.py
- Set _DEFAULT_SKELETON_RATIO = 0.15 in project_context.py
- Update Behave feature tests to assert the 0.15 default value
- Add new scenario to project_context_cov3.feature asserting
  _DEFAULT_SKELETON_RATIO == 0.15 in _default_acms_config()

ISSUES CLOSED: #2909
This commit is contained in:
2026-04-05 08:22:36 +00:00
parent 1411adfed3
commit e05a577090
7 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ Feature: Depth/Breadth Projection System and Skeleton Context Propagation
Scenario: PlanContextInheritance config uses default skeleton_ratio
Given the depth/breadth projection modules are available
When I create an InheritanceConfig with defaults
Then the inheritance config skeleton_ratio should be 0.2
Then the inheritance config skeleton_ratio should be 0.15
@inheritance @skeleton
Scenario: PlanContextInheritance extract_child_focus returns parent decisions
+5
View File
@@ -62,3 +62,8 @@ Feature: Project context coverage round 3 (pccov3)
Then the pccov3 command should succeed
And the pccov3 output should contain "Execution Environment"
And the pccov3 output should contain "fallback"
# --- _DEFAULT_SKELETON_RATIO spec alignment ---
Scenario: Default ACMS config skeleton_ratio matches spec value of 0.15
When I pccov3 read the ACMS config for "local/pccov3-app"
Then the pccov3 ACMS config skeleton_ratio should be 0.15
+1 -1
View File
@@ -38,7 +38,7 @@ Feature: Skeleton compressor
Scenario: Default ratio applied when None
Given context fragments with total tokens 1000
When I compress with skeleton_ratio not specified
Then the metadata ratio should equal the default 0.3
Then the metadata ratio should equal the default 0.15
# --- stable ordering --------------------------------------------------
@@ -438,3 +438,15 @@ def step_pccov3_assert_output_contains(context: Any, text: str) -> None:
assert text in context.pccov3_output, (
f"Expected '{text}' in output, got: {context.pccov3_output!r}"
)
@then("the pccov3 ACMS config skeleton_ratio should be {expected:g}")
def step_pccov3_assert_skeleton_ratio(context: Any, expected: float) -> None:
from cleveragents.cli.commands.project_context import _DEFAULT_SKELETON_RATIO
assert context.pccov3_acms["skeleton_ratio"] == expected, (
f"Expected skeleton_ratio {expected}, got {context.pccov3_acms['skeleton_ratio']}"
)
assert expected == _DEFAULT_SKELETON_RATIO, (
f"_DEFAULT_SKELETON_RATIO is {_DEFAULT_SKELETON_RATIO}, expected {expected}"
)
@@ -48,7 +48,7 @@ logger = structlog.get_logger()
# Constants
# ---------------------------------------------------------------------------
DEFAULT_SKELETON_RATIO: float = 0.2
DEFAULT_SKELETON_RATIO: float = 0.15
"""Default fraction of child's token budget reserved for parent skeleton."""
EDGE_RELATIONS: tuple[str, ...] = (
@@ -47,7 +47,7 @@ class CompressionResult:
# ---------------------------------------------------------------------------
# Default skeleton_ratio when the caller does not specify one.
DEFAULT_SKELETON_RATIO: float = 0.3
DEFAULT_SKELETON_RATIO: float = 0.15
class SkeletonCompressorService:
@@ -65,7 +65,7 @@ _DEFAULT_WARM_MAX_DECISIONS = 500
_DEFAULT_COLD_MAX_DECISIONS = 5000
_DEFAULT_BREADTH = 2
_DEFAULT_DEPTH = 3
_DEFAULT_SKELETON_RATIO = 0.2
_DEFAULT_SKELETON_RATIO = 0.15
_DEFAULT_BUDGET_TOKENS = 8000