Skip to content

feat(ipc-codegen): human-authored JSONC schema format#24086

Open
charlielye wants to merge 1 commit into
cl/ipc-foundation-fixesfrom
cl/ipc-phase2-schema-format
Open

feat(ipc-codegen): human-authored JSONC schema format#24086
charlielye wants to merge 1 commit into
cl/ipc-foundation-fixesfrom
cl/ipc-phase2-schema-format

Conversation

@charlielye

Copy link
Copy Markdown
Contributor

Replaces the positional/reflection-shaped IPC schema with a human-authored JSONC format and drops the C++ schema-reflection machinery.

  • Friendly front-end in schema_visitor.ts: one object per service (service/aliases/types/error/commands) with shorthand string type refs, lowered to the positional named_union form the generators already consume — generators untouched, produced CompiledSchema identical. Type prefix + method-prefix-stripping fold into service, retiring --prefix/--strip-method-prefix. Aliases cover bin32 (nominal) and scalar synonyms (e.g. MerkleTreeId: u32).
  • Reflection removed (now that the schema is the hand-authored source of truth): templates/cpp/ipc_codegen/schema.hpp, get_*_schema_as_json(), the <Prefix>Api/<Prefix>Command reflection aggregates, per-type msgpack_schema methods, and the rust __typename field. MSGPACK_SCHEMA_NAME (NamedUnion dispatch tag) and the NamedUnion type are kept; wire format is unchanged.
  • Echo example converted to schema.jsonc; scripts/convert_schema.ts added (one-shot positional→friendly converter); SCHEMA_SPEC.md rewritten.

Goldens byte-unchanged; full echo matrix (golden ×4, UDS 4×4, SHM, ts_package) passes.

@charlielye charlielye force-pushed the cl/ipc-foundation-fixes branch from 917aa13 to 66ff2af Compare June 16, 2026 16:02
@charlielye charlielye force-pushed the cl/ipc-phase2-schema-format branch from 8cec13b to 561b762 Compare June 16, 2026 16:03
@charlielye charlielye force-pushed the cl/ipc-foundation-fixes branch from 66ff2af to 14b6dd9 Compare June 16, 2026 17:02
@charlielye charlielye force-pushed the cl/ipc-phase2-schema-format branch from 561b762 to a5dc5dd Compare June 16, 2026 17:02
@charlielye charlielye force-pushed the cl/ipc-foundation-fixes branch from 14b6dd9 to 993c25a Compare June 16, 2026 18:12
@charlielye charlielye force-pushed the cl/ipc-phase2-schema-format branch from a5dc5dd to dae506d Compare June 16, 2026 18:12
Add a friendly JSONC schema front-end to schema_visitor.ts that lowers a
single per-service object (service/aliases/types/error/commands with shorthand
string type refs) to the positional named_union form the generators already
consume, so the four generators are untouched and the produced CompiledSchema
is identical. The type prefix and method-prefix stripping fold into the
'service' field, retiring --prefix/--strip-method-prefix and detectPrefix for
friendly schemas. aliases support bin32 (nominal) and scalar synonyms (e.g.
MerkleTreeId = u32).

Convert the echo example schema to schema.jsonc and update its bootstraps;
remove the schema_reflection_test (it asserted the old positional shape).
Add scripts/convert_schema.ts, a one-shot positional->friendly converter used
to migrate the remaining service schemas.

Goldens unchanged; full echo test matrix (golden x4, UDS 4x4, SHM, ts_package)
passes.
@charlielye charlielye force-pushed the cl/ipc-foundation-fixes branch from 993c25a to 0ac3119 Compare June 16, 2026 19:36
@charlielye charlielye force-pushed the cl/ipc-phase2-schema-format branch from dae506d to a0d859e Compare June 16, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant