Skip to content

B-O4GF-ontogen-explicit-route-shapes

ontogen derives HTTP route shape from function-name prefixes and arity: add_/remove_ with exactly two params and list_ with one param silently become junction routes; only get_/list_/count_/exists_/find_/is_/has_ route GET; POST params partition by Option-ness between query and body; and the module-name echo is stripped (get_vault_openers in module openers emits GET /api/openers/vault, not /api/openers/vault-openers — hit while building the vault openers surface). A wrong name reshapes routes silently rather than failing the build, and every api/v1 module carries a long defensive doc header (platform-core/src/api/v1/collections.rs:37-58) to compensate. Proposal: explicit route/verb declaration (attribute or registration builder), or at minimum a build-time error on ambiguous/junction-prone shapes instead of silent reshaping.

Related emitter ergonomics, worth addressing alongside the route-shape work: the generated TS type pool is emitted in alphabetical order, so adding any wire type reshuffles types.ts wholesale — small API changes produce large, noisy generated diffs. A stable emission order (insertion order or per-module grouping) would keep diffs proportional to the change.


← Back to Backlog