Repository navigation
fix(cli): clean usage-error envelope; flow/outline accept FQN roots (#473 #474 #475) - #481
Merged
Merged
Conversation
…473 #474 #475) #473: an invalid --detail/--format value crashed the usage-error path with a raw traceback — the handler re-read render flags from raw argv via a choices-less pre-parser and fed the offending token to render(). Render-flag choice sets are now shared constants and clamped before rendering (clean envelope, exit 2). #474: flow resolved entries with hint_kind=route only, so method-level FQNs returned not_found although visible via outline/callees. A route not_found now retries as a Symbol: method roots get a BFS CALLS walk (trace_symbol_flow, edges carry minimum-distance hops), class/type roots expand to declared method/constructor members (DECLARES) with a warning, file symbols are rejected with a pointer to outline. Route resolution (incl. ambiguous candidate lists) is unchanged — pinned by the heavy goldens (16/16 byte-identical). #474 review fix: only not_found retries; route ambiguity propagates with its candidates instead of a false not_found diagnosis. #475: outline resolved <file> on disk only, so a class FQN hit file-not-found. An FQN now resolves as a Symbol and outlines the declaring file (identical symbol set to the path form); identifier-like misses surface the resolve envelope, path-like misses keep the file-not-found error. Tests: graph-layer BFS semantics, payload boundary, CLI subprocess coverage for all three fixes + ambiguity contracts + render-flag drift guard. Docs/help updated (en+ru); skills/agents artifacts re-synced.
The rename (f51b3d4) moved the skill to .agents/skills/publish-pip/ but test_publish_skill_runbook kept reading .claude/skills/..., so all 6 tests failed with FileNotFoundError on CI (master stayed green only because the rename push ran a path-filtered 22s job that skipped the suite). Resolve the current location first with a legacy .claude fallback for symlinked dev checkouts.
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.
Summary
Fixes three reported CLI bugs. All three reproduce on master and are verified fixed end-to-end on the bank-chat fixture.
Fixes #473
Fixes #474
Fixes #475
#473 — CLI crash with a wrong option value
jrag dependents "X" --detail minimalproduced a raw chained traceback and exit 1. Root cause:_EnvelopeArgumentParserroutes argparse errors tomain(), whose usage-error handler re-read--format/--detailfrom raw argv through a pre-parser that deliberately has nochoicesvalidation — the very token that triggered the error was fed torender(), raisingValueErrorinside the except block, outside every guard.Fix:
_FORMAT_CHOICES/_DETAIL_CHOICESare now shared constants (single source of truth for the real parser'schoices=and for a clamp in the usage-error path). Invalid values now yield the cleanstatus: errorenvelope, a terse stderr line, and exit 2 — for both--detailand--format. A drift-guard test (per the repo's enum-choices pattern) keeps the constants in sync with the render layer, which validates independently.#474 — flow does not resolve method-level FQNs
flow_payloadresolved its entry withhint_kind="route"only, and the resolver searches only the hinted kind — so method FQNs returnednot_foundeven thoughcalleesresolved the identical FQN fine.Fix: route resolution stays first (route path/topic behavior unchanged); a route not_found retries as a Symbol:
LadybugGraph.trace_symbol_flow, one frontier query per hop); each edge carrieshops= minimum BFS distance (renderedhop=in text)DECLARES) with awarnings[]notejrag outline(no silent empty flow)A review pass caught that the initial retry swallowed route ambiguous results (a topic prefix like
banking.chat.returned a false not_found instead of its candidate list); ambiguity now propagates immediately, with a regression test.#475 — outline cannot find a class
_cmd_outlineresolved its argument only as a path on disk, so an FQN fell through to file-not-found. An FQN (class or method) now resolves as a Symbol and outlines the declaring file — verified to return the identical symbol set as the file-path form. Identifier-like misses surface the resolve envelope (closest symbols,jrag searchpointer); path-like misses keep the familiar file-not-found error. Ambiguous names surface their candidates (no silent pick).Verification
JAVA_CODEBASE_RAG_RUN_HEAVY=1): 16/16 byte-identical — the route flow output is unchanged..claude→.agentsrename fallout in test_publish_skill_runbook, release_sh requires a clean tree).skills/+agents/artifacts re-synced (sync_agent_artifacts.py --checkpasses).Reviewed by a three-scope reviewer team (CLI fixes / flow backend / docs-artifacts); the one Critical and all Important findings are addressed in this commit.