Surfaced by the 4-reviewer fan-out on PR #422 (issue #376). Deferred as a Minor — no behavioral bug.
Problem
_require_kind in src/java_codebase_rag/jrag.py defines a local closure:
def _emit(msg: str) -> int:
... # renders a status="error" envelope, returns 2
#422 added a module-level _emit(env, args, *, noun="", shape=None, next_offset=None) -> int — the single exit-code/output funnel every ok/not_found/ambiguous result now routes through. The two now share a name, so grep "_emit(" (and reading the file) returns both.
Why it's (only) cosmetic
- Different signatures (
str vs Envelope + args), so a mistaken call fails loudly at the first test, not silently.
_require_kind never calls the module-level funnel — they don't interact at runtime.
Proposed fix
Rename the local closure (it predates #376), e.g. _emit_kind_error. Mechanical — single function, no behavior change.
Files
src/java_codebase_rag/jrag.py — _require_kind (~line 2362)
Surfaced by the 4-reviewer fan-out on PR #422 (issue #376). Deferred as a Minor — no behavioral bug.
Problem
_require_kindinsrc/java_codebase_rag/jrag.pydefines a local closure:#422 added a module-level
_emit(env, args, *, noun="", shape=None, next_offset=None) -> int— the single exit-code/output funnel everyok/not_found/ambiguousresult now routes through. The two now share a name, sogrep "_emit("(and reading the file) returns both.Why it's (only) cosmetic
strvsEnvelope+args), so a mistaken call fails loudly at the first test, not silently._require_kindnever calls the module-level funnel — they don't interact at runtime.Proposed fix
Rename the local closure (it predates #376), e.g.
_emit_kind_error. Mechanical — single function, no behavior change.Files
src/java_codebase_rag/jrag.py—_require_kind(~line 2362)