You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds governed local table-import and Milvus semantic-search capabilities to the DBX MCP server while reusing dbx-core parsing and database drivers.
Add dbx_preview_import_file, dbx_prepare_table_import, dbx_start_table_import, dbx_get_import_status, and dbx_cancel_import.
Add dedicated dbx_vector_search and dbx_vector_upsert_file; keep v1 batch deletion registered but fail-closed as VECTOR_DELETE_DISABLED_V1 until DBX has an authoritative publication-state source.
Classify vector REST entity operations so dbx_execute_query cannot bypass the dedicated tools.
Stream governed XLSX/XLSM imports into a server-generated, unique staging table whose source and lineage columns are all TEXT.
Preserve duplicate headers by 1-based source position and stable canonical names.
Require exact semantic_version, approval_status=approved, and a YYYY-MM-DD activity window for every semantic search.
Correct Milvus single-query response flattening, including data: [[]] as zero rows.
Make connection management opt-in for an unscoped maintenance process, and correctly resolve every named connection in a multi-ID runtime scope.
Safety model
Local import tools fail closed unless DBX_MCP_IMPORT_ROOTS is configured; web mode returns IMPORT_UNSUPPORTED_IN_WEB_MODE_V1.
Inspection/import concurrency, timeouts, ZIP entry and decompression budgets, row/cell/string/output limits, disk-space checks, bounded XLSX channels, cancellation, and RAII cleanup bound resource use.
Imports finish their governed snapshot before opening the database and can write only a new server-generated staging relation.
Semantic JSONL is fully validated against the Milvus collection contract before the first network write, including UTF-8 byte limits, checksums, version consistency, embedding shape, and card ownership.
Generic vector entity search/query/upsert/delete calls are blocked; collection diagnostics remain available where already allowed.
dbx_add_connection, dbx_duplicate_connection, and dbx_remove_connection are hidden by default. They require DBX_MCP_ENABLE_CONNECTION_MANAGEMENT=1 and no runtime scope; method-level guards remain in place.
v1 boundaries
Governed imports support XLSX/XLSM and explicitly UTF-8 CSV/TSV.
Legacy .xls, JSON table imports, GBK, UTF-16, and automatic encoding detection remain bounded preview-only and fail before database access during prepare.
Preview row counts and used ranges expose exactness flags; a bounded preview is not reported as a full-file count.
Semantic deletion remains disabled rather than trusting a caller-provided publication flag.
cargo test -p dbx-core --lib: 5,447 passed, 60 ignored.
cargo check -p dbx-mcp: passed.
cargo check -p dbx-core --example data_transfer_bench --locked --no-default-features: passed; covers the all-target benchmark initializer added for source row lineage.
cargo clippy -p dbx-mcp --no-default-features: 0 errors; two pre-existing nonminimal_bool warnings outside this change.
pnpm --filter @dbx-app/mcp-server test: 1 test file, 2 tests passed.
An opt-in local XLSX regression fixture verified a 145-column sheet, repeated headers, stale used-range metadata, 81 all-empty columns, absolute source row numbers, complete row hashes, and all-TEXT governed mappings without opening a database or logging business cell values. The fixture itself is not included.
CI follow-up: the original rust-test and rust-fmt-clippy failures had the same compile cause: ParsedImportFile gained source_row_numbers, while crates/dbx-core/examples/data_transfer_bench.rs still used the old initializer. This is fixed, and the branch has been cleanly rebased onto the current main (no workflow-file changes in the PR diff). The latest compatibility commit also preserves 1-based source record numbers for the new SQL import path on current main. Local merged-base validation passed: cargo fmt --check; 19 SQL-import tests; cargo check -p dbx-mcp --locked; cargo check -p dbx-core --example data_transfer_bench --locked --no-default-features --features sqlite-bundled; and 93 DBX MCP tests. The new CI run 33080745104 is action_required with zero jobs. Could a maintainer approve this Actions run?
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
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
This PR adds governed local table-import and Milvus semantic-search capabilities to the DBX MCP server while reusing
dbx-coreparsing and database drivers.dbx_preview_import_file,dbx_prepare_table_import,dbx_start_table_import,dbx_get_import_status, anddbx_cancel_import.dbx_vector_searchanddbx_vector_upsert_file; keep v1 batch deletion registered but fail-closed asVECTOR_DELETE_DISABLED_V1until DBX has an authoritative publication-state source.dbx_execute_querycannot bypass the dedicated tools.TEXT.semantic_version,approval_status=approved, and aYYYY-MM-DDactivity window for every semantic search.data: [[]]as zero rows.Safety model
DBX_MCP_IMPORT_ROOTSis configured; web mode returnsIMPORT_UNSUPPORTED_IN_WEB_MODE_V1.O_NOFOLLOW, file-descriptor identity checks, SHA-256 revalidation, single-use 30-minute plans, and task-private snapshots protect the preview/prepare/start boundary.dbx_add_connection,dbx_duplicate_connection, anddbx_remove_connectionare hidden by default. They requireDBX_MCP_ENABLE_CONNECTION_MANAGEMENT=1and no runtime scope; method-level guards remain in place.v1 boundaries
.xls, JSON table imports, GBK, UTF-16, and automatic encoding detection remain bounded preview-only and fail before database access during prepare.Validation
cargo test -p dbx-mcp --no-default-features: 93 passed, 4 ignored, 7 filtered out.cargo test -p dbx-core --lib: 5,447 passed, 60 ignored.cargo check -p dbx-mcp: passed.cargo check -p dbx-core --example data_transfer_bench --locked --no-default-features: passed; covers the all-target benchmark initializer added for source row lineage.cargo clippy -p dbx-mcp --no-default-features: 0 errors; two pre-existingnonminimal_boolwarnings outside this change.pnpm --filter @dbx-app/mcp-server test: 1 test file, 2 tests passed.TEXTgoverned mappings without opening a database or logging business cell values. The fixture itself is not included.No production database, Milvus collection, credentials, or private fixture data is included in this PR.