The write path (use cases, unit of work, optimistic locking, outbox)
Status: M2a. Adopts the use-case envelope of the FlowCatalyst SDKs (Go pkg/fcsdk/usecaseop):
validate, authorize, execute returning a plan, and one runner that applies the plan atomically.
What this contract adds: optimistic locking, a declared conflict policy, client scoping, and the
local outbox. Build-time SQL checking is M2b and has its own contract.
1. Aggregates
Section titled “1. Aggregates”An aggregate is a record implementing Aggregate:
| Method | Meaning |
|---|---|
id |
its id, a typed id record |
client |
the ClientId it belongs to (design rule 8) |
version |
long; 0 for an aggregate not yet stored |
The aggregate holds what its rules need to decide (framework-plumbing.md section 7). Methods that change it return a new value; they do not write anything. Child collections belong to the aggregate: they are saved with it and covered by its version.
2. Repositories
Section titled “2. Repositories”Written by the application, with explicit SQL. A repository for aggregate A:
| Operation | Runs in | Contract |
|---|---|---|
find(db, client, id) |
no transaction (reads) | returns Optional<A>; filters by client_id; db is the Database instance, id the aggregate’s typed id (Repository<I, A>) |
insert(tx, a) |
the attempt’s transaction | stores a with version 1 |
update(tx, a) |
the attempt’s transaction | updates the root row with SET version = <a.version + 1> … WHERE id = ? AND client_id = ? AND version = <a.version>, then writes children; returns the root update’s row count |
delete(tx, a) |
the attempt’s transaction | DELETE … WHERE id = ? AND client_id = ? AND version = ? (children by cascade or explicitly); returns the root delete’s row count |
The runner calls insert when version == 0 and update otherwise. A row count of 0 from
update or delete means the aggregate is stale: someone else committed a change since it was
loaded. A count above 1 is a bug and fails the attempt as INTERNAL.
A unique-constraint violation (SQLSTATE 23505) from any write fails the use case as CONFLICT
with code UNIQUE_VIOLATION and the constraint name in the details. It is not retried.
3. Use cases
Section titled “3. Use cases”A use case is defined once, with:
| Part | Required | Contract |
|---|---|---|
| name | yes | [a-z][a-z0-9-]*, for logs and the audit row |
| validate | no | checks the command’s shape without loading data; returns Optional<UseCaseError> |
| authorize | yes | resource-level access check; returns Optional<UseCaseError>. Authorize.PUBLIC declares an operation deliberately open. A use case built without one fails when it is defined (the builder’s execute(...) is the last call and throws IllegalStateException). |
| execute | yes | loads what it needs (once), applies the rules, returns a Decision: Plan or Rejected(UseCaseError) |
| load, authorizeLoaded | no (amendment 2026-10-18, friction F1) | for a use case that works on one stored record: load(Load<C, L>, whenMissing) finds it once per attempt, authorizeLoaded(LoadedCheck<C, L>) is the record-level access check, and execute then receives the record: LoadedExecute<C, L, E>. See “The load phase” below. |
| conflict policy | no | ConflictPolicy.fail (default) or ConflictPolicy.retry(maxAttempts, backoff) |
Each phase receives the Context and the command. Load once: execute finds each aggregate
once. If it needs fresh state, the attempt has failed and runs again from the start.
Plan: what to write. Built with Plan.save(aggregate, repository, event),
Plan.delete(aggregate, repository, event), Plan.emit(event), and .andSave(...),
.andDelete(...), .andEmit(...) to add further aggregates and events. Every plan carries at
least one event; the first is the use case’s result. Events are written in step order.
Amended 2026-11-07 (early-adopter fixes A2, A3):
- Append-only rows.
plan.andAppend(row, Appender<R>)(Gousecase.Append(row, appender)) adds a row that is only ever inserted. The runner writes it in the attempt’s transaction in plan order: right after the steps added before it, before the steps added after it (step 5 of section 4, still step codePERSIST). It is never version-checked, produces no event, and is never the audit row’s subject (section 7 still takes the first aggregate, else the first event’s subject). A plan of appends only is refused. Java refuses it when the plan is built (IllegalArgumentExceptionnaming it; an append follows a step, and a plan whose only step is anEmitis valid). Go refuses it when the plan runs (INTERNAL/APPEND_ONLY_PLAN, logged as a bug: the appends belong to an aggregate change), allows an append before the first aggregate step, and itsAppender[R]hasAppend(ctx, tx, row)with no client argument (the row carries its own client; the runner checks aggregates only). An appender’s error fails the attempt as a repository’s does (23505isUNIQUE_VIOLATION). Use an aggregate for anything loaded, changed or deleted later; use an append for rows only ever inserted. Authorize.SERVICE(andAuthorize.requireService(context)for use inside a check; Gousecase.RequireService(cx)): granted only when the context has a principal of kindSERVICE, elseAUTHORIZATION/SERVICE_REQUIRED.Context.ofService(client, principal)(Gofw.ServiceContextFor) builds such a context for an inbound webhook with no platform principal.
3a. The load phase and the record-level check (amendment 2026-10-18)
Section titled “3a. The load phase and the record-level check (amendment 2026-10-18)”authorize sees the command and the context only; a rule that depends on the stored record (“a
requester may comment only on a ticket they opened”) used to live inside execute as a rejection,
away from the other access checks. A use case that works on one record can say so:
UseCase.named("add-comment", AddComment.class, TicketCommented.class) .validate(...) .authorize(requires(Permissions.COMMENT)) // permission-level, no record yet .load((ctx, cmd) -> tickets.find(db, ctx.client, new TicketId(cmd.ticketId)), TICKET_NOT_FOUND) .authorizeLoaded((ctx, cmd, ticket) -> ...) // record-level, optional .execute((ctx, cmd, ticket) -> ...); // gets the record that was checkedOrder inside one attempt: validate, authorize, load, authorizeLoaded, execute. Rules:
loadruns once per attempt, afterauthorize, so a caller who is refused at the permission level never causes a read. A conflict re-runs the attempt from step 1, so the record is loaded and checked again (the retry reads the other writer’s change).loadreturnsOptional<L>. Empty ends the run with thewhenMissingerror given toload(conventionallyNOT_FOUND);authorizeLoadedandexecutedo not run. The repository’sfindalready filters by client, so another client’s record is missing.authorizeLoadedreturns an error or empty, likeauthorize; its error is the result (kindAUTHORIZATIONby convention) andexecutedoes not run. It is optional (in Go it is part of the use case’s type and “none” is written explicitly, so it cannot be skipped by accident). The check chooses its error: a rule that must not reveal that the record exists answers withwhenMissing’s error instead of an authorization error.- A throwing
loadisINTERNALwith codeLOAD, a throwingauthorizeLoadedisINTERNALwith codeAUTHORIZE, as for the other phases: the cause is logged, never put in the message. - A use case with a load phase still needs
authorize(orAuthorize.PUBLIC); the load phase is additional, never a replacement. Defining one without fails as in section 3. - The loaded value is a plain value of the application’s type; the runner does not look at it. The plan still has to hold aggregates of the context’s client (section 4, step 3).
4. Running a use case
Section titled “4. Running a use case”UseCases.run(useCase, context, command) returns UseCaseResult<E>: Committed(E event) or
Failed(UseCaseError). It never throws for an expected outcome. One attempt:
- validate, then authorize; the first error is the result.
- execute (with a load phase: load, then the record-level check, then execute; section 3a);
Rejectedis the result. - Check every aggregate in the plan belongs to
context.client. A mismatch fails asINTERNALwith codeCROSS_CLIENT_WRITEand is logged as a bug. A plan of appends only fails asINTERNAL/APPEND_ONLY_PLAN(section 3, amended 2026-11-07), also logged as a bug. - Begin a transaction (READ COMMITTED) on the default database instance.
- Apply the plan’s writes in order, then write each event to the outbox, then one audit row.
- Commit.
Outcome of a failed write:
| Failure | Result |
|---|---|
| stale aggregate (row count 0) | conflict: apply the policy |
SQLSTATE 40001 or 40P01 (serialization failure, deadlock) |
conflict: apply the policy |
23505 |
CONFLICT / UNIQUE_VIOLATION, not retried |
| any other exception from a phase, a repository or the database | INTERNAL, code naming the step (VALIDATE, AUTHORIZE, LOAD, EXECUTE, BEGIN, PERSIST, PUSH (a push to clients, push contract section 2), OUTBOX, AUDIT, COMMIT); the cause is logged, never put in the error message |
| a plan with another client’s aggregate | INTERNAL / CROSS_CLIENT_WRITE (step 3), not retried |
| a plan of appends only (no aggregate step) | INTERNAL / APPEND_ONLY_PLAN (step 3), not retried |
| the thread is interrupted while waiting between attempts | INTERNAL / INTERRUPTED, the interrupt flag is restored |
Every failed attempt rolls back fully. Conflict policy: fail returns CONFLICT with code
STALE_AGGREGATE. retry(n, backoff) runs the whole use case again from step 1, up to n
attempts in total, waiting backoff (with jitter) between them; when attempts run out, the result
is CONFLICT / STALE_AGGREGATE. n is 2 to 10.
Application code never begins, commits or rolls back a transaction, and never writes outside a plan in a use case.
4a. Running inside the caller’s transaction (amendment 2026-10-18, friction F13)
Section titled “4a. Running inside the caller’s transaction (amendment 2026-10-18, friction F13)”UseCases.run(useCase, context, command, Tx joined) runs the same attempts on the caller’s
connection instead of opening its own, so a use case composes with work that owns the transaction
(DispatchDelivery.once, which hands its work an open connection).
joinedisTx.of(connection)for a connection in a transaction (auto-commit off); anything else is anIllegalArgumentException(a programming error, not an outcome).- Steps 1 to 3 of section 4 are unchanged. Steps 4 to 6 become: take a savepoint, apply the plan’s
writes, the events and the audit row on the caller’s connection, release the savepoint. The
runner never begins, commits or rolls back the caller’s transaction;
Committedmeans “applied in your transaction”, visible to others when the caller commits and gone if the caller rolls back. - A stale aggregate, a serialization failure, a deadlock, a unique violation or any other failed step rolls the attempt back to the savepoint: the caller’s earlier work in the transaction survives and the transaction stays usable. The result and the conflict policy are those of section 4. A retry runs the whole attempt again on the same transaction.
- The isolation level is the caller’s. Retrying a conflict assumes READ COMMITTED (what
onceuses): under a stronger level the retry would read the same snapshot and conflict again. - What does not join: reads a use case makes through its repository’s
find(db, ...)use the database’s own connections, so they do not see the caller’s uncommitted writes; and anything that is not the database. An HTTP call, an email or a message send is outside every transaction and is not made atomic by this: make such a call idempotent (the dispatch job id is the key).
5. Errors
Section titled “5. Errors”UseCaseError: kind, code (UPPER_SNAKE), message (safe to show a caller), details (string
map). It implements core’s ServiceError (MA item 8; http contract section 1), which is what the
HTTP layer maps, so framework-http does not depend on this module. Kinds and their HTTP status,
the same as the SDKs:
| Kind | Status |
|---|---|
VALIDATION |
400 |
AUTHORIZATION |
403 |
NOT_FOUND |
404 |
CONFLICT |
409 |
BUSINESS_RULE |
409 |
INTERNAL |
500 |
6. Events
Section titled “6. Events”A domain event is a record implementing DomainEvent, carrying EventMetadata and its own data
fields. Metadata, as in the SDKs:
| Field | Rule |
|---|---|
| event id | a TSID, generated |
| spec version | 1.0 |
| type | {application}:{domain}:{aggregate}:{action} |
| source | {application}:{domain} |
| subject | {domain}.{aggregate}.{id} |
| time | from the injected InstantSource |
| correlation id, principal id | from the Context |
| causation id, execution id | from the Context when present (M2a added both to Context, see core.md section 3) |
| message group | {domain}:{aggregate}:{id} by default |
The data payload is the record’s own fields as JSON (Jackson 3, records only).
7. The outbox
Section titled “7. The outbox”Events and audit rows are written to the outbox_messages table in the same transaction as
the aggregate. The table and the payloads are exactly those of the FlowCatalyst Java SDK
(flowcatalyst-go/clients/java-sdk: migrations/postgresql/001_create_outbox_messages.sql,
JdbcOutboxDriver, CreateEventDto, CreateAuditLogDto), so that in M3 the platform’s outbox
processor reads them unchanged:
-
the migration is the SDK’s file, byte for byte, contributed by the framework’s outbox module (module id
outbox). The framework’s migration runner needs the nameV0001__..., so the file is stored asV0001__create_outbox_messages.sql; the content, and so the recorded checksum, is that of the SDK’s001_create_outbox_messages.sql. An application that already ran the SDK’s migration by other means has the table; it must not also run this module’s migration; -
an event row has type
EVENT, the event’s message group, theCreateEventDtoJSON payload, status0, andclient_idset; -
the audit row has type
AUDIT_LOGand theCreateAuditLogDtoJSON: entity type and id from the first aggregate (or the event subject), operation = the use case name, principal, time, correlation id, client. Command data is included only when the command implementsAuditData, which returns the map to record. -
clientCodein both payloads is theClientIdvalue. (In FlowCatalyst mode the client id is the platform client’s identifier.) Amended 2026-11-18: not when the context’s client isClientId.PLATFORM(_platform): then neither payload has aclientCodemember, as a dispatch job (7a) and a push (push contract, amendment 17.17) of that context have none. The row’sclient_idcolumn is still theClientIdvalue. -
The SDK’s event payload has no field for the event time, the principal or the execution id. The row carries the event id as
deduplicationId, and the principal and execution id ascontextDataentries (principalId,executionId) when present; the event time is not sent (the platform stamps it on ingest;created_atof the row is the write time). -
The SDK’s table has
client_id VARCHAR(26), but aClientId(a platform client identifier,VARCHAR(100)in the platform) may be up to 100 characters. The outbox module’s second migration,V0002__widen_outbox_client_id.sql, widens the column toVARCHAR(100); the first stays byte-identical to the SDK file. The platform’s outbox processor does not readclient_id. -
Added 2026-11-06 (the operator): when the
Contexthas an actor (core contract section 3), the platform’s DTOs have no field for it, so it rides in what is open. The event row’scontextDatagainsoperatorIdandoperatorType(afterprincipalId, beforeexecutionId); the audit row’soperationDatagainsoperatorIdandoperatorTypeafter the command’s own data (and the audit row has anoperationDataeven when the command has none).principalIdstays the subject (the worker). Without an actor nothing changes, byte for byte: the existing conformance vectors are unchanged. An app’s audit trail then reads “done byoperatorIdas workerprincipalId”. -
Added 2026-11-18 (no
clientCodefor the platform’s context):_platformis no platform client’s identifier (core contract section 3), so a payload naming it named a client the platform cannot resolve. The platform’s events batch (flowcatalyst-goResolveEventClient, read 2026-11-18) keeps an anchor credential’s event with an unknown code platform-scoped and refuses the whole batch with403for any other credential; its audit batch answeredSKIPPEDfor such an entry and stored nothing, and its outbox processor deleted aSKIPPEDrow as delivered, so the audit row of every use case run in the platform’s context (a scheduled job’s sweep, a receiver run whose delivery named no client, a request whose principal has no client) was lost. Without the member the platform stores the event and the audit row platform-scoped for an anchor (and, for an event, under the credential’s one client for a credential confined to one). Rule, for every implementation: the event payload’sclientCodeand the audit payload’sclientCodeare written exactly when the context’s (the entry’s) client is notClientId.PLATFORM, in the same place as before (the event’s aftermessageGroup, the audit row’s last); nothing else changes, byte for byte. The vectors’ platform-context cases (conformance/outbox/outbox.json“dispatch jobs in the platform’s context: no clientCode”,outbox-push.json“pushes in the platform’s context: no clientCode”) have the event and audit rows without the member, andpayload_size25 bytes smaller. A client the application chose that the platform does not know (any code other than_platform) is still written as it is: that is the application’s choice ofClientId, against this section’s rule that it is a platform client’s identifier. Built in Go first (go/usecase/outbox.go, 2026-11-18), then in Java the same day (OutboxWriter, the event and audit payloads):OutboxConformanceTestwith-Dconformance.update=truewritesoutbox.jsonbyte for byte as it was edited for Go (outbox-push.jsonis Go’s, push contract 17); and in Rust the same day (fw-usecaseoutbox.rs,EventPayloadandAuditPayload, whoseclientCodeis optional), whose outbox vector test compares these rows.
Nothing in M2 reads the outbox; delivering it is the platform’s job (M3).
7a. Dispatch-job rows (MA item 4, 2026-10-10)
Section titled “7a. Dispatch-job rows (MA item 4, 2026-10-10)”A plan may also carry dispatch jobs: plan.andDispatch(DispatchJob). They are written to
outbox_messages in the same transaction as the aggregates, events and audit row (after the events,
before the audit row), and the platform’s outbox processor delivers them to
POST /api/dispatch-jobs/batch. A plan still needs at least one event; dispatch jobs never replace
it. Only the runner writes them.
Facts this section is built on (platform Go source, read 2026-10-10):
- The processor claims rows with
status = 0ordered bymessage_group, created_at, maps thetypecolumn to an endpoint by exact string (DISPATCH_JOB→/api/dispatch-jobs/batch;internal/common/outbox.go), and sends each row’spayloadtext unchanged as one element of{"items":[...]}(internal/outbox/http_dispatcher.go). It never readsclient_id,headersorpayload_size;message_groupis used only for per-group FIFO and is not copied into the body. Results are positional. A whole-batch400is terminal (BAD_REQUEST) and blocks a grouped row’s group. - The batch item (
internal/platform/shared/sdk/dispatch_jobs_batch.go,BatchItem) has exactly:id, externalId, kind, code, source, subject, targetUrl, payload, payloadContentType, dataOnly, eventId, correlationId, clientId, subscriptionId, serviceAccountId, dispatchPoolId, messageGroup, mode, sequence, timeoutSeconds, maxRetries, metadata, queue, descriptor(and, read again 2026-11-07,clientCodeafterclientId,connectionIdandidempotencyKeyat the end). Unknown keys are ignored silently;metadatais an array of{"key","value"}(an object fails the whole batch with400 INVALID_JSON, which is what the SDKs’ object-shapedmetadatadoes today). Platform defaults:kindEVENT,payloadContentTypeapplication/json,dataOnlyfalse,modeNEXT_ON_ERROR,sequence0 → 99,timeoutSeconds0 → 30,maxRetries0 → 3 (so an explicit 0 cannot be sent for those three).targetUrlmust be an absolutehttp(s)URL with a host and no user info (the platform’s SSRF guard may refuse more, such as loopback addresses).sourceandpayloadareNOT NULLcolumns although the item fields are optional, so leaving them out fails the insert. - Column limits (
msg_dispatch_jobs): ids (id,eventId,clientId,subscriptionId,serviceAccountId,dispatchPoolId)VARCHAR(17);code,source,subject,externalId,correlationId,messageGroup,queue,descriptorVARCHAR(255);payloadContentTypeVARCHAR(100). clientIdis stored as given (a platform client id, at most 17 characters). (2026-11-07: the batch endpoint now also acceptsclientCode,connectionIdandidempotencyKey; see the amendment below the payload.)- The insert is
ON CONFLICT (id, created_at) DO NOTHINGwithcreated_atset at ingest, so a redelivered batch can create a second job row; the receiver’s at-least-once rule covers it.
The row:
| Column | Value |
|---|---|
id |
the job’s id (below) |
type |
DISPATCH_JOB |
message_group |
the job’s message group, or null |
payload |
the batch item JSON below |
status |
0 |
client_id |
the context’s ClientId (as for event rows; the processor does not read it) |
payload_size, headers, created_at, updated_at |
as for event rows (headers null) |
The payload is the batch item. Written always: id, kind, code, source, targetUrl,
payload, payloadContentType, dataOnly, correlationId (the context’s). Written only when set:
subject, externalId, eventId, clientId, clientCode (below), subscriptionId,
serviceAccountId, dispatchPoolId, messageGroup, mode, sequence, timeoutSeconds,
maxRetries, metadata (array form, insertion order, only when not empty), queue, descriptor,
connectionId, idempotencyKey, in that order (the batch item’s). Never written, because the
batch endpoint ignores them: headers, retryStrategy, scheduledFor, expiresAt, causationId.
Amended 2026-11-07 (early-adopter fixes A1; platform Go source read the same day:
dispatch_jobs_batch.go, client_code.go, job_connection.go, dispatchjob/keys.go,
internal/server/delivery_creds.go):
clientCodeis the context’sClientIdvalue, written right after whereclientIdgoes, when the job has noplatformClientIdand the context’s client is notClientId.PLATFORM(_platform). The platform resolves it as the events batch does (ResolveJobClient: an explicitclientIdwins; an unknown code is400 CLIENT_NOT_FOUNDfor an anchor caller and403for others, each refusing the whole batch) and delivers the job withX-FlowCatalyst-Clientand the envelope’sclientCode, so the receiver’s context is that client (flowcatalyst contract section 4).idempotencyKey(DispatchJob.Builder.idempotencyKey): not blank, at most 100 bytes of UTF-8 (the platform’s limit, counted in bytes after trimming). The platform keeps a key 7 days (JobKeysRetention), scoped by the application (the code’s first segment) and the client; a later item naming a held key creates nothing and is answered with the holding job’s id. Never derived fromexternalId: a shared reference must not silently merge two jobs.connectionId(DispatchJob.Builder.connectionId): a platform id ([0-9A-Za-z_-]{1,17}). The platform refuses the whole batch when it does not exist (CONNECTION_NOT_FOUND), is outside the job’s client or application (CONNECTION_SCOPE_MISMATCH), or the job’s subscription has another connection (CONNECTION_MISMATCH). A paused connection holds the job.- Who signs the delivery (the platform’s order, first that names an account decides): the
subscription’s own service account; the subscription’s connection’s account; for a job with no
subscription, its own
connectionId’s account; otherwise the oldest active service account of the application named by the code’s first segment; otherwise the delivery goes out unsigned with a reason on the attempt.
DispatchJob (a record, built with DispatchJob.builder(code, targetUrl)) is validated when built
(IllegalArgumentException), so a row the platform would refuse terminally is never written:
code:{application}:{rest}, the application segment[a-z][a-z0-9-]*, at most 255 characters (the platform confines an application-scoped caller by this first segment).targetUrl: absolutehttporhttpsURI with a host and no user info.source: default the code’s application segment; 1 to 255 characters.- payload:
payload(text, contentType)orjsonPayload(value)(the framework’s Jackson 3 mapper, content typeapplication/json); default the empty JSON object{}(the column isNOT NULL). kind:EVENTorTASK, defaultTASK(ruling taken: a job the application creates itself is a task; the platform’s own default,EVENT, describes jobs fanned out from events).dataOnlydefault false (the platform envelope, which the framework’s receiver understands).id: optional,[0-9A-Za-z_-]{1,17}; when absent the writer generates a 13-character TSID. The id is in the payload, so a batch the processor sends again after a lost response creates a job with the same id, and the receiver’sDispatchDelivery.once(keyed on the job id) runs the work once.- platform ids (
eventId,subscriptionId,serviceAccountId,dispatchPoolId,connectionId,platformClientId→clientId):[0-9A-Za-z_-]{1,17}.platformClientIdis the platform’s id, never derived from theContext: the framework’sClientIdis a client code, which goes inclientCodeinstead (amendment above). Without either the job has no client, and with no pool named the platform usesplatform-DEFAULT-POOL. messageGroup,externalId,subject,descriptor: 1 to 255 characters.mode:IMMEDIATE,NEXT_ON_ERROR,BLOCK_ON_ERROR.queue:DEFAULTorHIGH_PRIORITY.sequence,timeoutSeconds,maxRetries: at least 1 when set.metadata: keys not blank, at most 100.
Sink gained writeDispatchJobs(tx, context, jobs), a default method that throws; a Sink that does
not support dispatch jobs fails the attempt at step OUTBOX when a plan carries one.
Amended 2026-11-07 (early-adopter port, item 16; the platform now takes these fields, verified in
flowcatalyst-go internal/platform/shared/sdk/dispatch_jobs_batch.go, client_code.go,
job_connection.go and internal/server/delivery_creds.go):
- The job’s client. When the job has no
platformClientIdand the context’s client is not the platform client (_platform), the item carriesclientCode: the context’s client, written right afterclientId’s place. The platform resolves it to its client (ResolveJobClient): an unknown code, or one the caller may not reach, refuses the whole batch (400 CLIENT_NOT_FOUNDfor an anchor,403otherwise), so a framework application’s clients must exist on the platform. An explicitplatformClientIdwins and noclientCodeis written. A job that names a client is delivered withX-FlowCatalyst-Client: {clientId}:{clientCode}(andclientId/clientCodein the envelope), so the receiver runs its handler in that client’s context (flowcatalyst contract section 4b); a platform-scoped job is delivered without them and runs for_platform. connectionId(optional,[0-9A-Za-z_-]{1,17}): the connection the job is delivered through. Pausing the connection holds the job; with no subscription, the connection’s service account signs the delivery. The platform refuses the batch when the connection does not exist, is outside the job’s client and application, or is not the subscription’s own connection. Without it (and with no subscription) the platform signs with the oldest active service account of the application named by the job code’s first segment (delivery_creds.go, step 3), and sends the delivery bare when that application has none.idempotencyKey(optional, not blank, at most 100 bytes of UTF-8): the first job to name a key within its application (the code’s first segment) and client is created; a later item naming it creates nothing and answers the first job’s id. The platform keeps keys 7 days. It is set explicitly only, never derived fromexternalId: two jobs that share an external reference must not merge silently.- Payload order:
... correlationId, clientId, clientCode, subscriptionId, ... queue, descriptor, connectionId, idempotencyKey(the platform’sBatchItemorder for the two new fields). The conformance vectorconformance/outbox/outbox.jsonhas a client’s jobs withclientCode, a job with both new fields, a platform-scoped job withoutclientCode, and the builder’s refusals of the new fields.
Platform work found
Section titled “Platform work found”The dispatch-jobs batch should accept: done on the platform; the writer sends it since 2026-11-07.clientCodeand resolve it- The Java, TypeScript and Laravel SDKs write
metadataas an object, which the batch endpoint rejects with400for the whole batch, and write fields the endpoint ignores (headers,retryStrategy,scheduledFor,expiresAt,idempotencyKey,connectionId), and their defaultmaxRetriesis 5 against the platform’s 3. Reported; the framework does not copy them.
8. Ids
Section titled “8. Ids”Ids (core) generates TSIDs: 13 Crockford base-32 characters, time-ordered, optionally with a
prefix (ord_0ABC...). Monotonic within one Ids instance (the framework provides one per application): when the clock
does not advance or goes backwards, the generator continues from the last value instead of
repeating or going back; more than 4096 ids in one millisecond borrow the next one.
9. Reads
Section titled “9. Reads”Outside use cases, screens and lists read through plain typed queries on the database instance; they do not load aggregates. M2a provides a small JDBC helper (prepare, bind typed values, map rows to records); M2b replaces hand-written mapping with generated code.
Conformance vectors (2026-10-18)
Section titled “Conformance vectors (2026-10-18)”conformance/usecase/scenarios.json (54 scenarios, written by UseCaseScenariosConformanceTest against
PostgreSQL): the phase order and which phases run (section 3a), conflicts under fail and retry,
SQLSTATE 40001, 40P01 and 23505, every step code (VALIDATE through COMMIT, BEGIN included),
CROSS_CLIENT_WRITE, INTERRUPTED, and the joined runs of section 4a (commit and rollback by the caller,
the savepoint, a retry on the caller’s transaction, the auto-commit argument error). The sink’s events stand for
the outbox rows (outbox/outbox.json covers the rows themselves). Not in the contract and not in the vector:
the joined run names its savepoint-release step SAVEPOINT, and a repository that affects more than one row is
INTERNAL/PERSIST. The codes PERMISSION_REQUIRED and NOT_AUTHORIZED do not exist in the Java framework
(Authorize is an application check; the application picks the error), so the vector has no such case.