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
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:
@@ -88,7 +88,7 @@ async def test_build_autoinject_hint_titles_only_with_margin_gate():
|
||||
# Telemetry fired for BOTH retrievals this path runs: the scored menu and
|
||||
# the reuse-slot query competing against it. The slot's query used to be
|
||||
# the one unlogged retrieval on this path — the hit it displaced was in
|
||||
# retrieval_logs, the query that displaced it was not (#2463).
|
||||
# retrieval_logs, and the query that displaced it must be too.
|
||||
sources = [c.kwargs["source"] for c in rec.call_args_list]
|
||||
assert sources == ["auto_inject", "reuse_slot", "lesson_slot"]
|
||||
|
||||
@@ -127,7 +127,7 @@ async def test_build_session_context_includes_project_when_scoped():
|
||||
# No design system on the project -> no design block at all. An install with
|
||||
# none is the ordinary case, not a degraded one.
|
||||
assert "## Design system" not in out["context"]
|
||||
# Live state only (decision #4027): how to work with Scribe is the
|
||||
# Live state only: how to work with Scribe is the
|
||||
# using-scribe skill's to say. A restated reflex here is a copy that drifts.
|
||||
assert 'content_type="rule"' not in out["context"]
|
||||
assert "Reflex:" not in out["context"]
|
||||
@@ -140,8 +140,8 @@ def test_a_short_goal_is_shown_whole():
|
||||
|
||||
|
||||
def test_a_long_goal_is_cut_at_a_word_and_says_where_the_rest_is():
|
||||
"""#4036: a raw slice ended mid-word with nothing marking the cut, so a
|
||||
reader took half a sentence for the whole goal."""
|
||||
"""A raw slice ends mid-word with nothing marking the cut, and a reader
|
||||
takes half a sentence for the whole goal."""
|
||||
from scribe.services.plugin_context import _GOAL_CHARS, _goal_line
|
||||
goal = "make the record reach the next session\nso a solution is recalled " * 10
|
||||
line = _goal_line(goal, 2)
|
||||
@@ -190,7 +190,7 @@ async def test_build_session_context_pushes_the_projects_design_system():
|
||||
assert "resolve_design_system(9)" in ctx
|
||||
assert "get_design_system_stylesheet(9)" in ctx
|
||||
# The prose pointer names the call that has the MERGED guidance, not
|
||||
# enter_project, which carries only the summary now (#4045).
|
||||
# enter_project, which carries only the summary.
|
||||
assert "`get_design_system(9)` → `resolved_guidance`" in ctx
|
||||
|
||||
|
||||
@@ -230,8 +230,8 @@ async def test_build_session_context_unbound_repo_emits_bind_hint():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_project_id_that_does_not_resolve_is_reported_not_dropped():
|
||||
"""A `.scribe` marker names a project directly (#4085), so for the first
|
||||
time a caller arrives holding a pointer it BELIEVES in. If the id is for
|
||||
"""A `.scribe` marker names a project directly, so a caller arrives
|
||||
holding a pointer it BELIEVES in. If the id is for
|
||||
another instance, or names a deleted project, the session has to be told —
|
||||
it cannot infer it from an absence.
|
||||
|
||||
@@ -306,20 +306,18 @@ async def test_build_process_manifest_truncates_long_preview():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_build_session_context_caps_length():
|
||||
"""The cap still binds, and now has to be provoked rather than tripped.
|
||||
"""The cap binds, and has to be provoked rather than tripped.
|
||||
|
||||
This used to hand the block 200 long rule titles, because the preload made
|
||||
overflow the easy case. Milestone 394 removed that block, so nothing this
|
||||
function assembles on its own is big enough any more — which is a reason
|
||||
to drive the cap directly, not a reason to drop it. The project and design
|
||||
Nothing this function assembles on its own is ordinarily big enough to
|
||||
overflow — which is a reason to drive the cap directly, not a reason to
|
||||
drop it. The project and design
|
||||
blocks are still unbounded in principle, and the hook passes this text
|
||||
through verbatim.
|
||||
|
||||
Patching the cap rather than manufacturing 9,000 characters keeps the test
|
||||
about the TRUNCATION PATH — that it cuts, and that it says it cut — which
|
||||
is the part a reader depends on. The unbound-repo hint supplies the text:
|
||||
since milestone 410 the block carries live state only, and a bare session
|
||||
is a one-liner.
|
||||
the block carries live state only, and a bare session is a one-liner.
|
||||
"""
|
||||
from scribe.services import plugin_context as pc
|
||||
|
||||
@@ -333,7 +331,7 @@ async def test_build_session_context_caps_length():
|
||||
)
|
||||
|
||||
|
||||
# --- the reuse slot (#2246) --------------------------------------------------
|
||||
# --- the reuse slot ---------------------------------------------------------
|
||||
|
||||
_CFG = {"enabled": True, "threshold": 0.55, "top_k": 3}
|
||||
|
||||
@@ -348,7 +346,7 @@ def _asked_for_reuse(calls: list[dict]) -> bool:
|
||||
async def _autoinject(main_hits, reuse_hits, cfg=None, lesson_hits=None):
|
||||
"""Run build_autoinject_hint with each semantic query stubbed by the kinds
|
||||
it asks for: the unscoped pool, the reserved reuse query, and the reserved
|
||||
lesson query (milestone 385 step 5).
|
||||
lesson query.
|
||||
|
||||
ROUTED ON THE REQUESTED KINDS, not on call order, and that is the point of
|
||||
the helper. Order-keyed stubbing was fine while there was one reserved
|
||||
@@ -458,7 +456,7 @@ async def test_a_process_counts_as_reuse_too():
|
||||
assert not _asked_for_reuse(calls2)
|
||||
|
||||
|
||||
# --- write-path widened beyond snippets (#2246, the mirror half) -------------
|
||||
# --- write-path prior art beyond snippets ------------------------------------
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_write_path_semantic_arm_asks_for_experience_not_just_snippets():
|
||||
@@ -517,7 +515,7 @@ async def test_write_path_labels_a_non_snippet_hit_with_its_kind():
|
||||
)
|
||||
|
||||
ctx = out["context"]
|
||||
# The issue says what it is — and, since #4154, where it stands: a piece of
|
||||
# The issue says what it is — and where it stands: a piece of
|
||||
# prior art offered as "already tried" reads differently when it is still open.
|
||||
assert "· issue (todo)]" in ctx
|
||||
assert '[similar 0.72] "debounce helper"' in ctx # the snippet does not
|
||||
@@ -525,19 +523,18 @@ async def test_write_path_labels_a_non_snippet_hit_with_its_kind():
|
||||
assert "get_task(id)" in ctx and "get_snippet(id)" in ctx
|
||||
|
||||
|
||||
# ── The config stand-in cannot fall behind the real one (#4214) ───────────
|
||||
# ── The config stand-in cannot fall behind the real one ───────────────────
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_the_config_stand_in_carries_every_key_the_real_one_does():
|
||||
"""THE GUARD `writepath_cfg`'s DOCSTRING ALREADY CLAIMED AND DID NOT HAVE.
|
||||
"""THE GUARD `writepath_cfg`'s DOCSTRING CLAIMS.
|
||||
|
||||
Three arms read their numbers out of that dict inside a fail-open
|
||||
`except`, so a missing key does not raise where anyone can see it — the
|
||||
arm silently becomes a no-op, which is indistinguishable from the arm
|
||||
working and finding nothing. The helper derives its SURFACE keys from the
|
||||
registry to prevent exactly that, and then #4214 added a key that is
|
||||
deliberately not a surface: the whole derivation missed it, ten tests went
|
||||
red at once, and the diagnosis cost a CI round.
|
||||
registry to prevent exactly that, and a key that is deliberately not a
|
||||
surface slips past the derivation unless the key sets are compared.
|
||||
|
||||
Asserting the KEY SETS match, not the values: the stand-in exists to let a
|
||||
test set different numbers.
|
||||
@@ -559,7 +556,7 @@ async def test_the_config_stand_in_carries_every_key_the_real_one_does():
|
||||
)
|
||||
|
||||
|
||||
# ─── the passage that matched travels onto the menu (#4243, #4250) ───────────
|
||||
# ─── the passage that matched travels onto the menu ──────────────────────────
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user