feat(shapes): the practice is written where it is read, and the coverage line measures the slip (milestone 439 step 6)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 16s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 47s
CI & Build / Python tests (push) Successful in 1m39s
CI & Build / Build & push image (push) Successful in 29s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 16s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 47s
CI & Build / Python tests (push) Successful in 1m39s
CI & Build / Build & push image (push) Successful in 29s
- reusing-code: "Before the turn ends — say what you built" — the four verdicts, the one classify_shapes(repo=…) call, and the component file as a shape. Description names the end-of-turn moment. - shape-accounting: the writer judges; audits are the check that it held. The write path SUGGESTS (no more hook instances); component file rows and whole-file canon described; scoped covers Svelte too. - _INSTRUCTIONS reuse line: "before the turn ends, say what you built (create_snippet the reusable, classify_shapes the rest)" — 1570/1600. - Coverage line: "written-shape check (7d): N turns checked, M asked, K left unjudged", from the Stop hook's recorded outcomes; silent until the question has been put. - test_guidance_ownership pins the new topic on reusing-code. - prior-art hook header no longer says it stamps instance rows. Plugin version minted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -198,6 +198,11 @@ TOPICS: tuple[Topic, ...] = (
|
||||
Topic("reuse recorded shapes; record at first build", "skill:reusing-code",
|
||||
("create_snippet", "when_to_use", "first build", "second copy"),
|
||||
"prior art offered beside a write is not noise", index=("create_snippet",)),
|
||||
# Milestone 439: the writer judges what it wrote, at the end of the turn,
|
||||
# asked by the plugin's Stop hook — the moment the knowledge exists.
|
||||
Topic("judge what you wrote before the turn ends", "skill:reusing-code",
|
||||
("before the turn ends", "classify_shapes", 'kind: "file"'),
|
||||
"you are the one who knows what the code you just wrote is"),
|
||||
Topic("report back where the work stands", "skill:reporting-back", ("reporting-back", "placement"),
|
||||
"take the placement from the record"),
|
||||
Topic("the operator's own reply shapes come first", "skill:reporting-back",
|
||||
|
||||
@@ -907,3 +907,16 @@ def test_a_file_is_a_unit_when_it_renders_and_nothing_inside_carries_its_name(pa
|
||||
from scribe.services.coverage import class_references, extract_definitions, is_file_unit
|
||||
|
||||
assert is_file_unit(path, text, extract_definitions(text), class_references(path, text)) is unit
|
||||
|
||||
|
||||
def test_the_line_says_whether_writers_judged_what_they_wrote():
|
||||
"""Milestone 439: the write-time figure — silent until the question has
|
||||
been put, then turns checked, asked, and asks walked past."""
|
||||
from scribe.services.coverage import coverage_line
|
||||
base = {"accounted": 10, "total": 10, "counts": {"exempt": 10},
|
||||
"unclassified": 0, "computed_at": "2026-10-01T00:00:00"}
|
||||
assert "written-shape check" not in coverage_line(base)
|
||||
assert "written-shape check" not in coverage_line(
|
||||
{**base, "write_time": {"checked": 0, "asked": 0, "left": 0, "days": 7}})
|
||||
line = coverage_line({**base, "write_time": {"checked": 12, "asked": 4, "left": 1, "days": 7}})
|
||||
assert line.endswith("; written-shape check (7d): 12 turns checked, 4 asked, 1 left unjudged")
|
||||
|
||||
@@ -79,3 +79,11 @@ async def test_an_unknown_outcome_is_refused_before_anything_is_written():
|
||||
pytest.raises(ValueError):
|
||||
await record_shape_check(7, "skipped", written=1, unjudged=1)
|
||||
session.add.assert_not_called()
|
||||
|
||||
|
||||
def test_the_window_counts_turns_asks_and_asks_walked_past():
|
||||
from scribe.services.shape_check import summarise
|
||||
|
||||
assert summarise([]) == {"checked": 0, "asked": 0, "left": 0}
|
||||
got = summarise(["passed", "blocked", "judged_after_block", "blocked", "left_after_block"])
|
||||
assert got == {"checked": 3, "asked": 2, "left": 1}
|
||||
|
||||
Reference in New Issue
Block a user