Skip to content

Split service.tn into service.tn and http.tn, and give each module a schema package - #32

Merged
oobles merged 3 commits into
mainfrom
schema-split
Nov 27, 2026
Merged

oobles merged 3 commits into
mainfrom
schema-split

Conversation

@oobles

@oobles oobles commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

The schema split

service.tn is now two schemas, as proposal/schema-split.md (adopted here) measured:

  • service.tn keeps its !!id and root map service, and holds the protocol side only.
  • http.tn (https://tson.io/2026/40/io/ltr8/http/http.tn, root map http) imports it and holds the projection of a
    protocol onto HTTP.

Every HTTP-side name moves from service.X to http.X keeping its member name, except service.http →
http.projection, service.http_verb → http.verb and service.http_auth → http.auth. The facts annotations stay
@service.safe and the rest. A description using HTTP imports http.tn alone and sees the protocol vocabulary through
its import closure; a protocol-only description imports service.tn.

The module and package layout

The HTTP half of the description moves out of tson-service into tson-http, and both modules follow one rule: the
root package is the API; schema holds only the classes that mirror a .tn type; internal is unexported.
Mirrors of
a module's own root map sit in schema, and mirrors of another schema it owns in schema.<root map>.

Module Package Holds
tson-service io.ltr8.tson.service TsonBindings, TsonServiceSchema, the join TsonServiceProtocol, TsonExchangeName
io.ltr8.tson.service.schema Protocol, Exchange, Signature
io.ltr8.tson.service.internal Landed, exported to tson-http only
tson-http io.ltr8.tson.http the codec and headers as before, plus TsonHttpSchema, TsonServiceDescription, TsonServiceCoverage, TsonRoute, TsonPayloadType, TsonRequestPlacement, TsonDeploymentSchema
io.ltr8.tson.http.schema http.tn's mirrors (HttpProjection, Endpoint, Binding, …)
io.ltr8.tson.http.schema.problem TsonProblem, TsonProblemDiagnostic
io.ltr8.tson.http.schema.deployment TsonDeployment and its nested records

Consequences worth knowing when reading the diff:

  • tson-service no longer holds anything of HTTP. The packages io.ltr8.tson.service.protocol and
    io.ltr8.tson.service.http are gone.
  • TsonServiceSchema holds service.tn; TsonHttpSchema holds http.tn and is what an HTTP description wires (it
    publishes and binds both schemas). TsonDeployment's schema-holder statics are TsonDeploymentSchema.
  • The record Http is HttpProjection.
  • The description's tests and fixtures sit in the module whose code they test, and MediaTypeNames, a hand copy of the
    media type names, gives way to TsonMediaType.

Behaviour changes

Apart from names, two refusals are new. With per-schema bindings (TsonBindings.bySchema) a caller must now key both
schemas' identities; leaving one out would otherwise surface as a ClassCastException, so the reader and
the join refuse a projection or a protocol whose value did not bind, naming the fix.

Measured, and corrected

SchemaSplitProbeTest.aRootOfTheHttpSchemasOwnIsOpenToEveryImporter shows a root map of the HTTP schema's own is as
open to an importer as service is: only a member path two schemas both declare collides. The proposal had claimed such
a root is closed; that is corrected, and the notes say each root is reserved only against a root that is no schema map.

CLAUDE.md no longer claims the demos run as named modules: only each module's main source set is one.

Names

Four root-package types a consumer names take the Tson prefix: TsonRoute, TsonPayloadType and
TsonRequestPlacement in io.ltr8.tson.http (the first met io.helidon.webserver.Route under wildcard imports), and
TsonExchangeName in io.ltr8.tson.service.

problem.tn and deployment.tn no longer say each reserves its root name alone; they state the same rule as
service.tn and http.tn. It is measured for service and http, and follows from the spec's rule for the other two.

Left open

  • The join judges no exchange facts: an exchange marked both safe and destructive is refused only when an HTTP
    projection binding its protocol is read. BACKLOG.md records it.

Verification

./gradlew build javadoc --rerun-tasks is green locally against the sibling's main, and both doc checks pass. Each of
the three structural stages had an independent review; one verified from a throwaway named module that both schemas load from
their own modules and a description reads through the qualified export.

🤖 Generated with Claude Code

oobles and others added 3 commits November 27, 2026 11:59
…the http half to tson-http

service.tn keeps its identity and its root map and holds the protocol side
only. http.tn, under the root map http, imports it and holds the projection of
a protocol onto HTTP: service.http is http.projection, service.http_verb is
http.verb, service.http_auth is http.auth, and every other member keeps its
name under http. A description using HTTP imports http.tn alone and sees the
protocol vocabulary through its import closure.

The Java follows the schemas. Each module's root package is its API, schema
holds only the classes mirroring the module's .tn types, and internal is
unexported machinery:

- tson-service: TsonBindings, TsonServiceSchema, the join TsonServiceProtocol
  and ExchangeName in io.ltr8.tson.service; Protocol, Exchange and Signature in
  io.ltr8.tson.service.schema; Landed in internal, exported to tson-http only.
- tson-http: TsonHttpSchema, TsonServiceDescription, TsonServiceCoverage, Route,
  PayloadType and RequestPlacement beside the codec; http.tn's mirrors in
  io.ltr8.tson.http.schema. The description's tests and fixtures sit in the
  module whose code they test, and MediaTypeNames gives way to TsonMediaType.

The reader refuses a projection or a protocol left unbound by per-schema
bindings, naming the fix, where it threw a ClassCastException. The probe
measures that a root of the http schema's own is as open to an importer as
service is, and proposal/schema-split.md is adopted with that corrected.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… own root map

tson-http's layout rule now covers its three schemas. The root package is the
API, the holder of each schema among it; a class mirroring a .tn type lives
under schema: http.tn's, whose root map is the module's own, in schema itself,
and those of each other schema the module owns in schema.<root map>.

- TsonProblem and TsonProblemDiagnostic are in io.ltr8.tson.http.schema.problem.
- TsonDeployment and its nested records are in
  io.ltr8.tson.http.schema.deployment. What it held as a schema holder (ID,
  source, bindings, read, tson) is the root class TsonDeploymentSchema, shaped
  like TsonProblemSchema.

No behaviour changes. A descriptor that is not valid against deployment.tn
stopping the read is now pinned through read itself, and
TsonHttpSchema.bindings says its service.tn entries are inert under http.tn's
key in per-schema bindings.

CLAUDE.md no longer claims the demos run as named modules: only each module's
main source set is one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ot map reserves

Route, PayloadType and RequestPlacement in io.ltr8.tson.http and ExchangeName in
io.ltr8.tson.service are types a consumer names, sitting beside Tson-prefixed
API; Route also met io.helidon.webserver.Route under wildcard imports. They are
TsonRoute, TsonPayloadType, TsonRequestPlacement and TsonExchangeName.

problem.tn and deployment.tn no longer say each reserves its root name alone.
A nested schema map is open, so another schema's map of the same name adds its
members, and only a path both declare collides: the name is reserved only
against a root that is no schema map. TsonProblemSchema, TsonServiceSchema and
the notes say the same.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@oobles
oobles merged commit 541ccab into main Nov 27, 2026
1 check passed
@oobles
oobles deleted the schema-split branch November 27, 2026 02:58
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