Skip to content

fix: clarify CCR marker content preservation - #3175

Open
hopstreax wants to merge 1 commit into
headroomlabs-ai:mainfrom
hopstreax:fix/3098-ccr-marker-wording
Open

fix: clarify CCR marker content preservation#3175
hopstreax wants to merge 1 commit into
headroomlabs-ai:mainfrom
hopstreax:fix/3098-ccr-marker-wording

Conversation

@hopstreax

@hopstreax hopstreax commented Aug 21, 2026

Copy link
Copy Markdown

Description

Closes #3098

CCR compression markers currently tell agents that content was compressed and
can be retrieved, but do not explicitly state that the original content is
preserved. This can cause agents to interpret the marker as data corruption or
truncation and perform unnecessary verification work.

This change adds Original content preserved. to the Kompress CCR marker while
preserving the existing Retrieve more: hash=<24-hex> retrieval protocol.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Code refactoring (no functional changes)

Changes Made

  • Added Original content preserved. to CCR markers emitted by:
    • KompressCompressor.compress()
    • KompressCompressor.compress_batch()
    • RemoteKompressCompressor.compress()
  • Updated the primary CCRToolInjector marker regex to recognize the new
    marker wording while retaining compatibility with existing marker formats.
  • Added regression tests covering all three producer paths and new marker
    detection.
  • No changes to compression, CCR storage, hashing, retrieval, TTL, or eviction
    behavior.

Testing

  • Unit tests pass (pytest)
  • Linting passes (ruff check .)
  • Type checking passes (mypy headroom)
  • New tests added for new functionality
  • Manual testing performed

Test Output

Targeted pytest suites:
tests/test_ccr_marker_policy.py
tests/test_ccr_tool_injection.py
tests/test_remote_kompress_dropin.py

64 passed in 3.84s

ruff check:
All checks passed!

ruff format --check:
1356 files already formatted

Real Behavior Proof

  • Environment: Windows 11, Python 3.14.2, Node 24.14.0, uv 0.11.32.
  • Exact command / steps: Ran the targeted CCR pytest suite with python -m pytest tests/test_ccr_marker_policy.py tests/test_ccr_tool_injection.py tests/test_remote_kompress_dropin.py; ran uv tool run ruff check headroom tests and uv tool run ruff format --check headroom tests; additionally exercised CCR compression, marker generation, CCRToolInjector detection, and CompressionStore retrieval with a synthetic tool result.
  • Observed result: The targeted suite passed with 64 tests passing; Ruff check passed; formatting check passed; the generated marker contained Original content preserved., CCRToolInjector detected its hash, and CompressionStore retrieved the original 730-character input with a verbatim match.
  • Not tested: The full repository test suite, upstream cloud LLM billing calls, and neural network retraining/inference quality were not tested; this change only modifies CCR marker wording and parser compatibility.

Runtime Rollout Safety

  • Rollout-managed feature(s): None; this is a static CCR marker wording and parser compatibility change.
  • Minimum rollout channel: Standard release; no staged rollout is required.
  • Stable/default behavior changed: Yes; the default Kompress CCR marker now explicitly states that original content is preserved.
  • Kill switch / disable path: None required; reverting the change restores the previous marker wording.
  • Unsafe override required: No.
  • Qualification impact: None; compression, CCR storage, hashing, retrieval, TTL, and eviction behavior are unchanged.
  • Rollback path: Revert commit 4bef0f3a to restore the previous marker wording.

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing targeted unit tests pass locally with my changes
  • I did not edit CHANGELOG.md — it is generated by release-please from my Conventional Commit PR title (a CI guard enforces this)

Screenshots (if applicable)

N/A — this is a model-facing marker/protocol change.

Additional Notes

The compressed representation itself remains intentionally condensed. The
integrity statement refers to the original content preserved in CCR storage,
which remains retrievable through the existing hash-based retrieval mechanism.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

PR governance

This PR follows the template and is marked ready for human review.

@github-actions github-actions Bot added status: needs author action Pull request body or readiness checklist still needs author updates status: ready for review Pull request body is complete and the author marked it ready for human review and removed status: needs author action Pull request body or readiness checklist still needs author updates labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready for review Pull request body is complete and the author marked it ready for human review

Projects

None yet

1 participant