Skip to content

docs(architecture): describe the commands that exist, mark the ones that don't - #582

Merged
EVWorth merged 1 commit into
mainfrom
docs/architecture-import-export
Sep 9, 2026
Merged

EVWorth merged 1 commit into
mainfrom
docs/architecture-import-export

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Section 5 documented ten Tauri commands that were never written. Nine appear nowhere in the tree; ai_status matches only test function names in mas-ai/tests/data_layer.rs. A reader following the document and calling export_data, refresh_schema or get_users gets a runtime "command not found" from a source that reads as authoritative.

§5.5 rewritten to describe the real import/export surface: export_results formats a fetched result set, pick_file/pick_save_file open the native dialogs, read_file_contents/write_file_contents move the bytes. Parsing and preview are frontend-side because the file is already in memory there. The prose now states that there is no transaction around an import and could not usefully be one — a dump's DDL commits as it runs — and that streaming is not implemented.

The other ten are marked NOT IMPLEMENTED rather than deleted. They are a plan worth keeping, just not a surface to call.

scripts/check-documented-commands.sh compares the async fn names in §5 against the commands registered in lib.rs. Documented-but-unregistered fails unless marked; registered-but-undocumented is reported as information only. Verified it fails on an unmarked phantom (exit 1) before trusting the pass.

CI runs it when docs/**, src-tauri/** or scripts/** change.

Closes #363

…hat don't

Section 5 was the reference for the Tauri command surface, and ten of the
commands it documented had never been written. Nine appear nowhere in the
tree; ai_status matches only test function names. Someone reading the
document and calling export_data, refresh_schema or get_users gets a
runtime "command not found" from a source that reads as authoritative.

Section 5.5 now describes what import and export are actually built from:
export_results formats a fetched result set, pick_file/pick_save_file open
the native dialogs, and read_file_contents/write_file_contents move the
bytes. Parsing and preview happen in the renderer because the file is
already in memory there. The prose says plainly that there is no
transaction around an import and could not usefully be one — a dump's DDL
commits as it runs — and that streaming is not implemented.

The remaining ten are marked NOT IMPLEMENTED rather than deleted: they are
a plan worth keeping, just not a surface to call.

scripts/check-documented-commands.sh compares the async fn names in section
5 against the commands registered in lib.rs and fails on any that are
neither registered nor marked, so the section cannot drift back. CI runs it
when docs, src-tauri or the scripts change.

Closes #363

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit 7154620 into main Sep 9, 2026
11 checks passed
@EVWorth
EVWorth deleted the docs/architecture-import-export branch September 9, 2026 23:55
EVWorth added a commit that referenced this pull request Sep 10, 2026
…s of it (#606)

Section 5 declared the Tauri commands but omitted 32 of the 63 registered,
so a reader could not tell whether a command existed by looking. #582 fixed
the other direction — commands documented but never written — and this is
the half that was left (#457).

Added: the two connection commands, kill_query and get_own_thread_ids, the
four view and DDL commands, the four AI commands that exist, and three
sections that had no place to live at all — history (§5.6), SQLite (§5.7)
and platform (§5.8). Each says why the command is shaped as it is rather
than restating its signature, since the signature is generated into
bindings.ts and does not need a second copy.

The check script only matched `async fn`, so a documented *sync* command
was invisible to it. Widening the pattern immediately found `format_sql` —
documented, never implemented, and undetectable by the tool written to
catch exactly that. It is now marked NOT IMPLEMENTED and not planned:
formatting is the frontend's, via the sql-formatter npm package, and a
round trip to Rust to reformat text as the user types would buy nothing.

Widening it also broke the name extraction, because a one-line signature
ends in its return type rather than the function name. Fixed, and verified
the check still fails on a reintroduced break before trusting the pass.

Closes #457

Co-authored-by: Claude Opus 5 <[email protected]>
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.

[P0][doc-drift] ARCHITECTURE 5.5 declares import_data, preview_import, export_data Rust commands — none exist

1 participant