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

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:
2026-11-24 19:16:01 -05:00
co-authored by Claude Opus 5.5
parent a2e474f401
commit b68aefc109
17 changed files with 307 additions and 33 deletions
+37 -2
View File
@@ -154,9 +154,10 @@ async def test_this_responses_menu_is_withheld_but_a_pulled_one_is_still_scored(
)
(call,) = calls
# The listed one never reaches the search; the pulled one does, and the
# limit covers it so the menu still gets its full budget.
# limit covers it so the menu still gets its full budget, plus the
# pointer line's depth.
assert call["exclude_ids"] == {listed}
assert call["limit"] == 3
assert call["limit"] == 3 + rp.POINTER_DEPTH
assert [int(n.id) for _s, n in result.answered] == [pulled, 7]
assert [int(n.id) for _s, n in result.menu] == [7]
# Something was withheld after the search answered, so the score it
@@ -305,3 +306,37 @@ async def test_a_slot_whose_kind_the_door_turned_off_is_not_reserved():
# The reuse slot narrows to processes; the lesson slot does not run.
assert [c.get("note_type") for c in calls] == [None, ("process",)]
assert "lesson_slot" not in result.slot_ids
# ── the pointer: what cleared the floor and was not shown ─────────────────
@pytest.mark.asyncio
async def test_what_the_menu_did_not_show_is_kept_for_the_pointer_by_kind():
hits = [_note(1, 0.90), _note(2, 0.60), _note(3, 0.59, note_type="snippet"),
_note(4, 0.58, is_task=True, task_kind="issue"), _note(5, 0.57)]
result, _io_, _calls = await _run(
rp.WRITE_PATH, lambda kw: hits, budget=3, seen=frozenset({5}),
)
on_menu = {int(n.id) for _s, n in result.menu}
pointed = {i for ids in result.pointers.values() for i in ids}
assert not on_menu & pointed
# A record this session already has is not pointed at again.
assert 5 not in pointed
assert result.pointers.get("task:issue") == [4]
def test_the_pointer_line_names_ids_per_kind_with_the_call_that_opens_them():
from grimoire.services import record_kinds
line, ids = record_kinds.pointer_line(
{"task:issue": [4, 8, 9, 12], "snippet": [3]}, "Also resembling this, not shown",
)
assert line == (
"> Also resembling this, not shown: snippets #3 (`get_snippet(id)`); "
"4 issues #4, #8, #9 (`get_task(id)`). Open one if it may bear on the work."
)
assert ids == [3, 4, 8, 9]
assert record_kinds.pointer_line({}, "x") is None
capped, _ = record_kinds.pointer_line({"note": list(range(1, 21))}, "x", capped_at=20)
assert "20+ notes" in capped