Schema camelCase inconsistency: paramTypes / retType in Term::Lam #30

Closed
opened 2026-05-21 11:40:46 +02:00 by Brummel · 0 comments
Owner

Two field names in the canonical JSON schema use camelCase while everything else uses kebab-case or single words:

  • Term::Lam.paramTypes (serde rename in crates/ailang-core/src/ast.rs line 492)
  • Term::Lam.retType (serde rename in crates/ailang-core/src/ast.rs line 494)

The surrounding schema uses kebab-case for compound keys (drop-iterative, reuse-as) and single words for atomic ones (type, fn, else, in, as). The two camelCase outliers in Lam are the only ones in the whole AST module.

This matters for LLM-author consistency — the schema reads as (lam (params ...) (paramTypes ...) (retType ...) (effects ...) BODY) in Form A, which is jarring next to the surrounding (fn-type ...) / (reuse-as ...) etc.

Proposed: rename to param-types and ret-type in both the JSON schema (serde rename) and the Form A surface keyword. Breaks every existing fixture's canonical-JSON hash, so the right place is bundled with any other schema-touching milestone — not a one-off.

Discovered during the naming-A/B experiment review (experiments/2026-05-21-naming-ab/), found while auditing every serde rename in ast.rs.

Two field names in the canonical JSON schema use camelCase while everything else uses kebab-case or single words: - `Term::Lam.paramTypes` (serde rename in crates/ailang-core/src/ast.rs line 492) - `Term::Lam.retType` (serde rename in crates/ailang-core/src/ast.rs line 494) The surrounding schema uses kebab-case for compound keys (`drop-iterative`, `reuse-as`) and single words for atomic ones (`type`, `fn`, `else`, `in`, `as`). The two camelCase outliers in Lam are the only ones in the whole AST module. This matters for LLM-author consistency — the schema reads as `(lam (params ...) (paramTypes ...) (retType ...) (effects ...) BODY)` in Form A, which is jarring next to the surrounding `(fn-type ...)` / `(reuse-as ...)` etc. Proposed: rename to `param-types` and `ret-type` in both the JSON schema (serde `rename`) and the Form A surface keyword. Breaks every existing fixture's canonical-JSON hash, so the right place is bundled with any other schema-touching milestone — not a one-off. Discovered during the naming-A/B experiment review (experiments/2026-05-21-naming-ab/), found while auditing every serde rename in ast.rs.
Brummel added the bug label 2026-05-21 11:40:46 +02:00
Sign in to join this conversation.