feat(7835): what resembles the work but is not shown is named by id in one pointer line
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Python tests (push) Failing after 2m1s
CI & Build / integration (push) Successful in 2m20s
CI & Build / Build & push image (push) Skipped
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Python tests (push) Failing after 2m1s
CI & Build / integration (push) Successful in 2m20s
CI & Build / Build & push image (push) Skipped
A pointer before a payload:
- the notes arms fetch a few results past the menu; those that cleared
the floor but were held back by the gate, the band or the budget are
named by id per kind, with the call that opens each kind, in one line
("Also resembling this, not shown: ...") at the message and the write
path;
- they are recorded in the record ledger as `pointed`, so an open that
follows is counted apart from pushed lines;
- setting a task in progress returns records_in_area: the notes and open
issues tagged to the task's areas, by id (a work.start row in the
kind x moment table says which kinds; it answers in a tool reply, so it
is shown as unmeasured).
The static context says what a pointer line means. Plugin version minted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,8 @@ Sentinels (preserved from existing fable-mcp):
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from grimoire.mcp._context import current_user_id
|
||||
from grimoire.mcp.tools import systems as systems_tools
|
||||
from grimoire.services import access as access_svc
|
||||
@@ -34,6 +36,7 @@ from grimoire.services.notes import minted_kind
|
||||
from grimoire.services import placement as placement_svc
|
||||
from grimoire.services import planning as planning_svc
|
||||
from grimoire.services import record_batch as batch_svc
|
||||
from grimoire.services import record_kinds, record_links
|
||||
from grimoire.services import rulebooks as rulebooks_svc
|
||||
from grimoire.services import systems as systems_svc
|
||||
from grimoire.services import task_logs as task_logs_svc
|
||||
@@ -43,6 +46,8 @@ from grimoire.services.record_refs import refuse_guessed_ids
|
||||
from grimoire.services.text import elide
|
||||
from grimoire.services import moment_delivery
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# A work log entry is prose, often long — the discipline asks for what was
|
||||
# decided and why, not a line of status. Two caps, not one, because the entries
|
||||
@@ -410,6 +415,11 @@ async def update_task(
|
||||
reconstructing them, because a remembered milestone title or "next step"
|
||||
reads exactly like a real one when it is wrong.
|
||||
|
||||
Setting a task `in_progress` also returns `records_in_area` when the
|
||||
task's areas hold notes or open issues: one line naming them by id with
|
||||
the call that opens each. Read the ones that bear on the work before
|
||||
starting it.
|
||||
|
||||
Closing a task (done or cancelled) also returns `reply_shape`, the
|
||||
default shape of the completion report you are about to write, and
|
||||
`report_back`: a one-line reminder of what that reply should cover. The
|
||||
@@ -465,11 +475,29 @@ async def update_task(
|
||||
# Owed family adoptions filed while the task was open — work now
|
||||
# waiting in some project, which the report names.
|
||||
await family_adoption_svc.attach_owed_adoptions(uid, data, note)
|
||||
if status == "in_progress":
|
||||
await _attach_area_records(uid, task_id, data)
|
||||
return await moment_delivery.attach_moment_rules(
|
||||
uid, "update_task", {"status": status, "project_id": project_id}, data,
|
||||
)
|
||||
|
||||
|
||||
async def _attach_area_records(uid: int, task_id: int, data: dict) -> None:
|
||||
"""Name, by id, what is recorded in the areas of a task being taken up:
|
||||
the `work.start` row of the kind×moment table says which kinds. Absent
|
||||
when the task has no area or nothing is recorded there."""
|
||||
try:
|
||||
kinds = await record_kinds.kinds_for(uid, "work.start")
|
||||
found = await record_links.area_records(uid, task_id, kinds)
|
||||
line = record_kinds.pointer_line(
|
||||
found, "Recorded in this task's areas", capped_at=record_links.AREA_DEPTH,
|
||||
)
|
||||
if line:
|
||||
data["records_in_area"] = line[0].removeprefix("> ")
|
||||
except Exception: # noqa: BLE001 - a decoration never breaks the payload
|
||||
logger.debug("area records for task %s could not be attached", task_id, exc_info=True)
|
||||
|
||||
|
||||
async def add_task_log(task_id: int, content: str) -> dict:
|
||||
"""Append a timestamped progress log entry to a Grimoire task.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user