Parent
Source: PLAN Phase A3, topic plugin-audit-port — plan locked at commit 40a64b5c on
feat/plugin-audit-port.
What to build
plugins/context-guard/reference/reader-contract.md, modeled on rate-limit-guard's reader
contract: snapshot path pattern, file shape, single fixed staleness value consumers inline,
fail-open capability-detection table (null used_percentage / null current_usage → unknown),
zones.json shape + resolver invocation + shipped default bands, untrusted-field warning,
per-session (NOT machine-scope last-writer-wins) semantics, idle-session note, invariants (no
shipped Monitor config; path deliberately outside ${CLAUDE_PLUGIN_DATA} as a cross-plugin seam).
Three load-bearing sections beyond the model:
- Session-id discovery — documents how a model-context consumer learns its own session id:
the ${CLAUDE_SESSION_ID} substitution in skill content (skills doc, verified 2026-07-23;
re-verify at implementation) with the documented fallback (substitution unavailable →
conservative/unknown path).
- Inline-floor ownership — this file OWNS the operable floor consumers inline (path pattern,
staleness value, default zone bands) and states the byte-identity rule; the plugin-quality lane
carries the matching drift check.
- Zone-is-not-a-compaction-indicator rule — a compacted session's percentage resets while its
evidence is already gone; consumers treat known-compacted sessions as evidence-degraded
regardless of zone. Cites the verified absence of any documented auto-compact threshold (fetch
date) and the empirical observation from the resolver slice.
Acceptance criteria
Blocked by
- Zone resolver slice (native edge).
Parent
Source: PLAN Phase A3, topic
plugin-audit-port— plan locked at commit40a64b5confeat/plugin-audit-port.What to build
plugins/context-guard/reference/reader-contract.md, modeled on rate-limit-guard's readercontract: snapshot path pattern, file shape, single fixed staleness value consumers inline,
fail-open capability-detection table (null
used_percentage/ nullcurrent_usage→ unknown),zones.json shape + resolver invocation + shipped default bands, untrusted-field warning,
per-session (NOT machine-scope last-writer-wins) semantics, idle-session note, invariants (no
shipped Monitor config; path deliberately outside
${CLAUDE_PLUGIN_DATA}as a cross-plugin seam).Three load-bearing sections beyond the model:
the
${CLAUDE_SESSION_ID}substitution in skill content (skills doc, verified 2026-07-23;re-verify at implementation) with the documented fallback (substitution unavailable →
conservative/unknown path).
staleness value, default zone bands) and states the byte-identity rule; the plugin-quality lane
carries the matching drift check.
evidence is already gone; consumers treat known-compacted sessions as evidence-degraded
regardless of zone. Cites the verified absence of any documented auto-compact threshold (fetch
date) and the empirical observation from the resolver slice.
Acceptance criteria
grep -c 'staleness' plugins/context-guard/reference/reader-contract.md≥ 1fetch date
${CLAUDE_SESSION_ID}mechanism + fallback documentedBlocked by