docs(6209): twelve more test files say which behaviour they pin
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 52s
CI & Build / integration (push) Successful in 1m12s
CI & Build / Python tests (push) Successful in 1m53s
CI & Build / Build & push image (push) Successful in 12s

shape ledger, MCP projects/search/rulebooks tools, backup, chunking,
plugin context, derived mirror, rule band, shape form gate, plugin
version mint and note usage tests drop issue, milestone and rule numbers,
dates and one-install figures from docstrings, comments and messages.
Three shape-form-gate test names that told the discovery story now name
the property: a registry module's helpers are not service functions, the
divergence gate silences only a family contradiction, and callable helpers
beside a callable canon still prompt. The rulebook tool-count comment that
logged each milestone's additions is replaced by the reason it is a count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:24:50 -04:00
co-authored by Claude Opus 5.5
parent 91c96a8b8a
commit d41e72d26c
12 changed files with 223 additions and 265 deletions
+19 -24
View File
@@ -1,22 +1,20 @@
"""An act surfaces a SET of rules, and rank decides how loudly (#3851).
"""An act surfaces a SET of rules, and rank decides how loudly.
WHY THIS EXISTS
`RULEHINT_LIMIT` was 1. That was right while retrieval merely SUPPLEMENTED a
33-rule resident set — one salient rule beside everything already loaded. It
stops being right the moment milestone 394 removes residency, because then
this arm is the whole delivery, and `git push origin dev` is governed by
rules 1, 2, 9 and 140 at once, each of which alone permits the mistake the
others catch.
This arm is the whole delivery of rules to an act, and one command can be
governed by several rules at once — a `git push` by where to push, what not
to push, who polls CI and what to wait for — each of which alone permits the
mistake the others catch. One slot cannot serve that.
Two instruments, and they answer different questions:
- `_rule_band` decides HOW MANY. A fixed k fills its slots whether or not
anything deserves them; a band keeps only what scored close to the top,
so one clearly-relevant rule still shows one.
- `compact` decides HOW LOUD. Measured at #3851: a full line is ~143 tokens
once the trigger is rendered, so five of them cost ~646 before every Bash
call. Top-full-plus-references costs ~198.
- `compact` decides HOW LOUD. A full line is ~143 tokens once the trigger
is rendered, so five of them cost ~646 before every Bash call.
Top-full-plus-references costs ~198.
WHAT THIS PINS
@@ -96,7 +94,7 @@ def test_a_flat_cluster_surfaces_together():
def test_the_band_is_computed_from_scores_not_from_the_ledger():
"""A seen top hit still anchors the band (#3750 x #3851).
"""A seen top hit still anchors the band.
`_rule_band` never learns what the session has seen — dedup happens after
it, in the arms. Pinned here because the tempting "reorder so a fresh rule
@@ -124,7 +122,7 @@ def test_the_leading_line_carries_the_trigger(seen):
def test_a_later_line_cites_its_rule_without_quoting_the_trigger(seen):
"""Rank > 0 is a reference: identity and pointer, no trigger.
The trigger is the expensive half — 300-400 characters after #3855 — and
The trigger is the expensive half — often 300-400 characters — and
the leading line has already demonstrated the shape. Both assertions
matter: dropping the trigger is the saving, and keeping `get_rule(id)` is
what makes the saving safe, because a cited rule the reader cannot pull is
@@ -140,12 +138,11 @@ def test_a_later_line_cites_its_rule_without_quoting_the_trigger(seen):
def test_shortening_a_line_does_not_decide_what_it_says_about_holding():
"""A reference still tells a repeat from a first surfacing (#3750 x #3851).
"""A reference still tells a repeat from a first surfacing.
This is the regression the first cut of #3851 actually shipped: the
compact branch dropped the tail along with the trigger, so a rule the
session had already been told read exactly like one it had not. #3750's
whole argument is that the two are different claims — a repeat is rendered
A compact branch that drops the tail along with the trigger makes a rule
the session had already been told read exactly like one it had not. The
two are different claims — a repeat is rendered
precisely because the session may no longer HOLD what it was told — and
the tail is the entire difference a reader can act on.
@@ -153,10 +150,8 @@ def test_shortening_a_line_does_not_decide_what_it_says_about_holding():
a fact about its rank; what the session holds is a fact about the ledger;
and neither may be allowed to answer the other's question.
THREE STATES SINCE #4100, so this checks three. The axis grew and the test
grew with it — pinning only two would leave the compact branch free to
collapse the new middle state into either neighbour, which is the same
regression this was written for with one more place to hide.
THREE STATES, so this checks three. Pinning only two would leave the
compact branch free to collapse the middle state into either neighbour.
"""
rule = fake_rule(id=4, title="dev is home", when_to_apply=_TRIGGER)
fresh = _rule_hint_line(rule, where="here", seen=False, compact=True)
@@ -182,8 +177,8 @@ def test_a_compact_line_is_materially_shorter_than_a_full_one():
if a later edit puts the trigger back into the compact branch.
Measured against a REALISTIC trigger, because that is where the saving
lives: the rules this arm carries run 300-400 characters of trigger after
#3855, and a toy one-line trigger would make this pass on a compact branch
lives: the rules this arm carries run 300-400 characters of trigger, and
a toy one-line trigger would make this pass on a compact branch
that had stopped saving anything.
"""
long_trigger = (
@@ -200,7 +195,7 @@ def test_a_compact_line_is_materially_shorter_than_a_full_one():
def test_a_preference_keeps_its_noun_when_compact():
"""Force survives the shortening (#3849).
"""Force survives the shortening.
`kind` and `compact` are independent axes. A preference rendered as a
reference must still not read as a rule — the noun is the whole of the