Skip to content

fix(prune): separate file and context savings#360

Closed
SUaDtL wants to merge 1 commit into
feat/pi-supportfrom
fix/prune-context-metrics-current
Closed

fix(prune): separate file and context savings#360
SUaDtL wants to merge 1 commit into
feat/pi-supportfrom
fix/prune-context-metrics-current

Conversation

@SUaDtL

@SUaDtL SUaDtL commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Separate whole-file reduction from model-visible context savings with an explicit scope for every prune strategy.
  • Preserve legacy file-metric aliases while correcting dry records, audit logs, state, CLI output, statusline output, and cold-cache nudge decisions across Claude, Codex, and Pi.
  • Reassess the existing aggregate evidence and keep pruning plus its nudge off by default because no sampled row cleared the 80,000 context-token floor.

Decision

sidecar-collapse is file-only because it removes host bookkeeping. Strategies that edit model-visible message content are context-scoped. Existing transformation eligibility remains byte-for-byte behaviorally compatible, including Unicode edge cases.

Conflict level 2: extend the preview metric contract without changing prune transformations, defaults, or release versions. This PR is stacked on #313 because it updates the shared Pi support core introduced there.

Test plan

  • wsl python3 -m unittest discover -s plugins/ca/hooks/tests -p test_*.py (1,022 passed, 1 skipped)
  • All 42 .github/scripts/test_*.py suites
  • Pi TypeScript typecheck and Vitest (544 passed, 1 skipped)
  • Policy parity plus focused prune behavior (3 policy tests and 108 focused tests)
  • Core sync, surface generation, host-package, plugin-reference, badge, license, JSON, secret-preview, and reproducible Pi build checks
  • Independent security review: PASS
  • Independent coverage review: CLEAN

Whole-file transcript reduction included host bookkeeping that never reaches the model, overstating compaction benefit and arming the cold-cache nudge on irrelevant bytes. Track strategy scope explicitly so operational decisions use only model-visible savings while retaining legacy file metrics for compatibility.

Task: v2.prune.0001

CHANGELOG: Prune metrics now distinguish model-visible context savings from file-only sidecar cleanup across all hosts.
@SUaDtL
SUaDtL changed the base branch from feat/pi-support to main July 20, 2026 10:58
@SUaDtL SUaDtL closed this Jul 20, 2026
@SUaDtL SUaDtL reopened this Jul 20, 2026
@SUaDtL
SUaDtL changed the base branch from main to feat/pi-support July 20, 2026 11:06
@SUaDtL

SUaDtL commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Hosted verification is green for exact head eff294caf89f4ee16533d5d1056bffc87e437ca8.

The PR base was temporarily changed to main and the PR was closed/reopened solely to trigger workflows that exclude stacked bases. It is restored to feat/pi-support, remains open, and is not merged.

@SUaDtL

SUaDtL commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #313, the single hackathon review surface. This PR's recorded head and changes are represented in #313's exact 16-PR / 29-commit / 126-path source manifest. PR #313 passed final exact-head CI at commit 6173b1d and remains open and unmerged. Closing this source PR to avoid parallel review; please continue review and discussion on #313.

@SUaDtL SUaDtL closed this Jul 20, 2026
@SUaDtL
SUaDtL deleted the fix/prune-context-metrics-current branch July 24, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant