Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"context-window",
"summarize",
"restructure",
"deduplicate"
"deduplicate",
"transcript-cleanup",
"self-correction"
]
}
]
Expand Down
2 changes: 2 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"summarize",
"restructure",
"deduplicate",
"transcript-cleanup",
"self-correction",
"mece",
"pyramid-principle",
"skill"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Build output
dist/

# Python
__pycache__/
*.pyc
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,78 @@ All notable changes to this project are documented here. The format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **Four named compression lenses** in [SKILL.md](skills/compress-text/SKILL.md), with a
new "Compression techniques" section and matching procedure/guardrail/success-criteria
updates:
- **Semantic** — merge paraphrases and entailments into the single most specific
statement (meaning-level dedup that catches restatements sharing no words).
- **Statistical** — scan repeated n-grams, near-duplicate sentences, and low
information-density filler to target redundancy objectively, and report how much
redundancy was removed alongside the size reduction.
- **Structural (key-point tree)** — when the input spans multiple documents or sections
that belong together, build a single MECE key-point tree over the whole context: a point
stated in several places collapses to one node, and a sub-point shared by sibling branches
hoists to their nearest common ancestor so it is stated once above the per-branch deltas
(merge/split related docs and dedupe across them, preserving the union of distinct points).
- **Supersession (pivots)** — in transcripts, dictation, drafts, and chat, drop
self-correction markers ("actually", "scratch that", "I mean", "instead", …) together
with the passages they supersede, keeping only the final intent; ambiguous pivots are
kept and flagged. Conservative removes explicit corrections only; aggressive also drops
implicitly superseded restatements.
- Two functional eval cases: `12-pivot-corrections.md` (supersession) and
`13-redundancy-stats.md` (statistical consolidation + reporting), plus two triggering
rows for transcript/pivot cleanup.
- **Functional eval harness** (`evals/run_functional.py`, stdlib-only): deterministic
behaviour checks (`evals/functional_checks.json`) with an offline `--selftest` (scores a
golden reference per case; wired into `scripts/validate.sh`), a live `--model` mode, and a
`--grade DIR` mode for scoring rollout outputs. Supports `--split train|val|all`.
- **SkillOpt optimization loop** ([microsoft.github.io/SkillOpt](https://microsoft.github.io/SkillOpt/)):
a held-out validation split (fresh cases `14`–`18`) gates skill edits, so changes are kept
only when they improve held-out `val` without regressing `train`. Round trajectories live in
`evals/skillopt/`; each round is written up in `evals/OPTIMIZATION_LOG.md`.
- **Statistical-lens refinement (round 01, validation-gated):** treat upbeat status-padding
/ vacuous sentiment ("overall, things are going well") as low-density filler. Held-out pass
rate 4/5 → 5/5, no training regression.
- **Aggressive-mode density (round 02, validation-gated):** `aggressive` now shortens repeated
long noun phrases after first mention and cuts scope-setting context that states no distinct
rule, fact, number, or constraint — with a caveat that never drops a load-bearing qualifier.
Held-out set refreshed with 4 new `val` cases (`19`–`22`: negations/exceptions, conditional
branches, numeric fidelity, factual-contradiction flagging); held-out ratio-gate 2/4 → 3/4 with
no fidelity regression and over-cut anchors (`04`/`09`) clean.
- **Held-out probes (round 03):** 4 new `val` cases (`23`–`26`: modal obligation must/should/may,
numeric quantifier-bounds, first-use acronym expansion, authority/precedence rules) added as
standing held-out probes. `23` confirmed the skill already preserves modal obligation levels;
`24`/`25`/`26` document an unaddressed under-tightening gradient on low-density prose.
- **Structural (key-point tree) lens (round 04, validation-gated — accepted):** added a 4th
compression lens that treats related documents/sections as one whole-context MECE tree of key
points, hoisting shared points to their nearest common ancestor and collapsing cross-document
duplicates to a single node while preserving the union of distinct points (merge/split related
docs and dedupe across them). Two new `val` cases (`27`–`28`: cross-context hoist + collapse
repeats, merge runbooks into shared-core + deltas) with deterministic dedup checks; held-out
1/2 → 2/2 with no-regression anchors (`03`/`04`/`16`/`09`) 4/4 clean.
- **Compact split outputs (round 05, validation-gated — accepted):** refined the Structural lens and
Output template so split/merged structural outputs do not repeat the source title after the
`## Compressed text` heading, use compact branch-delta bullets when order is not load-bearing, and
omit separation-only instructions once the new structure enforces them. Two new `val` cases
(`29`–`30`: mixed procedure split, partner-launch API/marketing split); held-out 0/2 → 2/2 with
no-regression anchors (`03`/`04`/`09`/`16`/`27`/`28`) 6/6 clean.

### Changed

- Eval suite grows from 13 to 30 functional cases (17 held-out `val` cases for SkillOpt across five
rounds); static validator and offline self-test (30/30) both green.

### Notes

- **Round 03 evaluated a bounded edit that was rejected** (no skill change). A low-density-tightening
edit was drafted to close the `24`/`25`/`26` gradient, but the frozen agent's run-to-run variance
exceeded the edit's effect, so the held-out gate did not improve (1/4 → 0/4). Per the SkillOpt
acceptance rule the edit was reverted; `SKILL.md` is unchanged. See `evals/OPTIMIZATION_LOG.md`.

## [0.1.0] - 2026-06-18

### Added
Expand All @@ -25,4 +97,5 @@ All notable changes to this project are documented here. The format is based on
- Repository validation script (`scripts/validate.sh`) and GitHub Actions CI
(`.github/workflows/ci.yml`).

[Unreleased]: https://github.com/MartinForReal/compress-text-skill/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/MartinForReal/compress-text-skill/releases/tag/v0.1.0
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ using **MECE** grouping and the **Pyramid Principle**. It generates multiple can
groupings, scores each on size reduction and meaning-fidelity, and ships the best one —
preserving every instruction, key point, reference, and example.

It compresses through four complementary lenses:

- **Semantic** — merge paraphrases and entailments into the single most specific statement (meaning-level dedup, even when wordings differ).
- **Statistical** — scan for repeated n-grams, near-duplicate sentences, and low-density filler to target redundancy objectively and report how much was removed.
- **Structural (key-point tree)** — when the input spans multiple related documents or sections, build one whole-context key-point tree: hoist shared points to their common ancestor and collapse cross-document duplicates so each point is stated once, preserving the union of distinct points.
- **Supersession (pivots)** — in transcripts, dictation, drafts, and chat, drop self-corrections ("actually", "scratch that", "I mean", "instead") together with the passages they supersede, keeping only the final intent.

Supports two output modes:

- **dense** (LLM-oriented): maximize information per token for prompts and context.
Expand Down Expand Up @@ -78,6 +85,8 @@ Then upload the zip wherever Agent Skills are accepted:
- "Compress this for an LLM prompt: …" (dense mode)
- "Shorten these meeting notes but keep them readable" (readable mode)
- "Deduplicate and restructure this doc, show me the candidate comparison"
- "Clean up this dictated note: drop the parts where I changed my mind and keep the final decisions" (pivot/supersession)
- "Compress this and tell me how much redundancy you removed" (statistical reporting)
- "Compress this email template but keep the `{{ tags }}` untouched"
- "Compress #file:notes.md and report the token reduction"

Expand All @@ -92,11 +101,14 @@ Validate everything (manifests, skill structure, eval datasets) before publishin
Run just the evaluation suite (offline static checks, no model required):

```bash
python3 evals/run_evals.py
python3 evals/run_evals.py # structure + dataset integrity
python3 evals/run_functional.py --selftest # deterministic behaviour checks (30/30 cases)
```

The suite also includes a labelled triggering dataset and functional rubric cases for
model-judged evaluation — see [evals/README.md](evals/README.md). CI runs the validator
The suite also includes a labelled triggering dataset, functional rubric cases for
model-judged evaluation, and a [SkillOpt](https://microsoft.github.io/SkillOpt/)
held-out validation loop (train/val split + `evals/OPTIMIZATION_LOG.md`) that gates skill
edits on generalization — see [evals/README.md](evals/README.md). CI runs the validator
and builds the bundle on every push and pull request.

## Changelog
Expand Down
Loading
Loading