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
+17 -17
View File
@@ -12,19 +12,19 @@ The failure is silent and the wrong way round, because every read PREFERS the
mirror — deliberately, since parsing markdown to answer what an index can
answer is how a hot path rots.
- A SNIPPET went on reporting its old repo/path/symbol to the location
- A SNIPPET goes on reporting its old repo/path/symbol to the location
reverse lookup and to prior-art recall while displaying its new body: a
record surfaced with full authority and wrong, which the drift-check
docstring calls worse than having no record at all (#3128).
docstring calls worse than having no record at all.
- A LESSON is worse. Its mirror holds the TRIGGER, and the trigger is the
entire retrieval story — a stale one keeps the lesson firing for the
situation it used to name while it displays the one it now names.
#3128's fix was correct and did not generalise: it tested one constant, so
milestone 385's lesson arrived with the same design and none of the protection.
The registry tests below assert the PROPERTY — every kind with a derived mirror
is registered — so a third kind fails here rather than shipping quiet (#3734).
A fix that tests one constant does not generalise: the next kind arrives with
the same design and none of the protection. The registry tests below assert
the PROPERTY — every kind with a derived mirror is registered — so a third
kind fails here rather than shipping quiet.
"""
import inspect
@@ -114,30 +114,30 @@ async def test_a_title_change_reaches_the_mirror_too():
def test_every_kind_with_a_derived_mirror_is_registered():
"""The load-bearing one. Before #3734 this was a single `if` naming
snippets, and the kind added next was simply not covered."""
"""The load-bearing one. A single `if` naming one kind leaves the next
kind uncovered."""
from scribe.services.lessons import LESSON_NOTE_TYPE
from scribe.services.notes import _mirror_recomposers
from scribe.services.snippets import SNIPPET_NOTE_TYPE
table = _mirror_recomposers()
assert SNIPPET_NOTE_TYPE in table, "the #3128 fix was lost"
assert SNIPPET_NOTE_TYPE in table, "snippets lost their mirror recomposer"
assert LESSON_NOTE_TYPE in table, (
"a lesson's `data` holds its trigger and `lesson_trigger` prefers it, "
"so a body edit through the generic door would leave the lesson being "
"retrieved for a situation it no longer names (#3734)"
"retrieved for a situation it no longer names"
)
def test_the_dispatch_is_a_lookup_not_a_named_kind():
"""Asserted on structure (rule 167). A lookup extends in one line in one
"""Asserted on structure. A lookup extends in one line in one
place; naming a kind inline is the shape that left lessons uncovered."""
from scribe.services import notes as notes_module
src = inspect.getsource(notes_module.update_note)
assert "_mirror_recomposers()" in src
assert "SNIPPET_NOTE_TYPE" not in src, (
"update_note names one kind again — that is the shape #3734 replaced"
"update_note names one kind inline — the dispatch must be a lookup"
)
@@ -184,7 +184,7 @@ async def test_a_body_write_moves_a_lessons_trigger_with_it():
async def test_a_subject_containing_an_em_dash_still_splits():
"""Why `untrigger_title` is given the trigger instead of splitting on the
separator: a subject may legitimately contain one. The title here is an
UN-MIGRATED one, still carrying its trigger (milestone 427), because that
UN-MIGRATED one, still carrying its trigger, because that
is the row the inverse still has to read correctly."""
from scribe.services.embeddings import trigger_title
from scribe.services.lessons import TRIGGER_KEY
@@ -259,8 +259,8 @@ async def test_a_lesson_title_change_reaches_the_mirror():
],
)
def test_untrigger_title_inverts_trigger_title(subject, trigger):
"""#3207's shape: the join had three copies before it was consolidated, so
its inverse lives beside it rather than in whichever caller wanted it."""
"""The join's inverse lives beside it rather than in whichever caller
wanted it."""
from scribe.services.embeddings import trigger_title, untrigger_title
title = trigger_title(subject, trigger)
@@ -289,12 +289,12 @@ def test_the_trigger_separator_is_spelled_in_exactly_one_place():
]
assert not offenders, (
f"the trigger separator is spelled inline in {offenders} — use "
f"TRIGGER_SEP, trigger_title or untrigger_title (#3207)"
f"TRIGGER_SEP, trigger_title or untrigger_title"
)
def test_the_mirror_guards_can_fail():
"""Rule 167: shown turning red once."""
"""Shown turning red once."""
from scribe.services.lessons import TRIGGER_KEY, recompose_data
bare = fake_lesson(title="just a title", body="no composed lines", data=None)