Skip to content

fix(memory-md): Tier 2 mechanical compression — strip carved-clause + §-chain trailing duplications (B-0006)#1480

Merged
AceHack merged 1 commit intomainfrom
fix/memory-md-tier2-mechanical-compression-b-0006-2026-05-04
May 4, 2026
Merged

fix(memory-md): Tier 2 mechanical compression — strip carved-clause + §-chain trailing duplications (B-0006)#1480
AceHack merged 1 commit intomainfrom
fix/memory-md-tier2-mechanical-compression-b-0006-2026-05-04

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 4, 2026

Summary

Tier 2 mechanical compression on memory/MEMORY.md per B-0006. Strips trailing duplication patterns identified by the prior audit; preserves all 430 bullets, link paths, and bullet order.

Mechanical patterns applied

  1. Trailing carved-clause strippingCarved candidate (not seed-layer):, Carved sentence:, Carved (recursion):, Carved provisional:, Carved blade:, Carved: clauses with quoted carved sentences (plus + *...* continuations). These duplicate content in the linked memory file. Conservative match: only the clause itself, NOT trailing content. E.g., line 100's **2026-05-01 cause-attribution refinement** subsection following a carved candidate is preserved as load-bearing.
  2. §-reference chain strippingComposes with §NN, §NN, ... graph-traversal hints. Inline narrative Composes with X (...) + Y without §-references is preserved; only chains containing §NN tokens are stripped.
  3. Trailing structural-marker stripping**...paired-edit** bold-header markers and CURRENT-<name>.md §NN paired-edit. short trailing forms at end-of-bullet. Mid-bullet paired-edit mentions in substantive context (e.g., line 175's paired-edit lint failed on PR #688) preserved.
  4. Long memory-file pointer-chain strippingComposes with <file>, <file>, <file>, <file>, <file> chains with 5+ refs. Smaller chains (which carry semantic content rather than just pointers) preserved.

Patterns NOT applied (judgment calls preserved per task brief)

  • Long verbatim quote blocks — Aaron's verbatim-preservation discipline says typos like "expically", "everytihng", "decsions" carry signal. Per task: "be conservative — only collapse quotes longer than ~150 chars" — but the verbatim-preservation discipline says even >150-char quotes are load-bearing substrate. Conservative call: leave all verbatim quotes intact.
  • Substantive **<date> refinement** subsections with semantic content following the bold-header (vs. paired-edit structural markers which carry no body). Stripping would lose load-bearing extension content.

Invariants verified

  • Bullet count: 430 in → 430 out (no entries lost) ✓
  • Bullet ORDER preserved ✓
  • All linked file paths preserved: audit-memory-references.ts reports 432/432 resolved, 0 broken ✓
  • audit-memory-index-duplicates.ts passes ✓
  • Fast-path banner at line 3 untouched ✓
  • Tail (pre-2026-04-23 archive pointer) untouched ✓
  • All bullet-end punctuation cleanly preserved ✓
  • Verbatim ellipsis spacing preserved ("... NOT" not collapsed to "...NOT") ✓

Numbers

Metric Before After Δ
Lines 455 455 0
Bytes 339,989 326,707 -13,282 (-3.9%)
Bullets 430 430 0
Bullets changed 53
Carved candidate 9 0 -9
Carved: 24 0 -24
Carved sentence: 7 0 -7
Composes with § 2 0 -2

Line count unchanged because the file is structurally one-bullet-per-line with each bullet a paragraph; line count is bullet-count + footer, not the compression target. Byte/density compression is the actual signal.

Test-bed framing

Per Aaron 2026-05-04: "Tiers 1-3 require judgment calls are your chance to record your architectural judgment and see how it holds up over time." The judgment IS the artifact for multi-AI scoring; ship the call you'd defend.

Compression script

/tmp/compress_memory.py — runnable Python with conservative regex patterns documented inline. Re-runnable on a restored copy to reproduce the diff exactly.

Test plan

  • bun tools/hygiene/audit-memory-references.ts — 432/432 resolve
  • bun tools/hygiene/audit-memory-index-duplicates.ts — 0 duplicates
  • grep -cE "^- \[" memory/MEMORY.md returns 430
  • diff spot-checked across 5 random bullets — substantive content preserved, mechanical clauses removed cleanly
  • Fast-path banner (line 3) and tail (pre-2026-04-23 archive pointer) byte-identical to before

🤖 Generated with Claude Code

… §-chain trailing duplications (B-0006)

Mechanical patterns applied across 53 of 430 bullets in memory/MEMORY.md:

1. Strip trailing "Carved candidate (not seed-layer):" / "Carved sentence:" /
   "Carved (recursion):" / "Carved provisional:" / "Carved blade:" / "Carved:"
   clauses with quoted carved sentences. These duplicate the linked memory
   file content. Conservative match: only the clause itself plus optional
   "+ *...*" continuations — content following the clause is preserved (e.g.,
   B-0006 line 100's "**2026-05-01 cause-attribution refinement**" subsection
   that follows a carved candidate is load-bearing and stays).

2. Strip "Composes with §NN, §NN, ..." section-reference chains (graph-traversal
   hints with §-references). Inline narrative "Composes with X (...) + Y" without
   §-references is preserved; only chains with §NN tokens are stripped.

3. Strip trailing "**...paired-edit**" bold-header structural markers and
   "CURRENT-<name>.md §NN paired-edit." short trailing forms that appear at
   end-of-bullet (mid-bullet paired-edit references in substantive context
   are preserved).

4. Strip trailing "Composes with <memory-file pointer chains>" only when the
   chain has 5+ distinct file/path references; smaller chains preserved.

Patterns NOT applied (judgment-call territory; preserved per task brief):

- Long verbatim quote blocks (Aaron's verbatim-preservation discipline; typos
  like "expically", "everytihng", "decsions" carry signal). Per task: "be
  conservative — only collapse quotes longer than ~150 chars" — but Aaron's
  verbatim-preservation discipline says even >150-char quotes are load-bearing
  substrate. Conservative call: leave all verbatim quotes intact.
- Substantive "**<date> <topic> refinement**" subsections with semantic content
  following the bold-header (vs. paired-edit structural markers which carry no
  body). Stripping these would lose load-bearing extension content.

Invariants verified:
- Bullet count: 430 input → 430 output (no entries lost).
- Bullet ORDER preserved.
- All linked file paths preserved (audit-memory-references.ts: 432/432
  resolved, 0 broken).
- audit-memory-index-duplicates.ts passes.
- Fast-path banner at line 3 untouched.
- Tail (pre-2026-04-23 archive pointer) untouched.
- All bullet-end punctuation cleanly preserved.
- Verbatim ellipsis spacing preserved (`"... NOT"` not collapsed to `"...NOT"`).

Outcome: 13.2KB saved (340KB → 327KB; ~3.9% byte reduction). Line count
unchanged (455) — the file is structurally one-bullet-per-line with each
bullet a paragraph; line count is bullet count plus footer, not the
compression target. Byte/density compression is the actual signal.

Per Aaron 2026-05-04 test-bed framing: "Tiers 1-3 require judgment calls
are your chance to record your architectural judgment." The judgment IS
the artifact for multi-AI scoring.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 4, 2026 12:34
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 4, 2026 12:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@AceHack AceHack merged commit e20f543 into main May 4, 2026
23 of 24 checks passed
@AceHack AceHack deleted the fix/memory-md-tier2-mechanical-compression-b-0006-2026-05-04 branch May 4, 2026 12:35
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.

2 participants