test(8249): the write-path sync-once check kept once, in the hook's own file
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 2m22s
CI & Build / integration (push) Successful in 2m50s
CI & Build / Build & push image (push) Successful in 17s

test_ledger_references_not_silence::test_the_sync_class_still_shows_only_once
checked a subset of test_write_path_trigger::test_sync_dedup_silences_a_sync_nudge_already_shown
(sync_note_ids empty, the id absent from the context); the covering test also
checks the semantic arm excludes it. Its reasoning (why the sync nudge is the
one class shown only once) moves into the covering test's docstring. The
helper's now-unused sync_exclude parameter goes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 19:53:03 -05:00
co-authored by Claude Opus 5.5
parent 094089e374
commit 4caa7bae4b
2 changed files with 7 additions and 18 deletions
+1 -17
View File
@@ -166,7 +166,7 @@ async def test_the_header_explains_the_seen_marker():
# ── the write path ─────────────────────────────────────────────────────────
async def _write_path(hits, exclude_ids, *, here=(), rec=None, sync_exclude=()):
async def _write_path(hits, exclude_ids, *, here=(), rec=None):
from grimoire.services import plugin_context as pc
search = AsyncMock(return_value=hits)
listing = AsyncMock(side_effect=[(list(here), len(here)), ([], 0)])
@@ -179,7 +179,6 @@ async def _write_path(hits, exclude_ids, *, here=(), rec=None, sync_exclude=()):
out = await pc.build_write_path_hint(
1, "src/x.py", code=REAL_CODE,
exclude_ids=list(exclude_ids),
exclude_sync_ids=list(sync_exclude),
)
return out, search
@@ -223,18 +222,3 @@ async def test_this_calls_own_menu_is_still_excluded_from_its_search():
_out, search = await _write_path(
hits, [], here=[_snippet_item(7, "records this file")])
assert 7 in (search.call_args.kwargs.get("exclude_ids") or set())
@pytest.mark.asyncio
async def test_the_sync_class_still_shows_only_once():
"""The deliberate exception, pinned so it reads as a decision.
The sync nudge says "you are editing the file this record describes, so
updating it is part of the edit". Repeated every write to the same file it
is nagging, and unlike a reuse suggestion it is not a claim whose relevance
can return — it either got acted on or it did not.
"""
out, _ = await _write_path(
[], [], here=[_snippet_item(7, "records this file")], sync_exclude=[7])
assert out["sync_note_ids"] == []
assert "#7" not in out["context"]