Skip to content

Revision 40 on tson-java's main: the service layer, externs, parametric records - #29

Merged
oobles merged 22 commits into
mainfrom
r2026-40-proposal
Nov 24, 2026
Merged

oobles merged 22 commits into
mainfrom
r2026-40-proposal

Conversation

@oobles

@oobles oobles commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Brings main to TSON 2026 Revision 40, now that tson-java has merged it to its own main (which CI here checks out). main before this merge is tagged r2026-39.

What this carries

Following the revision

  • Every identity moves to /2026/40/, and tson.version names 0.40.0-SNAPSHOT.
  • A value's name reads to a ValueRef; ^ after !name takes values and a record derives by &; a schema document is TSON syntax only, with JSON encoding data against the resolved form.
  • ScriptPolicy is TokenPolicy and IdentifierPolicy is flat; policy.script_policy is policy.token_policy. The descriptor's wire shape is unchanged.
  • meta.field_name is gone from the kernel, so service.tn types an endpoint's query, header keys and body by meta.identifier.
  • A record with parameters is a parametric record throughout; URI, path and header templates keep their name.

The service layer

  • meta-service.tn becomes service.tn, under one root map; problem.tn and deployment.tn nest under one root map each.
  • A protocol and an http projection are records with a namespace field; a projection's resources are a plain map keyed by a text path template.
  • Security schemes, response headers and a destructive marker on an exchange.
  • Externs: a description names a type of another schema and the reader follows it to its landing, resolving every type expression from the landing of the entry that writes it. A plain alias is judged by what it reaches.

Proposals and registers

  • Proposals for value references, an event kind and a live namespace of objects, and operation refinement, each measured by a probe. The affordances proposal now records that a namespace's key type may not admit ., so no path holding a dot can key its objects namespace.
  • UPSTREAM.md and UpstreamGapsTest follow the library's gaps as they stand at the close-out; no pin flipped in the final resync.
  • The design notes are reorganised, one per area, and the project is configured for agents.

Verification

Against tson-java main at 1ec6d39a:

  • ./gradlew build --rerun-tasks: 552 tests across the four modules, no failures, errors or skips.
  • ./gradlew build -Ptson.published=true --rerun-tasks after publishToMavenLocal in the sibling: passes (run at a51ce714, whose tree 1ec6d39a merges unchanged).
  • ./gradlew javadoc, scripts/check-line-length.sh and scripts/check-doc-references.sh: clean.

Known open

  • A plain-alias payload type is named as written, though a TSON read asks for the entry it reaches (BACKLOG.md, "A plain-alias payload type is named as what a read asks"); a test pins the current behaviour.

🤖 Generated with Claude Code

oobles and others added 22 commits November 12, 2026 16:16
…osal branch

Every identity moves to /2026/40/ and tson.version to 0.40.0-SNAPSHOT. The library's model follows Revision 40: a
dependent field is a type written in place, read through RecordField.sibling(), and RequestPlacement and ChosenTypes
follow a TypeInline into its body where a slot holds a type rather than a name. TsonDeployment drops the removed
max_materialisation_depth limit, with the validator's descriptor and the README's sample.

UpstreamGapsTest re-measures every pin the revision touches. A template's bare name at a field and the minted name in
a sibling's refusal are fixed and flip; value parameters go, and a value differing per application is pinned where
the application is declared; a template over an !http value is refused, so a projection is a value of its own; an
application inside a choice is declared or the choice is disjoint; an application at a kind slot in a value keeps
its refusal under the new wording. The mapped-class pin binds through DataNameBinder.ofMap, a binder answering null
being outside the contract. The experiments' probes follow: an untagged enum variant reads at a disjoint choice, a
non-name at a type slot is a type mismatch, and the envelope refusal names meta.ref<exchange> as written.

