Skip to content

Fix CLI relationship hops and preserve bounded source context - #166

Draft
PatrickSys wants to merge 4 commits into
masterfrom
fix/cli-next-hops-20261107
Draft

PatrickSys wants to merge 4 commits into
masterfrom
fix/cli-next-hops-20261107

Conversation

@PatrickSys

Copy link
Copy Markdown
Owner

The codebase-context CLI's JSON search results could suggest get_code_relationships, an MCP operation the CLI could not call. Compact previews could also end between a condition and the action it controls.

This adds relationships --file <path> through the existing MCP tool. Each search nextHops suggestion now includes a cli argument array to pass after the executable. The executable and argument parser use the same command list, so both recognize the new command. Relationships describe verified imports and re-exports; they do not assert runtime calls.

Compact results now retain up to seven contiguous source lines within a 480-byte JSON field budget. previewRange gives the excerpt's exact lines; readRange gives the lines to open in the returned file for omitted context. Oversized source lines are omitted rather than cut.

Review focus: following a search suggestion through the CLI, and preserving the preview's source-line and byte bounds.

The paired answer diagnostic did not improve overall: ten frozen questions fell from 17/20 to 14/20; five new public p-queue holdouts rose from 7/10 to 8/10. Scores for invitation redemption/expiry/revocation and audio cleanup on navigation/backgrounding were unchanged. This is one run of the combined change, with native source-reading fallback; it does not establish general answer quality or an effect from either individual fix.

Validation: build, 55 focused tests including executable routing, formatting, targeted lint, and packaged CLI smoke passed. The normal pre-push hooks passed formatting and the full suite: 133 test files, 1,472 tests passed, 2 skipped. Independent code and benchmark-evidence reviews found no material issue.

Dispatch relationships through the existing import/re-export tool and share CLI
command recognition with the executable entrypoint. Keep reference lookup on
the existing refs command and validate traversal options before dispatch.

Agent: codex-cli CB1
Session: 01a1b3cd-c694-7ac3-b211-e979f0aa14d8
Keep contiguous query-centered context within seven lines and a 480-byte
serialized field budget. Return exact preview spans and source-read ranges for
omitted context, and make the suggested relationship hop callable from the CLI.

Agent: codex-cli CB1
Session: 01a1b3cd-c694-7ac3-b211-e979f0aa14d8
Keep source omission and selected-result limits visible in the existing compact quality hint without changing retrieval or confidence.

Agent: codex-cli CB3
Recommend import traversal only after a confident match and a known edge. Prefer source evidence before optional graph hints and distinguish static imports from runtime calls.

Agent: codex-cli CB3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant