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:
@@ -1274,6 +1274,12 @@ class NoteResult:
|
||||
slot_ids: dict = field(default_factory=dict)
|
||||
"""{slot source: the id it spent}."""
|
||||
|
||||
pointers: dict = field(default_factory=dict)
|
||||
"""{kind: [id, …]} — records the search found past the floor that the
|
||||
payload does not show (the gate held them back, or the budget had no
|
||||
room), best first. A door names them by id in one pointer line instead
|
||||
of spending a line and a passage on each."""
|
||||
|
||||
gate: Any = None
|
||||
"""The `cue_gate.Gate` this call's lines were held to, or None."""
|
||||
|
||||
@@ -1390,6 +1396,27 @@ async def _reserve_note_slot(
|
||||
return (menu + placed)[:budget], slot_id
|
||||
|
||||
|
||||
# How many results past the menu's own a notes arm fetches for its pointer
|
||||
# line. The line names at most a few per kind, so a deeper fetch would only
|
||||
# count records nobody is told the ids of.
|
||||
POINTER_DEPTH = 6
|
||||
|
||||
|
||||
def _pointers(answered: list, exclude) -> dict[str, list[int]]:
|
||||
"""{kind: ids} of the answered records not excluded, in rank order."""
|
||||
out: dict[str, list[int]] = {}
|
||||
for _s, note in answered:
|
||||
nid = int(note.id)
|
||||
if nid in exclude:
|
||||
continue
|
||||
kind = record_kinds.kind_of(
|
||||
getattr(note, "note_type", None), getattr(note, "status", None),
|
||||
getattr(note, "task_kind", None),
|
||||
)
|
||||
out.setdefault(kind, []).append(nid)
|
||||
return out
|
||||
|
||||
|
||||
async def run_note_arm(
|
||||
arm: NoteArm, moment: NoteMoment, *, floor: float, budget: int, io: NoteIO,
|
||||
) -> NoteResult:
|
||||
@@ -1417,8 +1444,9 @@ async def run_note_arm(
|
||||
scored = moment.in_menu & moment.still_scored
|
||||
kwargs: dict = {
|
||||
# The still-scored ids come back and are dropped below, so the
|
||||
# limit has to cover them.
|
||||
"limit": budget + len(scored), "threshold": floor,
|
||||
# limit has to cover them; POINTER_DEPTH more are fetched for the
|
||||
# pointer line, and never reach the menu or the call row.
|
||||
"limit": budget + len(scored) + POINTER_DEPTH, "threshold": floor,
|
||||
"project_id": moment.project_id or None,
|
||||
**note_search_filters(arm), "report": report,
|
||||
"record_kinds": record_kinds.search_kinds(allowed),
|
||||
@@ -1474,6 +1502,7 @@ async def run_note_arm(
|
||||
_telemetry_failed(source)
|
||||
result = NoteResult(
|
||||
answered=answered, chunks=report.get("best_chunk") or {}, gate=gate,
|
||||
pointers=_pointers(answered, moment.in_menu | moment.seen | moment.named),
|
||||
)
|
||||
if not hits:
|
||||
return result
|
||||
@@ -1507,6 +1536,12 @@ async def run_note_arm(
|
||||
# A named record is shown once, in its own block, never again as a match.
|
||||
menu = [(s, n) for s, n in menu if int(n.id) not in moment.named]
|
||||
result.menu = menu
|
||||
shown_here = {int(n.id) for _s, n in menu} | set(result.slot_ids.values())
|
||||
result.pointers = {
|
||||
k: [i for i in ids if i not in shown_here]
|
||||
for k, ids in result.pointers.items()
|
||||
}
|
||||
result.pointers = {k: ids for k, ids in result.pointers.items() if ids}
|
||||
|
||||
# What SURVIVED the band — the menu the reader saw — where the call
|
||||
# row holds the candidate set a floor is tuned against. FRESH ONLY,
|
||||
|
||||
Reference in New Issue
Block a user