UPSTREAM.md holds what is still open: the bare-template item and three spec entries close, the dependent-field items
state the current model, and a diagnostic embedding a TokenEvent's toString is recorded. The notes and the
experiments' READMEs state the Revision 40 contract, and a stale claim that a value reference in data is reported as
not implemented is corrected: it is linked and judged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The library implements what experiments/one-level argued for, so the exploration and its probes go. What it held that
nothing else recorded is carried over: IDENTITY.md and COMPUTATION.md move to experiments/agent, which cites them;
UpstreamGapsTest pins a reference slot bound to a String component and a value reference in a data document, and
gains the plain-map half of the reference walk; design/service-description.md and design/deployment-descriptor.md
state the data/schema line precisely, a document exporting a namespace being a schema and any document referring
into one; BACKLOG.md asks whether a description may refine operation; the agent README records the pool typing a
plan wants; and UPSTREAM.md stages the question of who may declare constructors in a schema a request names.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… field

proposal/namespace-fields.md: a protocol and an http projection become records with declared fields and one field
typed by a namespace, a qualified name walking through that field (orders.exchanges.place_order), so the @BINDS claim
and the exemptions become fields the resolver judges at load. Nothing is asked of the kernel or the spec.

NamespaceFieldProbeTest measures it: the shape resolves; a claim naming no protocol is refused at load; the exchange
reference spells the field and nothing else; a path key is no qualified-name segment; a namespace-typed field binds to
Map, AnnotatedMap or Namespace, only the last two keeping key order and key annotations; a judged reference in a
schema value carries no referent, as one from an annotation does; and the positional form still admits the map alone.

CLAUDE.md names proposal/ among the root documents.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lueRef

A reference is a name. Binding.exchange and Exemption.exchange hold a ValueRef<Exchange>, a
binding's delivered its Exchange when the description links and an exemption's never, as it sits
in an annotation's value; ExchangeName is built from the name in both. An application is
ApplyBody, read through head(); an argument list in a data value is a parse error, and the pins
that measured the old refusals assert the new ones. A new pin measures delivery to a ValueRef
and the refusal of a TypeRef at a value's slot.

Two library findings staged: a tagged !meta.apply at a kind slot refused through the tag event's
toString, and an application in a data value refused as its head and then as a missing separator.

Three upstream rulings recorded. The dependent-field entry keeps only what is open, the §11
paragraph and a load-time refusal of a free sibling admitting an unbound type; the root-name and
constructor entries are deleted, the first replaced by the rule that a vocabulary this project
publishes reserves one root name, the second by the decision that the schema boundary admits
schemas and does not judge their kind. The backlog takes the move of the layer under one map and
the family rule for a bound request record's dependent field.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rvice.tn

Every root name of an import closure is reserved in each importer, so a layer declaring document,
resource, operation and binding at its root left a domain schema no way to own those names. The
layer now declares one root, the schema map service, and every entry including its annotations
is a member of it, written by its path from inside the layer as from outside: !service.protocol,
!service.binding, @service.safe, meta.ref<service.exchange>. The bound records' type names, the
description reader's lookups and messages, every description document and fixture, the README
sample and the notes follow. The same rule still has to reach problem.tn and deployment.tn, which
the backlog carries with their map names left to decide.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
problem.tn declares the schema map problem, holding problem.details, problem.diagnostic and
problem.diagnostic_code; deployment.tn declares deployment, holding deployment.descriptor,
deployment.listener and deployment.acceptance_profile. Each published schema of this project now
reserves one root name in every importer. The bound classes' type names, the codec's describing
call, every schema composing a business error, the descriptors, the demos, the suites and the notes
follow; a problem body is written and read as !problem.details at both media types, and the
acceptance profile is served as !deployment.acceptance_profile.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
service.protocol holds exchanges, a service.exchanges namespace, and service.http holds resources, a
service.resources namespace, beside its claims: binds names the protocols it binds and not_bound the
exchanges it claims and does not bind. Both claims were annotations on the projection's entry, where
the resolver judges no reference; as fields they are judged at load and delivered their referents,
so TsonApiDescription reads a bound protocol from binds and a binding's exchange from the reference,
and its own name checks go. An exchange's qualified name is the protocol's entry, the field and the
key: orders.exchanges.place_order. Every description writes the full form. The namespace-fields
proposal is adopted and its spec entry withdrawn.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A description declares a security scheme as a value entry tagged with a subtype of
service.security_scheme, http_auth or api_key, and an http projection or an endpoint names schemes
in security, references the resolver judges at load and delivers: a list is alternatives, an
endpoint's replaces the projection's, an explicit empty list is open and an absent one inherits.
Nothing enforces a scheme yet; the backlog carries the 401 at the error boundary. An endpoint's
response_headers map a header to an RFC 6570 level-1 template over its response type's fields, or
a literal, checked at startup against the response type as a request placement is; the demos set
the declared headers and the conformance test holds every success reply to them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…st RFC 9880

