chore: polish bundle — correctness/robustness nits (#359)#370
Merged
Conversation
- exclude_roles now disables role weighting (search_lancedb): skip_role_weight
was bool(role or role_in), so an exclude_roles-only filter still applied role
weights — asymmetric with role/role_in. Include exclude_roles.
- _parse_ladybug_json quotes only key positions (ladybug_queries): the old
(\\w+): regex matched word-colon runs inside values too (e.g. a URL), corrupting
them. Quote keys only after { , [ ; fix the misleading "counts_json" log label.
- resolve rejects wildcards consistently (mcp_v2): * / ? silently returned
status='none'; search/find/neighbors reject them. Now success=False with a
pointer to search(query=...). Updated the wildcard test accordingly.
- client-kind literals de-leaked: feign_method/rest_template/web_client emitted
and matched directly; reference named CLIENT_KIND_* constants from
java_ontology so a rename can't desync the emit/match sites.
- CALLS dedup key includes call_site_byte (build_ast_graph): two call sites of
the same method on the same source line (same arg_count) no longer collapse
into one edge. Regenerated the bank-chat baseline CALLS count (678 -> 684) and
mirrored the byte-inclusive key in the dedup test.
- malformed YAML no longer silently swallowed (config): catch yaml.YAMLError and
emit a stderr hint instead of a bare except returning {}.
- table_names() -> list_tables() (config, cli): the lancedb deprecation warning
is gone (lance_optimize already preferred list_tables).
Deferred: the FastMCP run_stdio_async "coroutine never awaited" RuntimeWarning —
benign (the server runs; run_stdio_async is a clean coroutine awaited by
asyncio.run), root cause elusive without FastMCP stdio-transport internals, and
a speculative entry-point change risks destabilizing server startup.
Co-Authored-By: Claude <noreply@anthropic.com>
_write_meta deduped CALLS with the pre-#370 4-tuple (no call_site_byte) while _write_edges wrote edges with the 5-tuple, so counts['calls'] (678) diverged from the real CALLS edge count (684) and describe/stats undercounted. Mirror the 5-tuple in _write_meta and bump the bank-chat baseline's counts_json.calls to 684. Verified red->green: with only the fixture bumped, the baseline test fails (rebuild yields 678); with the _write_meta fix it passes. Co-Authored-By: Claude <noreply@anthropic.com>
The client-kind literal de-leak missed graph_enrich.py, which still emitted the bare "rest_template" default when synthesizing a brownfield HttpClientHint with no anchor. Reference the named constant so a future rename in VALID_CLIENT_KINDS cannot silently desync this emit site. Co-Authored-By: Claude <noreply@anthropic.com>
Narrowing the except to yaml.YAMLError let OSError (chmod 000,
stat/read TOCTOU) and UnicodeDecodeError (non-UTF-8 config) propagate
and abort startup, breaking the loader's return-{} contract. Catch all
three so an unreadable/malformed config degrades to defaults; keep the
stderr hint (generalized).
Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
|
Addressed 3 findings from a multi-agent review pass:
3 commits on this branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A bundle of low-severity correctness/robustness nits from #359. Each independently small.
exclude_rolesnow disables role weighting (search_lancedb.py) —skip_role_weight = bool(role or role_in), so anexclude_roles-only filter still applied role weights (asymmetric withrole/role_in). Now includesexclude_roles._parse_ladybug_jsonquotes only key positions (ladybug_queries.py) — the old(\w+):regex matchedword:inside values too (e.g. a URLhttps://...), corrupting them. Now quotes keys only after{/,/[. Also fixed the misleading"counts_json"log label (the helper parses many graph_meta blobs). New unit testtest_parse_ladybug_json_handles_colon_in_values.resolverejects wildcards consistently (mcp_v2.py) —*/?silently returnedstatus='none', whilesearch/find/neighborsreject them. Nowsuccess=Falsewith a pointer tosearch(query=...). Renamed/updated the wildcard test.java_ontology/ast_java/build_ast_graph) —feign_method/rest_template/web_clientwere emitted and matched directly. Added namedCLIENT_KIND_*constants (exported in__all__) and reference them at every emit/match site so a rename inVALID_CLIENT_KINDScan't silently desync callers.call_site_byte(build_ast_graph.py) — two call sites of the same method on the same source line (samearg_count) no longer collapse into one edge. Regenerated the bank-chat baseline CALLS count (678 → 684; sampled CALLS first-3 are byte-identical since the new edges land later in insertion order) and mirrored the byte-inclusive key in the dedup test.config.py) —load_yaml_mappingcaught bareExceptionand returned{}. Now catchesyaml.YAMLErrorand emits a stderr hint.table_names()→list_tables()(config.py,cli.py) — the lancedbDeprecationWarningis gone (lance_optimizealready preferredlist_tableswith a fallback).Deferred (with justification)
FastMCP.run_stdio_async"coroutine never awaited"RuntimeWarning(server.py:752): benign — the server runs fine;run_stdio_asyncis a clean coroutine properly awaited byasyncio.run, and the root cause appears to be inside the FastMCP stdio transport on premature stdin close. A speculative entry-point change risks destabilizing MCP server startup for no functional gain, so I left it rather than guess.Test
The bank-chat full-build smoke also passes (
build_ast_graph.py --source-root tests/bank-chat-system).Notes
ontology_versionbump (full-rebuild semantics are the canonical reference; this makes CALLS edges more granular, not differently typed).Closes #359.
🤖 Generated with Claude Code