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
2 changes: 1 addition & 1 deletion plugins/context-guard/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "context-guard",
"version": "0.7.14",
"version": "0.7.15",
"description": "Per-session context-window observability plus the first shipped consumer: a statusline wrapper tees each session's context_window fields to a per-session snapshot file, a zone resolver classifies usage into smart/acceptable/dumb bands (percentage bands plus window-class token bands, conservative-min combination, zones.json SSOT with shipped defaults), a reader contract fixes how consuming sessions interpret the snapshots, and zone-crossing hooks report once per transition into a worse zone across two channels \u2014 the continuation menu to the operator, who owns that choice, and to the model only the zone determination plus the counter-steer that a zone word is not a decay signal (advisory by default; an optional blocking mode gates new mutating work on a fresh dumb-zone snapshot with handoff-writing exempt), with a PostCompact hook persisting an evidence-degraded marker.",
"author": {
"name": "Melodic Software",
Expand Down
15 changes: 15 additions & 0 deletions plugins/context-guard/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to the `context-guard` plugin.
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).

## [0.7.15]
Comment thread
kyle-sexton marked this conversation as resolved.

### Fixed

- **`reference/reader-contract.md` described pre-0.5.0 advisory injection (#2973).** The
zone-crossing hooks section still called the injection "a minimal generic continuation tree plus
a presence-gated pointer to `session-flow:workflow`'s router", as one undifferentiated block —
the shape before the 0.5.0 audience split moved the menu off the model channel. The reference
therefore misdescribed shipped behavior to every reader of the seam. It now states what each
channel carries — `additionalContext`: the determination plus the counter-steer, and the
durable-note addendum in `dumb`; `systemMessage`: the same crossing plus the continuation menu
and the router pointer — that neither the menu nor the pointer ever reaches the model channel,
and the I23 rationale for the split. Verified against `hooks/zone-crossing-inject.sh`'s actual
emission rather than its header summary. Documentation only; no behavior change.

## [0.7.14]

### Changed
Expand Down
22 changes: 19 additions & 3 deletions plugins/context-guard/reference/reader-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,25 @@ not validation.
Since 0.4.0 the plugin itself ships hooks over its own seam — the first shipped consumer:

- **Advisory injection** (`PostToolBatch` + `UserPromptSubmit`): on a transition into a zone worse
than any this session has already reported, inject continuation guidance (a minimal generic
continuation tree plus a presence-gated pointer to `session-flow:workflow`'s router). Silent
while the zone is unchanged, improving, or `unknown`. **Hysteresis** (since 0.7.0): the gate is
than any this session has already reported, report the crossing on **two channels with two
audiences** (the 0.5.0 audience split). The **model channel** (`additionalContext`) carries the
determination and a counter-steer — the reading is a measurement rather than an instruction, real
degradation shows up in the model's own output and never in a zone word, and the model is told to
keep working the task in hand — plus, in `dumb`, a note to write each expensive conclusion to a
durable note against a short compaction distance. The **operator channel** (`systemMessage`)
carries the same crossing plus the continuation menu that is the human's call to make (continue /
`/clear` / handoff-then-`/clear`, with a hand-written resume note as the standalone-install
fallback / `/compact`) and the presence-gated pointer to `session-flow:workflow`'s router.
**Neither the menu nor the router pointer ever reaches the model channel.** A menu injected into
model context manufactures the model's own initiative to stop, summarize, or hand off — a live
finding under the instruction-audit catalog's I23 (`claude-config`, `reference/criteria.md`),
whose Remediate clause prescribes exactly this shape: state the counter-steer plainly, and where
the harness must surface a budget, pair it with a reassurance rather than with an exit menu. The
measurement decides only *when to ask*; the model still decides whether to stop. The model
channel states that continuation is the operator's CALL, never that the operator has SEEN the
menu — no documented hook behavior tells a hook whether an operator is present, so a delivery
claim would be a fact the hook cannot know. Silent while the zone is unchanged, improving, or
`unknown`. **Hysteresis** (since 0.7.0): the gate is
the worst zone already *reported*, not the zone last *seen*. That marker decays only when the
session returns to `smart` — the bottom of the ladder (**since 0.7.2**; 0.7.0 asked instead for an
improvement of at least two ranks, which no band but `dumb` could ever satisfy, so a session that
Expand Down