proposal/affordances.md judges SDF's affordance kinds by their value to HTTP services: a property
kind is not proposed, being a grouping over two exchanges the layer already states; an event kind
is adopted later, as a stream endpoint kind composing service.endpoint and an optional events
namespace beside exchanges, with OpenAPI 3.2's sequential media types as the HTTP-native witness;
a live namespace of objects at a deployment is sketched as a discovery surface and kept open.
AffordanceProbeTest measures each shape in a layer of its own, including the concrete-path key
family and an instance read as data. One library gap found: a data document importing two
schemas throws at a reference through a record value's field, staged as an UPSTREAM item.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…oward

@service.destructive is the third fact a caller composing calls needs beside safe and idempotent: an
effect a caller cannot undo and should confirm first. It excludes @service.safe, is derived from no
verb, and the http projection refuses a destructive exchange at GET or HEAD; a route carries all
three facts. The backlog's tool-manifest item becomes an LLM-facing projection of a protocol, and
CLAUDE.md, the service-description note and the agent experiment state the aim: service
capabilities a model integrates with better than today's conventions allow, with the Model Context
Protocol and RFC 9880 as design input rather than targets, no JSON Schema emitted and no MCP
implemented as it stands.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…scription's subtype

ReferenceBody is RefBody. The operation-refinement probe measures a description's own
endpoint shape: the subtype is admitted at the layer's slot and binds to the base's class
once it is bound, so UPSTREAM.md's entry narrows to the untagged refusal's hint, and the
proposal's first reason becomes the binding cost. The dependent-field and annotation-value
spec feedback is filed upstream and retired here; item 4 states the ruling.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
header_name and auth_scheme fold under ASCII_CASEFOLD, so a fullwidth or long-s spelling
stays outside the token grammar; a header-borne api key is held to it. service.endpoint and
service.security_scheme are abstract, the resolver refusing an untagged value naming the
subtypes, and TsonApiDescription refuses a projection the library held as a tree rather than
serving it with routes missing (UPSTREAM.md). problem.details.errors is optional and status is
problem.status, 100 to 599. The docs state the no-response status rule, the varname grammar,
and the parts of policy.processor a descriptor carries. design/http-projection.md takes the
HTTP side of design/service-description.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rives by `&`

The probe pins a bare `operation ^ { … }` as the parse error naming the composition and
`!operation ^ { … }` as the resolver error, and measures that a composition adds a field the
base's bound class then lacks. The proposal, the notes and the experiments spell record
derivation as composition, meta.namespace among them, and the authoring note states that a
restated field may take a pin with its name marked.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s extern's return condition

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A path is where the schema stops and HTTP begins: a server matches it and nothing references
it, so it is text held as written, ASCII-exact by an I-Regexp pattern over RFC 3986's path
characters, a percent octet and an RFC 6570 expression, and no identifier family bent to start
with a slash. A protocol's exchanges stay a namespace, since a binding walks into it. Http reads
the map in written order.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…resolved form

Stated once in the JSON encoding note and pointed at from the authoring note and the traps: a
construction, an application, a composition, a refinement or a completion exists only in schema
syntax, a JSON body carries the value it resolves to, and a new schema-side form needs no JSON
spelling.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…at a value slot

A value entry reached by meta.ref is the alias half; the proposal is the other half, a base
written `!R ^ { values }` and completed `!base ^ { … }` where a value stands, nothing replaced,
the resolved form flat. The probe pins what the grammar does today with each spelling and that
open construction over meta.array already works end to end. The operation-refinement proposal
points at it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… follows it to its landing

