fix(moments): the tools import the delivery module, and the tool-list cache leaves the swept directory (milestone 458 step 4a, #4922)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / integration (push) Successful in 49s
CI & Build / TypeScript typecheck (push) Successful in 52s
CI & Build / Python tests (push) Successful in 1m48s
CI & Build / Build & push image (push) Successful in 32s

Two guards caught 7865313:

- test_mcp_tool_processes reads every coroutine in a tool module's
  namespace as a tool, and a name-imported attach_moment_rules looked
  like one. All seven modules now call moment_delivery.attach_moment_rules,
  and the parity guard accepts the attribute form.
- The session-ledger convention: a file in a swept directory must be a
  .ids ledger. The tool-list cache describes the install, not the
  context, so it moves to its own directory, scribe-moment, where a
  compaction does not sweep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 12:24:30 -04:00
co-authored by Claude Opus 5.5
parent 78653130d6
commit b3b616b20a
11 changed files with 32 additions and 27 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ from scribe.services import trash as trash_svc
from scribe.services.note_usage import record_pulled
from scribe.services.record_refs import refuse_guessed_ids
from scribe.services.text import elide
from scribe.services.moment_delivery import attach_moment_rules
from scribe.services import moment_delivery
# A work log entry is prose, often long — the discipline asks for what was
@@ -467,7 +467,7 @@ async def update_task(
if prefs:
data["reply_preferences"] = prefs
data["report_back"] = REPORT_BACK_CUE + " " + REPLY_PREFERENCES_CUE
return await attach_moment_rules(
return await moment_delivery.attach_moment_rules(
uid, "update_task", {"status": status, "project_id": project_id}, data,
)
@@ -737,7 +737,7 @@ async def start_planning(
)
if isinstance(result, dict):
result.update(dedup_svc.batch_overlap_response(overlaps))
await attach_moment_rules(uid, "start_planning", {"project_id": project_id}, result)
await moment_delivery.attach_moment_rules(uid, "start_planning", {"project_id": project_id}, result)
return result