ID |
|
|---|---|
Status |
Backlog |
Bucket |
docs |
Priority |
5 |
Theme |
runtime-connection |
Created |
2026-10-27 |
Updated |
2026-10-27 |
The user manual documents the owned-connection engine as the primary path
Goal
A consumer who reads the user manual learns to wire graphitron the way the project recommends: the owned-connection engine, where graphitron pins one connection per GraphQL operation, mounts the caller’s identity on it, and owns its transactions (Graphitron.runtime(dataSource, dialect), runtime.newGraphQL(schema), Graphitron.newOwnedExecutionInput(...)). Today the manual’s runtime pages describe only the escape hatch, where the consumer passes its own DSLContext per request (Graphitron.newExecutionInput(dsl, ...)). The owned engine, session identity, a rejected identity’s SessionMountException, and the graphitron-jakarta-rest adapter are documented only under docs/architecture/ or in javadoc. After this item the manual states the current behaviour of connection handling, including what R1097 shipped, and gives the owned path one consumer-facing home that later runtime changes (R1101’s per-field transaction scope among them) extend rather than work around.
Findings
Audited on 2026-10-27 against trunk at 89cde0450. R1097 and R1055 were Done, and R1101 was In Progress with no code landed.
Out of date now
-
manual/reference/runtime-api.adocpredates the owned-connection engine. -
The
Graphitronfacade listing shows onlybuildSchema, whileGraphitronFacadeGeneratoralso emitsruntime(...),newGraphQL(...)andnewOwnedExecutionInput(...). -
GraphitronContextis described as "populated by `Graphitron.newExecutionInput(...)`". -
The
getDslContextlisting shows a one-lineGraphQLContextread. The emitted method (GraphitronContextInterfaceGenerator) routes through the per-operation connection carrier (OwnedConnections) and falls back to a suppliedDSLContext. -
"Three hand-written-feeling classes" undercounts what is emitted.
-
The page never links to
architecture/reference/runtime-extension-points.adoc, the only place the owned path is described. -
The same escape-hatch-only framing elsewhere.
quick-start.adoc("the emittedbuildSchema/newExecutionInputsurface"),manual/explanation/how-it-works.adoc(the fetcher reads theDSLContextthatnewExecutionInput(dsl, ...)populated), andmanual/explanation/batching-model.adoc. -
manual/how-to/test-your-schema.adocteaches testing through the escape hatch only (GraphQL.newGraphQL(schema)plusnewExecutionInput(dsl, ...)). Tests written this way never exercise identity mounting or graphitron’s transaction boundaries, so they diverge from production on exactly the behaviour R1097 and R1101 change. It needs an owned-path variant, built over aDataSourcethe waygraphitron-sakila-example’s `SakilaGraphitronApplicationwires it. -
manual/reference/mojo-configuration.adocยง The seam parameter: "A throwingmountevicts the connection … and fails the request before any of your query’s SQL runs." -
It should name
SessionMountExceptionand linkruntime-extension-points.adoc#rejected-mount. -
"Before any of your query’s SQL runs" is not true across tenants: on a multi-tenant mutation, a field routed to a tenant whose mount succeeded may already have committed.
tenant-scoping.adocalready states this correctly. -
graphitron-jakarta-resthas no manual page. -
The
GraphitronApplicationseams (newExecutionInput,engineBuilder,newReference,redactedMessage, and R1097’sclientFault) are documented in javadoc andruntime-extension-points.adoconly. -
The same holds for the
ChainedInstrumentationadvice: a later.instrumentation(...)on the engine builder silently replaces graphitron’s connection instrumentation. -
manual/how-to/error-channel.adocis the only manual page that mentions the module. It says a fault can occur "whennewExecutionInputopens a connection", but on the owned path no connection is opened until a field needs one. -
The MCP
executetool’s rollback promise.manual/how-to/mcp-agent-context.adocsays "Mutations always roll back" and exempts only query-path writes. -
Read from the code, not run: the dev executor’s
ROLLBACK_ONLYoperation transaction opens only when something reachesGraphitronTransactionProvider.begin, and the pinned connection is otherwise held in autocommit. -
So a
@servicemutation that writes without opening its owntransactionResult, as the operation’s first mutation field, would persist. -
DevExecuteExecutionTesthas no@servicemutation case. -
Confirm with a test before deciding: the remedy is a documented caveat if R1101 has not landed, and nothing if it has, since R1101’s field scope opens under
ROLLBACK_ONLYtoo.
Goes stale when R1101 lands, missing from R1101’s Documentation list
R1101 already lists service.adoc, mutation.adoc, error-channel.adoc, runtime-extension-points.adoc and mojo-configuration.adoc. Two more pages make claims its field scope changes:
-
manual/reference/directives/routine.adoc: "two statements with a transaction boundary between them", the post-commit re-read, and "a read error in statement 2 cannot undo the already-committed write". Under R1101 the re-read runs inside the field’s transaction, and a failure rolls the write back. -
manual/how-to/mcp-agent-context.adoc: the rollback guarantee wording above.
Current, no change needed
architecture/reference/runtime-extension-points.adoc (owned path, hook state contract, rejected identity, per-tenant routing), manual/how-to/tenant-scoping.adoc (the rejected-mount fan-out exception and its committed-writes caveat), and security.adoc. R1055 changed no consumer-documented behaviour.
Open question for the Spec
Where the consumer-facing owned-path documentation lives. runtime-extension-points.adoc sits under docs/architecture/, the contributor docs, but it is written for consumers and is where R1097 put its reference and where R1101 plans its own. Two shapes:
-
Move its consumer-facing sections into a manual page, a reference beside
runtime-api.adocor a how-to for wiring the engine, and leave the architecture page the contributor rationale. -
Keep it where it is and link it prominently from the manual.
Recommendation: move. The manual’s readers arrive from search and should not have to cross into contributor docs to wire the engine. R1101’s documentation would then target the manual page.
Sequencing
Not a hard dependency on R1101. The rewrite of runtime-api.adoc and the new jakarta-rest page are independent of it, but the transaction story is best written once. Either land this after R1101 phase 1, or land it first and leave the per-field transaction section to R1101. If the page move above is chosen and lands first, R1101’s Documentation section is retargeted in the same commit.