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
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:
@@ -166,7 +166,7 @@ async def test_the_header_explains_the_seen_marker():
|
|||||||
|
|
||||||
# ── the write path ─────────────────────────────────────────────────────────
|
# ── 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
|
from grimoire.services import plugin_context as pc
|
||||||
search = AsyncMock(return_value=hits)
|
search = AsyncMock(return_value=hits)
|
||||||
listing = AsyncMock(side_effect=[(list(here), len(here)), ([], 0)])
|
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(
|
out = await pc.build_write_path_hint(
|
||||||
1, "src/x.py", code=REAL_CODE,
|
1, "src/x.py", code=REAL_CODE,
|
||||||
exclude_ids=list(exclude_ids),
|
exclude_ids=list(exclude_ids),
|
||||||
exclude_sync_ids=list(sync_exclude),
|
|
||||||
)
|
)
|
||||||
return out, search
|
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(
|
_out, search = await _write_path(
|
||||||
hits, [], here=[_snippet_item(7, "records this file")])
|
hits, [], here=[_snippet_item(7, "records this file")])
|
||||||
assert 7 in (search.call_args.kwargs.get("exclude_ids") or set())
|
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"]
|
|
||||||
|
|||||||
@@ -164,7 +164,12 @@ async def test_reuse_dedup_never_suppresses_the_sync_nudge():
|
|||||||
async def test_sync_dedup_silences_a_sync_nudge_already_shown():
|
async def test_sync_dedup_silences_a_sync_nudge_already_shown():
|
||||||
"""Once the session has been told "snippet #12 records this file", every
|
"""Once the session has been told "snippet #12 records this file", every
|
||||||
further edit of the same file stays quiet about it — on every arm: the
|
further edit of the same file stays quiet about it — on every arm: the
|
||||||
directory query and the semantic arm would both re-surface it otherwise."""
|
directory query and the semantic arm would both re-surface it otherwise.
|
||||||
|
|
||||||
|
This is the deliberate exception to "a repeat is shown again and marked".
|
||||||
|
Repeated on every write to the same file, the nudge 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."""
|
||||||
from grimoire.services import plugin_context as pc
|
from grimoire.services import plugin_context as pc
|
||||||
|
|
||||||
async def _listing(uid, **kw):
|
async def _listing(uid, **kw):
|
||||||
|
|||||||
Reference in New Issue
Block a user