fix(7729): a rule with no statement keeps its full line, and the delivery test flushes like a door
CI & Build / TypeScript typecheck (push) Successful in 38s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 1m56s
CI & Build / integration (push) Successful in 2m8s
CI & Build / Build & push image (push) Successful in 33s

A first mention whose rule had an empty statement fell through to the
reference form and lost its "may apply <where>" — for a trigger-fired rule,
the very clause that says which trigger fired. The full form now renders
with or without a statement. The integration helper flushes the request
buffer, as a door does once its payload is fitted. using-grimoire trimmed
back to its 350-line budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 19:12:06 -05:00
co-authored by Claude Opus 5.5
parent a16dee4080
commit 05831149b8
3 changed files with 14 additions and 10 deletions
+4 -6
View File
@@ -100,12 +100,10 @@ Two constraints on *how* that's achieved:
**lesson** is what is worth knowing — a better way to think about a **lesson** is what is worth knowing — a better way to think about a
problem, a solution that transfers — and ignoring it costs time. All three problem, a solution that transfers — and ignoring it costs time. All three
are worth reading and all three arrive beside your work; only the first is are worth reading and all three arrive beside your work; only the first is
a mistake to miss. An injected line names which in its opening words — a mistake to miss. A line names which up front (*"Rule 11 …; it binds:"*,
*"Rule 11 …; it binds:"* against *"Preference 173 …; how this has been done *"Preference 173 …; how this has been done before:"*) and on first mention
before:"* — and on a first mention it carries the record's own statement, quotes the statement; `get_rule(id)` gives the why and how. A lesson is
so `get_rule(id)` is for the full text (why, how to apply), not for marked `lesson` under a header saying it binds nothing; payloads carry `kind`.
finding out what it says. A lesson arrives in the records menu marked `lesson`, under a header that
says outright that it binds nothing, and every payload carries `kind`.
**One question sorts them, and it is worth asking out loud: what happens if **One question sorts them, and it is worth asking out loud: what happens if
someone doesn't do this?** *Something breaks, or a boundary is crossed* — a someone doesn't do this?** *Something breaks, or a boundary is crossed* — a
+7 -4
View File
@@ -237,12 +237,15 @@ def _rule_hint_line(
else: else:
state = "First mention this session" state = "First mention this session"
tail = f"{state}; full text: get_rule({rule.id})." tail = f"{state}; full text: get_rule({rule.id})."
statement = "" if (compact or seen or held) else _statement_excerpt(rule) if compact or seen or held:
if not statement:
return f"Also relevant: {noun} {rule.id} \u201c{rule.title}\u201d ({force}). {tail}" return f"Also relevant: {noun} {rule.id} \u201c{rule.title}\u201d ({force}). {tail}"
statement = _statement_excerpt(rule)
if statement and statement[-1] not in ".!?…":
statement += "."
return ( return (
f"{noun} {rule.id} \u201c{rule.title}\u201d may apply {where}; {force}: " f"{noun} {rule.id} \u201c{rule.title}\u201d may apply {where}; "
f"{statement} {tail}" + (f"{force}: {statement}" if statement else f"{force}.")
+ f" {tail}"
) )
@@ -35,7 +35,10 @@ async def _rows(uid: int) -> list[RuleDelivery]:
async def _record(uid, sid, source, lines): async def _record(uid, sid, source, lines):
# A bound request's rows wait for the door's payload; flushing all of
# them is what a door does when every line it rendered was kept.
rule_deliveries.record(uid, sid, source, lines) rule_deliveries.record(uid, sid, source, lines)
rule_deliveries.flush()
await background.drain() await background.drain()