fix(7883): a lesson recorded for reply.report reaches the turn before the reply, and reply.ask is not offered to a lesson
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / integration (push) Successful in 2m0s
CI & Build / Python tests (push) Successful in 3m48s
CI & Build / Build & push image (push) Successful in 20s

Situated lessons arrived only at tool acts and in MCP replies, so a lesson
given a reply moment was accepted and never shown. The per-turn delivery now
carries lessons confirmed on reply.report, once per session, between the
turn's rules and its reply shape. reply.ask is known only after the reply is
written, so lesson_situations refuses it and leaves it out of the catalog the
pass and the lesson page offer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 10:48:12 -05:00
co-authored by Claude Opus 5.5
parent 5bde619511
commit 07c4a716bd
7 changed files with 114 additions and 23 deletions
+5 -1
View File
@@ -227,8 +227,12 @@ async def autoinject_retrieve():
# what the last turn left unjudged, then the records menu, fitted to the
# budget.
carry = (request.args.get("carry") or "").strip()[:_CARRY_CHARS]
# Lessons recorded for the reply, once per session: booked in the record
# ledger only if the fit keeps their line.
record_deliveries_svc.record(g.user.id, turn.get("lesson_ids") or [], "lesson_situation")
turn_parts = (
[*turn["rule_parts"], *turn["shape_parts"]] if "shape_parts" in turn
[*turn["rule_parts"], *turn.get("lesson_parts", []), *turn["shape_parts"]]
if "shape_parts" in turn
else [hook_payload_svc.Part(text=turn.get("context") or "", ids={
hook_payload_svc.RULE: tuple(turn.get("rule_ids") or ()),
hook_payload_svc.SHAPE: tuple(turn.get("shape_forms") or ()),