Skip to content

refactor(context_compressor): extract text-util leaves into context_compressor_text_utils - #80626

Open
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:gfg/cc-lb2-skill-prune
Open

refactor(context_compressor): extract text-util leaves into context_compressor_text_utils#80626
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:gfg/cc-lb2-skill-prune

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Large-file decomposition feature package (tracker #78647): agent/context_compressor.py slice — extract the two pure text-util leaves (_redact_compaction_text, _content_text_for_contains) into agent/context_compressor_text_utils.py with an is-identical re-export seam.

Why these two first

Wave-2 graph redraw (dual REQUEST_CHANGES, #78645): the skill-prune cluster (LB2) depends on both helpers — extracting them first breaks the import cycle and unblocks LB2 as a clean one-way dependency.

Slice

  • God-file: agent/context_compressor.py (6,883 lines @ pin 6e9cae6ac4b)
  • Window: 679–697 + 870–890 (pin line numbers)
  • Golden sha256: 5591e8c923958085… / 3f79a957ac93230a… — both byte-exact, verified by 5/5 blind reviewers
  • Module: agent/context_compressor_text_utils.py (imports only typing + agent.redact; no cycle)
  • Seam: godfile re-exports both names; cc._redact is tu._redact verified at runtime

Verification

  • 31/31 targeted tests (seam + redaction boundaries + ghost-skill + zero-user-guard)
  • 5/5 blind re-review APPROVED (0 CRITICAL / 0 IMPORTANT; 1 provenance MINOR)
  • ruff clean · git diff --check clean · LF-only · DCO signed
  • Collision census clean (no open PR modifies either window)

Part of #78645
Part of #78647

…ll-prune

Wave-2 dual REQUEST_CHANGES agreed LB2 skill-prune cannot extract first:
it calls _redact_compaction_text and _content_text_for_contains (cycle).
Move those two pure leaves into context_compressor_text_utils.py with
is-identical re-export through the godfile. Golden bodies byte-exact.

Part of NousResearch#78645
Part of NousResearch#78647

Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
@andrexibiza

Copy link
Copy Markdown
Contributor Author

Interlock: Part of #78645 + #78647. 5/5 blind APPROVED receipts in worktree tmp/PASS_*_VERDICT.md.

@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/compression Context compression and continuation sessions sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 6, 2026
@andrexibiza

Copy link
Copy Markdown
Contributor Author

Interlock completion for the context-compressor shard campaign:

The full related set is explicitly recorded in #81074, including the prior compressor shards, same-surface colliders/fixers, and their referenced issue nodes. The residual agent/context_compressor.py remains alive until the 2k Law is satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compression Context compression and continuation sessions comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants