Repository navigation
fix: six more findings from the architecture review - #539
Merged
Merged
Conversation
test_last_verified_within_six_months failed once LAST_VERIFIED was more than 180 days old, so the default suite would turn red on 2026-11-19 with no code change. A test that fails because the calendar moved tests nothing, and the only way to make it pass is to bump the date without checking any pricing page. The age assertion is removed; the ISO-format check stays. The comment on LAST_VERIFIED no longer claims a test enforces its age. record_spend still has no caller: the Voyage call site in server/query_encoder.py is a commented-out TODO, so arxmcp_api_spend_usd_total reads 0. The metric is left as it is. Closes #326
The drill's Kùzu check could not pass on a restored graph, for two reasons: - Kùzu 0.11 stores the database as a single file at index/kuzu, but the locator accepted only a directory there. A real graph was reported as absent and the check was skipped. - Past the locator, the count queried MATCH (p:Paper). The node table is papers, so Kùzu raised "Table Paper does not exist" and the drill reported the graph as unreadable and exited 1. The locator now takes index/kuzu whether it is a file or a directory, and the count reads papers. The new test builds a real graph with the ingest schema under a restic-style path prefix and checks the count; before this only the absent case was tested. The issue's claim about WAL checkpoints for the other SQLite stores is left for a separate change. Closes #302
The connection is autocommit, and the v2->v3 and v3->v4 steps ran their ALTERs and the user_version bump as separate statements. A crash between them left a column in place while user_version still named the old schema, so the next open re-ran the step, hit "duplicate column name", and the server could not start. v3->v4 has three ALTERs, so its window was the widest. Only v4->v5 and v5->v6 opened a transaction. Every step now goes through one helper, _migrate, which runs the statements and the version bump between BEGIN and COMMIT and rolls back on any error, including KeyboardInterrupt. The v4->v5 comment that explained this in one place moves to the helper. The new test fails the second v3->v4 ALTER, then checks that the file is still at v3 with none of that step's columns, and that the next open migrates to the current version and keeps a notebook written in between. Closes #299
get_paper read up to 10,000 chunk rows with every column, including both 1024-float vector columns (~14 KB per row), and then used only section_path, chunker_version, embedder_version and the row count. That ran on every call, on the event loop. The scan now selects those three columns at the scanner, the same pattern as the lemma fallback and the notebook recount. The reply is unchanged. The new test wraps a real LanceDB table so it can see the columns each scan returned. It checks the reply's counts and versions and that the scan carried exactly the three columns; before the fix it returned all 26. Closes #353
A batched get_chunk gave each element result_byte_cap // n, but
enforce_byte_cap trims only the element's primary body. Referenced
counterparts (up to 8 bodies of 4000 characters each) were never cut,
so 20 elements with include_referenced=True came to about 700 KB of
structured content, nearly three times the 256 KB cap, with no
body_truncated flag. /mcp is exempt from the response-size middleware,
so nothing downstream caught it.
The assembled {chunks: [...]} is now passed through cap_result_list,
which drops trailing entries until the reply fits and sets
body_truncated. The per-element share still trims oversized primary
bodies first, so a batch of large primaries keeps every entry, as
before.
The new test gives each of 20 elements a full set of counterparts. It
checks the reply fits the cap, is flagged, and keeps a request-order
prefix of the ids. Before the fix the reply was 706,555 bytes.
Closes #327
build_bm25_index read the pinned chunks table with tbl.to_arrow(), which in lancedb 0.30 materializes every column, both 1024-float vector columns included, and then used chunk_id, body_tokens and paper_id. On a cold start with no index this ran on the startup path. The scan now goes through project_columns with the table's row count as expected_rows. The table is checked out at corpus_version, so a short read means the read failed; the build raises instead of writing an index that silently misses chunks. The other half of the finding, the startup chunk_id cross-check in server/resources.py, already projects through project_column. Two new tests wrap the real table. One checks that every scan returned exactly the three columns and the index covers every chunk (before the fix the scan returned all 26). The other makes the scan come back one row short and checks that nothing is written. Closes #336
This was referenced Nov 15, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Six audit findings, one commit each.
8c8480bLAST_VERIFIEDage assertion, which would turn the default suite red on 2026-11-19 with no code change. The ISO-format check stays.record_spendstill has no caller (the Voyage call site inserver/query_encoder.pyis a commented-out TODO), soarxmcp_api_spend_usd_totalreads 0; the metric is unchanged.b8f982aindex/kuzu, but the locator took only a directory, so a real graph was skipped as absent; past that, the count queriedPaper, and the table ispapers.2afb88d_migratehelper: BEGIN, the statements, theuser_versionbump, COMMIT, and ROLLBACK on any error. v2→v3 and v3→v4 were bare autocommit ALTERs. Most of the diff is re-indentation; the store file is 4 lines shorter.59ccc2aget_paperselectssection_path,chunker_versionandembedder_versionat the scanner instead of all 26 columns. The reply is unchanged.3bd720cget_chunkpasses the assembled{chunks: [...]}throughcap_result_list. Trailing entries are dropped until it fits, andbody_truncatedis set. It callscap_result_listwithout editing it, so it does not conflict with #538.8885093project_columnswithexpected_rows, and a short read raises instead of writing an index that misses chunks. Theserver/resources.pyhalf of the finding was already projected.Closes #326
Closes #302
Closes #299
Closes #353
Closes #327
Closes #336
Verification
Run on Ubuntu at
8885093, on top ofmainatd9ddaa8.ruff check .is clean.python3 .github/credo_prose.py origin/mainexits 0.pytestat8885093, with noARXMCP_*variables set: 5559 passed, 144 skipped, 1 xfailed, 0 failed, out of 5704 collected, in 214 s, exit 0.Notes
get_chunktool description (server/tools.py:337) says a batch returns "one entry per id", but when the cap fires trailing entries are now dropped. Changing the description movesEXPECTED_TOOL_SCHEMA_SHA256, so it waits for the nextTOOL_SCHEMA_VERSIONre-pin.make bootstrapcreatesvar/arxmcp/index/kuzuas a directory. Kùzu 0.11.3 refuses a directory there ("Database path cannot be a directory"), so graph ingest fails on a freshly bootstrapped box, and a backup of that empty directory still fails the drill.🤖 Generated with Claude Code