Skip to content

Join a schema's protocol to a Java interface, and measure the service.tn split - #31

Merged
oobles merged 2 commits into
mainfrom
protocol-join-and-schema-split-probe
Nov 27, 2026
Merged

oobles merged 2 commits into
mainfrom
protocol-join-and-schema-split-probe

Conversation

@oobles

@oobles oobles commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

The join

TsonServiceProtocol.join(tson, schemaId, protocol, type), in io.ltr8.tson.service.protocol, joins a schema's
!service.protocol entry to a Java interface read through bind's DataBindContext.getProtocol, and refuses any
disagreement at startup with an IllegalArgumentException:

  • a schema exchange with no method, a method no exchange names, or two schema names finding one method;
  • a request or response present on one side only;
  • a type the two sides disagree on: a record by the class its entry binds to, arrays and maps by element, an atom by
    the check a record's field gets, a choice by membership in a closed union;
  • a declared error missing or extra on either side, or named twice.

A shape it cannot judge (a tuple, a namespace type, an open union and the like) is refused rather than passed. It does
not check a record's fields, facets, or bridge conversion; its Javadoc and design/invoke.md say so.

With it:

  • Landed moves to an unexported io.ltr8.tson.service.internal, kept out of the generated Javadoc.
  • tson-service has its own tests, on a protocol-only fixture.
  • tson-service names io.ltr8:tson-atom directly. This PR is the first run of the published-artifacts build with
    that coordinate.

Not built: dispatch from a call document, the rpc wire form, a protocol document written from an interface, the proxy.

The schema-split probe

proposal/schema-split.md, measured by SchemaSplitProbeTest, reports that service.tn can be split into a protocol
schema and an http schema importing it. The http schema may add its entries to the open service map, with no rename,
or take a root of its own. The probe measures a cut-down pair of schemas written in the test, not service.tn itself.
No schema is split in this PR.

service.tn's @doc and the notes no longer claim the layer reserves the name service alone, since a nested schema
map is open. problem.tn and deployment.tn make the same claim and are unchanged here.

Upstream

Three new low-priority UPSTREAM.md entries, each pinned:

  • A union read from a sealed hierarchy is not reported closed.
  • The atom family a bind-mode read uses for an entry is not one public call.
  • A local declaration colliding with an imported one names neither schema.

Verification

./gradlew build javadoc --rerun-tasks is green locally against the sibling's main, and both doc checks pass.

🤖 Generated with Claude Code

oobles and others added 2 commits November 27, 2026 11:01
TsonServiceProtocol.join reads a schema's !service.protocol entry and bind's
DataProtocol for an interface, and refuses any disagreement at startup: an
exchange without a method or a method without an exchange, a request or
response present on one side only, a type the two sides disagree on, and a
declared error missing or extra on either side. A shape it cannot judge is
refused rather than passed.

Landed moves to an unexported internal package, since both the protocol and
the http packages use it, and is kept out of the generated Javadoc.
tson-service gains its own tests on a protocol-only fixture, and names
io.ltr8:tson-atom directly for the atom check.

Two library gaps the join works around are pinned in UpstreamGapsTest and
entered in UPSTREAM.md: a union read from a sealed hierarchy is not reported
closed, and the atom family a bind-mode read uses is not one public call.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SchemaSplitProbeTest measures a cut-down pair of schemas, the http one
importing the protocol one, and proposal/schema-split.md reports it: both
resolve, a description in one document or two reads, a second projection
layer sits beside the http one, and one bind context binds both layers. The
http schema may add its entries to the protocol schema's service map, since a
nested schema map is open, or take a root of its own.

service.tn and the notes no longer say the layer reserves the name service
alone: it is reserved only against a root that is no schema map.

UPSTREAM.md gains the collision whose diagnostic names neither schema, and
the two-schema data document entry cites the probe's pin of the same throw.
BACKLOG.md follows both this and the join.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@oobles
oobles merged commit ba4686c into main Nov 27, 2026
1 check passed
@oobles
oobles deleted the protocol-join-and-schema-split-probe 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