Skip to content

feat(context): add hybrid retrieval and typed agent decisions - #3

Closed
keepmeside wants to merge 1 commit into
nullmastermind:masterfrom
keepmeside:feat/ctxe-hybrid-system-one
Closed

keepmeside wants to merge 1 commit into
nullmastermind:masterfrom
keepmeside:feat/ctxe-hybrid-system-one

Conversation

@keepmeside

Copy link
Copy Markdown

No description provided.

Copilot AI lite review requested due to automatic review settings September 22, 2026 21:17
@keepmeside keepmeside closed this Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved security, MCP compatibility, and retrieval correctness issues block approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 6 Medium severity

Open (7)
What changed in this PR

This pull request adds hybrid lexical/vector retrieval, typed agent decisions, the ask-context MCP tool, optional TypeSafe enrichment, and stdio transport support.

Changes:

  • Fuses lexical and vector retrieval with evidence-based decisions.
  • Adds structured MCP responses and TypeSafe integration.
  • Updates configuration, indexing, documentation, plans, and dependencies.
File Summary
src/​typesafe.rs TypeSafe client and decision state
src/​runtime/​stdio.rs Stdio MCP runtime
src/​runtime/​mod.rs Registers stdio runtime
src/​query/​mod.rs Registers query modules
src/​query/​hybrid.rs Lexical retrieval and scoring
src/​query/​engine.rs Retrieval fusion and decisions
src/​query/​decision.rs Evidence classification and routing
src/​prompts/​mcp_ask_context.txt Ask-context guidance
src/​mcp/​tests.rs MCP schema and structured-result tests
src/​mcp.rs Ask-context handlers and response workflow
src/​main.rs Stdio CLI mode
src/​lib.rs Exposes TypeSafe module
src/​indexing/​pipeline.rs Incremental graph marker
src/​config.rs Configuration migration and defaults
README.md English documentation
README-zh.md Chinese documentation
README-vi.md Vietnamese documentation
plans/​reports/​turso-260922-2052-assessment.md Turso assessment
plans/​reports/​2026-09-22-ctxe-system-one-research.md Research findings
plans/​260922-2052-typesafe-api/​plan.md TypeSafe implementation plan
plans/​260922-2052-turso-prototype/​plan.md Turso prototype plan
plans/​2026-09-22-ctxe-system-one.md Overall integration plan
Cargo.toml Enables stdio transport

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/typesafe.rs
const DEFAULT_TIMEOUT_MS: u64 = 5_000;
const MAX_TIMEOUT_MS: u64 = 30_000;

#[derive(Debug, Clone)]
Comment thread src/config.rs
Comment on lines +463 to +465
// `file-retrieval` remains advanced and opt-in. The structured Ask tool is
// read-only and is the default machine-readable entry point for new installs.
vec!["codebase-retrieval".to_string(), "ask-context".to_string()]
Comment thread src/mcp.rs
enabled_tools: &[String],
) -> Self {
let all_tools: &[&str] = &["codebase-retrieval", "file-retrieval"];
let all_tools: &[&str] = &["codebase-retrieval", "file-retrieval", "ask-context"];
Comment thread src/mcp.rs
Comment on lines +822 to +823
Ok(value) if value.get("error").is_some() => CallToolResult::structured_error(value),
Ok(value) => CallToolResult::structured(value),
Comment thread src/query/hybrid.rs
Comment on lines +116 to +118
"(string::lowercase(content) CONTAINS $term{index} OR \
string::lowercase(file) CONTAINS $term{index})"
)
Comment thread src/query/hybrid.rs
Comment on lines +121 to +124
let statement = format!(
"SELECT file, line_start, line_end, content, symbol_ref FROM chunk WHERE {} LIMIT $limit",
predicates.join(" OR ")
);
Comment thread src/query/hybrid.rs
Comment on lines +121 to +124
let statement = format!(
"SELECT file, line_start, line_end, content, symbol_ref FROM chunk WHERE {} LIMIT $limit",
predicates.join(" OR ")
);
@keepmeside
keepmeside deleted the feat/ctxe-hybrid-system-one branch September 22, 2026 22:34
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.

2 participants