PROBLEM
The TS bulk accessors (#298) ship get_method_bodies with a mechanical omission rule: entries whose code is None are omitted, so every returned value is a real str, documented on both the ABC and the facade. Python's implementations pass c.code straight through with no filter, and the docstrings make no such promise — a Dict[str, str] contract violation whenever a PyCallable carries no source text. Found during #298's final review.
SCOPE BOUNDARY
get_method_bodies on the Python side only — the in-memory backend and the Neo4j backend, plus the two docstring layers. Not the other bulk accessors, and not the TS side, which already has the rule.
GOALS
CAVEATS AND KNOWN RISKS
- Latent, not reproduced. It is unconfirmed whether
codeanalyzer-python ever actually emits code=None; the fix closes a declared-contract hole either way, but no failing case has been observed.
- The two backends must agree — fixing only the in-memory path recreates the dual-backend divergence this rule exists to prevent.
DEFINITION OF DONE
- Every value returned by
get_method_bodies is a real str on both backends, with a callable carrying code=None omitted rather than yielding None.
- Python and TS return the same shape for the same input.
- Rule stated in the ABC and facade docstrings.
STATUS
Fixed on release/2.0 by #305 (merged). Still open for main — the "both release lines" goal is unmet, and GitHub did not auto-close because #305 did not target the default branch.
PROBLEM
The TS bulk accessors (#298) ship
get_method_bodieswith a mechanical omission rule: entries whosecodeisNoneare omitted, so every returned value is a realstr, documented on both the ABC and the facade. Python's implementations passc.codestraight through with no filter, and the docstrings make no such promise — aDict[str, str]contract violation whenever aPyCallablecarries no source text. Found during #298's final review.SCOPE BOUNDARY
get_method_bodieson the Python side only — the in-memory backend and the Neo4j backend, plus the two docstring layers. Not the other bulk accessors, and not the TS side, which already has the rule.GOALS
cldk/analysis/python/codeanalyzer/codeanalyzer.py): filter onc.code is not None.cldk/analysis/python/neo4j/neo4j_backend.py): addAND c.code IS NOT NULLto theMATCH, index the row directly instead ofr.get("code").CAVEATS AND KNOWN RISKS
codeanalyzer-pythonever actually emitscode=None; the fix closes a declared-contract hole either way, but no failing case has been observed.DEFINITION OF DONE
get_method_bodiesis a realstron both backends, with a callable carryingcode=Noneomitted rather than yieldingNone.STATUS
Fixed on
release/2.0by #305 (merged). Still open formain— the "both release lines" goal is unmet, and GitHub did not auto-close because #305 did not target the default branch.