Skip to content

refactor(jrag): rename local _emit in _require_kind to stop shadowing the module-level funnel #428

Description

@HumanBean17

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions