Interface Parity Track: Phases 137–141#123
Merged
Merged
Conversation
POST /analysis/author now accepts since, detail, includeCommits, hybrid,
and bm25Weight, threaded through to the same computeAuthorContributions/
hybridSearch/searchCommits logic the CLI author command uses. Also accepts
chunks/level/vss for flag-surface parity (deliberately no-op, matching the
CLI's own dead-flag behavior for these three). Model-override triplet
stays out of scope (tracked separately in Phase 140).
Breaking change: response shape is now { authors, commits? } instead of a
bare array, to carry includeCommits results, per parity.md's parity-over-
API-stability rule.
CLI's --model/--text-model/--code-model triplet was missing from the HTTP routes for clusters, change-points, author, impact, semantic-diff, semantic-blame, triage, and workflow. Fix it once with a shared modelOverrideSchema Zod fragment + resolveRequestProvider() helper (src/server/lib/modelOverrides.ts) instead of eight per-route patches. resolveRequestProvider() deliberately doesn't reuse the CLI's resolveModels()/buildProviderOrExit() as-is: those mutate process.env and call process.exit() on failure, unsafe for a concurrently-serving HTTP process. It threads an explicit ResolvedConfig through buildProvider() instead and throws a catchable ModelOverrideError that routes turn into a 400. clusters accepts and validates the triplet for flag-surface parity but it has no effect on clustering behavior (same as the CLI clusters command), since computeClusters() doesn't filter by model — documented inline and in features.md rather than faked. Updates docs/parity.md §2.3 item 3 to mark the CLI-vs-HTTP gap closed, and docs/PLAN.md/docs/features.md accordingly. Adds an 11-test "Phase 140: model overrides on analysis routes" block to tests/serverRoutes.test.ts.
code-search's default --level symbol was merging the chunk and symbol candidate pools into one shared-cutoff ranked list on every call (unlike search's opt-in multi-level combinations), hitting the same cross-pool crowding-out bug Phase 136 fixed for search. Reuses Phase 136's resolveExtraLevels()/isMultiLevelActive()/includeFiles mechanism across all three call sites: - CLI code-search isolates chunk/symbol pools by default and renders them via renderResultsByLevel(); --merge-levels opts back into one merged list. - MCP code_search and Guide's code_search tool return a results_by_level object instead of a flat results array when multi-level (breaking response-shape change, accepted per parity.md's parity-over-stability principle), with a merge_levels param to opt back into the old shape. - interpretations.ts updated with the new result shape and cross-level score-comparability caveat; skill regenerated via pnpm gen:skill. Adds tests/integration/codeSearchLevelSeparation.test.ts covering the per-blob dedup invariant and the chunk-vs-symbol crowding-out proof. Updates docs/PLAN.md, docs/features.md, README.md, and docs/parity.md (resolves the "code-search never received Phase 136's treatment" gap).
Add level/branch/model-override/alerts params to POST /evolution/file, branch/model-override params to POST /evolution/concept (threading branch filtering into computeEvolution/computeConceptEvolution), and weightStructural to POST /graph/hotspots.
Close the MCP/HTTP flag gap behind CLI `search`/`first-seen` found by the
Phase 138-148 interface parity audit.
- MCP `semantic_search` gains a `module` level option and, when 2+ of
{chunk, symbol, module} are active, renders labeled per-level text
sections (`merge_levels` opts back into one list) via the same
`resolveExtraLevels()`/`isMultiLevelActive()` helpers CLI `search` uses.
HTTP `POST /search` gets the same plus a `mergeLevels` body param and a
breaking `resultsByLevel` JSON shape when 2+ levels are active.
- Both interfaces gain the remaining query-shaping flags CLI `search`
already had: negative-example scoring (`notLike`/`lambda`), boolean
composition (`or`/`and`), `explain`, `explainLlm`, `expandQuery`,
`annotateClusters`, `vss` (routes through `vectorSearchWithAnn()`),
`repos` (multi-repo), per-request `model`/`textModel`/`codeModel`
overrides, `earlyCut`, `noCache`.
- `first-seen`/`first_seen` gain `vss`, `repos`, and model overrides.
- Added `hasModelOverride()`/`buildProviderForRequest()` to
`providerFactory.ts` so per-request model overrides don't mutate
`process.env` (unsafe for a server handling concurrent requests) —
shared by both MCP and HTTP instead of duplicated.
- `POST /analysis/multi-repo-search` kept as a thin deprecated alias
(unchanged response shape, `Deprecation` header) over the same
`multiRepoSearch()` call; `repos` on `POST /search` is the
parity-complete replacement.
- `code_search` untouched (Phase 137's scope, developed concurrently).
Updates docs/parity.md, docs/features.md, docs/deprecations.md, and
docs/PLAN.md (Phase 138 marked complete with deviation notes).
…-deploy-phases-137-141-3d6vm5 # Conflicts: # docs/features.md # docs/parity.md # src/mcp/tools/search.ts
…-deploy-phases-137-141-3d6vm5 # Conflicts: # docs/parity.md
…-deploy-phases-137-141-3d6vm5 # Conflicts: # tests/serverRoutes.test.ts
…-deploy-phases-137-141-3d6vm5 # Conflicts: # docs/features.md # docs/parity.md
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Five phases from the Interface Parity Track (
docs/PLAN.md), each built independently and merged together:code-searchisolates chunk/symbol candidate pools per-level by default (CLI, MCP, Guide), fixing the same cross-pool score-scale crowding-out bug Phase 136 fixed forsearch.--merge-levels/merge_levelsopts back into the old single merged list. Breaking response-shape change for MCPcode_search/Guide'scode_searchtool (results_by_levelinstead of a flat array), accepted perdocs/parity.md§4.semantic_search/first_seenand HTTPPOST /search/POST /search/first-seengain full CLIsearchflag parity: per-level result separation (resultsByLevel/mergeLevels), negative-example scoring (notLike/lambda), boolean composition (or/and),explain/explainLlm,expandQuery,annotateClusters,vss(viavectorSearchWithAnn()),repos(multi-repo), per-request model overrides,earlyCut,noCache.POST /analysis/multi-repo-searchkept as a thin deprecated alias over the same core call.POST /evolution/filegainslevel(symbol),branch, model overrides,alerts;POST /evolution/conceptgainsbranchand model overrides —branchis now threaded through the corecomputeEvolution()/computeConceptEvolution()functions, not just route schemas.POST /graph/hotspotsgainsweightStructural.modelOverrideSchemaZod fragment +resolveRequestProvider()helper (src/server/lib/modelOverrides.ts), applied once across all 8analysis.tsroutes that were missing--model/--text-model/--code-modelparity:clusters,change-points,author,impact,semantic-diff,semantic-blame,triage,workflow.POST /analysis/authorgainssince,detail,includeCommits,hybrid,bm25Weight, pluschunks/level/vss(accepted as documented no-ops, matching the CLI's own dead-flag behavior). Breaking change: response shape is now{ authors, commits? }instead of a bare array, to carryincludeCommitsresults.All five follow
docs/parity.md§4's standing principle: parity across interfaces is prioritized over preserving existing response shapes, so several of these are deliberate breaking changes to MCP/HTTP response shapes.Implementation notes
Each phase was implemented independently (in isolated git worktrees) and merged sequentially. The overlapping files —
src/mcp/tools/search.ts(137 + 138) andsrc/server/routes/analysis.ts(138 + 140 + 141, especially theauthorroute/AuthorBodySchema) — required manual conflict resolution on merge; the underlying route/schema logic from each phase composes cleanly (e.g.AuthorBodySchemanow carries both Phase 140's model-override triplet and Phase 141'ssince/detail/hybridfields).Doc maintenance
docs/PLAN.md— all five phases marked ✅ complete, with deviation notes.docs/features.md,README.md— updated for new flags/commands.docs/parity.md— gaps closed, flag tables updated for MCP/HTTP parity.docs/deprecations.md—POST /analysis/multi-repo-searchdeprecated alias documented.code-search-per-level-results.md,search-mcp-http-flag-parity.md,evolution-hotspots-http-parity.md,analysis-routes-model-overrides.md,author-http-route-parity.md(allminor).Test plan
pnpm buildcleanpnpm test— 1468 passed, 22 skipped, 0 failedtests/integration/codeSearchLevelSeparation.test.ts,tests/mcpSearchToolsPhase138.test.ts,tests/evolutionBranch.test.ts, and newdescribeblocks intests/serverRoutes.test.tsfor Phase 138/139/140/141 routes