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:
@@ -1,16 +1,15 @@
|
||||
"""A canon may only be urged on a shape that could plausibly BE it (#4204).
|
||||
"""A canon may only be urged on a shape that could plausibly BE it.
|
||||
|
||||
WHAT WAS WRONG. `dominant_canon` is a base rate: it answers "what is most
|
||||
common in this directory" and never "is this that". With `kind` carrying only
|
||||
`css | sym`, a frozen dataclass, a module constant, a sync predicate, a class
|
||||
and an async service function were all siblings, so the prior was the entire
|
||||
argument — it told a registry module of pure helpers to build from the
|
||||
`async_session` service canon. Upstream, the auto-stamp had no resemblance
|
||||
floor at all (`elif sid in resembles`), so 0.69 asserted as confidently as
|
||||
0.95, and one payload-level score was applied to every symbol in the file.
|
||||
WHY. `dominant_canon` is a base rate: it answers "what is most common in this
|
||||
directory" and never "is this that". With `kind` carrying only `css | sym`, a
|
||||
frozen dataclass, a module constant, a sync predicate, a class and an async
|
||||
service function are all siblings, so the prior is the entire argument — it
|
||||
would tell a registry module of pure helpers to build from an
|
||||
`async_session` service canon. An auto-stamp without a resemblance floor
|
||||
asserts 0.69 as confidently as 0.95.
|
||||
|
||||
The two halves compound: loose stamping manufactures the density that the
|
||||
divergence check then reads as authority. Both are fixed by the same
|
||||
divergence check then reads as authority. Both are held by the same
|
||||
primitive, and it is tested here on REAL signatures taken from the ledger —
|
||||
Python, Go, TypeScript and Vue — rather than invented ones, because a
|
||||
classifier that only works on the examples its author imagined is the failure
|
||||
@@ -75,9 +74,9 @@ def test_css_is_its_own_form_regardless_of_signature() -> None:
|
||||
assert shape_form("", "css") == "css"
|
||||
|
||||
|
||||
def test_the_five_shapes_that_started_this_are_not_service_functions() -> None:
|
||||
"""The concrete case. #2860 is an `async def` service unit; none of these
|
||||
is one, and all five were told to build from it."""
|
||||
def test_a_registry_modules_helpers_are_not_service_functions() -> None:
|
||||
"""The concrete case. The canon is an `async def` service unit; none of
|
||||
these is one."""
|
||||
canon = shape_form("async def create_note(user_id: int, ...):", "sym")
|
||||
assert canon == "async-fn"
|
||||
for sig in (
|
||||
@@ -90,27 +89,25 @@ def test_the_five_shapes_that_started_this_are_not_service_functions() -> None:
|
||||
assert not forms_agree(shape_form(sig, "sym"), canon), sig
|
||||
|
||||
|
||||
def test_how_many_of_the_five_the_divergence_gate_actually_silences() -> None:
|
||||
def test_the_divergence_gate_silences_only_a_family_contradiction() -> None:
|
||||
"""HONEST ACCOUNTING, and it is deliberately an assertion rather than a
|
||||
comment so it fails the day the answer changes.
|
||||
|
||||
Divergence gates at FAMILY level and only on contradiction, because a form
|
||||
mismatch is the PREMISE of a divergence prompt, not an objection to it —
|
||||
see `shape_family`. So of #4204's five false prompts this silences one:
|
||||
`Point` is a type and the canon is a callable. The four `def` helpers are
|
||||
callables like the canon and still ask.
|
||||
see `shape_family`. So of these five this silences one: `Point` is a type
|
||||
and the canon is a callable. The four `def` helpers are callables like the
|
||||
canon and still ask.
|
||||
|
||||
That is not a shortcoming of the gate, it is the limit of the signature:
|
||||
at this level those four are indistinguishable from #2793's acceptance
|
||||
case, where a sync `confirmDanger` beside an async confirm helper SHOULD
|
||||
be flagged.
|
||||
at this level those four are indistinguishable from the divergence
|
||||
readout's acceptance case, where a sync `confirmDanger` beside an async
|
||||
confirm helper SHOULD be flagged.
|
||||
|
||||
CORRECTED 2026-09-21 (#4208). This used to say separating them needs
|
||||
"widen `kind` or a comparison of meaning", offering the two as
|
||||
alternatives. Widening `kind` does not separate them: it buys the silence
|
||||
by bucketing `fn` apart from `async-fn`, which takes the async canon out
|
||||
of a sync candidate's denominator and silences #2793's acceptance case by
|
||||
the identical mechanism, one layer down. Whatever separates these four
|
||||
Widening `kind` does not separate them: it buys the silence by bucketing
|
||||
`fn` apart from `async-fn`, which takes the async canon out of a sync
|
||||
candidate's denominator and silences the acceptance case by the identical
|
||||
mechanism, one layer down. Whatever separates these four
|
||||
has to distinguish a helper that does the canon's JOB from one that does
|
||||
not, and no signature carries that. A comparison of meaning is the only
|
||||
lever, not one of two."""
|
||||
@@ -130,10 +127,10 @@ def test_how_many_of_the_five_the_divergence_gate_actually_silences() -> None:
|
||||
|
||||
|
||||
def test_a_sync_function_beside_an_async_canon_is_still_a_fair_question() -> None:
|
||||
"""#2793's acceptance case, which the first version of this change broke:
|
||||
gating divergence on `forms_agree` silenced a hand-rolled sync confirm in
|
||||
a directory where an async confirm helper is canon — the exact prompt the
|
||||
milestone exists to produce."""
|
||||
"""The divergence readout's acceptance case: gating divergence on
|
||||
`forms_agree` would silence a hand-rolled sync confirm in a directory
|
||||
where an async confirm helper is canon — the exact prompt the readout
|
||||
exists to produce."""
|
||||
canon = shape_form("async function onTrash() {", "sym")
|
||||
mine = shape_form("function confirmDanger() {", "sym")
|
||||
assert canon == "async-fn" and mine == "fn"
|
||||
@@ -185,8 +182,8 @@ def test_a_canon_whose_instances_agree_asserts_that_form() -> None:
|
||||
|
||||
|
||||
def test_a_canon_whose_instances_disagree_asserts_nothing() -> None:
|
||||
"""Portal's #3283 exactly: one snippet recorded as canon for a class, a
|
||||
plain def, an async def and a dozen tests. That spread is the SYMPTOM of
|
||||
"""One snippet recorded as canon for a class, a plain def, an async def
|
||||
and a dozen tests. That spread is the SYMPTOM of
|
||||
loose stamping, so reading it as "no opinion" makes the two fixes
|
||||
cooperate — a poisoned canon falls silent instead of flagging others."""
|
||||
rows = [_Row("class A:"), _Row("def b():"), _Row("async def c():")]
|
||||
@@ -334,7 +331,7 @@ def test_the_resemblance_floor_is_above_the_retrieval_floors() -> None:
|
||||
assert _RESEMBLE_MIN >= 0.80
|
||||
|
||||
|
||||
# ── The denominator, not the gate (#4208) ─────────────────────────────────
|
||||
# ── The denominator, not the gate ─────────────────────────────────────────
|
||||
#
|
||||
# `dominant_canon` is a base rate, and a base rate is only a statement about
|
||||
# something if its denominator is a population somebody asked a question
|
||||
@@ -369,7 +366,7 @@ def test_a_callable_is_not_counted_against_a_dataclass() -> None:
|
||||
|
||||
|
||||
def test_the_async_canon_stays_in_a_sync_candidates_denominator() -> None:
|
||||
"""THE ACCEPTANCE CASE OF #2793, and the reason this narrows by family
|
||||
"""THE DIVERGENCE READOUT'S ACCEPTANCE CASE, and the reason this narrows by family
|
||||
rather than by form.
|
||||
|
||||
A hand-rolled sync `confirmDanger` in a directory where an async confirm
|
||||
@@ -421,13 +418,13 @@ def test_a_family_passed_where_a_form_belongs_would_be_a_silent_no_op() -> None:
|
||||
assert by_form != by_family
|
||||
|
||||
|
||||
def test_the_four_survivors_still_prompt() -> None:
|
||||
def test_callable_helpers_beside_a_callable_canon_still_prompt() -> None:
|
||||
"""HONEST ACCOUNTING, matching the sibling test above.
|
||||
|
||||
The narrowed denominator does not silence #4204's four `def` helpers, and
|
||||
was never going to: they are callables, the canon is a callable, so
|
||||
nothing is excluded from their count. What changes is that the count is
|
||||
now over comparable things. Asserted so the claim cannot quietly rot into
|
||||
The narrowed denominator does not silence the four `def` helpers, and
|
||||
cannot: they are callables, the canon is a callable, so nothing is
|
||||
excluded from their count. What it buys is that the count is over
|
||||
comparable things. Asserted so the claim cannot quietly rot into
|
||||
"this fixed it".
|
||||
"""
|
||||
rows = [_Row(SERVICE) for _ in range(6)] + [_Row("class Point:", snippet_id=9)]
|
||||
|
||||
Reference in New Issue
Block a user