Documentation

Docs / Reference

ADR 0042 - API section HTTP API

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

Context

The first real UI view (T016d) shows, for the indexed repository, every HTTP route and every Tauri IPC command, who calls each one, how sure each link is and where the graph is incomplete. The UI decisions (the T016 task record (internal): U3 B, U4 A, M5, developer decision D1) put HTTP routes and Tauri IPC commands in one API section, grouped by transport with the same coverage counts, with a gap sheet per category. The developer decided (2026-11-03) that coverage is grouped by the calling site's source root, that production is the default scope with an "Include tests" toggle, and that nothing is hidden or relabelled.

VISION's precision principle governs the data: a guess is never shown as a link. The index records callers as stored edges; dynamic calls record no candidates (T016d F5), ambiguous and test-only calls record capped candidate lists, and a call whose status is not linked may still have stored edges through one alternative. The index stores no reason text for any status. T016d1 adds the server side: three read-only endpoints under HTTP API v0 (ADR 0041), with no store, contract or extractor change.

Options considered and decisions

1. Endpoint granularity

2. Raw statuses on the wire

3. Count definitions and scope

The counts of docs/cli/serve.md: endpoints and calls per transport (fixed by node kind, not by the transport attribute), by_status on raw values, caller_count from stored call edges only, never_called, linked_without_edge (an inconsistency, expected 0) and edges_from_unlinked (legitimate). Scope production is "no scope attribute", test is scope: "test"; any other value is unknown and only in all (unknown is not production). Callers come only from stored edges; near misses only from recorded candidates of ambiguous and test-only choices (http: the path entry's status, so a call whose node status is dynamic can hold one; tauri: the node's); dynamic and unmatched choices are never attached to an endpoint. A tie size that is only a lower bound (no stored count, a list at the cap of ten) is marked candidate_count_exact: false and its reason says "At least"; it is never shown as exact (T016d Revision 1).

4. Reasons

5. Identity in a query parameter

6. Consistency

7. No cache, no server-side search or paging

Every request reads the store after it arrives. Lists are bounded by the repository's call count (Langflow: 422 dynamic calls) and the store has no attribute search. Revisit when a corpus exceeds a few thousand rows in one list or the 500 ms latency target fails.

8. Source roots

9. UI building blocks (T016d2)

The UI maps raw statuses to categories in web/src/api/categories.ts: only the exact string linked is linked; ambiguous, test only, unproven (registry_unproven, acl_possible, shadow_possible, unknown_command), plugin and global get a shared neutral colour with their label and icon; anything else, including "" and case variants, is "Other" with the raw value shown. Guards for every response are hand-written (no schema library). The wrapper colour became an olive family distinct from the HTTP accent, and an --other family was added (values and contrast in T016d2's summary).

Consequences

Known gaps

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

Review notes, UI (delegated review, 2026-11-03)

Report a problem with this pageSource: docs/adr/0042-api-section-http-api.md