Skip to content

Merge mit-base-salvage into test without extension source#251

Merged
m1rl0k merged 1388 commits into
testfrom
import/mit-base-salvage-test
Jul 3, 2026
Merged

Merge mit-base-salvage into test without extension source#251
m1rl0k merged 1388 commits into
testfrom
import/mit-base-salvage-test

Conversation

@m1rl0k

@m1rl0k m1rl0k commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • merge the OSS mit-base-salvage fork into test
  • preserve the current README.md
  • restore the safe .env
  • remove only the VS Code extension source and publish workflow from the branch
  • keep existing UI/docs references to the VS Code extension intact

Validation

  • git diff --check
  • python3 -m compileall scripts
  • frontend package validation not run because node_modules is not present in the clean worktree and no dependency install was performed

Notes

  • this branch was rebuilt cleanly from origin/test after the earlier branch was based on origin/main
  • target branch is test (the actual default branch)

Pull Request opened by Augment Code with guidance from the PR author

m1rl0k and others added 30 commits December 29, 2025 16:44
Add retrieval benchmark harness and A/B config support
…se” collection

- watch_index_core/utils.py
  * treat per-repo state entries that point at placeholder collections (codebase,
    etc.) as invalid in multi-repo mode, derive the correct collection via
    get_collection_name, and persist the repaired mapping back to state
- workspace_state.py
  * stop auto-populating serving_collection from qdrant_collection when
    multi-repo is enabled and staging is off, and never propagate placeholder
    collection names into serving_collection
- tests/test_watcher_collection_resolution.py
  * add regression test ensuring stale state.json values (codebase) are ignored
    for per-repo routing in multi-repo mode
Regression fixes: Per repo fixes
…yments

Reverts 4ec4208. The hardcoded allowed_hosts whitelist breaks:
- ctx-mcp-bridge (primary extension access pattern)
- K8s deployments (LAN IPs, internal DNS)
- Any custom domain deployment

If host validation is needed, it should be opt-in via env var (auth already exists).
Revert TransportSecuritySettings - breaks bridge and non-Docker deployments
Updated both mcp_indexer_server.py and mcp_memory_server.py to disable DNS rebinding protection in FastMCP by setting transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False). This change is necessary to allow proper internal networking when running the servers inside Docker containers.
Updated both Dockerfile and Dockerfile.mcp to explicitly pin mcp to 1.17.0 and fastmcp to 2.12.4 for consistency across services and alignment with requirements.txt. This ensures reproducible builds and avoids issues from unintentional upgrades.
Update environment variable definitions to use the ${VAR:-} syntax, ensuring variables are inherited from .env files rather than the host shell. This change improves consistency and reliability when configuring chunking and lexical vector settings across services.
Fix env var inheritance in docker-compose.yml
Updated both Dockerfile and Dockerfile.mcp to install Python dependencies from a shared requirements.txt file for improved consistency and maintainability across services.
Disable DNS rebinding protection for FastMCP in Docker
Removed default value '0' for PATTERN_VECTORS and added missing PATTERN_VECTORS variable in one service. Standardized environment variable definitions to use '${VAR:-}' for proper .env inheritance, and added missing default fallbacks for several variables.
Introduces scripts/refrag_openai.py, providing an OpenAI-based adapter for decoder-side ReFRAG operations. Updates requirements.txt to require openai>=2.11.0. Modifies context_answer.py and query_expand.py to support OpenAI as a runtime, including auto-detection via OPENAI_API_KEY and proper client instantiation. Decoder availability checks and prompt handling are updated to accommodate the new OpenAI integration.
Update environment variable defaults in docker-compose.yml
Autodetect of REFRAG_RUNTIME is now opt-in via REFRAG_RUNTIME_AUTODETECT to prevent unintended API calls. Query expansion prompts for OpenAI and GLM now require a JSON object with a 'queries' key. Added an async variant generate_pseudo_tags_batch_async to refrag_openai.py and improved event loop handling for batch pseudo tag generation.
Updated .env.example and CONFIGURATION.md to add OpenAI as a supported decoder backend, document new environment variables for OpenAI integration, and clarify runtime selection with an opt-in auto-detection mechanism. Expanded documentation for decoder configuration and query expansion to reflect these changes.
Matches 1793a46 pattern: detect running loop and use ThreadPoolExecutor
to avoid RuntimeError when generate_pseudo_tags_batch is called from
async context (e.g., FastMCP server handlers).
Eliminated the REFRAG_RUNTIME_AUTODETECT environment variable and all related auto-detection logic from configuration, documentation, and code. The decoder runtime must now be set explicitly, defaulting to 'llamacpp' if unset, to prevent unintended API calls.
Add OpenAI adapter and runtime support for ReFRAG
Introduces scripts and modules for running CoIR and CoSQA code search benchmarks, including dataset handling, indexing, and evaluation runners. Updates requirements.txt to include the coir-eval package for benchmarking. Also adds Context-Engine retriever adapters and utilities for Qdrant-based evaluation.
The indexer now enriches code snippets with AST-extracted symbols, imports, and calls, improving both embedding and lexical vector quality. The runner script's documentation is updated to reflect new Context-Engine features, including hybrid search, reranking, and query expansion, and adds environment variable controls for these features. Baseline MRR values are updated to match the latest CoSQA+ paper.
Refactored fallback functions in indexer.py to clarify unused arguments and added noqa comments. Updated and expanded baseline MRR comments in runner.py for clarity, added context on expected performance, and passed the 'mode' parameter to repo_search in search_cosqa_corpus.
Introduces a new benchmarking suite for evaluating file retrieval performance on the SWE-bench dataset. Adds dataset loading, repository management, and a runner script to measure recall, precision, and other retrieval metrics for Context-Engine, supporting both lite and full subsets.
voarsh and others added 25 commits January 10, 2026 20:07
Fix ingest metadata TS config import order
- Refactored extension.js from 1,416 to ~590 lines (~58% reduction).
- Extracted cohesive logic into dedicated managers using a factory pattern:
    - python_env.js: Python interpreter and venv management.
    - process_manager.js: Spawning, tracking, and terminating child processes.
    - config_resolver.js: Path resolution and configuration logic.
    - commands.js: Centralized vscode command registration.
    - Sign out if auth on and local session exists
    - onboarding.js: Workspace setup and onboarding flow logic.
