feat(8191): knowledge reaches a session from every project, ranked below its own and labelled
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m7s

A per-kind reach beside the kind-by-moment table (setting record_reach,
default snippet/note/process/lesson) widens the passive note arms and their
slots to the user's other projects. A record from elsewhere gives up 0.05
before the floor and the ranking, and its line names the project. Work kinds
stay in their project, the visibility clause is unchanged, and an explicit
project search still means that project. Settings > Moments edits the reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 17:20:31 -05:00
co-authored by Claude Opus 5.5
parent 163d32859f
commit 30aa5cf1c6
14 changed files with 491 additions and 13 deletions
+29
View File
@@ -296,6 +296,35 @@ async def test_an_arm_searches_only_the_kinds_its_door_allows():
assert calls[0]["record_kinds"] == ["snippet"]
@pytest.mark.asyncio
async def test_the_arm_and_its_slots_take_the_users_reach_from_other_projects():
main = [_note(1, 0.70)]
reuse = [_note(9, 0.60, note_type="snippet")]
lesson = [_note(42, 0.58, note_type=LESSON_NOTE_TYPE)]
default = sorted(record_kinds.REACH_DEFAULT, key=record_kinds.KINDS.index)
_r, _io_, calls = await _run(
rp.AUTO_INJECT, _routed(main, reuse, lesson), kinds=EVERY_KIND,
)
# Unset, the shipped default, and every search of the call the same.
assert len(calls) == 3 and all(c["cross_kinds"] == default for c in calls)
_r, _io_, calls = await _run(
rp.AUTO_INJECT, _routed(main, reuse, lesson), kinds=EVERY_KIND,
reach=frozenset({"note"}),
)
assert all(c["cross_kinds"] == ["note"] for c in calls)
# Nothing crossing is passed as nothing, not as "no preference".
_r, _io_, calls = await _run(rp.WRITE_PATH, lambda kw: [], reach=frozenset())
assert calls[0]["cross_kinds"] == []
def test_a_line_from_another_project_names_it():
line = rp.menu_entry(7, kind="note", name="How the cache warms", score=0.71,
origin="Another project")
assert line[0].endswith("(0.71) — from Another project")
# A record from the session's own project carries no origin.
assert "from" not in rp.menu_entry(7, kind="note", name="How the cache warms")[0]
@pytest.mark.asyncio
async def test_a_door_with_every_kind_off_searches_nothing_and_logs_nothing():
result, io, calls = await _run(rp.AUTO_INJECT, lambda kw: [], kinds=frozenset())