A description externs order from two versions and binds each at its own path; every judgement of
a payload, an error's fixed status, a response header template, placement and a dependent field,
is made of the record the extern lands on, in the foreign schema. Payload types are named by their
declaring schema and warmed by what the binder is asked; TsonBindings.bySchema binds two versions
in one context; a binding keyed by an extern's local name is refused at startup. Referenced
schemas walk dependencies, and the codec's kernel filter passes the namespace through. UPSTREAM.md
stages the JSON bind registry refusing a namespace component and drops the extern feedback, which
landed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Split service-description.md into the layer and service-reader.md (the reader, externs, wiring, coverage and
business errors), and status-classification.md into the status mapping and name-policy.md (name hygiene and the
processor policies), each under the budget. Prune history phrasing from the remaining notes; cite an UPSTREAM.md entry
by title everywhere.

scripts/check-doc-references.sh holds every citation of a note, a section, a test or an UPSTREAM.md entry to something
that exists, and the pre-commit hook runs it beside the line-length check. CLAUDE.md gains the recurring tasks and the
project agents under .claude/agents/ (doc-editor, code-editor, reviewer), which carry the conventions; settings.json
allows the read-only commands and the build clone's git operations sessions use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t, at every hop

Landed.entries() answered a name with the definition it lands on and dropped the landing, so a
name that definition writes was looked up in the namespace the lookup started from: a request
field typed by an extern of an array declared in a third schema had its element type resolved in
the request record's schema, found as nothing and admitted, or as another entry of that name.
RequestPlacement carries the landing with each definition instead, and entries() is gone. The
landing's namespace is enough where its schema holds the entry by import, since an import merges
the declarer's whole namespace and refuses a redefinition, so no registry lookup is made.

TsonApiDescriptionExternTest holds it over a third schema, tags-1.tn: an array of records refused
in the query, an array of scalars admitted, an array the landing holds by import, and a response
header's field. The notes state the rule at every hop. BACKLOG.md drops the entry and gains one
found on the way: a plain alias reaching no extern lands on its alias.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…'s types are reached

A request, a placed field, an array element, a response-header record and an
error type named through a plain alias are judged as the entry the alias
reaches past every hop (Landed.pastAliases), so an alias of a record is no
scalar in the path and a request aliasing a record is placed as that record.
The name the binder is asked stays apart from the shape question; a plain-alias
payload type is still named as written though a TSON read asks for its target,
which BACKLOG.md records as the next fix and a test pins as it stands.

UpstreamGapsTest pins the three halves of the UPSTREAM.md entry on reaching a
dependent field's admitted types through casts and catches: no vocabulary
predicate on the name binder, no by-name answer to whether a type binds, and
no accessor for the types a dependent field admits. The entry is corrected
where it had drifted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The sibling closed Revision 40 and merged it to main. This follows its
close-out:

- ScriptPolicy is TokenPolicy and IdentifierPolicy is flat; policy.tn's
  script_policy is token_policy, and TsonDeployment.Policy.Scripts is
  Policy.Tokens. The wire shape is unchanged.
- meta.field_name is gone from the kernel, so service.tn types an endpoint's
  query, header keys and body by meta.identifier.
- A record with parameters is a parametric record: tests, fixtures, Javadoc,
  notes and proposals take upstream's word, and URI, path and header templates
  keep theirs.
- Refusal wording and the section a restatement is cited under (§5.8) follow
  upstream in the tests that assert them.
- A namespace's key type may not admit '.', so no path holding a dot keys a
  namespace. The namespace-fields probe keys by a dotless family and shows a
  reference quoted whole reaching a path key; the affordances probe asserts the
  refusal, and the proposal records it as a cost and an open question.
- UPSTREAM.md: the kind-slot entry is cut to its open half, a tagged
  application, and the annotation entry to the schema-document case the spec
  now rules. No pin flipped.
- The orientation notes name the published revision, and the README's
  deployment-descriptor paragraph states the current contract.

Clean build with every test, the published-artifacts build and Javadoc
verified against the sibling's main.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@oobles
oobles merged commit d5d307b into main Nov 24, 2026
1 check passed
@oobles
oobles deleted the r2026-40-proposal branch November 24, 2026 00:50
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