You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
canonical(frontend): replace every hand-written API response type with the generated contract #20867
Both GUIs declare backend response shapes by hand instead of importing the generated contract (src/types/generated/api.ts). A hand-written type drifts from the backend without the compiler noticing, which is the class behind dead buttons, wrong fields and dates read from fields that no longer exist (#20865).
Maintainer decision 2026-11-05: "find wherever handwritten api types are present and replace with generated", at the highest priority.
Target set (measured on main at da88b6c, with the detectors of repo_tests/frontend_api_contract_ratchet_test.py)
App
interface *Response
inline api.get<…> generics
files
autobot-frontend
186 in 76 files
534 in 157 files
194
autobot-slm-frontend
33 in 10 files
87 in 20 files
28
Boundary: non-test .ts and .vue under each app's src/. Excluded: generated/ and _generated/, and tests.
Plan
Classify every site (read-only): (a) a generated type exists, so replace now; (b) the backend route has no response_model, so the generated type is missing or unknown; (c) not a backend response at all.
Replace (a) in PRs of at most 100 files, grouped by feature area. Each PR lowers responses and inline_generics in the ratchet in the same commit.
Fix (b) at the source: give the backend route its response_model, regenerate, then replace the call site. Never re-declare the type by hand.
SLM GUI the same way, after the main GUI.
Acceptance criteria
responses and inline_generics reach 0 in both apps in frontend_api_contract_ratchet_test.py, each lowered in the PR that did the work.
Every backend route a GUI reads declares a response_model, and the generated api.ts carries a named type for it.
No GUI declares a type for a backend response; the guard forbids new ones (already true) and the population is empty.
vue-tsc passes in both apps with no new suppressions.
Maintainer direction (2026-11-06): this work goes hand in hand with the unconnected-code gate (#20512, landed on main with PR #20538). The gate's frozen baseline (repo_tests/unconnected_code_baseline.txt) lists ~844 backend routes with no caller, all linked to the umbrella #10603. When a frontend call site moves onto the generated contract, each route it now reaches through the generated client must be removed from that baseline in the same PR (the gate's test_every_baseline_entry_is_still_unconnected fails otherwise), and a route that turns out to have no real caller is either wired in or recorded with its own issue. Conversely, a frontend call to a route that does not exist in the generated contract is a defect, not a hand-written type to keep. Measure both in each PR: baseline route entries removed, hand-written types removed.
Activity
mrveiss commentedon Nov 6, 2026
Maintainer direction (2026-11-06): this work goes hand in hand with the unconnected-code gate (#20512, landed on main with PR #20538). The gate's frozen baseline (
repo_tests/unconnected_code_baseline.txt) lists ~844 backend routes with no caller, all linked to the umbrella #10603. When a frontend call site moves onto the generated contract, each route it now reaches through the generated client must be removed from that baseline in the same PR (the gate'stest_every_baseline_entry_is_still_unconnectedfails otherwise), and a route that turns out to have no real caller is either wired in or recorded with its own issue. Conversely, a frontend call to a route that does not exist in the generated contract is a defect, not a hand-written type to keep. Measure both in each PR: baseline route entries removed, hand-written types removed.