UAT: AssembledContext in crp.py missing spec-required skeleton_fragments field #4555

Closed
opened 2026-04-08 14:25:57 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: ACMS / CRP domain models
Severity: Medium
File: src/cleveragents/domain/models/acms/crp.py

What Was Tested

The AssembledContext class in the CRP domain model module was compared against the specification definition.

Expected Behavior (from spec)

Per docs/specification.md line 25574, AssembledContext must have a skeleton_fragments field:

@dataclass
class AssembledContext:
    """The fused, budget-respecting context payload."""
    fragments: list[ContextFragment]
    total_tokens: int
    budget_used: float
    strategies_used: list[str]
    context_hash: str
    preamble: str | None
    provenance_map: dict
    skeleton_fragments: tuple[ContextFragment, ...] = ()  # Compressed parent context for child plan inheritance

The skeleton_fragments field holds compressed parent context fragments for propagation to child plans, produced by the SkeletonCompressor during Phase 3 finalization.

Actual Behavior

The AssembledContext class in src/cleveragents/domain/models/acms/crp.py (lines 322–360) is missing the skeleton_fragments field entirely:

class AssembledContext(BaseModel, frozen=True):
    fragments: tuple[ContextFragment, ...] = Field(default=(), ...)
    total_tokens: int = Field(...)
    budget_used: float = Field(...)
    strategies_used: tuple[str, ...] = Field(default=(), ...)
    context_hash: str = Field(...)
    preamble: str | None = Field(default=None, ...)
    provenance_map: dict[str, Any] = Field(default_factory=dict, ...)
    # skeleton_fragments is MISSING

Note: ContextPayload (in context_fragment.py) which extends CRPAssembledContext does have skeleton_fragments. However, the base AssembledContext in crp.py is used directly in project_context.py CLI commands (the _simulate_context_assembly function returns AssembledContext and the _assembled_to_dict function serializes it), meaning the skeleton_fragments field is never exposed in context simulation output.

Steps to Reproduce

  1. Inspect src/cleveragents/domain/models/acms/crp.py class AssembledContext
  2. Compare against spec line 25574
  3. Note skeleton_fragments field is absent from the base CRP model

Impact

  • Context simulation (agents project context simulate) never shows skeleton fragments in output
  • Any code consuming AssembledContext directly (not ContextPayload) cannot access skeleton fragments
  • The _assembled_to_dict helper in project_context.py does not serialize skeleton fragments

Fix

Add skeleton_fragments: tuple[ContextFragment, ...] = Field(default=(), description="Compressed parent context for child plan inheritance") to AssembledContext in crp.py.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** ACMS / CRP domain models **Severity:** Medium **File:** `src/cleveragents/domain/models/acms/crp.py` ### What Was Tested The `AssembledContext` class in the CRP domain model module was compared against the specification definition. ### Expected Behavior (from spec) Per `docs/specification.md` line 25574, `AssembledContext` must have a `skeleton_fragments` field: ```python @dataclass class AssembledContext: """The fused, budget-respecting context payload.""" fragments: list[ContextFragment] total_tokens: int budget_used: float strategies_used: list[str] context_hash: str preamble: str | None provenance_map: dict skeleton_fragments: tuple[ContextFragment, ...] = () # Compressed parent context for child plan inheritance ``` The `skeleton_fragments` field holds compressed parent context fragments for propagation to child plans, produced by the `SkeletonCompressor` during Phase 3 finalization. ### Actual Behavior The `AssembledContext` class in `src/cleveragents/domain/models/acms/crp.py` (lines 322–360) is **missing the `skeleton_fragments` field entirely**: ```python class AssembledContext(BaseModel, frozen=True): fragments: tuple[ContextFragment, ...] = Field(default=(), ...) total_tokens: int = Field(...) budget_used: float = Field(...) strategies_used: tuple[str, ...] = Field(default=(), ...) context_hash: str = Field(...) preamble: str | None = Field(default=None, ...) provenance_map: dict[str, Any] = Field(default_factory=dict, ...) # skeleton_fragments is MISSING ``` Note: `ContextPayload` (in `context_fragment.py`) which extends `CRPAssembledContext` **does** have `skeleton_fragments`. However, the base `AssembledContext` in `crp.py` is used directly in `project_context.py` CLI commands (the `_simulate_context_assembly` function returns `AssembledContext` and the `_assembled_to_dict` function serializes it), meaning the `skeleton_fragments` field is never exposed in context simulation output. ### Steps to Reproduce 1. Inspect `src/cleveragents/domain/models/acms/crp.py` class `AssembledContext` 2. Compare against spec line 25574 3. Note `skeleton_fragments` field is absent from the base CRP model ### Impact - Context simulation (`agents project context simulate`) never shows skeleton fragments in output - Any code consuming `AssembledContext` directly (not `ContextPayload`) cannot access skeleton fragments - The `_assembled_to_dict` helper in `project_context.py` does not serialize skeleton fragments ### Fix Add `skeleton_fragments: tuple[ContextFragment, ...] = Field(default=(), description="Compressed parent context for child plan inheritance")` to `AssembledContext` in `crp.py`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Closing as duplicate of #4429. Both issues describe the same bug: AssembledContext in crp.py is missing spec-required skeleton_fragments field. Issue #4429 is older and covers the same root cause.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Closing as duplicate of #4429. Both issues describe the same bug: `AssembledContext` in `crp.py` is missing spec-required `skeleton_fragments` field. Issue #4429 is older and covers the same root cause. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
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#4555
No description provided.