Skip to content

Extract tson-service, with protocol and http packages - #30

Merged
oobles merged 3 commits into
mainfrom
tson-service-extraction
Nov 26, 2026
Merged

oobles merged 3 commits into
mainfrom
tson-service-extraction

Conversation

@oobles

@oobles oobles commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

The service description leaves tson-http for a module of its own, so a projection other than HTTP can reuse it. This is the first entry of BACKLOG.md, "The module split". It is a move plus renames: the same tests pass before and after.

What changes

  • New module tson-service (io.ltr8.tson.service). It holds service.tn, the bound records, the description's reader and TsonBindings. It depends on tson-java, ltr8-bind and ltr8-annotation directly, and on nothing of tson-http.

  • tson-http depends on it and hands it on (requires transitive), so the adapters and demos change imports only.

  • The api package becomes two:

    Package Holds
    io.ltr8.tson.service TsonBindings
    io.ltr8.tson.service.protocol Protocol, Exchange, Signature, ExchangeName
    io.ltr8.tson.service.http the projection's records, Route, placement, the security schemes, the schema class, the reader, coverage

    protocol imports nothing from http, and the root imports neither.

  • Renames: TsonApiSchema → TsonServiceSchema, TsonApiDescription → TsonServiceDescription, TsonApiCoverage → TsonServiceCoverage. Method names are unchanged. The test classes named for them follow, including TsonServiceConformanceTest in the jdk adapter.

  • service.tn's !!id is unchanged.

What is not a move

  • The reader used TsonMediaType for three media type names. TsonMediaType stays in tson-http; the reader holds the names in a package-private MediaTypeNames, and a new MediaTypeNamesTest holds them to TsonMediaType's.
  • ExchangeName.of is public, since its caller is now in another package.
  • Javadoc that the move made untrue is reworded ("this library" of a codec that is no longer in the module).

Also in this PR

  • The sibling moved (first commit): its binder reworded one refusal, so one UpstreamGapsTest pin and its UPSTREAM.md entry follow the new message. The gap is still open.
  • The protocol layer's note (second commit): ltr8-bind now reads an interface as a DataProtocol, so design/invoke.md states the contract as built, and this project's own proposal for it is marked superseded.

Worth a reviewer's eye

  • tson-service has no tests of its own. The description's tests and fixtures stay in tson-http's test tree, in package io.ltr8.tson.service.http, because the fixtures import problem.tn and one test uses TsonHttpCodec. They reach package-private members of a package in another module only because tson-http's tests run on the class path.
  • The schema class and the reader sit in http, not the root. service.tn is one schema holding the HTTP projection, and the reader's body is the !service.http reader. In the root they would make a cycle with http through TsonBindings.
  • The published-artifacts build was not run locally. It now needs io.ltr8:ltr8-bind and io.ltr8:ltr8-annotation as direct coordinates, and CI is the first run of that path.
  • One intermittent failure seen locally: TsonJavalinAdapterTest.aNonTsonBodyIs415 failed once in four from-scratch builds and passed in every rerun. This change does not touch it.

Tests

./gradlew build and ./gradlew javadoc pass against the sibling's current main: 553 tests, the 552 from before the move plus MediaTypeNamesTest. Both doc checks pass.

🤖 Generated with Claude Code

oobles and others added 3 commits November 26, 2026 15:41
The sibling's binder now reports its own reason, so the message a mapped
class that cannot be analysed carries no longer has "Failed to resolve: "
before it. The gap is still open: preparing the schema passes and every read
throws MissingBindingException. The pin's message assertion and the UPSTREAM.md
entry's quoted message follow the new wording.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ltr8-bind now reads a Java interface as a DataProtocol of DataExchanges, so
the descriptor this project proposed for it is built upstream and differs from
the proposal. design/invoke.md states the contract as built: one record or
nothing, the response returned and a declared error thrown, per-call context
as a ScopedValue around handle, names running from the data's spelling to
Java's, and no proxy in the library. proposal/bind-invoke.md is kept as the
record of what was proposed here, marked superseded with where it departs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The service description leaves tson-http for a module of its own,
io.ltr8.tson.service, which depends on tson-java, ltr8-bind and
ltr8-annotation directly and on nothing of tson-http. tson-http depends on it
and hands it on, so the adapters and demos change imports only.

The api package becomes two. protocol holds Protocol, Exchange, Signature and
ExchangeName and imports nothing from http. http holds the projection's
records, Route, placement, the security schemes, the schema class and the
description's reader, since service.tn is one schema holding the HTTP
projection. The root holds TsonBindings alone. TsonApiSchema,
TsonApiDescription and TsonApiCoverage are TsonServiceSchema,
TsonServiceDescription and TsonServiceCoverage, and the tests named for them
follow.

Two things are not a move. The reader no longer names TsonMediaType: it holds
the three media type names itself, and MediaTypeNamesTest holds them to
TsonMediaType's. ExchangeName.of is public, since its caller is now in another
package.

The description's tests and fixtures stay in tson-http's test tree, in package
io.ltr8.tson.service.http: the fixtures import problem.tn and one test uses
TsonHttpCodec. BACKLOG.md says what remains: a protocol-side reader, the join
over DataProtocol, and splitting service.tn, which waits on a probe.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@oobles
oobles merged commit ca3cfde into main Nov 26, 2026
1 check passed
@oobles
oobles deleted the tson-service-extraction 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