diff --git a/.github/workflows/python-native-qualification.yml b/.github/workflows/python-native-qualification.yml index 0e8026c1..43dee791 100644 --- a/.github/workflows/python-native-qualification.yml +++ b/.github/workflows/python-native-qualification.yml @@ -197,7 +197,7 @@ jobs: cd /tmp "$venv/bin/python" -m pytest -q /source/bindings/python/tests "$venv/bin/python" /source/bindings/python/scripts/smoke_installed_wheel.py - "$venv/bin/python" -c "import platform,sys; from importlib.metadata import distribution; import eggsearch; assert platform.machine() in (\"armv7l\", \"armv8l\"); assert sys.version_info[:2] == (3, int(\"$tag\"[3:])); assert len(eggsearch.tool_names()) == 10; print(platform.machine(), sys.version, distribution(\"eggsearch\").version)" + "$venv/bin/python" -c "import platform,sys; from importlib.metadata import distribution; import eggsearch; assert platform.machine() in (\"armv7l\", \"armv8l\"); assert sys.version_info[:2] == (3, int(\"$tag\"[3:])); assert len(eggsearch.tool_names()) == 9; print(platform.machine(), sys.version, distribution(\"eggsearch\").version)" done ' @@ -228,7 +228,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 tomllib; from pathlib import Path; import eggsearch; from importlib.metadata import distribution; expected=tomllib.loads(Path('$GITHUB_WORKSPACE/bindings/python/pyproject.toml').read_text())['project']['version']; assert len(eggsearch.tool_names()) == 10; assert distribution('eggsearch').version == expected" + "$RUNNER_TEMP/runtime-venv/bin/python" -c "import tomllib; from pathlib import Path; import eggsearch; from importlib.metadata import distribution; expected=tomllib.loads(Path('$GITHUB_WORKSPACE/bindings/python/pyproject.toml').read_text())['project']['version']; assert len(eggsearch.tool_names()) == 9; assert distribution('eggsearch').version == expected" 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 diff --git a/.github/workflows/qualify-eggpack-candidate.yml b/.github/workflows/qualify-eggpack-candidate.yml index 78db4901..87e798a7 100644 --- a/.github/workflows/qualify-eggpack-candidate.yml +++ b/.github/workflows/qualify-eggpack-candidate.yml @@ -154,6 +154,59 @@ jobs: env: CARGO_TARGET_DIR: "${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}" run: "'cargo' '+stable' 'build' '--release' '--locked' '--target' 'aarch64-pc-windows-msvc' '--package' 'eggsearch' '--bin' 'eggsearch'" + - name: Measure stripped binary size and startup RSS + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $target = "aarch64-pc-windows-msvc" + $buildRoot = [System.IO.Path]::Combine($env:RUNNER_TEMP, "eggpack", "$($env:GITHUB_RUN_ID)-$($env:GITHUB_RUN_ATTEMPT)") + $binary = [System.IO.Path]::Combine($buildRoot, $target, "release", "eggsearch.exe") + if (-not (Test-Path -LiteralPath $binary -PathType Leaf)) { throw "Release binary not found: $binary" } + $candidateSha = (git rev-parse HEAD).Trim() + $binaryBytes = [long](Get-Item -LiteralPath $binary).Length + $rssSamples = @() + for ($attempt = 0; $attempt -lt 10 -and $rssSamples.Count -lt 5; $attempt++) { + $process = [System.Diagnostics.Process]::new() + $process.StartInfo.FileName = $binary + $process.StartInfo.Arguments = "--version" + $process.StartInfo.UseShellExecute = $false + $process.StartInfo.CreateNoWindow = $true + $process.StartInfo.RedirectStandardOutput = $true + $process.StartInfo.RedirectStandardError = $true + if (-not $process.Start()) { throw "Could not start release binary" } + $stdoutTask = $process.StandardOutput.ReadToEndAsync() + $stderrTask = $process.StandardError.ReadToEndAsync() + $rssSample = 0L + do { + $process.Refresh() + if ($process.HasExited) { break } + $currentSample = [long]$process.PeakWorkingSet64 + $process.Refresh() + if (-not $process.HasExited -and $currentSample -gt $rssSample) { $rssSample = $currentSample } + if ($process.WaitForExit(1)) { break } + } while ($true) + $process.WaitForExit() + $stdout = $stdoutTask.GetAwaiter().GetResult() + $stderr = $stderrTask.GetAwaiter().GetResult() + if ($process.ExitCode -ne 0) { throw "--version exited with $($process.ExitCode): $stderr" } + if ($rssSample -gt 0) { $rssSamples += $rssSample } + $process.Dispose() + } + if ($rssSamples.Count -ne 5) { throw "Collected $($rssSamples.Count) valid peak working set samples; expected 5" } + $record = [ordered]@{ candidate_sha = $candidateSha; target = $target; binary_bytes = $binaryBytes; probe = "eggsearch --version"; peak_working_set_bytes_samples = $rssSamples; threshold_applied = $false } + $json = $record | ConvertTo-Json -Compress + $outputDir = Join-Path $PWD "eggpack-footprint" + New-Item -ItemType Directory -Path $outputDir -Force | Out-Null + $outputPath = Join-Path $outputDir "$target.json" + Set-Content -LiteralPath $outputPath -Value $json -NoNewline -Encoding utf8 + Write-Output $json + - name: Upload footprint evidence + uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" + with: + name: "eggsearch-footprint-windows-arm64" + path: "eggpack-footprint/aarch64-pc-windows-msvc.json" + if-no-files-found: error + retention-days: 7 - name: Capture canonical build handoff shell: bash run: "'eggpack' 'ci' '_capture-build' '--release-plan' 'eggpack-runtime/release-plan.json' '--build-bindings' 'release/eggpack/build-bindings.toml' '--target' 'aarch64-pc-windows-msvc' '--cargo-target-dir' '${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}' '--output-dir' './eggpack-build/build_aarch64_pc_windows_msvc'" @@ -249,6 +302,32 @@ jobs: CARGO_ZIGBUILD_ZIG_PATH: ${{ env.CARGO_ZIGBUILD_ZIG_PATH }} CARGO_ZIGBUILD_CACHE_DIR: ${{ env.CARGO_ZIGBUILD_CACHE_DIR }} run: "'cargo' '+stable' 'zigbuild' '--release' '--locked' '--target' 'aarch64-unknown-linux-gnu.2.17' '--package' 'eggsearch' '--bin' 'eggsearch'" + - name: Measure stripped binary size and startup RSS + shell: bash + run: | + set -euo pipefail + target="aarch64-unknown-linux-gnu" + build_root="$RUNNER_TEMP/eggpack/$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT" + binary="$build_root/$target/release/eggsearch" + test -x "$binary" + candidate_sha="$(git rev-parse HEAD)" + binary_bytes="$(wc -c < "$binary" | tr -d '[:space:]')" + rss_samples="" + for _ in 1 2 3 4 5; do + sample="$(/usr/bin/time -f '%M' "$binary" --version 2>&1 >/dev/null)" + [[ "$sample" =~ ^[0-9]+$ ]] + if [[ -n "$rss_samples" ]]; then rss_samples="$rss_samples,"; fi + rss_samples="$rss_samples$sample" + done + mkdir -p eggpack-footprint + printf '{"candidate_sha":"%s","target":"%s","binary_bytes":%s,"probe":"eggsearch --version","peak_rss_kib_samples":[%s],"threshold_applied":false}\n' "$candidate_sha" "$target" "$binary_bytes" "$rss_samples" | tee "eggpack-footprint/$target.json" + - name: Upload footprint evidence + uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" + with: + name: "eggsearch-footprint-linux-arm64" + path: "eggpack-footprint/aarch64-unknown-linux-gnu.json" + if-no-files-found: error + retention-days: 7 - name: Capture canonical build handoff shell: bash run: "'eggpack' 'ci' '_capture-build' '--release-plan' 'eggpack-runtime/release-plan.json' '--build-bindings' 'release/eggpack/build-bindings.toml' '--target' 'aarch64-unknown-linux-gnu' '--cargo-target-dir' '${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}' '--output-dir' './eggpack-build/build_aarch64_unknown_linux_gnu'" @@ -444,6 +523,59 @@ jobs: env: CARGO_TARGET_DIR: "${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}" run: "'cargo' '+stable' 'build' '--release' '--locked' '--target' 'x86_64-pc-windows-msvc' '--package' 'eggsearch' '--bin' 'eggsearch'" + - name: Measure stripped binary size and startup RSS + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $target = "x86_64-pc-windows-msvc" + $buildRoot = [System.IO.Path]::Combine($env:RUNNER_TEMP, "eggpack", "$($env:GITHUB_RUN_ID)-$($env:GITHUB_RUN_ATTEMPT)") + $binary = [System.IO.Path]::Combine($buildRoot, $target, "release", "eggsearch.exe") + if (-not (Test-Path -LiteralPath $binary -PathType Leaf)) { throw "Release binary not found: $binary" } + $candidateSha = (git rev-parse HEAD).Trim() + $binaryBytes = [long](Get-Item -LiteralPath $binary).Length + $rssSamples = @() + for ($attempt = 0; $attempt -lt 10 -and $rssSamples.Count -lt 5; $attempt++) { + $process = [System.Diagnostics.Process]::new() + $process.StartInfo.FileName = $binary + $process.StartInfo.Arguments = "--version" + $process.StartInfo.UseShellExecute = $false + $process.StartInfo.CreateNoWindow = $true + $process.StartInfo.RedirectStandardOutput = $true + $process.StartInfo.RedirectStandardError = $true + if (-not $process.Start()) { throw "Could not start release binary" } + $stdoutTask = $process.StandardOutput.ReadToEndAsync() + $stderrTask = $process.StandardError.ReadToEndAsync() + $rssSample = 0L + do { + $process.Refresh() + if ($process.HasExited) { break } + $currentSample = [long]$process.PeakWorkingSet64 + $process.Refresh() + if (-not $process.HasExited -and $currentSample -gt $rssSample) { $rssSample = $currentSample } + if ($process.WaitForExit(1)) { break } + } while ($true) + $process.WaitForExit() + $stdout = $stdoutTask.GetAwaiter().GetResult() + $stderr = $stderrTask.GetAwaiter().GetResult() + if ($process.ExitCode -ne 0) { throw "--version exited with $($process.ExitCode): $stderr" } + if ($rssSample -gt 0) { $rssSamples += $rssSample } + $process.Dispose() + } + if ($rssSamples.Count -ne 5) { throw "Collected $($rssSamples.Count) valid peak working set samples; expected 5" } + $record = [ordered]@{ candidate_sha = $candidateSha; target = $target; binary_bytes = $binaryBytes; probe = "eggsearch --version"; peak_working_set_bytes_samples = $rssSamples; threshold_applied = $false } + $json = $record | ConvertTo-Json -Compress + $outputDir = Join-Path $PWD "eggpack-footprint" + New-Item -ItemType Directory -Path $outputDir -Force | Out-Null + $outputPath = Join-Path $outputDir "$target.json" + Set-Content -LiteralPath $outputPath -Value $json -NoNewline -Encoding utf8 + Write-Output $json + - name: Upload footprint evidence + uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" + with: + name: "eggsearch-footprint-windows-x64" + path: "eggpack-footprint/x86_64-pc-windows-msvc.json" + if-no-files-found: error + retention-days: 7 - name: Capture canonical build handoff shell: bash run: "'eggpack' 'ci' '_capture-build' '--release-plan' 'eggpack-runtime/release-plan.json' '--build-bindings' 'release/eggpack/build-bindings.toml' '--target' 'x86_64-pc-windows-msvc' '--cargo-target-dir' '${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}' '--output-dir' './eggpack-build/build_x86_64_pc_windows_msvc'" @@ -539,6 +671,32 @@ jobs: CARGO_ZIGBUILD_ZIG_PATH: ${{ env.CARGO_ZIGBUILD_ZIG_PATH }} CARGO_ZIGBUILD_CACHE_DIR: ${{ env.CARGO_ZIGBUILD_CACHE_DIR }} run: "'cargo' '+stable' 'zigbuild' '--release' '--locked' '--target' 'x86_64-unknown-linux-gnu.2.17' '--package' 'eggsearch' '--bin' 'eggsearch'" + - name: Measure stripped binary size and startup RSS + shell: bash + run: | + set -euo pipefail + target="x86_64-unknown-linux-gnu" + build_root="$RUNNER_TEMP/eggpack/$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT" + binary="$build_root/$target/release/eggsearch" + test -x "$binary" + candidate_sha="$(git rev-parse HEAD)" + binary_bytes="$(wc -c < "$binary" | tr -d '[:space:]')" + rss_samples="" + for _ in 1 2 3 4 5; do + sample="$(/usr/bin/time -f '%M' "$binary" --version 2>&1 >/dev/null)" + [[ "$sample" =~ ^[0-9]+$ ]] + if [[ -n "$rss_samples" ]]; then rss_samples="$rss_samples,"; fi + rss_samples="$rss_samples$sample" + done + mkdir -p eggpack-footprint + printf '{"candidate_sha":"%s","target":"%s","binary_bytes":%s,"probe":"eggsearch --version","peak_rss_kib_samples":[%s],"threshold_applied":false}\n' "$candidate_sha" "$target" "$binary_bytes" "$rss_samples" | tee "eggpack-footprint/$target.json" + - name: Upload footprint evidence + uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" + with: + name: "eggsearch-footprint-linux-x64" + path: "eggpack-footprint/x86_64-unknown-linux-gnu.json" + if-no-files-found: error + retention-days: 7 - name: Capture canonical build handoff shell: bash run: "'eggpack' 'ci' '_capture-build' '--release-plan' 'eggpack-runtime/release-plan.json' '--build-bindings' 'release/eggpack/build-bindings.toml' '--target' 'x86_64-unknown-linux-gnu' '--cargo-target-dir' '${{ runner.temp }}/eggpack/${{ github.run_id }}-${{ github.run_attempt }}' '--output-dir' './eggpack-build/build_x86_64_unknown_linux_gnu'" diff --git a/AGENTS.md b/AGENTS.md index 335d465e..94ad4953 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ eggsearch is a lightweight MCP search/fetch server for AI agents (live metasearch with RRF dedup, bounded fetch, deterministic evidence bundles). Transports: client-owned `mcp stdio` or explicit loopback-only `mcp serve`. -Single library + binary crate, not a workspace. Stable contract is MCP tools (10) plus CLI, with a narrow native operation facade in `src/sdk.rs`; the remaining Rust module tree has no general semver library guarantee (see `src/lib.rs` and `architecture/python-library.md`). Dependency flow: `core <- meta <- mcp <- commands`; `fetch` is independent of `meta`. Start with `src/lib.rs` (module map) and `architecture/overview.md` (component index); operator docs live in `docs/`. +Single library + binary crate, not a workspace. Stable contract is MCP tools (10) plus CLI, with a narrow native operation facade in `src/sdk.rs`; the remaining Rust module tree has no general semver library guarantee (see `src/lib.rs` and `architecture/python-library.md`). Dependency flow: `core <- meta <- mcp <- commands`; `challenge_replay` depends on `meta` and `fetch` and is used by `mcp` and `commands`; `fetch` remains independent of `meta`. Start with `src/lib.rs` (module map) and `architecture/overview.md` (component index); operator docs live in `docs/`. ## Build & verification @@ -14,7 +14,7 @@ make release-check # check + docs + release build + publish dry-run make bench-check # compile-check the Criterion perf harness (characterization only, never a threshold); fuzz: make fuzz-smoke ``` -Feature flags: `mock` (test-only engine harness — **required for integration/corpus tests**; plain `cargo test` misses most of them), `pdf`, `browser`, `egress` (opt-in listener-free HTTP/SOCKS proxy-chain route for provider upstreams only; prebuilt/default binaries exclude it), `live-smoke` (implies `mock`, ignored by default, network). Tests must pass keyless: CI blanks all credential env vars, so missing credentials are provider-scoped skips, never global failures. Tests must not require network. +Feature flags: `pdf` and `browser` are enabled by Cargo defaults; `mock` is the test-only engine harness (**required for integration/corpus tests**, and plain `cargo test` misses most of them); `egress` is opt-in and excluded from prebuilt/default binaries; `live-smoke` implies `mock`; `live-mcp-smoke` is the opt-in real MCP/network smoke that retains default `pdf`/`browser` and does not enable `mock`. Both live smoke targets are ignored by default. Tests must pass keyless: CI blanks all credential env vars, so missing credentials are provider-scoped skips, never global failures. Tests must not require network. ```bash cargo test --locked --features mock --test web_search_integration # single suite @@ -42,7 +42,7 @@ cargo test --locked --all-features --test tool_surface_live -- --ignored # opt- Guard-enforced by `tests/static_guards.rs` (fail-closed; see `architecture/maintenance.md` for the ownership table): -- MCP tools call the `MetadataSearchAdapter`, never engines directly. New tools: dedicated module under `src/mcp/tools/` (shared validation in `common.rs`, goal/workflow resolution in `canonical.rs`), register in `src/mcp/server.rs` — exactly 10 tools unless tool-matrix, docs contract tests, and CodeGG docs move in the same change. +- MCP tools call the `MetadataSearchAdapter`, never engines directly. New tools: dedicated module under `src/mcp/tools/` (shared validation in `common.rs`, goal/workflow resolution in `canonical.rs`), register in `src/mcp/server.rs` — exactly 9 advertised tools (plus three callable compatibility aliases) unless tool-matrix, docs contract tests, and CodeGG docs move in the same change. - New engines implement `SearchEngine::search(&EngineSearchRequest)`; unsupported capabilities stay explicit (dispatch emits capability-skip attempts, never silent omissions). New providers also declare 24-flag `ProviderCapabilities`, add the ID to `KNOWN_PROVIDER_IDS`, document native-vs-local enforcement in `docs/provider-setup.md`, extend `tests/provider_capability_contract.rs`. Native enforcement: `brave_api` natively enforces safe-search, freshness/date-range, language, region, news; `exa` natively enforces freshness/date-range, domain filters, result timestamps; `tavily` natively enforces safe-search, freshness/date-range, language, region, domain filters, news; `serpapi` natively enforces safe-search, language, region; `kagi` natively enforces safe-search, freshness/date-range, region, domain filters, result timestamps. Domain filters are natively enforced only by providers advertising `supports_domain_filters` (currently `exa`, `kagi`, `tavily`); all other domain filtering is local approximation. `arxiv` is the only `ProviderKind::StructuredApi` provider (additive variant; existing wire values unchanged). Source of truth for native enforcement is `tests/provider_capability_contract.rs` (full matrix in `architecture/maintenance.md` § New engines and providers) — do not edit these claim strings to match prose preferences. - Domain workflows (`repo`/`research`/`security`) share `WorkflowExecution`/`RetrievalAttemptSet`/`FetchCandidateBuilder` primitives but keep typed planners/grouping/builders — do not flatten into one generic workflow. - Ordinary files must stay under 1,600 lines / 80 KB; larger modules carry explicit ratchet ceilings and next-slice notes in `architecture/maintenance.md`. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2494b946..9de23139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `web_fetch`, `batch_fetch` web items, the unified `fetch` tool, and CLI `eggsearch fetch` now + reach a browser-gated origin for the same reason `web_search` already did. A `429` or `5xx` from + such an origin escalates once to the shipped browser render under `render: "auto"` instead of + returning `http_status`; a rendered document replaces the error only when the render ended on + `2xx`/`3xx` or completed a recognised wall, so a genuine `5xx` outage still errors and says so. + Under auto a gated status is not retried, `401`/`402`/`403`/`404` never render, and an origin + the browser served is not charged to the HTTP circuit breaker. CLI `eggsearch fetch` honours + `[fetch.browser].policy` (`auto` by default) with no new flag. + +- `brave` and `yahoo` return results when the origin gates access on browser execution. Both + engines keep the HTTP request as the first attempt and fall back once, inside the same request + deadline, to the shipped browser render when that attempt is blocked or answered with `429`/ + `5xx`: Yahoo's empty `500` to a client that announces a headless browser becomes the results + page, and Brave's proof-of-work wall is completed by clicking the page's own `Verify` control. + The rendered DOM goes through each provider's existing parser, so the four-outcome contract is + unchanged. Without the `browser` feature, a discovered browser, or `[fetch.browser].enabled`, + the provider reports the HTTP failure exactly as before. A browser-gated search costs one render + (seconds, not milliseconds), bounded by the request deadline. +- The launched browser presents the identity of the Chrome build it actually is instead of + `HeadlessChrome/…`, and browser flags reach Chromium as key/value pairs. A literal + `--key=value` argument was previously emitted as `----key=value` and silently ignored, so + `--user-data-dir` and the autoplay policy never reached the process. + +- `knowledge_brief` resolves model cutoffs from a bundled, source-verified catalog that now + covers 11 models across OpenAI, Anthropic, and xAI instead of a single row, and reports + `model_resolution.catalog_as_of` so a stale catalog is visible. Every shipped row carries the + vendor page it was read from and the date it was verified; a model whose vendor publishes no + cutoff stays explicitly unresolved rather than guessed. The manifest is validated against the + bundled snapshot, so an alias collision, a precision mismatch, or a row missing from either + side fails a test. Operator and caller overrides keep precedence. +- The local evidence index now reports `coverage.index_status: disabled` when a request asks to + read or retain while the index is switched off, instead of reusing `offline` for both, and a + disabled request never opens or creates the database. An `index` refresh that emits nothing + separates `index_not_seeded` from `index_stale` and from a genuine + `no_matching_index_hits`, so an operator can tell an empty index from an expired one. +- `knowledge_brief` coverage now accounts for selected cards as dated/undated and cutoff-relative, + reports selected providers that advertise result timestamps, and explains empty delta sets with + reason-specific warnings. Dates remain provider-declared publication timestamps only; prose, + snippets, and fetched HTML are not used to infer them. Retained excerpts prefer heading-marked + chunks over leading site chrome and mark possible residual chrome when heading metadata is absent. + Index permission warnings identify the rejected directory, its current mode, and the required + `0700` mode. +- `security_search` selects every provider that configuration already enables and that + advertises native advisory lookup for identifier-bearing requests (`cve_id`, `ghsa_id`, + `osv_id`, `rustsec_id`, or `package`), so an enabled OSV provider answers a CVE query by + default instead of being silently skipped. An explicit `providers` list is unchanged and + stays authoritative; no provider is enabled by the code and `default_providers` is + untouched. A native vulnerability now carries an optional `summary` (sanitized as external + untrusted text and bounded to 500 characters, omitted when the provider publishes none), so + the response can say what an advisory is without a second fetch. The + `native_advisory_search_unavailable` warning appears only when no enabled provider + advertises a native operation, `severity_unavailable` appears only when no returned + vulnerability carries severity, and a provider-operation budget skip names its cap. +- A pass cookie the fetch path is issued is now reused for a later fetch to the same origin + instead of being solved again every time. The cache is process-local and keyed by origin + (scheme, host, effective port), holds at most 32 origins and 64 KiB, and is never written to + disk. The window is the lifetime the upstream published, clamped by `cookie_ttl_seconds`, so + `0` still disables reuse and a malformed, zero, or already-expired lifetime stores nothing. A + fetch that crossed an origin stores nothing and reuses nothing. A pair set the upstream + rejects is evicted, and the same call then solves the challenge it was already holding and + replays once with the freshly issued pair set, so a stale pair set costs no second fetch. A + transport error or a non-2xx status is not a refusal: the stored pair set is kept and no solve is + attempted. One fetch call still performs at most one solve and one replay; a reused pair set + performs no solve at all, and a refused pair set is presented at most once. No tool, argument, + schema, or configuration key changes. +- `web_fetch` and `batch_fetch` web items accept opt-in `include_screenshot` to capture a bounded 1280×720 viewport PNG (maximum 4 MiB) as native MCP image content. Structured JSON remains unchanged; recognized PDF responses are skipped, screenshot requests bypass caches, and screenshot-bearing batches run synchronously with images associated by original item index and label. +- `batch_fetch` web items accept the same PDF page-selection options as `web_fetch`, with page syntax prevalidated before item fetching. `repo_fetch` extracts explicitly named PDFs under configured local workspace roots by extension or `%PDF-` prefix, under `[local].pdf_max_file_bytes` and the existing PDF feature/config gates; PDFs remain excluded from local indexing and repo maps. +- `batch_fetch` web items accept `pdf`, `render`, and `browser_profile` with the same routing and cache semantics as `web_fetch`; repo items accept `symbol`, `symbol_kind`, `match_text`, `expand_to_block`, `max_block_lines`, and `prefer_local`. Host-local scope metadata now restricts batch workspace items to the same authorized view as `repo_fetch`. Item order, per-item failures, stable IDs, budgets, and telemetry are unchanged. - `web_fetch` accepts the field names used by the reference MCP fetch server and common search/fetch servers as compatibility aliases: `max_length` for `max_chars`, `start_index` for `offset`, and `question` or `prompt` for `focus`. Aliases are wire-level spellings, not separate @@ -122,6 +190,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- The advertised MCP inventory is nine tools. `fetch` is the only advertised repository + read: a repo item carries the locator, ref, symbol, line range, and `prefer_local` + controls that `repo_fetch` accepted, and mixed web/repo arrays still work. `repo_fetch` + stays routed and callable with its unchanged request and response, and is now a + compatibility alias alongside `web_fetch` and `batch_fetch`: absent from `tools/list`, + presets, `next_actions`, and SDK discovery. Generated follow-ups name `fetch` and carry a + repo item, so a suggestion never asks the caller to reconstruct a locator + (ADR-0022). +- Advertised search vocabularies are now single-sourced. `goal` is advertised for + `repo_search`, `research_search`, and `security_search`, and `research_domain` for + `research_search`, from the same constants the parsers accept, identically in the full + and compact profiles. Compact per-tool field allow-lists live with their argument types. +- The `build_evidence_bundle` input schema advertises a bounded passthrough shape for + `sources` and `fetches` instead of inlining 39 transitive definitions. Nested metadata is + accepted verbatim at runtime and bundle identity is unchanged; the tool definition drops + from 40,152 to 2,578 bytes and the full advertisement from 72,368 to 31,511 bytes. +- `tests/tool_inventory_parity.rs` now asserts that the contract registry, core + follow-up gate, presets, SDK discovery, documented preset table, and documented + canonical list all agree, and that the compatibility aliases stay routed but + undiscoverable. + +- Computational challenge solving is now on by default, as ADR-0019 §4 specified: + `[search.challenge].enabled` defaults to `true`, and the shipped ceilings cover the + walls the supported upstreams serve today (`max_difficulty = 6`, + `max_attempts = 20000000`, `timeout_ms = 10000`). A challenged `startpage` or + `mojeek` request therefore returns results instead of `blocked` without operator + configuration; `enabled = false` restores the previous behaviour. Interactive + CAPTCHA, OCR, third-party solving, and every other prohibition in ADR-0009 are + unchanged, and each solve still runs inside the call deadline with one solve per + provider per reuse window. +- `fetch` now enforces `max_total_chars` against the emitted payload instead of + the readable-text measure alone. Each item reports `payload_chars` (the + serialized character count of its response value before projection) and the + envelope reports `total_payload_chars`. Before any requested text is clipped, a + repo item drops optional structure in a fixed order — `document.blocks` and + `document.chunks`, then `document`, then `lines` — and records each removal in + `degraded_fields` with one `batch_payload_budget_degraded` warning mapped to the + existing `fetch_content_truncated` code. `chars_returned` keeps its readable + meaning and `truncated` still means text was clipped; an item that cannot fit + after the ladder remains a failed, omitted item. No tool, argument, or + configuration default changes. +- Local workspace search continues past the path-ranked first window for content + and symbol queries. When the first pass admits fewer than the requested + results, one bounded second pass scans the remaining inventory in deterministic + relative-path order, accelerated by a bounded `git grep` literal hint that only + skips candidates (every match is still validated and read locally). It stops at + the result cap, 512 files, 8 MiB, 1.5 seconds, or the request deadline, and a + git failure falls back to the walk. A symbol hint can now find a definition + without a path hint. `local_search_truncated` means a bound cut the scan short + or returned matches were dropped; `local_search_completed_no_matches` now + requires the scan to have completed. No tool, argument, schema, configuration + key, or shipped default changes. +- Under `render: "auto"` the fetch path now runs the bounded challenge solver before any browser + escalation, so a solvable Anubis or ALTCHA wall returns its document without launching Chrome. + A wall the solver leaves unsolved is completed by the browser when one is available, and a wall + that does not resolve inside `verification_wait_ms` is returned with + `manual_interaction_required: true` and the `fetch_challenge_page` warning instead of as an + unmarked document. Completion is decided by live `classify_response` over the rendered page + rather than by four title substrings, and + `provider_status.challenge_solver.providers.