Post-compaction premise-drift guard: injects a one-shot notice when a compaction summary drops a critical literal anchor.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ICCuse/dsh-premise-guard
GitHub-sourced plugins run build scripts on your machine at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
中文 | English
Post-compaction premise-drift guard. After a compaction/summary event, it extracts distinctive literal anchors (file paths, quoted literals, key=value pairs, error codes) from the shadowed span's text, checks whether the committed summary still contains them, and — when a critical anchor vanished — injects a one-shot notice into the next step telling the model what it may have lost and how to recover it from the append-only log.
Why
Recall-oriented designs (recallable-compaction, session-query tools) make shadowed content reachable when suspected. Nothing says "you just dropped a key fact". This guard turns the compaction summary into a checked handoff: the model learns the moment a path, value, or error string it was relying on is no longer in the summarized context.
How it works
| Hook | Role |
|---|---|
session/event (compaction/summary) |
Re-derives the shadowed span's text from shadowedSeqs (the log keeps every byte), extracts anchors, and compares against event.data.summary. |
agent/pre-step |
Injects one notice (plugin source) naming up to maxAnchors vanished anchors and the shadowed seq range, once per alarm; a new user prompt skips delivery. |
Anchor extraction is deterministic and pure — no LLM calls, no new storage.
Config
| Field | Default | Meaning |
|---|---|---|
maxAnchors |
5 |
Vanished anchors named in one notice. |
minAnchorLength |
6 |
Anchors shorter than this are never critical. |
maxNoticeChars |
400 |
Notice text cap. |
All three must be integers >= 1; misconfiguration throws at plugin load.
Install
Not on npm yet - install from this repository:
npm install github:ICCuse/dsh-premise-guard
# or: pnpm add github:ICCuse/dsh-premise-guard
Then mount the bundle (declared in package.json 'dsh.bundle'):
- id: dsh-premise-guard
name: 'dsh-premise-guard'
Or, once published, 'dsh plugin --profile web add dsh-premise-guard'.
Links
More in this category
LoserFox/distill★ 15
Automatic conversation distillation: background subagent reflection + skill create/update.
omdsh-dev/dsh-mnemon★ 11
Deep Mnemon integration: local three-tier memory (Runtime Memory, retrievable Documents, supervised Memory Spaces).
modusensus/dsh-mneme★ 8
Cross-session memory: SQLite with a human-editable Markdown mirror, background consolidation (dedup, merge, conflict resolution), and six memory tools.
nowledge-co/nowledge-mem-deepseek-harness★ 5
One memory layer for every AI tool and agent: Context Bundle injection, prompt-time recall, MCP tools, and turn-end DSH thread capture.
Jesse-njx/dsh-memory★ 2
Cited memory over DSH's lossless session log: distilled facts carry `(sessionId, eventRange)` citations that expand back to the exact original log excerpt.
PerryLink/dsh-memento★ 1
Bounded, layered, approval-gated, auditable cross-session memory: a typed `ctx.memory` seam with a zero-dependency SQLite provider, a `memory` tool, and frozen snapshot injection; every write passes the approval gate and stays reconstructable from the session log.