Documentation

Docs / Reference

ADR 0038 — Tauri invoke linking

Status: Accepted (delegated review, 2026-11-02)

Context

ADR 0037 caches Tauri syntax without proof: command attributes, generate_handler! entries, builder chains and the let bindings that carry a builder to invoke_handler. T015c2 turns it into graph facts: which Rust functions a Tauri app exposes as commands, which TypeScript calls invoke them, and the links between them. Tauri dispatches an invoke by exact, case-sensitive string equality with the first matching arm of the handler installed last before the builder is consumed (tauri-v2.12.5 app.rs:1723, 2408, 2616; handler.rs). The T015c1 and T015c2 censuses of kftray (e3116e0c: 115 commands, one handler, 105 invoke sites) are the corpus.

The investigation of T015c2 found that the rules as written picked the let whose own initializer holds the root (let app = app.…), so kftray proved no registry (stop P2). Revision 1 added the statement end to the payload (R1), conditional markers on alternative names (R2), explicit builtin macro mapping (R3) and a link-time crate root for the ACL check (R4).

Options considered

Decision

Consequences

Known gaps

Revision 2 (review 1)

Review 1 found two confident wrong facts and five smaller gaps. The reviewer decisions change the rules as follows (status stays Proposed).

Consequences: kftray is unchanged (115 / 115 / 105 / 103, 0 diagnostics); its production scope holds one Tauri builder root (the proof's own), one generate_context!, no other invoke_handler call and one config directory (tauri.conf.json with a tauri.linux.conf.json overlay).

Known gaps added by Revision 2:

Revision 3 (review 2)

Review 2 found two more confident wrong facts (MA1, MA2) and two gaps (mi1, mi2). The reviewer decisions change the rules as follows (status stays Proposed). Payload version 3 changes in place (still unmerged; extractors-27 unchanged).

Consequences: kftray is unchanged (115 / 115 / 105 / 103, 0 diagnostics, both wrappers recognized). Its payload grows to 36 of 270 Rust files with 30 app sites (17 roots, 12 glob re-exports of local modules, 1 context); the production evidence is its own root (main.rs:164) and one generate_context!, so no other-app evidence.

Known gaps added or kept by Revision 3:

Review 3

Review 3 found one more confident wrong fact (MA3) and one gap (mi3). Status stays Proposed; the payload and contract are unchanged.

Known gaps added by review 3:

Review notes (delegated review, 2026-11-02)

Report a problem with this pageSource: docs/adr/0038-tauri-invoke-linking.md