- Consolidated all path logic into config_resolver.js and deleted workspace_paths.js.
- Cleaned up orphaned global variables and redundant delegator functions.

(cherry picked from commit d2b85d9)
  - auth_utils.js: Convert checkAuthStatus to async (use spawn instead of spawnSync to avoid blocking UI thread), fix logout to show error when endpoint not configured, add proper type checking for getEffectiveConfig

  - commands.js: Fix uploadGitHistory command to use uploadGitHistory' mode instead of 'force' (was duplicate behavior), deduplicate auth command error handling with resolveEndpointOrThrow helper

  - config_resolver.js: Fix startWatchAfterForce default value - VSCode's
    config.get() ignores second parameter, use nullish coalescing instead

  - extension.js: Add spawn and log to sidebar dependencies, remove unused checkAuthStatus import

  - onboarding.js: Add .catch() handler to executeCommand call to prevent unhandled promise rejections

  - process_manager.js: Fix double-resolve race condition in execAsync cancellation (add finished flag), fix path containment check to use path.relative instead of startsWith (prevents false positives from sibling directories), fix _hasLoggedBuildEnv flag to actually be set

  - python_env.js: Fix error handling to safely convert non-Error thrown values to strings (prevent crashes), fix double-resolve in execAsync

  - sidebar.js: Convert getCachedAuthLoggedIn to async (uses async
    checkAuthStatus), add workspace path to cache key for per-workspace caching, add proper error handling, remove spawnSync import

(cherry picked from commit ca8a97b)
(cherry picked from commit 48aa4ce)
(cherry picked from commit eb3f612)
Distinguish between transient MCP transport errors (recoverable via reinit)
and terminal backend auth rejections. When a true auth failure is detected
(e.g., "Invalid or expired session"), mark the local session as expired
(set expiresAt: 1).

This ensures the sidebar correctly shows "Sign In" immediately upon
rejection, while preserving the backend URL for seamless re-authentication.

(cherry picked from commit 1b016fc)
(cherry picked from commit 5d0d309)
…bility

- Fix ReferenceError in mcpServer.js by correctly passing backendHint.
- Add missing activation event for Antigravity MCP config command.
- Standardize stdout/stderr string conversion in process manager.
- Improve defensive error handling for child processes.
- Refactor watch cleanup logic and remove duplicate notifications.

(cherry picked from commit 73be4ba)
… and tighten git-history/auth behavior

- Rewire uploadGitHistory so the command runs the dedicated mode and passes REMOTE_UPLOAD_GIT_FORCE only when requested, ensuring the python clients emit git_history.json without starting watch mode afterward.

- Restore the prior targetPath inference fallback so status bar/tooling stay stable even when auto-detect can’t read the workspace folder.

- Tighten auth gating (state must be 'ok'), slow sidebar refresh churn, and make command registration degrade gracefully instead of throwing during activation when optional managers fail.

- Harden MCP bridge routing by only sending known memory-prefixed tools to the memory client.

(cherry picked from commit 64ec362)
  - Conditionally load cached paths only on deletion events (performance)
  - Use requireDep pattern for safer config access in commands.js
  - Normalize error values before logging in process_manager.js
  - Validate gitMaxCommits >= 0 (allow 0 for disable, reject negative)
  - Filter onDidChangeTextDocument for file:// URIs only

(cherry picked from commit 28a0dbe)
…oad clients - for windows specifically (antivirus, etc)

(cherry picked from commit 74ceb16)
…ror handling

  Critical fixes:
  - Normalize watchdog event_type to lowercase (was checking uppercase, never matched)
  - Wrap configResolver init in try/catch to prevent extension activation failures

  Diagnostics & robustness:
  - Capture stderr for any non-zero auth exit (not just error state)
  - Add dependency validation for clearer initialization errors
  - Fix misleading error message in settings reading
  - Clarify derivedHostRoot edge case handling

(cherry picked from commit 770d0e4)
…bridge detection

  - Export readConfig for use in mcpServer
  - Resolve auth backend dynamically by matching indexer/memory URL hostnames
  - Strip internal container_path from bridge search results
  - Add probeBridgeAlive to detect externally running bridge processes
  - Suppress auto-install prompts for auto-detected Python interpreters
  - Add MCP config watchers for antigravity, server mode, and bridge settings

(cherry picked from commit 653efee)
@m1rl0k m1rl0k marked this pull request as ready for review July 3, 2026 13:17
Copilot AI review requested due to automatic review settings July 3, 2026 13:17
@m1rl0k m1rl0k merged commit 6503446 into test Jul 3, 2026
2 of 3 checks passed

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 wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

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.

5 participants