docs(6209): seventeen more test files — lesson shape and round trip, rule scope/moments/kind/surfacing, drift, deadlock race, backup, inception, backfill, claims, supersession, ledgers, family shapes
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / integration (push) Successful in 1m7s
CI & Build / Python tests (push) Successful in 1m54s
CI & Build / Build & push image (push) Successful in 12s

Docstrings and comments state the property and its reason in the present
tense. The session-context ledger test no longer describes the decision it
"used to pin"; the supersession tests state demote-not-filter without the
quote; one-row measurements become the general shape with their figures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:37:15 -04:00
co-authored by Claude Opus 5.5
parent ba0b56018e
commit 63e97a6f0f
17 changed files with 95 additions and 123 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
"""Real-Postgres tests for the drift surface (milestone 399 step 5, #3895).
"""Real-Postgres tests for the drift surface.
WHY THIS EXISTS
@@ -20,8 +20,8 @@ subquery picking the newest version per rule, an ownership clause spanning two
paths, and a write that has to leave the history longer than it found it. A
stand-in session returns whatever the test handed it, so it could confirm none
of those. `test_the_restore_is_recorded_as_an_edit` is the one that matters
most: it is the whole basis for allowing a one-click revert here when
milestone 323 refused one for rules, and if it were ever to pass while the
most: it is the whole basis for allowing a one-click revert here when rules
have none, and if it were ever to pass while the
restore silently overwrote history, the carve-out would be indefensible.
"""
import pytest
@@ -228,8 +228,8 @@ async def test_restoring_puts_the_old_wording_back(world):
async def test_the_restore_is_recorded_as_an_edit(world):
"""THE ONE THAT MATTERS MOST — it is why this carve-out is defensible.
Milestone 323 refused a one-click restore for rules because "a silent
revert would erase the only record of why the rewrite happened". The
Rules have no one-click restore because a silent revert would erase the
only record of why the rewrite happened. The
preference carve-out survives that objection only while nothing is
erased: the restore goes through `update_rule`, so it takes its own
snapshot and the history GAINS an entry.
@@ -262,7 +262,7 @@ async def test_the_restore_is_recorded_as_an_edit(world):
async def test_a_rule_refuses_the_one_click_restore(world):
"""Milestone 323 stands for rules, and the kind check is in the service
"""Rules still have no restore, and the kind check is in the service
rather than only in the route — so a caller reaching this directly cannot
forget it."""
await rulebooks_svc.update_rule(