docs(6209): task document, query scrubbing, note pipeline, lesson door, live body, ledger clear, rule usage

Seven more test files: docstrings and comments state the property and its
reason, the SQL-twin note states why `\m` and not `\b` without the install
it broke, and fixture provenance says "real near-miss queries" rather than
naming the spike that collected them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:29:49 -04:00
co-authored by Claude Opus 5.5
parent 17e1931c0b
commit 0e658bf275
7 changed files with 81 additions and 92 deletions
+11 -11
View File
@@ -1,11 +1,11 @@
"""The REST door for lessons — the half the web UI can actually reach (#3734).
"""The REST door for lessons — the half the web UI can actually reach.
WHY THIS EXISTS AT ALL
Milestone 385 built the lesson kind through the MCP tools, which is the surface
an agent uses. The Vue app speaks REST, so until this blueprint existed a lesson
was a record a person could not create, read, edit or retire from the UI — rule
27's "no UI, no ship" failing at the door rather than in the view.
The MCP tools are the surface an agent uses; the Vue app speaks REST. Without
this blueprint a lesson is a record a person cannot create, read, edit or
retire from the UI — a feature with no UI, failing at the door rather than in
the view.
WHAT THESE PIN
@@ -17,7 +17,7 @@ kind:
own title would produce lessons that rank differently from the agent's, and
the document IS what ranks.
- ACL (rule 78). Share-aware resolve, write as the owner — the pattern
- ACL. Share-aware resolve, write as the owner — the pattern
routes/snippets.py sets — so a shared editor isn't rejected by the
owner-scoped service.
@@ -50,7 +50,7 @@ def test_both_doors_share_one_serializer():
def test_the_rest_door_composes_nothing_itself():
"""Asserted on structure (rule 167). The document is what ranks, so a door
"""Asserted on structure. The document is what ranks, so a door
that built its own title would produce lessons that rank differently from
the ones the agent writes."""
from scribe.routes import lessons as routes
@@ -124,7 +124,7 @@ def test_the_subject_is_required_too():
assert "what is required" in src
# ── ACL: rule 78's pattern, not a bare owner filter ──────────────────────────
# ── ACL: the shared-access pattern, not a bare owner filter ──────────────────
@pytest.mark.parametrize(
@@ -139,12 +139,12 @@ def test_writes_check_permission_and_act_as_the_owner(handler):
assert "can_write_note" in src, f"{handler} does not check write permission"
assert "note.user_id" in src, (
f"{handler} writes as the caller rather than as the owner, which "
f"rejects a legitimately shared editor (rule 78)"
f"rejects a legitimately shared editor"
)
def test_no_handler_builds_its_own_owner_filter():
"""Rule 78's actual failure mode: a route assembling its own
"""The access layer's actual failure mode: a route assembling its own
`Note.user_id == uid` clause instead of going through the service and the
access helpers. Passing `user_id=uid` INTO a service is the correct call
and is not what this looks for."""
@@ -238,7 +238,7 @@ def test_the_payload_reads_back_the_composed_fields():
def test_the_rest_guards_can_fail():
"""Rule 167: shown turning red once."""
"""Shown turning red once."""
from scribe.routes import lessons as routes
src = inspect.getsource(routes)