feat(context): Resolve bounded lexical file mentions - #167
Conversation
Resolve normalized repository-relative paths and bounded subsystem routes before intent risk analysis. Reject unsafe and ambiguous mentions.
f54fc94 to
c030bb9
Compare
|
Reviewed this closely and built binaries from both The problem is what passes 3 and 4 do to Blocking: passes 3 and 4 manufacture a risk verdict from prompts that mention no file
Pass 4 (subsystem paths). With Four files chosen by alphabetical position and truncated at topK — Pass 3 (stem matching) is worse, because it needs no config at all.
The fix I'd suggest, smallest first: drop pass 3 (require an extension, keeping the basename pass), and thread a Blocking: the two cross-cutting guarantees in the description have no test coverageBoth verified by mutation,
Worth adding: a fixture where pass 1 and pass 3 resolve to different files, and a direct Smaller things
The exact and basename passes are a real improvement and I'd take those on their own. It's the confidence that passes 3 and 4 manufacture that I can't merge — Baseline note: Generated by Claude Code |
Keep inferred candidates as suggestions without letting them drive scope or risk. Reuse the shared subsystem matcher and keep route ordering deterministic.
Preserve significant whitespace in inventory paths; trim only prompt and configuration input.
Complied
Other changes
|
|
Re-verified everything at The fabrication is gone. Same prompts as before, against codemap's own repo: The "files": ["scanner/alpha.go", "scanner/beta.go", "scanner/delta.go", "scanner/epsilon.go"],
"file_confidence": "inferred",
"scope": "unknown",
"risk": "unknown",
"suggestions": [{"reason": "risk is unknown without an explicit file mention"}]and the mixed case computes scope and risk from the explicit file alone while still listing the inferred ones as The new tests are load-bearing. I re-ran the mutations that previously passed:
Also confirmed fixed: the
Two things I'm deliberately not holding this for, noting them for later: Merging. Thanks for the quick turnaround on this one — the provenance field is a genuine improvement to the contract, not just a patch over my complaint. Generated by Claude Code |
What does this PR do?
This makes common agentic coding prompts such as
refactor final_builduseful without fuzzy dependency false positives.Type of change
Checklist
go test ./...go vet ./...Additional notes
Routing is inventory-only and performs no semantic search or unbounded expansion.