Repository navigation
feat(guards): follow-on improvements to the context-guard and rate-limit-guard mods deferred from #6152 #6156
Copy link
Copy link
Open
Labels
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.Nice-to-have, cosmetic, or speculative; opportunistic.work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.Refactors, migrations, contract changes; cross-cutting and hard to reverse.
Description
Problem
Five improvements to the context-guard and rate-limit-guard mods were deferred during #6152's planning so the conversion could ship without them. This issue is the checklist. Each box can be split into its own issue when someone picks it up.
This follows from #6152 (draft). Line references below are on that PR's branch, feat/5778-mod-conventions, until it merges. The deferral was decided during the #6152 planning interview: the conversion keeps each guard's existing behavior and adds no new behavior beyond the improvements the owner approved for it.
Checklist
- A notice when context-guard's
zones.jsonis malformed. A malformed file silently falls back to the shipped bands. The resolver already computes notices (plugins/context-guard/hooks/zone.ts:41,readBands, and:134,resolveZone), but the module drops them:register.tsx:362takes only{ word }, andparseSettingsswallows a JSON parse failure (register.tsx:140-145, "malformed: every mod key takes its default"). Today only/context-guard:setup checkreports it. To decide: who is told (operator, Claude, or both), and how often (once per change to the file). - Context bands that follow a lowered auto-compact window. The bands are percentages of the model's full window, so a lowered
autoCompactWindoworCLAUDE_CODE_AUTO_COMPACT_WINDOWmakes auto-compact fire while the zone still reads green. The operator must retunezones.jsonby hand (plugins/context-guard/README.md:175-183). To decide: whether the mod can read the effective window at all. Evidence that settles it: the per-build types for the session usage reading (upstream "create: get the types for your build"), and a probe of whether$.settings.readand$.env.getreturn the effective window on the machines in scope, including where the built-in guardsec-defaultloads. - An earlier lane warning before the fixed 90% rate-limit pause edge (a reader-contract change). The floor fixes the pause at 90% (
plugins/rate-limit-guard/reference/reader-contract.md:32, "Fixed constants" at:273). The mod already sends a session one approach line at 85% ("approaching the 90% pause edge",plugins/rate-limit-guard/README.md:52, optionrate_limit_approach_pct), but no lane acts on it, and a 7-day window trips the same edge, which can mean a multi-day pause. What is left is a contract decision: whether lanes should stop claiming new work at an earlier mark or only report it. Changing the floor means rewording its drift-gated copies together (see docs(rate-limit-guard): reword the loop-lane floor's stale headless-tee sentence in the contract and its seven drift-gated copies #6155). - A separate grace budget for context-guard's blocking mode after a compaction. After a compaction the session counts as
dumbfor the rest of its life (register.tsx:363-366sets the flag, nothing clears it;:671-678handlessession.compact). A compaction resets the sharedzone_gate_grace_callsbudget (register.tsx:677; README:107-108), so a compacted session in blocking mode gets one budget per compaction and is then denied until/clear. That may be intended (hand off, then/clear). To decide: whether it is, or whether the post-compaction block needs its own budget or a way to lift. - Configurable actions at rate-limit thresholds. context-guard lets
zones.jsonset an action per zone and per threshold (README.md:66-68; the actions arenone,save-state,handoffandblock,register.tsx:18). rate-limit-guard's options set the line threshold, approach mark, data and band only (plugins/rate-limit-guard/.claude-plugin/plugin.json,userConfig), and the 90% pause edge is a contract constant. feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152 makes actions configurable for context boundaries only, by an owner-approved exception. To decide: what an action at a rate-limit threshold would be for a lane, given the pause edge stays fixed.
Done when
- Each box is ticked by a merged change, or replaced with a link to the issue that carries it, or struck with a reason.
- Anything that touches the reader contract's floor ships with its drift-gate update in the same change (
scripts/check-loop-lane-floor-drift.sh).
Related
- feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152: the draft PR this follows from.
- docs(rate-limit-guard): reword the loop-lane floor's stale headless-tee sentence in the contract and its seven drift-gated copies #6155: rewords the floor's stale sentence; the third box's contract change touches the same copies.
- context-guard: document verified auto-compact-window interplay with zones #2995 (closed): documented the auto-compact surfaces the second box builds on.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.Nice-to-have, cosmetic, or speculative; opportunistic.work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.Refactors, migrations, contract changes; cross-cutting and hard to reverse.
Type
Fields
No fields configured for Feature.
Activity
github-actions commentedon Oct 4, 2026
Thanks for the report. Automated triage handed this issue to a maintainer.
Automated triage. A maintainer reviews it.
kyle-sexton commentedon Oct 4, 2026
This was generated by AI during triage.
Routing: human-gated, needs a decision, work class structural. This is a checklist of five deferred design questions, each with an open "to decide", and three of them change behavior or a cross-plugin contract (the reader contract's fixed pause edge and its drift-gated floor copies). None is delegable as written.
Two gates sit in front of it:
Basis: verified,
docs/adr/0035-defer-claude-code-mods-with-five-go-criteria.mdon main;gh pr view 6152reportsisDraft: true; #5777 isstatus: needs-decision,work-class: structural.Open questions (one per box), with what settles each:
zones.jsonnotice: who is told (operator, Claude, or both) and how often. Settled by an owner choice; the resolver already computes notices./clearintended, or does it need its own budget or a way to lift?Recommended next step: once #6152 merges, split each box into its own issue as the body suggests, so each decision is answered and routed on its own.
Related cluster: #6155, #6156, #6157 and #6158 all wait on #6152; box 3 touches the same floor copies as #6155.
kyle-sexton commentedon Oct 13, 2026
Decision recorded. The owner approved applying independently verified recommendations (high-risk set, reviewed) on 2026-10-13.
Basis: plugins/context-guard/CHANGELOG.md:28 (Remove usage throttles and make guard notices to Claude opt-in #7135); plugins/context-guard/hooks/register.tsx:140-141
Basis: plugins/context-guard/hooks/register.tsx:150-158 (parse failure swallowed); fix(guards): one command per guard, band rows off by default, toast on zone and window changes #6271 merged (toasts on zone changes); judgment for the channel
Basis: feat(guards): follow-on improvements to the context-guard and rate-limit-guard mods deferred from #6152 #6156 body box 3 (rate_limit_approach_pct at 85%, floor fixed at 90%); docs(rate-limit-guard): reword the loop-lane floor's stale headless-tee sentence in the contract and its seven drift-gated copies #6155 closed 2026-10-07 (floor copies); judgment
Basis: feat(guards): follow-on improvements to the context-guard and rate-limit-guard mods deferred from #6152 #6156 body 'Each box can be split into its own issue'; triage comment 2026-10-04 'split each box into its own issue'; plugins/context-guard/reference/reader-contract.md:468 (autoCompactWindow row)
A checklist of five deferred guard-mod improvements from #6152, each with a 'to decide'. #6152 merged 2026-10-04 and #7135 removed the blocking gate, so box 4 no longer applies; boxes 1, 2, 3 and 5 are still open on main.
Verification notes:
Verified by an independent fresh-context check (confirmed, risk high): gh issue view 6156 (body, 2 comments); plugins/context-guard/CHANGELOG.md:26-30; plugins/context-guard/hooks/register.tsx:138-160; plugins/context-guard/reference/reader-contract.md:466-469; PR 6271 MERGED, PR 6152 MERGED, issue 6155 CLOSED 2026-10-07, issue 7135 CLOSED; gh pr list search 'zones.json malformed' (none)
Admission to an agent lane stays with the work-class rules and owner ratification.