fix: resync src/databasis_mcp with the monolith (observations, auxiliary_files_url) - #12
Merged
Merged
Conversation
#11 landed the per-language `observations` arguments in the top-level `server.py`, which is what the deployed MCP actually runs (`claude mcp list` points at `Dropbox/BD/mcp/server.py`). It did not touch `src/databasis_mcp/tools/write.py`, which holds a second copy of the same three writers. That is exactly the drift #10 had just finished correcting, so this ports the change verbatim: `bulk_upsert_columns` and `update_column` take `observations_pt`/`_en`/`_es`, `upload_columns_from_sheet` reads the `observations_en` and `observations_es` sheet columns, and all three write `observationsPt`/`En`/`Es` rather than the bare key. A lone `observations` still means Portuguese. `grep -n observations` now returns identical output for the two files. Verified against staging through `src.databasis_mcp.tools.write` — not the monolith — with the same round-trip used on #11: all three fields written by both entry points, a lone `observations` still landing in Portuguese without touching English or Spanish, `order` and the descriptions untouched, and the original values restored at the end.
`create_update_table` in the monolith takes `auxiliary_files_url` and sends it as `auxiliaryFilesUrl`; the copy in `src/databasis_mcp/tools/write.py` never gained the argument. This drift predates #11 — #10 corrected the src tree but missed this one. It matters because the onboarding rules require the field: every table with a documentation bundle records its GCS URL there, and 84 production tables already carry one. On the package copy the argument simply does not exist, so the bundle would go unrecorded. Comparing every tool's source between the two trees now reports 45/45 identical, where main reported 41/45. Verified with the mutation stubbed, since `create_update_table` has no partial-update semantics and a live call would rewrite a real table record: the payload carries `auxiliaryFilesUrl` when the argument is passed, and omits the key entirely when it is not, so an update that leaves it out cannot blank a stored value.
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.
The repo keeps two copies of every tool
server.py(the monolith, 3,724 lines) andsrc/databasis_mcp/both define the same 45 tools, same names. Neither imports the other; they are kept in sync by hand.server.pyis what actually runs today —claude mcp listpoints atDropbox/BD/mcp/server.py.Comparing every tool's source AST-to-AST between the two trees:
mainbulk_upsert_columns,update_column,upload_columns_from_sheet,create_update_tableTwo commits
fix(columns): carry the per-language observations into src/databasis_mcp#11 landed the per-language
observationsarguments inserver.pyonly, so the package copy still had the single-argument form that produced 3,022 Portuguese-only columns across 46 production datasets. Ported verbatim:bulk_upsert_columnsandupdate_columntakeobservations_pt/_en/_es,upload_columns_from_sheetreads theobservations_enandobservations_essheet columns, and all three writeobservationsPt/En/Esinstead of the bare key. A loneobservationsstill means Portuguese.fix(tables): carry auxiliary_files_url into src/databasis_mcpThis one predates #11 — #10 corrected the src tree but missed it.
create_update_tablein the monolith takesauxiliary_files_urland sendsauxiliaryFilesUrl; the package copy never gained the argument. The onboarding rules require the field (84 production tables already carry a bundle URL), so on the package copy a table's documentation bundle would simply go unrecorded.Verification
Live round-trip on staging, through
src.databasis_mcp.tools.write— deliberately the newly-changed copy, not the already-verified monolith — against a real column (elections.house_first_preference_division.ballot_position):bulk_upsert_columnswith all three → all three fields setobservations→ Portuguese updated, English and Spanish untouchedupdate_columnwith the new arguments → all three setorderanddescriptionPtwere unchanged throughout, confirming the partial input does not clobber neighbouring fields.create_update_tablewas tested with the mutation stubbed, not live: it has no partial-update semantics, so a real call would rewrite an actual table record. The payload is what changed and the payload is what is asserted —auxiliaryFilesUrlpresent when the argument is passed, key absent entirely when it is not, so an update that omits it cannot blank a stored value.Worth considering separately
45 hand-synced duplicate tools drifted twice in two PRs. Generating one tree from the other, or finishing the migration and deleting the monolith, would remove the failure mode rather than repairing it each time.
🤖 Generated with Claude Code