← Back to Plugins
Tools

Compact Review

5p00kyy By 5p00kyy 👁 11 views ▲ 0 votes

OpenClaw plugin: Compaction quality reviewer - audits compaction summaries against raw session transcripts

GitHub

Install

openclaw plugins install path:/root/projects/compact-review

README

# compact-review

**OpenClaw plugin — Compaction Quality Reviewer**

Compaction summaries are never verified. A bad summary silently loses context: infrastructure facts disappear, pending tasks vanish, decisions get dropped. This plugin fires after every compaction, reads the raw session JSONL transcript, scores the summary for completeness, and alerts via Telegram when it's below threshold.

## What it checks

- **User requests** — did the summary capture what the user actually asked for?
- **Decisions made** — are the "decided / agreed / DO NOT TOUCH" signals preserved?
- **Infrastructure facts** — IPs, ports, container IDs, service states
- **Pending tasks** — things assigned but not completed
- **Errors fixed** — bug/error → fix pairs
- **Files changed** — key files that were created or modified

## How it works

No LLM calls. Pure signal extraction + string matching against the compaction summary. Fast, free, deterministic.

1. `after_compaction` hook fires with the session JSONL path
2. Parse raw session → extract signals from user and assistant messages
3. Check how many signals appear in the summary text
4. Score 0–100 based on weighted signal coverage
5. Write quality report to `memory/daily/YYYY-MM-DD.md`
6. If score < threshold (default 70), fire a Telegram alert

## Why this doesn't exist elsewhere

ClawMem handles per-turn memory extraction and retrieval. OpenClaw's built-in compaction handles the summarization. Neither one audits whether the summary was *good*. This fills the gap.

## Installation

```bash
# Wire into OpenClaw config
openclaw plugins install path:/root/projects/compact-review

# Or manually in openclaw.json:
# plugins.installs.compact-review.source = "path"
# plugins.installs.compact-review.sourcePath = "/root/projects/compact-review"
# plugins.entries.compact-review.enabled = true
```

## Config

```json5
{
  "plugins": {
    "entries": {
      "compact-review": {
        "enabled": true,
        "config": {
          "workspaceDir": "~/.openclaw/workspace",
          "minScoreToAlert": 70,
          "telegramChatId": "YOUR_TELEGRAM_CHAT_ID"
        }
      }
    }
  }
}
```

## Scoring breakdown

| Signal type | Weight | Why |
|---|---|---|
| User requests | 3x | Primary signals — what was asked |
| Decisions | 2x | High-stakes — losing these hurts most |
| Infra facts | 1x | IPs, ports, services |
| Pending tasks | 1x | Work continuity |
| Files changed | 0.5x | Nice to have |

## Contributing

MIT licensed. Part of the Spooky homelab agent stack. Companion to [openclaw-src](https://github.com/openclaw/openclaw) contribution work.
tools

Comments

Sign in to leave a comment

Loading comments...