sessiongen

command
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Command sessiongen generates pkg/session's contract types from the frozen ABI schema (pkg/abi/llmsafespaces/abi/v1/contract.proto).

ADR 0056 T3 / issue #1161: the schema is the single source of truth for the session contract; pkg/session is its dialect-preserving Go view (string enums, flat Part, time.Time, int) that the API's JSON egress (SSE/REST) serves until the S3 frontend cutover — US-69.10/.11 deletes this view. The output is committed and verified fresh by `make abi-check`, so the two representations cannot drift: a schema change regenerates this file or fails CI.

The translation rules (the same ones the S1 parity test asserted):

  • enum values: strip the enum prefix, lowercase; EventType additionally maps `_`→`.` (the dotted wire set); *_UNSPECIFIED is dropped.
  • google.protobuf.Timestamp: plain → time.Time, `optional` → *time.Time.
  • message fields → pointers, except the VALUE_FIELDS table.
  • int32 → int (`optional` int32 → *int); bytes → json.RawMessage.
  • oneof → flat fields on the parent (single-field wrappers flatten).
  • json tags: proto JSON names; omitempty everywhere except the REQUIRED_FIELDS table (proto3 cannot express required-ness).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL