feat(7834): issues linked to the file being written arrive before anything found by meaning
CI & Build / TypeScript typecheck (push) Successful in 37s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 2m53s
CI & Build / integration (push) Successful in 2m7s
CI & Build / Build & push image (push) Successful in 30s

Before a write, the write path now looks up issues by structure:
- an issue whose body or a log names the file (any status: a closed one
  is the record of what was already tried there);
- an open issue tagged to an area whose path patterns cover the file.

At most two, listed first, withheld from the search by meaning, which
fills only what is left and only past the gate. Measured under
write_path_linked. The lookups follow the kind x moment table: no issue
lookup when issues are off at work.change, no nearby-snippet lookup when
snippets are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 18:58:59 -05:00
co-authored by Claude Opus 5.5
parent 1363936ed7
commit a2e474f401
7 changed files with 328 additions and 8 deletions
+17
View File
@@ -388,6 +388,23 @@ def _default_record_kinds(request):
yield
@pytest.fixture(autouse=True)
def _no_linked_issues(request):
"""Stub the write path's structural issue lookup to find nothing.
It reads notes and task logs, which a unit test of the write path has
not written; a test about linked issues patches it with its own answer.
The integration lane runs the real query.
"""
if request.node.get_closest_marker("integration"):
yield
return
from grimoire.services import record_links
with patch.object(record_links, "issues_for_path", AsyncMock(return_value=[])):
yield
@pytest.fixture(autouse=True)
def _ungated_doors(request):
"""Leave the plugin doors' cue-swap gate off unless a test asks for it.