Skip to content

fix: resync src/databasis_mcp with the monolith (observations, auxiliary_files_url) - #12

Merged
rdahis merged 2 commits into
mainfrom
fix/resync-src-databasis-mcp
Aug 27, 2026
Merged

fix: resync src/databasis_mcp with the monolith (observations, auxiliary_files_url)#12
rdahis merged 2 commits into
mainfrom
fix/resync-src-databasis-mcp

Conversation

@rdahis

@rdahis rdahis commented Aug 27, 2026

Copy link
Copy Markdown
Member

The repo keeps two copies of every tool

server.py (the monolith, 3,724 lines) and src/databasis_mcp/ both define the same 45 tools, same names. Neither imports the other; they are kept in sync by hand. server.py is what actually runs today — claude mcp list points at Dropbox/BD/mcp/server.py.

Comparing every tool's source AST-to-AST between the two trees:

identical drifted
main 41 / 45 bulk_upsert_columns, update_column, upload_columns_from_sheet, create_update_table
this branch 45 / 45

Two commits

fix(columns): carry the per-language observations into src/databasis_mcp

#11 landed the per-language observations arguments in server.py only, 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_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 instead of the bare key. A lone observations still means Portuguese.

fix(tables): carry auxiliary_files_url into src/databasis_mcp

This one predates #11#10 corrected the src tree but missed it. create_update_table in the monolith takes auxiliary_files_url and sends auxiliaryFilesUrl; 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):

  1. bulk_upsert_columns with all three → all three fields set
  2. a bare observations → Portuguese updated, English and Spanish untouched
  3. update_column with the new arguments → all three set
  4. original three values restored, byte-identical to the starting state

order and descriptionPt were unchanged throughout, confirming the partial input does not clobber neighbouring fields.

create_update_table was 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 — auxiliaryFilesUrl present 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

rdahis added 2 commits August 27, 2026 17:48
#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.
@rdahis rdahis self-assigned this Aug 27, 2026
@rdahis
rdahis merged commit f334beb into main Aug 27, 2026
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.

1 participant