Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-native-qualification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
"$RUNNER_TEMP/runtime-venv/bin/python" -m pip install pytest==8.4.2
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/runtime-venv/bin/python" -m pytest -q "$source_dir/bindings/python/tests"
"$RUNNER_TEMP/runtime-venv/bin/python" -c "import eggsearch; from importlib.metadata import distribution; assert len(eggsearch.tool_names()) == 10; assert distribution('eggsearch').version == '0.4.3'"
"$RUNNER_TEMP/runtime-venv/bin/python" -c "import eggsearch; from importlib.metadata import distribution; assert len(eggsearch.tool_names()) == 10; assert distribution('eggsearch').version == '0.4.4'"
sha256sum "$GITHUB_WORKSPACE"/dist/* "$GITHUB_WORKSPACE"/extracted-wheel/* | tee "$GITHUB_WORKSPACE/dist/SHA256SUMS"
cat "$GITHUB_WORKSPACE/dist/SHA256SUMS" >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.4] - 2026-10-19

### Added

- CodeGG-managed stdio requests can carry authenticated per-call local
workspace scope for `repo_search`, `repo_fetch`, and `repo_map`. Each
canonical root and indexing configuration gets an isolated bounded
in-memory backend/inventory view. Invalid host metadata fails closed and
never falls back to startup-configured roots; standalone requests without
host metadata retain existing behavior.

### Fixed

- Local `repo_fetch` reads through the bounded descriptor-relative opener
after path validation instead of reopening the canonical pathname. Local
`repo_map` enrichment uses the same bounded safe reader for manifests,
source files, and test files, and skips symlinked entries even when local
search is configured to follow symlinks.

## [0.4.3] - 2026-10-13

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eggsearch"
version = "0.4.3"
version = "0.4.4"
edition = "2021"
rust-version = "1.89"
authors = ["eggstack"]
Expand Down
20 changes: 20 additions & 0 deletions architecture/local-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@

## Overview

CodeGG-managed Eggsearch 0.4.4+ can receive an authenticated private request
scope over stdio. For each repository tool call, CodeGG supplies one
authorized workspace root or an explicit `root: null` local-disabled scope.
Eggsearch authenticates that metadata with the per-process
`CODEGG_EGGSEARCH_HOST_SCOPE_TOKEN`; missing or invalid authentication is an
error and never falls back to configured roots. The selected backend and
inventory cache are isolated by canonical root and full indexing configuration
in a bounded eight-entry in-memory LRU. Standalone calls with no host metadata
continue to use `[local].roots`. The metadata is not part of a model-facing
tool schema. This private extension is for a trusted locally spawned CodeGG
child only; it does not establish authority for HTTP or remote MCP clients.

The local workspace backend searches operator-configured filesystem roots
without cloning or indexing services. Each call ensures a cached inventory,
selects a bounded deterministic candidate set, reads files through
Expand Down Expand Up @@ -215,6 +227,14 @@ capped `top_symbols`, heuristic `test_relationships`, CI/Dockerfile/Makefile
`build_configs`, and `structure_truncated` on any cap breach. Caps come from
the `[local]` budgets; the scan never executes workspace code.

Local `repo_fetch` validates the requested path, then reads it with
`safe_read_file()` relative to the selected workspace root; it never reopens
the canonicalized pathname. Local `repo_map` structure enrichment uses the
same bounded opener for manifest, source, and test contents. Its structural
walk skips symlink entries even when local search permits following symlinks,
so map enrichment does not enumerate or read a linked tree outside the
workspace.

---

## Cache Identity and Local Gating
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eggsearch-python"
version = "0.4.3"
version = "0.4.4"
edition = "2021"
rust-version = "1.89"
publish = false
Expand All @@ -13,7 +13,7 @@ name = "_native"
crate-type = ["cdylib"]

[dependencies]
eggsearch = { path = "../..", version = "=0.4.3" }
eggsearch = { path = "../..", version = "=0.4.4" }
futures = "0.3"
pyo3 = { version = "=0.29.3", features = ["abi3-py311", "extension-module", "macros"] }
pyo3-async-runtimes = { version = "=0.29.0", features = ["tokio-runtime"] }
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "eggsearch"
version = "0.4.3"
version = "0.4.4"
description = "Native asyncio bindings for the Eggsearch evidence engine"
requires-python = ">=3.11,<3.15"
license = "MIT"
Expand Down
11 changes: 11 additions & 0 deletions docs/codegg-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,17 @@ Step 4: Bundle with trust markers from both local and remote

## Trust Boundary Rules

CodeGG 0.4.4 and newer use a private stdio extension for local repository
retrieval. CodeGG starts one child with a fresh per-process
`CODEGG_EGGSEARCH_HOST_SCOPE_TOKEN`, then places an authenticated workspace
scope in MCP request metadata for each `repo_search`, `repo_fetch`, and
`repo_map` call. A null root means local retrieval is disabled for that call.
Eggsearch rejects malformed or unauthenticated scope metadata and does not
fall back to its startup roots. Do not expose the scope key through a model
tool schema or reuse this extension over an untrusted HTTP/MCP connection.
Standalone Eggsearch requests that carry no host scope keep their configured
local-root behavior.

### Trust Levels

| Level | Meaning | Source |
Expand Down
23 changes: 15 additions & 8 deletions src/mcp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ use rmcp::model::{
CallToolResult, Implementation, InitializeResult, ListToolsResult, PaginatedRequestParams,
ServerCapabilities, ServerInfo,
};
use rmcp::{tool, tool_handler, tool_router, ErrorData as McpError, ServerHandler};
use rmcp::service::RequestContext;
use rmcp::{tool, tool_handler, tool_router, ErrorData as McpError, RoleServer, ServerHandler};

use crate::mcp::state::ServerState;
use crate::mcp::tools::{
map_tool_result, run_batch_fetch, run_build_evidence_bundle, run_provider_status_async,
run_repo_fetch, run_repo_map, run_repo_search, run_research_search, run_security_search,
run_web_fetch, run_web_search, BatchFetchArgs, EvidenceBundleArgs, ProviderStatusArgs,
RepoFetchArgs, RepoMapArgs, RepoSearchArgs, ResearchSearchArgs, SecuritySearchArgs,
WebFetchArgs, WebSearchArgs,
run_repo_fetch_with_host_scope, run_repo_map_with_host_scope, run_repo_search_with_host_scope,
run_research_search, run_security_search, run_web_fetch, run_web_search, BatchFetchArgs,
EvidenceBundleArgs, ProviderStatusArgs, RepoFetchArgs, RepoMapArgs, RepoSearchArgs,
ResearchSearchArgs, SecuritySearchArgs, WebFetchArgs, WebSearchArgs,
};

#[derive(Clone)]
Expand Down Expand Up @@ -95,10 +96,12 @@ impl EggsearchServer {
)]
async fn repo_search(
&self,
context: RequestContext<RoleServer>,
Parameters(args): Parameters<RepoSearchArgs>,
) -> Result<CallToolResult, McpError> {
let state = self.state.clone();
map_tool_result(run_repo_search(state, args).await)
let host_scope = context.meta.0 .0.get("codegg/host-local-scope").cloned();
map_tool_result(run_repo_search_with_host_scope(state, args, host_scope).await)
}

#[tool(
Expand All @@ -121,10 +124,12 @@ impl EggsearchServer {
)]
async fn repo_fetch(
&self,
context: RequestContext<RoleServer>,
Parameters(args): Parameters<RepoFetchArgs>,
) -> Result<CallToolResult, McpError> {
let state = self.state.clone();
map_tool_result(run_repo_fetch(state, args).await)
let host_scope = context.meta.0 .0.get("codegg/host-local-scope").cloned();
map_tool_result(run_repo_fetch_with_host_scope(state, args, host_scope).await)
}

#[tool(
Expand Down Expand Up @@ -173,10 +178,12 @@ impl EggsearchServer {
)]
async fn repo_map(
&self,
context: RequestContext<RoleServer>,
Parameters(args): Parameters<RepoMapArgs>,
) -> Result<CallToolResult, McpError> {
let state = self.state.clone();
map_tool_result(run_repo_map(state, args).await)
let host_scope = context.meta.0 .0.get("codegg/host-local-scope").cloned();
map_tool_result(run_repo_map_with_host_scope(state, args, host_scope).await)
}

#[tool(
Expand Down
Loading
Loading