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:
@@ -14,7 +14,8 @@ four calls:
|
||||
of it in the session gets the stamp. With nothing delivering it first, a
|
||||
`direct` row is written, delivered and opened at once: the record was
|
||||
reached without being shown.
|
||||
- `summary` — per kind, how records arrived (`pushed`, `asked`, `direct`),
|
||||
- `summary` — per kind, how records arrived (`pushed`, `pointed`, `asked`,
|
||||
`direct`),
|
||||
by door, and how many were opened.
|
||||
|
||||
Only rows from a plugin that reports its version count in the readout: an
|
||||
@@ -30,7 +31,7 @@ from sqlalchemy import case, delete, func, select, tuple_, update
|
||||
|
||||
from grimoire.models import async_session
|
||||
from grimoire.models.note import Note
|
||||
from grimoire.models.record_delivery import ASKED, DIRECT, PUSHED, RecordDelivery
|
||||
from grimoire.models.record_delivery import ASKED, DIRECT, POINTED, PUSHED, RecordDelivery
|
||||
from grimoire.models.retrieval_log import RetrievalLog
|
||||
from grimoire.services import rule_deliveries
|
||||
from grimoire.services.access import readable_notes_clause
|
||||
@@ -55,15 +56,16 @@ def reset() -> None:
|
||||
_pending.set([])
|
||||
|
||||
|
||||
def record(user_id: int | None, note_ids, source: str) -> None:
|
||||
"""Record records a hook pushed to the bound session. A no-op outside a
|
||||
plugin request, since an open could never be tied back to it."""
|
||||
def record(user_id: int | None, note_ids, source: str, way: str = PUSHED) -> None:
|
||||
"""Record records a hook put in front of the bound session: `pushed` as a
|
||||
line, or `pointed` when only named by id in a pointer line. A no-op
|
||||
outside a plugin request, since an open could never be tied back to it."""
|
||||
sid = rule_deliveries.current_session()
|
||||
if not sid or not user_id:
|
||||
return
|
||||
try:
|
||||
rows = [{"user_id": int(user_id), "session_id": sid, "note_id": int(n),
|
||||
"way": PUSHED, "source": source, "plugin": rule_deliveries.current_plugin()}
|
||||
"way": way, "source": source, "plugin": rule_deliveries.current_plugin()}
|
||||
for n in dict.fromkeys(note_ids or [])]
|
||||
except Exception: # noqa: BLE001 - observation never breaks the observed
|
||||
logger.debug("record delivery payload build failed", exc_info=True)
|
||||
@@ -239,7 +241,7 @@ async def summary(user_id: int, days: int = 30) -> dict:
|
||||
)).scalar_one()
|
||||
|
||||
def zero() -> dict:
|
||||
return {w: {"delivered": 0, "opened": 0} for w in (PUSHED, ASKED, DIRECT)}
|
||||
return {w: {"delivered": 0, "opened": 0} for w in (PUSHED, POINTED, ASKED, DIRECT)}
|
||||
|
||||
kinds: dict[str, dict] = {}
|
||||
totals = zero()
|
||||
|
||||
Reference in New Issue
Block a user