Skip to content

Requests for Comments (RFC) — the proposal register

For humans. Work under consideration at the Design altitude: proposals that may become an Architecture Decision Record, be reshaped, merge with another, or be withdrawn. It is the sibling of ADR.md and exists so that the ledger records decisions only — an ADR is written when a proposal is accepted, never before (memory/PROTOCOL.md Work from intent, DECAY.md §12). Read on demand, not part of the per-session agent read path (zero default token cost, the same footing as ADR.md).

Rules

  • Separate sequences. RFC-NNNN and ADR-NNNN never share numbers: a proposal does not reserve an ADR number, because proposals and decisions do not map one-to-one — some merge, some split, some die.
  • Two exits, both recorded here. Promoted: the human accepted it; the ADR is written in ADR.md and this entry keeps a pointer (Promoted → ADR-NNNN, date). Withdrawn: the entry stays with the reason. An entry is never deleted; a proposal may be revised freely while open, and only its final form reaches the ledger.
  • Status: Open (under consideration) · Parked (deliberately deferred — reactivate on demand) · Promoted → ADR-NNNN · Withdrawn.
  • Map, don't duplicate. The live work item stays in memory — an Open Thread in memory/open-threads/ carrying a → proposal: RFC-NNNN pointer — exactly as an accepted ADR is pointed to by a (ADR-NNNN) tag on its continuity fact. The register holds the proposal's reasoning (options, trade-offs, what a decision would commit to); the thread holds its state.
  • The human decides. The agent raises and revises proposals here; promotion is the Design-altitude human gate (DECAY.md §12). Newest first.

Format

## RFC-NNNN — <Title>
**Status:** Open · **Raised:** YYYY-MM-DD · **Serves:** <vision-id> · **Thread:** `<thread-id>`
<!-- id: rfc-NNNN | status: open | thread: <thread-id> -->

**Proposal.** What would change, and what a decision would commit the project to.
**Options.** The alternatives on the table, with their trade-offs.
**Resolution.** Empty while open; `Promoted → ADR-NNNN (date)` or `Withdrawn (date): <reason>`.

RFC-0018 — REST automation in the language packs: rest.yaml as the router of a Python or Node application, so a field utility app is built and deployed as an engine application is

Status: Open · Raised: 2026-11-24 · Serves: vision-mercury-composable · Thread: rest-automation-packs

Proposal. A language pack serves one HTTP path for its functions, POST /api/event, beside the actuators, a static folder and the routes an extension mounts in code (Platform.add_routes). The field runs many Python and Node scripts that are not standard anything, so a utility application there brings its own web framework, its own error body, its own headers and its own deployment, or stays a script. The engines answer the same need with REST automation: rest.yaml is the router - an entry maps a URL and its methods to a function, with CORS, header transforms, an authentication function, a timeout, tracing and static content; "config is the code". The maintainer's direction of 2026-11-24: offer REST automation in both packs, so a pack becomes a full-service application server for the utility apps of the field, designed and deployed as an engine application is - inspired by the AI SDLC work, where the utility functions of agent loops already run in the packs (ADR-0033, ADR-0035, ADR-0036, RFC-0014). This entry is the investigation of 2026-11-24 (the Python pack's session log 2026-11-24-233943) as a proposal. What changes: under rest.automation: true (off by default, so every installation today is unchanged) a pack reads one yaml.rest.automation location, default classpath:/rest.yaml read as resources/rest.yaml next to the application file under the packs' resources rule, file: for an absolute path; the grammar, the keys, the messages and the error body are the engines', never a pack dialect - a rest.yaml written for the Rust engine's subset loads in a pack unchanged, except that it must not bind a flow. One server, one port: POST /api/event and the actuators become the default entries merged when the file does not claim their URLs, as in both engines, so a user entry can attach authentication, CORS or a timeout to /api/event as the lambda-example does; precedence is the file's entries (the defaults among them), then an extension's mounted routes, then static content, then the error shape. Version 1 is the Rust port's subset, Java parity where the Rust port has it: function binding; {param} and a trailing *; the most specific route wins; timeout clamped 1 s to 5 min with an inbound x-ttl winning; cors with the preflight 204; headers keep-drop-add; authentication in the simple form, the verdict's headers riding as the session map; tracing with traceparent first, then the trace-id header, then a fresh id, the correlation id always ensured and echoed, and the three per-endpoint header-name overrides; stream: true rendered as SSE or chunked text on the packs' existing reply sink; the content-type dispatch table and the Accept negotiation; 404, 405, 401, 408 and 503 in the engines' body; static-content.no-cache-pages and filter (a function on the filter route; both left out of the packs' static content of 2026-11-20 because they presuppose this parser); the request delivered as the AsyncHttpRequest map with the engines' keys, and a function's returned envelope setting the status and the headers. The edge records http.request with the path GET /api/x as the engines do, so the forwarder's kind rule makes it the SERVER span with nothing new. Refused at load, by name, so the grammar itself shows the scope fence: flow and service: http.flow.adapter (the message says that flows run in the engines), the HTTP relay (http(s):// service, url_rewrite, trust_all_cert) and the A/B dual service. Deferred as in the Rust port: upload, custom.content.types, mime.types, XML. Out of scope: the outbound async.http.request client (Python has aiohttp, Node has fetch) and WebSocket. No new dependency in either pack: aiohttp's routes, cookies and multipart in Python, node:http in Node - where the legacy pack's port (tags v4.2.40 to v4.3.28: rest-automation.ts, routing.ts, async-http-request.ts, on express, body-parser, cookie-parser and busboy) is a reading aid for the parser and the request model, never a dependency source. Proof the packs' way: a shared rest-automation-vectors.json for the pure half - parser validation with the engines' messages, route matching, header transforms, negotiation, the request-map shape - byte-identical across the two packs; the engines' rest-automation.json grammar, which a Java CI drift test keeps in step with RoutingEntry, loaded as a fixture so a pack's parser cannot drift from it; the Rust port's 33 named tests as the behavioural checklist; a live drive through a browser and through an engine's async.http.request, with the trace lineage checked. The packs' own extensions are the first adopters in waiting: the agent-question app mounts six routes and the ask-person flow four by hand in each pack, each with its own method checks, bearer or OAuth check and error rendering - all but the SSE feed and the OAuth shell are a rest.yaml entry and a @preload function. What a decision would commit the project to: a pack is an HTTP application host for functions written in its language, and each pack's Vision says so (amended by the maintainer on 2026-11-24, from "a deliberately tiny Event-over-HTTP wrapper" to a full-service application development server for utility apps); the scope fence stands unchanged - no flows, no graphs, no persistence, no pub/sub in the package, flow refused by name; the grammar is the engines' and a pack never grows a dialect of it; no web framework enters a pack; the two packs build it in lockstep from one vector file; this repository's polyglot guide keeps "no flows, no graphs, no persistence, no pub/sub" and gains the host.

Options. (A) The shape above - proposed. (B) A web framework in each pack (FastAPI, Express) wrapping functions - rejected: a second grammar, framework dependencies against the packs' two, and the drift the field has today under another name. (C) The status quo - routes mounted in code through Platform.add_routes, each application its own router, its own authentication and its own error body; what the packs' own extensions do, and what the field's scripts do by other means. (D) An engine in front: an engine's REST automation already reaches a pack function through the Event-over-HTTP map, so where an engine runs beside the scripts nothing is missing - but the field's utility apps run where no engine does, which is the point. (E) Re-adopt the legacy Node port - rejected for its Express base; its parser and request model are read, not depended on. (F) Full Java parity in version 1 (the relay, the dual service, upload, the authentication routing specs, several file locations) - not proposed; the Rust port's deferrals are adopted, each reopenable on a field request. (G) flow ignored as an unknown key rather than refused - rejected: a silent 404 where an engine would run a flow hides the fence. Open for the review: /api/event as a default entry carries the engines' default timeout (60 s) where today only x-ttl bounds the call; upload in version 1, since aiohttp carries multipart and Node would need a small parser; whether the packs' extensions migrate their hand-mounted routes afterwards; the pack's rest.server.port is already the host's port, so one server and one port is the only form.

Resolution. Open - round 1 drafted 2026-11-24 from the investigation (the maintainer: "please investigate the viability of porting REST automation into both mercury-python and mercury-nodejs", then "Yes, draft RFC"). Ruled the same day (the maintainer): the packs' Vision statements are amended to reflect the addition of REST automation turning the language pack into a full-service application development server, inspired by the AI SDLC work where utility functions run in the language packs - so the investigation's first question, the altitude of the change, is answered, and the Blueprint gap is open in each pack (bp-rest-automation-python, bp-rest-automation-nodejs). No design spec and no code. Build order when the shape is ruled: the shared vector file written from the grammar and the Rust test list; the Python pack; the Node twin; the packs' READMEs and this repository's polyglot guide; the live drive; promotion to an ADR after the drive. Agreed and built 2026-11-25 (the maintainer: "agree with RFC-0018. Please proceed with implementation"): step 1 BUILT and MERGED as mercury-python #83 - rest_routing.py (the parser with the engines' messages and the pack's refusals, the matching, the transforms, the body dispatch, the negotiation, the response mapping), async_http_request.py (the engines' request model, exported), rest_automation.py (the edge as a middleware ahead of the host's routes: the trace and correlation ids, authentication, the RPC and the interceptor sink, SSE and chunked streaming, the default entries, the static-content filter and no-cache pages), the shared vector file tests/vectors/rest-automation-vectors.json written from the contract (126 cases), 45 tests over the Rust port's checklist, the demo's entry; the defaults set without a ruling are listed on the pack's thread bp-rest-automation-python (keep over drop, the engines' bare 404 for an unclaimed path, one file location, the service check at the end of the boot, no reply-lane pool, a filter failure serving the file). Upload BUILT and MERGED the same day as mercury-python #84, on the maintainer's word ("Please add upload feature after this PR"; the use case: documents uploaded to the LLM helper for a model to read them): the bounded form of the engines' streaming upload - the files' bytes in the request map under the engines' keys plus contents, together within rest.upload.max.bytes, AsyncHttpRequest.files() - and the helper's llm.upload behind POST /api/llm/upload saving the files into the attachments root and returning the references a later llm.chat call names; the vector file at version 2 (129 cases). Of the open questions: /api/event is a default entry with the engines' 60 s, as proposed; upload is in version 1 in the bounded form. Step 2 BUILT and MERGED 2026-11-25 as mercury-nodejs #146 by a session of its own: the three modules on node:http, the vector file byte-identical with the Python pack's, the demo's entry and the helper's intake - no new dependency in either pack. The extensions' migration, the last open question, answered and BUILT the same day on the maintainer's word ("for python, please refactor the hand-mounted routes with rest.yaml"): mercury-python #87 and its twin mercury-nodejs #148 - the ask-person reply page and endpoint and the agent-question app's feed, history, transcripts and click are rest.yaml entries behind private functions of their processes, who is asking resolved once by the entries' authentication functions into the session map, the device's Server-Sent Events stream a stream: true entry whose interceptor opens the stream at once (a day's idle allowance through the head's x-ttl) and follows the feed from a task of its own; nothing is mounted on either host and Platform.add_routes / addRoutes stays as the escape hatch for what an entry cannot express. The migration needed two host changes in each pack: a keep-alive comment that cannot be written ends a stream and closes its sink, and the stream writer's connected tells a long-lived producer that nobody listens. The defaults set without a ruling are on the packs' threads (the engines' standard error body, the apps' own JSON serialization so a null stays on the wire for the UI, no id: line in the stream, authentication before the ticket check, private functions). One departure from the proposal: the engines' rest-automation.json is not loaded as a fixture in the packs - the shared vector file, written from the grammar and the Rust port's test list, is the drift guard, and this repository's catalog drift test keeps the grammar page true to RoutingEntry. Documented 2026-11-25: this repository's polyglot guide gains the application-server half, the REST automation guide, grammar and AI agent guide say what a pack serves and refuses, and each pack's documentation site gains its REST Automation guide with its references and AI agent checklist. Remaining before promotion: the live drive through an engine's async.http.request with the trace lineage checked; then an ADR.


RFC-0017 — Hot deploy and undeploy of knowledge graphs: a certified graph set uploaded to a running engine, registered through the gate on every instance on demand, and removed by name

Status: Promoted → ADR-0038 · Raised: 2026-11-24 · Serves: vision-mercury-composable · Thread: hot-deploy-graph-sets

Proposal. A graph deploys today in one of two ways, both at startup: bundled in the artifact and listed in the manifest (graph.model.automation, ADR-0011), or packaged as a graph set the manifest names (ADR-0027); the rapid-prototyping lane of 4.12.19 adds an external manifest and still needs a restart, and nothing removes a graph after startup. The maintainer's draft of 2026-11-24 adds a third folder and two switches, and this entry is that draft as its review refined it (the design spec is draft-design-specs/hot-deploy-undeploy-graph-sets.md). Bundled graphs and the prototyping workspace (location.graph.temp, dev mode under app.env=dev) do not change. A new folder, location.graph.deploy (default file:/tmp/deploy, a file:/ folder the application can write, outside the temp folder and every manifest's unpack folder), holds what two switches govern, both off by default: graph.hot.deploy registers POST /api/graph-set/deploy, which takes a graph set (<set>.pack, the certified unit of ADR-0027, one graph packed alone when it is the whole deployment) as an application/octet-stream body, checks an optional X-Graph-Set-SHA256 header against the bytes, reads the set strictly, writes its files, runs the deployment gate on every graph and registers the set all or none, in one swap of the registry, so the ids are executable at once; graph.hot.undeploy registers POST /api/graph-set/undeploy/{graph-id}, which removes the set named by its main graph, its graphs leaving the registry in one swap. GET /api/graph-set/deployed answers the folder's record under either switch. A configured manifest owns its ids: a set that holds a bundled id is refused (409) rather than shadowing it, since undeploying a bundled graph is a rebuild, as the draft says; one hot set owns an id; a re-upload of the same set name replaces it. A hot-deployable set has exactly one main graph and is named after it, by the maintainer's direction: the set name is the main graph's id (the set-name rule already uses the graph-id character set), graph_id when present must equal it, and one string is the handle at every surface - the pack file, the record, the deploy answer, the undeploy path and the REST path; its subgraphs are private, 404 at /api/graph/{graph-id} and /api/openapi/{graph-id} and refused to a graph.extension from another set, reached only from their own set's graphs. The folder keeps, per set, the package, the unpacked graphs and one engine-written record named after the main graph, <id>.deployed.yaml (set, version, SHA-256, time, graphs, files), written last; at startup an engine re-registers every set whose record the folder holds, from the bytes the SHA-256 vouches for, through the same gate, so a mounted volume survives a restart. Several instances converge on demand, by the maintainer's direction: a registry lookup for a hot-deployed id reads its set's record and reconciles that set under a lock when the record changed or is gone, and a lookup for an unknown id checks whether a record of that name exists and loads the set if it does - a set appears, is replaced or disappears as a unit on every instance, with no poll, no thread, no broadcast and no global file; bundled ids never read anything. A package copied into the folder by hand is ignored with a warning: the records are the allowlist, so the endpoint is the only door at run time as the manifest is at startup. The deploy answer lists the task routes the set names, and the graph.extension targets it names outside itself, each known or unknown to this instance - an advisory and never a refusal. A graph id is unique across the engine, so two sets cannot carry one (enforced); a set is recommended to be self-contained, its main graph and subgraphs under ids of its own, and reuse across sets is by reference to a set of its own, never by containment, since a graph with two owners would leave undeploy, replace and the certified-artifact question without one answer; a composable function, by contrast, is reused by every graph that names its route (ADR-0001), which is where the shared utilities of graphs live. Suspended runs and asynchronous extensions across a replace or an undeploy are declared in the guide, not drained. Signing, the ledger, authentication and the operational dashboard stay outside the engine, with the gateway in front of the endpoints. Since a hot-deployed graph may need a custom composable function the engine does not hold, and the Event-over-HTTP map is loaded once at startup, a node that consumes task may name its function's provider: server.url, the provider's Event-over-HTTP endpoint with ${...} substitution (/api/event supplied when the URL has no path), and server.header[] for the transport's headers such as a gateway's token - server the parent label of the node's multi-level map, by the maintainer's direction; resolved per instance at registration; winning over a local function and the static map; the skill's reachability check skipped, the provider's 404 the node's error; for_each one call per element; refused by the gate unless an absolute http or https URL after resolution, and refused on a skill that consumes no task. For prototyping, the Playground's packaging panel gains a deployment dialog in dev mode - pack and deploy the assembled set or a dropped package, the digest shown and an expected one sent as the header, the deployed sets listed, one undeployed behind a confirmation - and an engine without the UI gets two Node template scripts in templates/starter-graph/scripts, one to upload a set and one to undeploy, zero dependencies, the folder's only copy; both are clients of the same three endpoints. What a decision would commit the project to: ADR-0011 amended - deployment stays explicit and gated through GraphModelGate, no longer restart-scoped, and a set may register at first use on an instance that did not receive it, still only through the record and the gate, while hot-dropping a file still does nothing and compiled-or-404 stands; ADR-0027 extended - the set is the unit of run-time deployment too, and the loader's strict read, SHA-256, ${...} resolution and all-or-none rule are one code path for startup and the endpoint, while a startup-lane set keeps its free name and public graphs; the registry as one immutable snapshot swapped once per deployment in both engines; a task node may bind its route to a provider's endpoint through server.url and server.header[], the Event-over-HTTP map unchanged beside it; a user-defined function belongs in a language pack beside the engine, so the engine's artifact stops changing when graphs do.

Options. (A) The design above - proposed, every default accepted by the maintainer on 2026-11-24. (B) Per-graph on-demand registration on file.exists(), the maintainer's first form of the direction: a miss on an unknown id looks for <graph-id>.json in the folder, a hit on a registered graph checks its file is still there - refined into (A) because a re-upload keeps every file in place, so a replaced set would go unnoticed until a restart, a per-file timestamp would refresh a set one graph at a time and lose all or none, and the folder would become the allowlist. (C) A periodic check of the record on a shared volume, round 1's recommendation: a thread and an interval to tune, and a latency of its own - not taken. (C2) One global revision marker for the whole folder, round 2's form: every instance re-read the whole record on any change, and two administrators deploying different sets wrote one file - replaced in round 3 by the set's own record, named after its main graph. (D) A broadcast over the service mesh: works where cloud.connector=kafka is on, which is opt-in (ADR-0006) and absent in most installations - not the default path. (E) The gateway or the dashboard calling every instance: nothing to build, impractical behind a round-robin service - stays possible. (F) A loose JSON upload beside the set - not offered; one graph is packed alone. (G) Later wins at run time, as across manifests at startup - rejected, since an upload would replace a pipeline-certified bundled graph and undeploying it would have to bring the bundled copy back. (H) The switches on by default with the field setting them off - rejected for the project's precedent on an operational choice: one artifact ships off, the installation decides per environment. (I) The provider of a task's function on the node, server.url and server.header[] - proposed; a configured server alias with URL and headers keeps the URL out of the graph but needs an engine configuration change per server, and a reloadable Event-over-HTTP map is a second artifact to coordinate with each set - neither taken. Open for the review: the real-time claim is the volume's (a network volume with attribute caching shows a change after its cache window); two instances deploying the same set at the same moment can leave a record and a package from different uploads, which the reconcile's second read catches in the ordinary case and otherwise reports; a verifier route for a signature check inside the engine is a named seam, not built.

Resolution. Open - round 1 (the review of the draft), round 2 (the maintainer's rulings: every default accepted, on-demand registration in place of a poll, refined into a revision marker and confirmed as keeping all or none per set) and round 3 (the maintainer: a set has exactly one main graph, only the main graph is used at the endpoint, the reference is the main graph id, and the set is named after it; the record of each set is its marker), round 4 (after this entry merged as PR #671: a task node names its function's provider with server.url and server.header[], the name the maintainer's since node properties are a multi-level map) and round 5 (the developer's two surfaces: a deployment dialog in the Playground for dev mode, and two Node template scripts for an engine without the UI), all on 2026-11-24; the design spec carries the five rounds. No code is written. Build order: the Java engine's registry snapshot, shared loader pieces and reconcile, then the three endpoints, then the Rust twin, the docs and the claims, then the live drive on the example engine with negative controls first (switch off is 503, a bundled id is 409, a tampered body is 400) and a two-instance drive on one folder; promotion to an ADR after the drive, with ADR-0011 marked amended and ADR-0027 extended. Promoted → ADR-0038 (2026-11-25), after the live drive of both engines on one hot folder (docs/test-reports/hot-deploy-live-drive.md); ADR-0011 marked amended, ADR-0027 marked extended; the register's status above says so.

Built and driven (2026-11-24 to 2026-11-25): the Java engine (#673, #675, #676, #677), the Rust twin (mercury #424) and the live drive of both engines over one hot folder, docs/test-reports/hot-deploy-live-drive.md: every scenario held, with three corrections to the wording - a switch that is off leaves the entry unserved (404; 503 is a switch on with the folder refused), bytes altered inside a well-formed package pass the strict read so the digest header is the check, and the provider named by server.url must publish the function (a private one answers 403) - and four operational follow-ups declared in the record. Promoted to ADR-0038 the same day.


RFC-0016 — Attachments on a single llm.chat call: images and PDF pages named by reference inside one configured root, read by the pack's helper

Status: Open · Raised: 2026-11-24 · Serves: vision-mercury-composable · Thread: llm-chat-attachments

Proposal. The helper's llm.chat takes text only, and its README records the exclusion of images and documents as deliberate. A bounded AI node whose job is to read a page - a scanned form, a table printed as an image, a chart, a screenshot, chosen pages of a long PDF - therefore cannot give the model what it has to read: text extracted outside the graph loses the layout, and a file's bytes in the request are too large for the event and would reach every log, trace and stored record the request reaches. A field request (mercury-python #78) asks for an optional attachments field; this entry is that request as its review amended it. A single llm.chat call - never a loop turn, and not llm.stream in version 1 - may carry attachments, a non-empty list whose entries are a path or {path, pages}: the request names a file and never carries one. The helper reads each file inside one configured root, llm.attachments.root, under the rules of the agent tools' workspace (ADR-0036): the root resolved once at start, a relative path only, the resolved path inside the root, a hidden entry refused, a regular file only. It decides a file's kind by its first bytes, never by its name - PNG, JPEG, GIF or WebP becomes an image block, a PDF a document block, both as base64 sources, the one form every backend accepts - and puts the blocks before the text of the last turn, which must be the user's. pages (13, 1-3,7) sends a new PDF that holds only those pages in the order named, a page named once. The helper refuses what the provider would refuse, with a 400 that names the rule, before any model call: more files than llm.attachments.max.count (20, the most a request carries before the provider tightens each image's dimension limit), more source bytes than llm.attachments.max.bytes (taken from each file's size before it is read), an image over the backend's limit (10 MB base64-encoded on the Claude API, 5 MB on Amazon Bedrock), a PDF that is encrypted or cannot be read, pages on a file that is not a PDF or outside the document. A missing setting follows the helper's convention: no root is a 503 that names the key, a root that is not a folder stops the application at start, and pages without the PDF library is a 503 that names the extra. Reading and cutting run off the event loop and inside the call's deadline (params.timeout_ms); a log line carries the count and the bytes, never a path or a file's content. With RFC-0015 the audit keeps each attachment as a reference in the last turn's content - {type: attachment, path, pages, media_type, bytes, sha256}, the hash taken from the source file's bytes as they are read - and the schema page names it as the one block that is not the provider's format: a call with attachments is reconstructed from the record and the files, by hash. The engines change nothing; the guide shows the node with a guard, because a null source supplies no parameter, and a call that lost its attachment is a text-only call that still answers. What a decision would commit the project to: a request names a file and never carries one; one root, with one definition of "inside" across the pack's extensions; the root is readable through the model by every caller that can reach the helper, and its files are sent to the provider, so it is deployment configuration, certified with the deployment; the helper checks before the provider does; the audit holds a reference and a hash, never the bytes; a loop turn takes no attachment until a transcript can keep one by reference.

Options. (A) By reference inside one configured root - proposed. (B) The file's bytes in the request - rejected: an event of megabytes, and the bytes in every log, trace and stored record the request reaches. (C) The provider's Files API, upload once and name the file by its id: the reference would be the provider's, but Amazon Bedrock, the helper's second backend, does not offer it, and an upload with a lifecycle of its own would sit outside the graph; a possible later source form of the same field. (D) Text extracted before the call, today's workaround, by a converter outside the graph or the agent tools' file.extract: the model never sees the layout, so a table's columns and a figure are lost or guessed. (E) An object store as the source of the files: by the maintainer's direction of 2026-11-24 a later iteration, in which the helper downloads a file from the store into the shared folder before the call - PDFs, images, spreadsheets and other inputs - so the store fills the folder and the field keeps its one form; until then an external script does the download. A reference the helper dereferences on each request, a second form of the field, is not taken. (F) Several roots searched in order, as the request's reference implementation has them - not proposed: the first match wins without a word, and the audit's path would not say which root it came from. The open questions for the review: whether the bound on source bytes is right for a long scanned document of which one page is sent, or belongs on the bytes sent, which needs the whole file read first; a page limit of the helper's own (the provider takes 600 pages a request, 100 on a model whose context window is under 1M tokens, and counting pages needs the PDF library) or the provider's refusal passed through (proposed); llm.stream, left out because the uses return structured output and a stream carries none; the documents extra or one of the helper's own.

Resolution. Open - round 1 drafted 2026-11-24 from the review of mercury-python #78 (the review is on the issue); nothing is ruled and no design spec is written yet. The request's reference implementation is not published, so a build starts from this entry. It depends on RFC-0015 for the audit's part only. Build order when ruled: the Python pack with the shared refusal vectors and fixture files; the Node twin; the packs' READMEs and the schema page here, with RFC-0015's change; a measurement of a PDF cut beside a running stream, since the helper's token batches are pinned as never held back; a live drive on both backends. Build ordered 2026-11-24 (the maintainer: "proceed with implementation for RFC 0015 and 0016"): step 1 is the Python pack, under this entry's defaults, each still open to the review. Round 2 (2026-11-24), the maintainer's direction on the first question, one root or several and a folder or a store: the shared folder is configured in the helper and filled before a graph runs - an upload, a copy, a script - and the object store comes later, as option E now has it; read here as one root. Clarified in the same exchange and written into the pack's README: the helper reads the file and sends its bytes in the request, so the model reads nothing on the host and the path never reaches it; the content counts as input tokens in every call that names it, by what the model sees and not by the file's bytes - an image by its pixels up to its tier's cap, a PDF page by its text and its image - which makes pages the cost control; the audit keeps the reference and the hash and never the file, so an installation that must reconstruct an exchange keeps its files unchanged for the audit's retention, with versioned objects once a store is the source. A document block takes PDF and plain text; a spreadsheet or a word-processor file is converted first, which the later iteration has to provide. Step 1 BUILT 2026-11-24: mercury-python #82 (MERGED, on top of #81) - the field and its shape, the one root under the agent tools' workspace rules, the kind by the first bytes, the pages cut with pypdf, the limits by backend, the read off the event loop and inside the deadline, the reference in the audit; a new shared vector file of 48 cases over eight fixture files, and six tests; thirty-one mutations of the code, the file and a fixture were each caught by a test. The defaults set without a ruling are this entry's open questions as proposed, and three more: hidden entries refused with no switch, a whole PDF checked only where the PDF library is installed, an image's limit taken as 10 and 5 times 1,048,576 bytes base64-encoded. Not done in step 1: a live call (no token was spent) and the measurement of a PDF cut beside a running stream. Step 2 BUILT 2026-11-24: mercury-nodejs #145 (MERGED, on top of #144) - the Node twin, from the same vector file and the same eight fixture files, byte for byte, with no case, expected block or message changed: the two helpers answer the same statuses in the same words. What differs is the runtime's. The reading is a module of its own run in a worker thread, because a hash, base64 and a PDF's cut are CPU work on the one event loop that carries every call and every stream, where the Python helper uses a thread of its pool; one deadline covers the reading and the model, and the model's call gets what the reading left. The Node twin's PDF library, an open question until now, is the maintainer's choice of 2026-11-24: @cantoo/pdf-lib (MIT, the maintained fork of pdf-lib), asked beside pdf-lib itself and beside leaving pages out of that pack for now. It is an optional install, as pypdf is, and pages without it is the 503 that names the package. Two libraries do not write the same bytes, so the shared vectors assert a cut document by its pages, and both packs pass them. Seven tests; thirty-three mutations of the code, the file and a fixture were each caught by a test. Not done in step 2: a live call, and the measurement of a PDF cut beside a running stream, which the worker thread answers by construction and nothing has measured. Next: the schema page here, with RFC-0015's change; the measurement; a live drive on both backends.


RFC-0015 — A single llm.chat call in the transcript audit store: a conversation of one turn, carried by the working record as a loop's turns are

Status: Open · Raised: 2026-11-24 · Serves: vision-mercury-composable · Thread: llm-chat-single-call-audit

Proposal. The audit store of ADR-0035 records every model turn of an agent loop. A single llm.chat call, one without tools, leaves no row, so a graph whose model calls are bounded AI nodes - a classification, an extraction against a schema, a review step - has no audit of its model use even with an audit store configured: the working store keeps nothing for a single call, and telemetry holds no content. A field request (mercury-python #77) asks for one conversation row and one turn row per single call, in the published schema. This entry proposes that, by the carrier ADR-0035 already has. With an audit store configured and llm.transcript.audit.single switched on, after the model answered llm.chat saves a closed record of one turn to the working store under a new conversation reference - version 2 as a loop's, with the request's messages and the assistant's content blocks as returned, the system prompt, no tools, the turn's facts (the trace id and path, the correlation id, the graph and the node from x-graph-id and x-node, the UTC bounds, the stop reason, the status, the provider's request id, the usage), retention zero, and the audit's grace as its time to live - and sends the one event a closed record needs, {conversation, check: true}. transcript.audit is unchanged: the check finds no row, writes the conversation row and the turn row from the record with the statements a loop's turns use, and releases the record, which deletes it; a check that fails leaves the record waiting, and the sweep sends the check again. The reply does not wait for the save, and neither a failed save nor a failed event refuses the call: each is logged by type. The rows: turns 1; tools null, which a loop's row never is, so tools IS NULL tells a single call from a loop with no change to the tables; status by the loop's table (done; refusal; cap for a reply cut off at max_tokens or at the context window); response the array of content blocks, never a text. A call the model answered is recorded whatever the caller then received, so a refusal, a cut-off reply and a reply the helper judged unusable (its 422) are in the store with their cost; a call that failed before the model answered leaves no row. The schema page gains what a single call's rows mean - the reference is not returned to the caller, model is the model that answered, status is the model's outcome and the trace holds the reply's - and the headers of the packs' schema/postgres.sql follow; the agent-question reader and its UI gain a filter on the kind of row, since one call per page would bury the loops' conversations. The engines change nothing: graph.task sends both headers on every request. What a decision would commit the project to: a single call is a conversation of one turn; one carrier (the record), one writer, the two events of ADR-0035 and none that holds content; the schema's tables unchanged and the page's meanings extended; single calls recorded only where an installation switched them on.

Options. (A) The record as the carrier - proposed: none of ADR-0035's seven decisions changes, only its scope widens; a failed write is repaired by the sweep; no content crosses the bus; an outage's backlog waits in the working store, bounded by the grace, where a loop's already waits. Its cost is a working-store write per single call (on Redis a record written, read once and deleted) and the working store as a requirement, which the audit function and the sweep already have. (B) The rows carried in the event to transcript.audit and written by a second case of the function, as the request's reference implementation does: no store write, but it departs from decision 1 (the function reads nothing but the record) and decision 3 (two events); a failed write is not repaired, so an outage of the database is a gap in the audit known only from log lines; and the content waits in the one worker's mailbox, an unbounded in-memory queue, which a stalled database frees once per statement timeout while a loop's writes and checks wait behind. (C) A kind column and schema version 2: clearer to a reader than tools IS NULL, at the price of a migration in every installation that implemented the schema on its own database. (D) A table of its own for single calls: the question "what did this graph's model calls cost" would span two tables. (E) Nothing: usage already rides the trace (llm_input_tokens, llm_output_tokens), so the cost is answerable from telemetry today; what was asked and what came back is not. The open questions for the review: the switch's default (proposed off: on would multiply the personal data an installation's audit store holds, on an upgrade, with nobody having decided it); llm.stream under the same switch (proposed yes: the mechanism is the same and a streamed call is a model call) or left out by name; the model recorded when a server-side fallback answered (proposed: the one that answered); a stop reason outside the loop's table (proposed done, the provider's word kept in stop_reason); whether the reply may wait for the save after all, bounded by a short timeout, which is simpler and puts the audit on the call's path; and llm.transcript.audit.instances, the follow-up recorded with RFC-0014's round 4, which a high rate of single calls makes more likely to be needed.

Resolution. Open - round 1 drafted 2026-11-24 from the review of mercury-python #77 (the review is on the issue); nothing is ruled and no design spec is written yet. A probe on the Python pack's helper as it stands (its main at 89aff42, the in-memory stores, no change to the function) wrote both rows from such a record on the check alone, kept the record through a failed write, wrote the rows on the check sent again, released the record and duplicated nothing on a third check; PostgreSQL, Redis and the Node twin are the build's to prove. Promotion would be a successor to ADR-0035 that widens its scope and keeps its decisions. Noted for the review and left out of the proposal: a loop turn whose reply the helper judges unusable (its 422) is raised before the record is saved, so by ADR-0035's first decision the conversation did not take the turn, and the audit does not hold its usage. Build order when ruled: the Python pack with a shared vector for a single call's rows; the Node twin; the schema page here and the packs' schema file headers; the reader's filter in both packs and the UI; a live drive with the database stopped and stalled, as RFC-0012's was. Build ordered 2026-11-24 (the maintainer: "proceed with implementation for RFC 0015 and 0016"): step 1 is the Python pack, under this entry's defaults, each still open to the review. Step 1 BUILT 2026-11-24: mercury-python #81 (MERGED) - llm.transcript.audit.single, the closed one-turn record saved by a task the reply does not wait for, the check event, and transcript.audit untouched. What the probe showed now holds through the real path: 25 cases of a new shared vector file run the save, the event over the in-process bus and the function behind its mailbox, on the memory working store and the reference audit store. Six tests pin what a vector cannot - the reply not waiting and the shutdown draining the save, a working store that fails, a failed write repaired by the sweep, a loop turn untouched by the switch, the start without a working store - and sixteen mutations of the code and the file were each caught by a test. The defaults set without a ruling are this entry's open questions as proposed, and one more: the switch without a working store stops the application at start. Not done in step 1: PostgreSQL and Redis under a live drive, with the database stopped and stalled. Step 2 BUILT 2026-11-24: mercury-nodejs #144 (MERGED) - the Node twin, from the same vector file byte for byte, with no case or expected row changed: the same switch, the same closed one-turn record saved by a promise the reply does not wait for, the same check event, and transcriptAudit untouched. Six tests pin what the Python pack's six pin, and sixteen mutations of the code and the file were each caught by a test. One of them first made a test hang instead of fail - with the reply waiting for the save, the test waited on a store only it could open - so that test now races the reply against a timer. Not done in step 2: PostgreSQL and Redis under a live drive. Next: the schema page here and the packs' schema file headers; the reader's filter in both packs and the UI; the live drive with the database stopped and stalled.


Status: Open · Raised: 2026-11-19 · Serves: vision-mercury-composable · Thread: ask-a-person-channel

Proposal. The loop can already wait for a person - a row marked write: true under the default mode, and the ask row of the loop spec's section 7.3, both built in both engines - and the graph suspends durably on the state store; what is missing is the person: nothing carries a waiting call to anyone, and nothing brings a decision back except a request a developer types. The proposal is in two parts. The main flow: a composable function in the packs, person.ask (Python first, Node in lockstep), that the graph's hold path calls before it suspends; it issues a signed, opaque, stateless ticket, builds the resume link and sends one message event - the graph id, a description, the correlation id, the turn, the waiting calls, the expiry and the link - to the routes the installation configures, knowing nothing of what they do with it; the link opens the wait on the pack's reply page (read from the engine by the reference graph's re-advice, which keeps the original expiry) and a deliberate submit, a person's or a channel app's on the person's behalf, resumes the graph through the pack, which maps the graph id to the engine's entry by an allowlist and prefixes who decided to the note the audit store keeps. The same function carries a third kind of message, advice - a status update of a long-running run, an acknowledgement after the person's response so the next steps can be anticipated - with no ticket and no link (Eric, round 3). Delivery and collection: every channel is a store-and-forward system of its own - a chat, a mail server, a topic - and the first is the agent-question app, a standalone application on the pack framework with a streaming HTTP server for an occasionally connected device and a PostgreSQL inbox: the message is committed before any push, a stream wakes a connected device, a reconnecting device replays everything open since its cursor and selects which card to answer, the card's button automates the click, and decided or expired cards keep their outcome. The engine stays the authority on an answer (at-most-once resume), and the reference graph's resume node refuses a decision that finds nothing waiting, so a reply never starts a fresh run. The engines' loop changes nothing in version 1. The design spec is draft-design-specs/ask-a-person-channel.md. What a decision would commit the project to: the engine waits and the pack delivers and collects; the tool sends an event and knows no channel; one reply path, the resume link, for every channel; a GET shows and only a submit resumes; the main flow keeps no store and every channel buffers in its own medium; who decided reaches the audit store.

Options. (A) person.ask as a routed tool the loop blocks on until the person answers - rejected: bounded by the tool timeout, lost on a restart, a second suspension beside graph.suspend. (B) The loop sends the event by itself through an llm.run setting in both engines - deferred: the graph's checkpoint is that seam today. (C) The link as the engine's own resume URL - rejected: fetched by link unfurlers, the engine exposed to the device, nobody recorded. (D) Per-channel inbound paths (a chat's buttons, a mailbox poller, a reply topic) - optional later; the link makes them unnecessary for version 1. (E) A store inside the main flow so its page renders without the engine - rejected on Eric's generalization of 2026-11-19: the main flow would become a channel's buffer, and every channel is its own. The open questions for the review are the spec's section 14.

Resolution. Open - round 1 drafted 2026-11-19; round 2 the same day applies Eric's generalization (the agent-question UI as one store-and-forward channel, a standalone app the tool knows nothing of; the main flow and delivery-and-collection as separate parts); round 3 the same day records Eric's agreement on every open question (Q2-Q9) and adds the advice kind for notifications - status updates and acknowledgements of a long-running run. Step 1 BUILT 2026-11-19: mercury-python #68 (MERGED) - extensions/ask-person: person.ask with the three kinds, the signed stateless ticket (the first vector's MAC reproduced with openssl), the event to the channel routes, the reply page (re-advice, never resuming) and endpoint (none, proxy, oauth2, a channel app's bearer; who decided on each note), Platform.add_routes; 72 shared vectors, 100 tests. Step 2 BUILT 2026-11-19 (this repository, #654): the hold path in order-assistant (notify, the checkpoint with the link, the 410 gate, the acknowledgement and the outcome advices, the handlers for a pack that is down), plan-assistant on the ask row with its scripted model, MockAskPerson, the tests, the page docs/guides/ask-a-person.md and the ask row in the guides. Found: graph.suspend takes ttl as written, so a re-advice renews the wait (Q2's fallback, documented); the original expiry across a re-suspend is an engine refinement for a later increment. Step 3 BUILT 2026-11-19: mercury-python #70 (MERGED) - extensions/agent-question, the store-and-forward inbox: the intake upserting a wait and appending an advice (memory or PostgreSQL, the change sequence as the replay cursor), the page, the replay, the stream with Last-Event-ID, the automated click to the link's reply endpoint under the app's bearer, seen; 30 shared vectors, 48 tests; the spec's section 19 records the defaults set without a ruling. Step 4 BUILT 2026-11-19: mercury-nodejs #134 (MERGED) - the Node twins of both extensions from the shared vector files byte for byte (the same ticket from the same file; the reference inbox landing on the same rows, ids and change sequence), the schema and purge files byte-identical, Platform.addRoutes in the Node host; 145 tests. Step 5 DRIVEN 2026-11-19 (this repository, PR #657; mercury-python #71, mercury-nodejs #136): the whole chain live through the Playground on Haiku 4.5 - negative controls, a pack that is down, the link in a bare browser with no channel, a device online, a device off and reconnecting, a decision after expiry, two devices on one ticket - on the Python pack and then the Node twins (docs/test-reports/ask-a-person-live-drive.md). Two defects fixed: the gate meets a re-advice of a dead wait (a turn, no decisions) with 410, so the reply page says the wait has expired; the inbox keeps the first accepted decision when two devices decide one card at once (both packs, vectors version 2). Narrowed: who decided reaches the audit store only through a refused call's note - an approved call's note goes nowhere the audit sees; the loop carrying the decisions into the turn's facts is the follow-up, and a wait decided elsewhere staying open on another device's card is a question for the review. Next: step 6 (the chat, mail and topic examples) and the promotion to an ADR, on Eric's call.


Round 4 (2026-11-20, Eric's sprint after the live drive; spec section 21). The questions, answers and advices become part of the transcript audit log, decoupled from the channels: the main flow records - a recorder in the ask-person process behind local events, order-independent writes, a published store contract with PostgreSQL out of the box and a memory implementation for tests - and the channels only deliver, so the record holds what every channel delivered, an AI node's and a deterministic node's alike. The agent-question app becomes the backend of a React UI built in the Node pack and deployed into both packs' resources/public (three panels: questions and answers, history with infinite scroll, transcript browsing - useful to inspect without answering, since a topic has no browser of its history); the pack hosts serve static content (static.html.folder, built 2026-11-20: mercury-python #73, mercury-nodejs #138); identity is none or oauth2 alone, PKCE in the browser, proxy removed. Steps 8 to 11 of the build plan; promotion after them. Built 2026-11-20 in both packs (static content #73/#138, the record #74/#139, the backend's reads #75/#140, the React UI mercury-nodejs #141 with the bundle in mercury-python #76) and driven live the same day (docs/test-reports/agent-question-ui-live-drive.md): one host defect fixed in both packs - a stopping backend held its streams, so the hosts gained Platform.on_shutdown / onShutdown and the app ends its streams there.

RFC-0013 — Essential built-in tools for agent loops: files inside a workspace, the web inside an allowlist and a knowledge graph inside one database, as pack functions with published catalog rows

Status: Promoted → ADR-0036 · Raised: 2026-11-16 · Serves: vision-mercury-composable · Thread: agent-essential-tools

Proposal. A first set of built-in tools every second agent use case needs, as composable functions in a new pack extension, extensions/agent-tools/ (Python first, Node in lockstep), each shipping its catalog row: file.read, file.write (marked write: true), file.list and file.search inside one configured workspace root; web.fetch and web.crawl inside a configured host allowlist, with private address ranges refused, redirects checked, sizes and page counts capped, robots.txt honoured, and HTML reduced to readable text in-house; on Eric's proposal (2026-11-17) a knowledge graph inside one configured database - graph.schema, graph.query in a read transaction, graph.write and graph.ingest (a structured, parameterized MERGE for what a model extracts) marked write: true, openCypher over the official Bolt driver (Neo4j, Memgraph), so documents are read once and queried many times - and a clock, time.now. The sandbox is deployment configuration, certified with the deployment; a tool whose sandbox is not configured does not register. Playground examples: site-notes (a crawl and a supervised write), document-ingest and document-query (extract once, query many). Existing MCP servers are leveraged by recipe where a server is a product's own front door (Git, GitHub, Playwright, a search vendor, Neo4j's Cypher server). The design spec is draft-design-specs/agent-essential-tools.md. What a decision would commit the project to: tools as pack routes with published rows and sandboxes in configuration, never engine code and never a generic request tool; an agent's own knowledge graph in, systems of record out (a wrapper route).

Options. (A) Bind the reference MCP servers (filesystem, fetch) through the binding: zero code, but a child process and runtime per server, the server's schemas and descriptions, and no crawl; kept as an installation's alternative behind the same routes, and the documented path for vendor servers. (B) Engine-side Java and Rust functions: no pack needed, but two implementations and weaker web libraries. (C) The pack extension - ruled. (D) A generic http.request tool - rejected, a model-chosen URL is the request-forgery hole the web tools close. For the graph: Neo4j's own MCP server bound (zero code; no structured ingest, APOC for its schema tool) versus the four in-house tools over the Bolt driver (proposed).

Resolution. Open. Reviewed by Eric on 2026-11-17: rulings R1-R7 recorded in the spec's section 11 (file.search added; the extension, the in-house HTML-to-text, the gated registration, the defaults and the example confirmed), and R8-R16 agreed the same day (the knowledge-graph tools, the clock, file.extract in version 1, the recipes, sql.query out). Settled for the build; promotion after the drives. Step 1 BUILT 2026-11-17: mercury-python #63 (the file, web and clock tools with their catalog files; six defaults set without a ruling in the spec's section 13) and the page docs/guides/agent-tools.md here (#644, merged 2026-11-17). Step 2 BUILT 2026-11-17: mercury-python #64 (the four knowledge-graph tools over the Bolt driver, driven live on Neo4j, and file.extract; eight defaults in the spec's section 14); the page extended here (#645, merged 2026-11-17). Step 3 BUILT 2026-11-17: mercury-nodejs #130 (the Node twin, the catalog files byte for byte the Python pack's, the same live sequence on Neo4j; the spec's section 15 lists the three visible differences; #646, merged 2026-11-17). Step 4 BUILT and DRIVEN 2026-11-17: the Playground's site-notes, document-ingest and document-query with the synthetic corpus and token-free tests, then the live drives through both packs on Haiku 4.5 (docs/test-reports/agent-tools-live-drive.md; #647, merged 2026-11-17). Step 5 BUILT 2026-11-18: the page docs/guides/tools-from-mcp-servers.md (seven recipes - Git, Time, Fetch, Filesystem, Neo4j's Cypher server, GitHub's hosted server, Playwright's browser - with the digests of 95 tools read from the pinned server versions through both packs' describe, GitHub's with a maintainer's token), the packs' mcp-recipes.yml with the shared digest vector and the gated live test (mercury-python

66, mercury-nodejs #132 and #648 here, all merged 2026-11-18; the spec's section 16). The build plan is complete. **PROMOTED → ADR-0036 (2026-11-18, Eric: "since we have demonstrated that we can use existing

MCP servers, please promote RFC-0013 as ADR")**, after the build of steps 1-5 in all three repositories, the live drives of 2026-11-17 and the recipes' live digest checks of 2026-11-18.


RFC-0012 — The transcript audit store: a durable, queryable record of every model turn, written by the pack, with a published schema

Status: Promoted → ADR-0035 · Raised: 2026-11-16 · Serves: vision-mercury-composable · Thread: transcript-audit-store

Proposal. Separate the two lifetimes the working transcript store serves today: its TTL stays the transaction's expiry (Redis, the compare-and-set, retention a working-store setting), and a second store, durable and append-only, keeps every model turn for audit on the installation's own policy. The pack's helper records every turn (the engine never holds a transcript, ADR-0033), asynchronously: after the compare-and-set accepts a turn, llm.chat sends a local event to a composable function with one worker, transcript.audit, which writes a conversation row and a turn row from the working record - the trace id of the turn's event, the business correlation id, the graph and node from two engine headers, UTC timestamps, the model, status, stop reason, usage, the request message and the assistant content in the provider's format, the normalized calls; a graph with a suspend and a resume shows one correlation id and a trace id per request. A failed write is logged and never blocks a turn. When the model ends the run, a second event to the same function runs the data-integrity check - the turns in Redis counted against the rows in PostgreSQL, the missing ones persisted - and only then is the Redis record released; one mailbox orders the writes and the check, so there is no race. A sweep repairs what a lost event or an outage leaves behind. PostgreSQL is the reference implementation (psycopg 3, pg), the schema is published so a field installation may implement the same tables in another database, a sample purge script ships for developers and the installation's operations schedule the purge. For development, Colima runs PostgreSQL and pgweb. The design spec is draft-design-specs/transcript-audit-store.md. What a decision would commit the project to: content in one governed, installation-owned store with a published schema; identity from the engine (two headers), content only from the pack; the audit off the turn's path.

Options. When to write: (A) every turn, complete under a stopped or abandoned run and a crash, no engine contract - ruled, asynchronously; (B) once at the end of the run, Eric's first framing - loses a run the loop stops, since the helper never learns of it; (C) A plus a close event from the loop carrying its reason - a later step. How: a synchronous write on the turn's path with a required/best-effort switch (round 1, withdrawn) or a composable function behind a local event with an end-of-run integrity check (ruled). Where: the pack's helper (ruled) or the engine (rejected, it never holds the transcript). The store: PostgreSQL first with psycopg 3 and pg as optional extras; another database behind the published schema.

Resolution. Promoted → ADR-0035 (2026-11-17, Eric), after the live drive through both packs (docs/test-reports/transcript-audit-live-drive.md, #642). Reviewed by Eric on 2026-11-17: rulings R1-R8 and his notes recorded in the spec's section 11 and applied (round 2); the defaults set without a ruling (its section 12) confirmed by him the same day; built as mercury-python #59, mercury-nodejs #126, the engines' #641 and mercury #414, the schema page

639, with the build precisions in the spec's section 14.


RFC-0011 — The agent loop: llm.run in the engines maps tool names to routes; model turns and MCP bindings in the language packs

Status: Promoted → ADR-0033 · Raised: 2026-10-28 · Serves: vision-mercury-composable · Thread: agent-loop-llm-run

Reviewed and approved by Eric on 2026-11-03. The promotion to an ADR is held until the end-to-end test from the engines to the language packs for AI SDLC is finished.

Proposal. The foundation of Track 2 (the graph as AI SDLC) for a node whose model calls tools while it reasons — the concept's adapter family C, built on families A (llm.chat) and B (MCP, route-per-tool). The design spec is draft-design-specs/llm-helper-agent-loop.md, and it carries Eric's rulings of six review rounds on 2026-10-28 and 2026-10-29. What a decision would commit the project to:

  1. Narrow loops, composed by the graph. Each agent loop has a narrow scope — one question, a few tools — so it runs few turns. A graph may hold several loop nodes, each with its own catalog, mode and turn limit. A use case grows by adding loop nodes, not by widening one.
  2. The agent loop is engine-side function code, route llm.run, in a new opt-in module extensions/agent-loop. Java first, then the Rust port catches up. It is not engine core, and it links no provider SDK, no MCP client and no store client. The function is not an agent — the model is — and the llm. prefix marks every node whose result is model output. Build plan step 2 built it in Java on 2026-11-03; the spec's sections 4 to 6.1 mark what building it settled, accepted by Eric on 2026-11-04 (round 7).
  3. The model turn stays llm.chat in the language packs, and it grows a loop contract. The pack keeps the transcript in an access-controlled store of its own (Redis first) and returns a reference to it, together with the calls normalized as {id, name, input}. The loop answers with {id, output | error} and the expected turn count. The pack builds the one tool-result message and appends it, refusing a stale turn count with 409. The transcript stays in the provider's format, append-only, which the 5.5 models' thinking blocks require. It never crosses an engine codec, its model is pinned at the first turn (no server-side fallback is sent on a loop turn), and any pack replica can serve any turn. Build plan step 1 built this in both packs on 2026-11-03; the spec's sections 3.2 and 3.3 carry the full contract. Compaction, if a loop ever needs it, is the provider's server-side compaction in the pack's llm.chat, never the loop's; deferred (Eric, 2026-11-04).
  4. A tool name maps to a route. The catalog is a skill-less dataset node under the graph's island, certified on the graph. Each row holds an API-safe name, a description written on the graph, the input schema, the route, strict, and write: true for a tool that writes. The loop checks the catalog before the first turn: names, schemas, write marks, and that every route is reachable. It validates each input before dispatch. An unknown name or a failed call goes back to the model as an error result; only the loop's own machinery fails the node.
  5. Approval comes in two kinds. The node's mode governs the use of tools: write by default holds a marked write for a person, auto runs every call, manual holds every call, and unattended turns a marked write back as a refusal (Eric, 2026-11-04: a write runs unasked only under a declared mode=auto). A turn holding a waiting call runs none of its calls. Every call of the turn, with its arguments, rides the outcome envelope (status: approval). The graph suspends, and on resume the loop takes the calls from the restored state and matches the decisions to them by call id. Separately, a business decision (true/false, or a 1-based integer) rides the verdict, and the graph's decision node routes it to a suspension or onward. The product owner anticipates both at design time. A choice that must return into the same conversation is a question for a person: a catalog row with ask: true and no route, whose call waits and whose resume carries the person's answer as the call's result (Eric, 2026-11-04).
  6. State stays small, and the settings are on the node. model.* holds the status, the decision, the usage, the references and any waiting calls. The settings are constant input mappings on the loop's node, each with a global default in application.properties:
  7. max_turns, the run's budget and a proxy for its cumulative input tokens; there is no separate token limit;
  8. result_limit;
  9. transcript_ttl;
  10. retention, the audit policy, 0 by default.

Telemetry is mandatory and carries no content. 6. A graph with an agent loop is asynchronous. - Unattended: graph.extension gains async=true. The node starts a subgraph or a flow and returns at once, taking no output[], which CompileGraph refuses. With for_each, it fans out in parallel: concurrency bounds the active runs, and the for_each suspension rules apply unchanged. The parent answers an HTTP 202 advice, and the subgraph notifies at its end, spanning days with suspend and resume. Event Script's deferred response (execution: response) is the model for this. Build plan step 3 built it in Java on 2026-11-04; the spec's section 8.1 marks what building it settled. - Watched: progress events (progress, then a terminal result or error) carry seq per sender, time, cid, the graph and the node, and llm.run's run, turn, tool and approval events. They never carry content. They go to the caller's return route: - for REST, async.http.response (final result only) or the progressive-rendering reply lane; - for any event, the route in its x-return-path header.

 `x-return-path` is generic: a function route name, served locally, over Event-over-HTTP, or by a wrapper that
 publishes to a Kafka topic. The engine sends and never waits; a receiver orders a sender's events by `seq`; and only
 routes the application declares (`return.path.routes`) are honoured (rules accepted in round 6). An entry ending
 with `*` declares a family by prefix (`order.status.*`), as `invocation.observer.include` does, and a bare `*` is
 refused. A node opts in with `progress=<text>`, and only then does its function receive `x-return-path`. Build plan
 step 3 built it in Java on 2026-11-04, with the WebSocket entry; the spec's sections 8.2 and 8.4 mark what
 building it settled.
  1. MCP bindings live in the language packs (Python, then Node.js). They use the official MCP SDK client, never a child process of an engine: a stdio server runs as a subprocess of the pack, which is why the MCP client lives there. Servers are named in the pack's configuration; there is one route per allowlisted remote tool, and boot fails on a missing tool or a changed input schema. The model sees the graph's descriptions, never the server's.
  2. No nesting, and no A2A. An agent is a graph node; the graph sequences agents. An external A2A peer, when one is required, is a route and a catalog row.

Options. (a) The loop in the packs, beside llm.chat, with the MCP client inside it: an earlier staged draft. It is one process and needs no new contract. But it puts orchestration in the packs, keeps the tool table and the approval logic away from the graph that certifies them, and reaches Mercury routes only by a second hop. Rejected in review. (b) The MCP connector or a provider-hosted agent: the provider runs the loop. It is not available on every platform the field uses, it reaches only public MCP URLs, and the per-call controls are thin. Rejected. (c) One generic mcp.call route: this hides the server and the remote tool inside the arguments, where the catalog cannot certify them. Rejected. (d) The loop in the engines (proposed). It keeps orchestration with the graph, the tool table on the graph, and provider and MCP code in the packs. (e) The transcript held by the engine and sent to llm.chat inline each turn: the pack stays stateless, but the transcript crosses the engine's codec and the wire twice per turn. Rejected in round 3 in favour of the pack's own store. (f) A progress route owned by the engine, which stamps every event: rejected in round 4, because the caller already names its return route. Open questions: none. Rounds 3 and 4 answered Q1–Q11:

  • the defaults are 10 turns, a 64 KiB result limit, a 7-day transcript TTL and retention 0;
  • the transcripts may share the suspend store's Redis under their own prefix.

The RFC is ready for promotion when Eric accepts it.

Resolution. Promoted → ADR-0033 (2026-11-14, Eric): option (d), the loop in the engines with the model turn and the MCP bindings in the language packs. Accepted after the end-to-end drive from the Java engine through both packs, negative control first (PR #624, docs/test-reports/agent-loop-live-drive.md); build plan step 4, the MCP bindings, is built under the accepted decision.


RFC-0010 — An in-house JSONPath engine to RFC 9535: system/minimalist-jsonpath replaces Jayway JsonPath

Status: Promoted → ADR-0031 · Raised: 2026-10-22 · Serves: vision-mercury-composable · Thread: minimalist-jsonpath

Proposal. Replace Jayway JsonPath (com.jayway.jsonpath:json-path 3.0.0) with a module of this repository that implements RFC 9535, the IETF JSONPath standard (February 2024), with no dependency beyond java.base. The module has two parts: - a parser that compiles a query into an immutable, thread-safe form; - an evaluator that runs it directly over the engine's own Map/List trees, with no conversion step.

platform-core's MultiLevelMap is the only caller; it evaluates every $ path, so Event Script and the knowledge graph inherit the change unchanged.

A decision commits the project to three things: - RFC 9535 as Mercury's one JSONPath grammar, on both engines. Eric's preference (2026-10-22): the standard gives cross-language predictability. Jayway was built long before it, on Stefan Gössner's 2007 proposal, so for Java the standard is a transition. - Owning a parser and an evaluator. - The behaviour changes below.

Why. 1. Supply chain. json-smart 2.6.0 is reported vulnerable (CVE-2026-113602, 5.3), by the IDE's dependency scan on 2026-10-22; no details are published. - No upgrade exists: 2.6.0 is the latest release (August 2025). - json-path 3.0.0, the latest release (February 2026), calls json-smart's JSONParser directly in its filter engine (ValueNode.isJson, ValueNodes$JsonNode.parse), whatever JSON provider is configured. So an exclusion cannot remove it. - json-smart's earlier advisories (CVE-2023-1370, and the incomplete fix of it in 2.5.0 to 2.5.1) were in that same parser. - The ASM 9.7.1 node that came through accessors-smart was closed by an exclusion in #576. This proposal removes the whole chain. 2. Parity. The Rust engine evaluates $ paths with serde_json_path 0.7, an RFC 9535 implementation, and shapes the result the way Jayway does (crates/event-script/src/mlm.rs). - A path both grammars accept gives the same answer on both engines. - A Jayway-only path is evaluated by Java but silently answers null on Rust, which discards the parse error. Examples: in, nin, subsetof, anyof, noneof, size, empty, =~, or a trailing .length(), .min(), .sum() or .keys(). - One grammar on both engines removes that difference. 3. Control. The engine decides: - the grammar it supports; - the errors it reports; - the limits it enforces; - how a substituted value is checked before the query is parsed (see The design).

The precedent is RFC-0006 (ADR-0028): a flagged library at a foundation is replaced by a module written from its specification.

Scope today. - The code. One call, JsonPath.read(multiLevels, path) in MultiLevelMap.getElementFromMap, which also converts json-smart's JSONArray to an ArrayList. Two exception types: PathNotFoundException there, and InvalidPathException in the Playground's GraphCommandService. Nothing else in the code or the tests imports json-path. - The guides. They document dotted paths, [*] and .*, an index, a slice, deep scan .., unions and == filters. They pin Jayway's result shape: the claim json-path-result-shape, and the shared fixture unit-test-jsonpath-1 on both engines. - All of it is RFC 9535 syntax. Jayway's [?(@.team == 'red')] is a filter whose expression is parenthesized, which RFC 9535 accepts.

The design. - Module. system/minimalist-jsonpath, beside minimalist-msgpack, because platform-core depends on it; package org.platformlambda.mini.jsonpath (answer 1). Its API, with the class names settled in WP1: - a compile call that returns an immutable query; - a select call that returns the nodelist; - one JsonPathException extends IllegalArgumentException, carrying the position and the reason. MultiLevelMap keeps a bounded cache of compiled queries, because a flow evaluates the same path on every event, as Jayway's path cache does. - Grammar: RFC 9535 in full. - Selectors: name, wildcard, index (negative too), slice and filter. - Segments: child and descendant. - Filter expressions: ||, &&, !, parentheses, the comparisons == != < <= > >=, existence tests, and relative (@) and absolute ($) queries. - Literals: strings (single or double quoted), numbers, true, false and null. - Functions: the standard's five, length, count, match, search and value, with its type checking. match and search take I-Regexp (RFC 9485), mapped onto java.util.regex and pinned by tests. - Comparisons are type-strict, as the standard specifies: numbers compare by value (1 == 1.0), strings by Unicode scalar value, and "5" == 5 is false. - Two Mercury rules are kept, declared and identical on both engines. 1. The result shape is Jayway's rule, as Mercury documents it. RFC 9535 returns a nodelist and leaves shaping to the application, so this is Mercury's shaping layer, as it already is on Rust: - a definite path yields the value, or null; - an indefinite path always yields a list; - a missing member name before the first indefinite step yields null. 2. A dot-notation name may contain a hyphen ($.fetcher-ext.result), because graph node names carry hyphens. RFC 9535's shorthand does not allow one, so this is the one declared extension. Rust already rewrites such names to bracket notation. - Refusal, never a silent null. A query outside the grammar fails by name, with its position: - when it is evaluated; - at deployment, because CompileGraph and the flow compiler parse every $ source, so a graph with an unsupported path is refused, and a flow loses the task that carries one, before it runs (the WP3 rulings below). The Rust engine moves from its silent null to the same refusal; it already has the parse error. - Limits. A nesting bound on filter expressions (parentheses, nested queries) and an iterative descendant walk, so that no query text exhausts the stack. - Substitution first, then parsing (answer 4). A reference in a $ source is replaced by its value before the query is parsed, as today, so existing graphs and flows keep their queries. Both kinds of reference work this way: Event Script's {model.key} and [model.i] (TaskExecutor.substituteDynamicIndex), and the knowledge graph's {namespace.key} (GraphLambdaFunction.substituteMappingSource). For example, $.input.body.{model.key} with model.key = item is the query $.input.body.item.

Each substituted value is checked where it lands, so that it cannot change the query's structure: - in a path, it must be a plain key path or an integer index. A plain key path is member names joined by single dots, each name RFC 9535's shorthand plus the hyphen of rule 2. - inside a string literal the author wrote ('{model.team}'), it is escaped for that literal: its quote and its backslash. - bare inside a filter, a text value becomes a string literal, as the knowledge graph quotes it today, and a number or a boolean is inserted as written. - a list or a map cannot be substituted into a $ source, because RFC 9535 has no array or object literals.

A value that fails its check fails the mapping by name.

This closes two gaps found on 2026-10-22: - A value next to a dot is inserted as written, so a value carrying query syntax can add segments, a wildcard or a filter to the query. In a graph, that value can come from the request. The guides' advice to put a fixed prefix before a request value does not prevent it. - The knowledge graph's quoting escapes the quote but not the backslash, so a value that ends with \ escapes the closing quote, and the literal runs on into the rest of the query.

Behaviour changes a decision accepts. 1. Jayway-only syntax is refused. - The refused forms: the filter operators in, nin, subsetof, anyof, noneof, size, empty and =~; the path functions .length(), .min(), .max(), .avg(), .stddev(), .sum(), .keys(), .first(), .last(), .index(), .concat() and .append(); and array or object literals in a filter. - Where the standard has a form, it replaces them: match(@.code, '…') or search(…) for =~; length(@.list) and count(@.list[*]) inside a filter; @.code == 'a' || @.code == 'b' for a small in. - All of these already answer null on Rust. 2. Filter comparisons are type-strict. 3. A substituted value cannot change a query's structure (see The design). Every value a working flow or graph substitutes today (a key name, a key path, an index, a filter value) gives the same query as before. A value carrying query syntax, or a list or a map in a $ source, now fails the mapping by name. 4. Queries both grammars accept but implementations answer differently. Examples: a filter applied to an object rather than an array, the order of descendant results, and slices at the edges. The differential run (Evidence plan) lists every such difference before the swap, and each is declared in the guide or fixed. 5. Transitive dependencies go. com.jayway.jsonpath, net.minidev, and ASM through accessors-smart no longer arrive transitively. An application that uses json-path directly declares it itself. The engine still declares ASM, because Event Script's plugin loader reads bytecode with it. 6. The Playground's error for a bad path changes: it states the position and the reason, in place of Jayway's message.

Evidence plan. 1. The compliance suite. The JSONPath Compliance Test Suite (jsonpath-standard/jsonpath-compliance-test-suite, BSD-2) holds 715 cases; 249 of them are invalid selectors that must be refused. - It is vendored as one file in the module's tests, with its licence: the independent oracle, the RFC-0006 method. - The Rust repository runs serde_json_path against the same file, so the two engines answer from one test file. 2. The shared fixture. unit-test-jsonpath-1 and the claim json-path-result-shape stay unchanged on both engines. 3. A differential run. Jayway and the new engine evaluate every $ path in the repository's flows, graph models, fixtures, tutorials and tests, over a seeded corpus of documents, and every difference is listed. The run is kept outside the reactor, as benchmark/msgpack-codec-harness/ was, because it needs json-path on its classpath. 4. A benchmark against Jayway on the engine's own paths: compile once, evaluate many. 5. A JaCoCo line and branch gate on the module.

Size. The precedent, minimalist-msgpack, is 1,136 lines of code and 1,058 lines of tests. This module is estimated at 1,500 to 2,000 lines of code (a parser, an evaluator and the five functions), with the compliance suite carrying most of the test weight.

Work packages. - WP1. The module and the compliance suite. - WP2. The swap in MultiLevelMap and the Playground, the dependency removal, the differential run and the benchmark. - WP3. Refusal at deployment (CompileGraph and the flow compiler), on both engines. - WP4. Substitution first, then parsing, with the checks where each value lands: in Event Script and the knowledge graph, on both engines (answer 4). - WP5. The guides, the help pages, the claims and the upgrade note.

WP3 rulings (Eric, 2026-10-22). 1. A flow keeps its compiler's unit. A task whose $ source is not RFC 9535 is dropped, as for any other invalid mapping entry, with an ERROR that names RFC 9535 and the position. A graph is rejected: CompileGraph, the packager and the Playground's run refuse it. 2. One scanner finds where each reference lands. WP3 builds it, to parse a source with a stand-in for each reference; WP4 reuses it to check each value before it is inserted. 3. A simple plugin's $ argument stays supported, as the Event Script guide promises. The argument splitter ends a $ argument at the first comma outside its brackets and string literals, on both engines, so a union ($['a','b']) or a filter's text reaches the plugin whole. 4. A {reference} never holds a JSONPath query ({$.input.body.amount} in a graph.math expression or a mapping source). JSONPath belongs to data mapping, where a source and its target are separated by ->; nothing used the form and no guide promised it. A data dictionary's default value is a source, the first use case of JSONPath in the engine, and is checked like one.

WP4 rulings (Eric, 2026-10-22). The checks where each value lands follow The design, with two refinements that keep every query that works today: 1. Bare inside a filter, Event Script keeps a text value that is already one literal as written - a number, true, false, null, or a quoted string - and quotes any other text as a string literal. Event Script has always inserted text as written, so @.price > {model.min} with the text 10 compares as a number, and quoting it would make the comparison silently false. The knowledge graph keeps quoting all text, as it always has. 2. In a name, the value is Mercury's dot-bracket key path: names joined by single dots, each optionally followed by [n] indexes (items[0].name). Such a value adds only child and index steps, never a wildcard, a filter or a descendant segment.

Found on the way: a nested reference in a $ source ({model.{model.k}}) is refused on both engines, at deployment and at run time, although the two engines' brace scans differ outside $ sources; and the knowledge graph's quoting of a text value in a graph.math expression escapes the backslash too, because the expression lexer reads a backslash as an escape.

Options. - (a) The in-house RFC 9535 engine. Recommended. One standard grammar on both engines, the json-smart chain gone for good, and the limits and the substitution rule under the project's control. Cost: owning a parser and an evaluator, with the compliance suite as their guard. - (b) Keep Jayway and record the json-smart advisory as unfixed, as the MsgPack 0.9.12 entry in 4.12.18 did. No work, but the finding recurs on every scan, and the engines keep two grammars. - (c) A third-party RFC 9535 library for Java. One grammar without writing it, but another dependency at the engine's foundation for the field's scanners to judge. None was evaluated for this draft. - (d) Wait for a json-smart fix. It has no date, and json-path would still carry the parser.

Open questions, answered (Eric, 2026-10-22). 1. Names. The module is minimalist-jsonpath (system/minimalist-jsonpath). Its package follows the minimalist-msgpack precedent: org.platformlambda.mini.jsonpath, because a Java package name cannot carry the hyphen. 2. Release vehicle: v4.12.26, the next release. One release swaps the engine and refuses Jayway-only syntax, with no warning release first, because the JSONPath surface is under the project's control. The differential run's findings are still listed and declared before the swap. 3. RFC 9535 is adhered to. There is no Mercury-declared alternative to in or any other Jayway-only form; the standard's forms are the replacements. The two declared Mercury rules (the result shape, and a hyphen in a dotted name) stay. 4. Substitution first, then JSONPath parsing, for backward compatibility (Eric's adjustment, the same day). Existing knowledge graphs and event scripts must not break. A model reference yields a concrete value, and it is replaced before the query is parsed: $.input.body.{model.key} with model.key = item is the query $.input.body.item. This holds in both layers and on both engines. - The flow-compiler refusal first proposed under this question is dropped. - The checks where each value lands (The design) keep that compatibility, while preventing a value from changing the query's structure. Accepted by Eric the same day. 5. Agreed. The thread on json-path's version under the Spring Boot parent (json-path-boot-bom-override, raised with #576) becomes moot, and closes when the swap ships.

Promotion to an ADR follows review and green CI, the RFC-0006 method.

Resolution. Promoted → ADR-0031 (2026-10-22, Eric): option (a), the in-house RFC 9535 engine. Accepted after PR #579 (squash 68637dd6) merged with green CI, with the Rust engine's mercury #391, #392 and #393 (Increments 185 to 187): WP1 the module (the compliance suite 715 of 715, 779 tests, 100% of lines and 95.7% of branches), WP2 the swap with the differential and the benchmark, WP3 the refusal at deployment, WP4 the substitution checks and WP5 the guides, the help pages and seven claims. The behaviour changes are accepted as listed in the CHANGELOG; the WP3 and WP4 rulings above are part of the decision; the json-path-boot-bom-override thread closed as moot and the minimalist-jsonpath thread closes with the promotion. Ships in v4.12.26.


RFC-0009 — Live invocation observers: a vendor-neutral seam in platform-core for an APM agent's code-level view

Status: Promoted → ADR-0032 · Raised: 2026-10-21 · Serves: vision-mercury-composable · Thread: dynatrace-oneagent-field-experiment

Proposal. A field installation validated the OpenTelemetry forwarder against Dynatrace, but OneAgent's code-level view does not show the hops between composable functions, and its log fields do not tie to the trace it shows. The cause: Mercury hands an event from the sender to the receiving function through the event bus and a per-route queue, so an agent's thread-bound context is lost at every hop. The forwarder cannot help, because it reports a finished span after the fact, and an agent needs a tracer that brackets the real call. (1) The seam. org.platformlambda.core.spi in platform-core, with no vendor dependency: an InvocationObserver with begin (on the thread that runs a function) and send (on the thread that sends an event), an InvocationScope closed on its own thread (error, then end; several observers close LIFO), and an InvocationContinuation that a Mono result resumes exactly once on its completion thread (or abandons on timeout). The linkage between hops rides as a string tag on the envelope, never as thread state, and is serialized across Event-over-HTTP and the cloud connector; across minimalist-kafka it travels as x-mercury-tag-* headers (InvocationObservers.export on publish, the tags restored and the delivery opened as a hop on consume). (2) The hooks. WorkerHandler.executeFunction; EventEmitter's direct dispatch of Event Script's event.script.manager and task.executor; and the five EventEmitter send entry points (send, two asyncRequest, two eRequest), each on the engine's own copy. A traced request is observed on every route but the telemetry routes and the RPC inbox; invocation.observer.include/exclude adjust that, and invocation.observer.unlinked is the experiment's negative control: the route alone is a separate fragment, because its reply keeps the caller's tag (Eric, 2026-10-23; before, the rest of the flow followed the route into its new trace). (3) Two optional adapters, off by default. extensions/dynatrace-oneagent (dynatrace.oneagent.enabled=true) models each hop as a message with the OneAgent SDK: an outgoing message's Dynatrace tag on the envelope, an incoming message that consumes it, and an in-process link for a Mono. All hops share one messaging system, and the destination is the application by default, so routes do not become Dynatrace services. extensions/opentelemetry-tracer (otel.tracing=true) opens a live CONSUMER span per hop through the vendor-neutral API, with W3C context in the tag; OneAgent's OpenTelemetry (Java) feature or the OpenTelemetry Java agent records it, and a span may end on another thread, so a reactive hop shows its real duration. (4) One fix found by the linkage test: Event Script's kick-off event to task.executor carried no trace id (the executor reads it from the flow instance), so it was unobserved and a flow's first task started a new trace; it now carries the flow's trace. Built on branch feature/dynatrace-oneagent-compatibility. Tested from a dev machine, not in the field (Eric, 2026-10-23). The plan of 2026-10-21 was to certify the integration end to end in the field, on a snapshot built locally, with no PR before that. With the support of Dynatrace's engineering team, the experiment runs instead from a dev machine against a Dynatrace sandbox environment, so a dev cycle is a rebuild rather than a field release. The first run (2026-10-22) proved enough to lift the gate: with the OneAgent adapter, a request was one connected, nested PurePath through every hop, the RPC and the Mono included, and every log line carried dt.trace_id and dt.span_id. The feature moves from experimental to regular feature development, and the branch goes to main through its PR; the run's findings are on the thread. The OpenTelemetry adapter was removed (Eric, 2026-10-23), as option (b) had warned: under OneAgent its spans were recorded but never linked across the event bus, because OneAgent links an API span only through its own context on the thread and ignores a W3C parent set by the caller (the SERVER kind behaves the same, INTERNAL yields no span), and its PurePath is not OpenTelemetry's current context at the REST entry. The seam stays vendor-neutral, so an adapter for an agent that honours W3C parents can come back with that agent to test against. One trace (Eric, 2026-10-23): a REST request or a Kafka message without a traceparent or a trace-id header continues the agent's trace context through InvocationObserver.traceparent, as if the caller had sent it, so a Mercury trace id is the Dynatrace trace id and the span lineage is continuous across applications. Options. (a) The OneAgent SDK adapter alone: native PurePath nodes, but SDK tracers are bound to one thread, so a Mono completion is a linked node, not a long hop. (b) The OpenTelemetry adapter alone: not tied to one vendor, and spans are not bound to a thread, but it depends on an agent capturing OpenTelemetry API spans, and Dynatrace documents that spans may display flat. (c) Both, chosen on the field's evidence (this branch ships both). (d) An SDK inside the engine itself: rejected, because the engine core stays vendor-free. Resolution. Promoted → ADR-0032 (2026-10-24, Eric): option (a), the OneAgent SDK adapter, over the vendor-neutral seam. Accepted after PR #583 (squash a09a1535) merged with green CI, with #584 and #585 found on the way. The OpenTelemetry API adapter, option (b), was built and removed: under OneAgent its spans were never linked across the event bus. The evidence is docs/test-reports/dynatrace-one-agent-integration.md.


RFC-0008 — The mini-scheduler's active environment: one site runs the jobs of an active-active deployment

Status: Promoted → ADR-0030 · Raised: 2026-10-09 · Serves: vision-mercury-composable · Thread: scheduler-active-environment

Proposal. A field installation deploys the scheduler in Production and DR active-active. The DR scheduler fires the same jobs, whose flows publish to the DR Kafka cluster, and the DR applications - which must stay idle while Production is up - consume them: unintended side effects (Eric's problem statement, 2026-10-09). The module's existing mechanisms are single-site: leader.election picks one instance inside a service mesh and the state resolver dedupes inside one state store; neither spans two sites with two Kafka clusters. (1) A declared environment. scheduler.environment names this instance's environment (an application property, e.g. ${ENV_NAME:prod}, default prod); the active environment is the one whose scheduler runs the jobs, prod until an operator sets another, so an unconfigured installation behaves as before. Not app.env, which already selects the Playground's dev mode (@OptionalService("app.env=dev"), 18 services): a Layer 3 application that also schedules jobs could not be in dev mode and count as Production at once. (2) Standby skips at execution, not at scheduling. Quartz keeps firing; the job executor compares the two values before anything runs and logs one line (Standby: job demo-task skipped - the active environment is prod, this instance is DR), so a switch takes effect at the next trigger with no restart. An operator's manual run is explicit and is honoured on a standby instance, with a log line saying so. (3) The value is persisted through a function the application implements (Eric, 2026-10-09: Kubernetes restarts a pod without notice, so an in-memory value would reset): the route named by scheduler.environment.store (default v1.environment.store), the contract type=get → the persisted name as text, type=set + environment + operator → true; the scheduler example's EnvironmentStore is the file-backed template, in the shape of the sample StateResolver, to be replaced by a database such as PostgreSQL or MongoDB. The store is the source of truth (Eric, 2026-10-09, dropping a first scheduler.active.environment property: a startup value has no place beside a store): it is read at every scheduled point, before a job runs, so one call moves every instance of every site; the last value read is kept only as the fallback for a store that fails to answer; without a registered store the value lives in memory only and the scheduler warns at startup. (4) The switch is the application's REST endpoint, per the rest.yaml rule: the module exposes ActiveEnvironment (status, activate) and the example wires GET/POST /api/scheduler/environment ({"active": "DR", "operator": "..."}) through v1.environment.admin; the operations dashboard calls it before and after a Production maintenance window. A decision would commit the module to the two properties and their defaults, the skip-at-execution semantics, the store as the source of truth read at every scheduled point, its contract and the honoured manual run.

Options. (a) Declared environment, skip at execution, persisted through an application function - recommended: the dashboard's one call reaches every instance through the store, no restart, the field keeps its own data store. (b) Pause the Quartz scheduler on standby - no trigger log, and a resume races the first firings. (c) Reuse app.env - collides with dev mode. (d) Keep the value in memory per instance - the dashboard's call reaches one instance behind a load balancer, and a pod restart resets it; rejected by Eric. (e) Extend the state resolver's contract with the environment - changes a contract the field has implemented for job state; a separate function keeps the two concerns apart.

Resolution. Promoted → ADR-0030 (2026-10-09, Eric): option (a), the declared environment with the store as the source of truth, read at every scheduled point. Accepted after PR #539 (squash 74212b1e) merged with green CI: ActiveEnvironment and the executor's standby path in the module, the example's EnvironmentStore template and GET/POST /api/scheduler/environment, the configuration reference, the claim scheduler-active-environment-standby; the scheduler.active.environment property of the first draft dropped at Eric's review. The release vehicle is the next release (CHANGELOG Unreleased, Added item 7).


RFC-0007 — The graph contract: a schema on the root and end nodes, discovery, OpenAPI on demand, input validation and a Schema panel

Status: Promoted → ADR-0029 · Raised: 2026-10-08 · Serves: vision-mercury-composable · Thread: graph-contract-schema

Proposal. Give a graph model an explicit, machine-readable contract and put it to three uses, from Eric's design of 2026-10-08 (the viability study is in the session log memory/sessions/ of that date). (1) Declaration. An optional schema property on the root node describes the request and an optional schema on the end node describes the response (the node says which side it is - Eric's naming). Each has two optional parts that mirror the state machine's namespaces: schema.body, a schema object in the OpenAPI 3.0 dialect for input.body or output.body, and schema.header, an object schema whose properties are header names for input.header or output.header - a graph instance receives the whole input of the flow that invokes graph.executor, headers included, and the Playground's Upload step mocks them since the same day (Eric, 2026-10-08, second round). Both parts are stored as nested property maps through the Playground grammar's composite keys - schema.body.type=object, schema.body.required[]=a, schema.body.properties.a.type=number, schema.header.required[]=x-api-key, schema.header.properties.x-api-key.type=string - so edit node, update node and the node editor carry them with no new grammar, and they travel with the graph through export, import, pack and graph.extension. The root and end nodes are skill-less in the common case, so the map already sits in every run's state machine by reference, as purpose does; no per-run cost. (2) Discovery. One contract class per engine, extracted from the describe graph scanner that both engines already share byte for byte, derives the data surface and as much typing as the model gives: the path scan (names, nesting, arrays from [], [*] and [0]), direct evidence (typed constants and wrappers, known plugin results such as f:now and f:listOfMap, for_each sources, JSONPath star steps) and one-hop propagation through the model namespace (a COMPUTE result is a number, a CONDITION a boolean, a DECIMAL a string, a mapper constant its own type, a pass-through from a typed input its type, a graph.extension target's declared output its result); it records which nodes reference each path. The declaration wins; discovered paths it lacks are appended untyped and flagged; declared paths the model never references are kept (a declaration may describe what a whole-body passthrough forwards) and flagged. (3) OpenAPI on demand. A dev-mode GET /api/openapi/{graph_id} answers a minimal OpenAPI 3.0 document for a deployed graph as a YAML attachment (?format=json for JSON): info from the root node's purpose and the deployed set's version, servers from the request's Host header so a downloaded file points back at the engine that generated it, POST /api/graph/{graph_id} with the request-body schema, the 200 response schema, every int(N) -> output.status constant as a response code, the declared or discovered output.header.* as response headers, the declared or discovered input.header.* as header parameters (a declared header carries its required and its schema), and the standard error shape. Query parameters are not part of the graph API - /api/graph/{graph_id} is one endpoint URI for every graph, by design (Eric, 2026-10-08) - so they are neither declared nor derived. A draft variant through the session shows the spec while authoring, and a discovery endpoint answers the skeleton and its evidence as JSON for the panel. The file drops into extensions/api-playground unchanged, and Swagger UI's explore bar can load the engine URL directly - the dev routes and the executor route carry the wildcard CORS entry. (4) Input validation. When the root node carries schema, both walkers - the executor and the Playground's traveler - validate input.body against schema.body and input.header against schema.header as the first thing at the root on every run; a root node's own skill, if it has one, runs after a successful validation, and a failed validation never reaches it. Header names match case-insensitively, the engine's rule for input.header.*; a header value is text, so type: integer, number or boolean validates the parsed text; required names the headers that must be present; the Playground's Upload step supplies mock headers (POST /api/mock/{id}?namespace=header, mercury-composable #531 and mercury #369), so a dry run can satisfy a header requirement. The step is assumed by the engine, nothing is written into the node (Eric, 2026-10-08: assumed properties leave no room for a typo): the engine invokes the built-in function graph.schema.validator through the task skill's own request and response machinery with {body, header, schema}; 200 passes, 400 carries every violation up to a cap in one message (Input validation failed - input.body.a: expected number; input.body.b: required; input.header.x-api-key: required), which the standard task error path turns into the run's abort status, the root's exception= handler, or the console line of a dry run; the application property graph.schema.validator names a substitute function with the same contract. The vocabulary is a closed subset of OpenAPI 3.0 keywords by their OpenAPI names - type (object, array, string, number, integer, boolean), properties, required, items, enum, minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength, maxLength, pattern, minItems, maxItems, nullable, additionalProperties - with title, description, example and format documentary and never validated. The gate refuses any other keyword, because a constraint the validator silently ignores teaches that unflagged means safe (the partial-gate lesson of 2026-09-18). Types are strict JSON types - a numeric string is not a number; money is type: string with a pattern, as the DECIMAL: guidance already says. A pattern runs after maxLength, in the regex subset common to Java and the Rust crate, and comes from the author, never the caller. The schema compiles once per compiled model. The end node's schema stays documentary, headers included. (5) The Schema panel. A left-slot panel like the packaging panel, opened from the Tools menu or from the root or end node editor: Input and Output tabs, each with a body section (one row per path) and a header section (one row per header name) - path or name, type, required, description, and a source chip reading declared, discovered or from last run - pre-filled from discovery; a "Fill from last run" action infers types and examples from the instance's actual input.body, input.header, output.body and output.header through the inspect endpoint, the only way to type a task's or a fetcher's result; Save writes the two properties through the existing update-node command, so every session member sees it and an agent does the same by command; Download fetches the draft spec. A decision would commit the project to the two schema properties with their body and header parts and the closed keyword subset on both engines (a shared vector file pins accept and reject with their messages, the method of ADR-0026), to validation by declaration at the root as an assumed step, to the OpenAPI document as a derived artifact that is never stored, and to the gate rules: a malformed schema fails, an unknown keyword fails, a mismatch between declaration and surface warns.

Options. (a) Declared schema, discovery, and validation assumed by the engine - the file stays as authored, the dry run and the deployed run behave identically, the function stays the atom, and the root keeps a skill of its own, run after the validation. Recommended. (b) Discovery only, no declaration - the structural minimum the viability study measured over the bundled models (the shape comes free; of 57 output mappings in the 14 tutorials 15 carry a type, of 31 input references 2; none reads a header or a query parameter): honest, but never a real contract and no validation. (c) Validator lines written into the root node at export or by the panel - visible in the file, but two sources of truth: a re-imported graph carries them as draft properties, a removed schema leaves a dangling validator, the dry run validates only after an export and an import, and a task node needs its two input[] mappings as well, four lines a developer can mistype. Rejected by Eric, 2026-10-08. (d) A dedicated validation skill - one more built-in skill for a step every graph with a contract wants; the assumed step through the task machinery gives the same traversal-log line and error path without it. (e) Sample a dry run only - accurate types and examples, but per session and only after an execution; kept as the panel's "Fill from last run", not as the contract. (f) JSON Schema 2020-12 with OpenAPI 3.1 - fuller, but the api-playground's Swagger UI and the field's tooling target 3.0; revisit when a 3.1-only keyword is needed.

Settled (Eric, 2026-10-08). The property is named schema on both nodes; the validator is assumed, never inserted; the vocabulary borrows a minimal set of OpenAPI 3.0 syntax; headers are declared and validated beside the body, in schema.header, their names case-insensitive (the second round of the same day, with the Upload step's mock headers shipped ahead of the sprint). Open: the closed subset above as the first cut; strict JSON types; additionalProperties left to OpenAPI's default (extra fields pass unless the author declares false); the cap on reported violations (proposed 10). Settled in WP1: the draft route is GET /api/openapi/session/{sessionId}, and schema.query is out (no query parameters on the graph endpoint). Settled in WP2 (2026-10-09): the assumed step is one synchronous request from the walker to the validator function on the run's first visit to the root (armed when the run begins, never on a resumed traversal), reported as Input validated by graph.schema.validator in N ms in the traversal log and on the console; the four open points are implemented as proposed - the subset as listed, strict JSON types with an integral float counting as an integer, additionalProperties left to OpenAPI's default, and ten violations per message with the rest counted - and remain Eric's to confirm at promotion; a keyword that cannot apply to the declared type is refused like an unknown one, the end node's schema compiles by the same rule, the gate warns at deploy and pack time about a declared path the model never reads or a read path the declaration lacks, a pattern is searched with Unicode-aware classes and a textual check refuses lookaround, atomic groups, backreferences and possessive quantifiers on both engines, and the values the Playground grammar stores as text (minimum=0, nullable=true) are read as the schema expects. The vectors are graph-schema-vectors.json. Settled in WP3 (2026-10-09): the panel edits a row's path, type, requiredness, description and example, and shows the other keywords of the subset (enum, minimum, pattern, …) as a summary chip carried through Save unchanged - the node editor edits those; a Save is one update node with the node's other properties re-sent as the node editor sends them (the engine clears the property set on update); a chip reads declared, discovered, from last run (the run supplied the type) or new; a reload that answers after a row was edited is dropped, an explicit Reload discards the edits. Work packages: WP1 the contract class, discovery, the OpenAPI and discovery endpoints, and describe graph printing the declaration (both engines, one shared fixture); WP2 the validator function for the body and the headers, the assumed step in both walkers, the gate rules and the shared accept/reject vectors (both engines); WP3 the Schema panel with its body and header sections, fill-from-run and download (one source, two deploy targets); WP4 the help page, the command reference, the AI agent guide recipe, the api-playground round trip and the claims. Promotion follows the implementation, as RFC-0001, RFC-0002 and RFC-0005 did.

Resolution. Promoted → ADR-0029 (2026-10-09, Eric): option (a), the declared schema with discovery and validation assumed by the engine. Accepted after all four work packages merged with green CI on both engines (the Java engine's PRs #533, #534, #535 and #536; the Rust engine's PRs #370 to #373, Increments 171 to 174), with the shared graph-contract-vectors.json and graph-schema-vectors.json passing in both. The points left open above are accepted as implemented: the keyword subset as listed, strict JSON types with an integral float as an integer, additionalProperties at OpenAPI's default, ten violations per message with the rest counted, the panel editing path, type, requiredness, description and example only, and a Save re-sending the node as the node editor does. The release vehicle is the next release (CHANGELOG Unreleased, Added items 2 to 5).


RFC-0006 — An in-house MessagePack codec: system/minimalist-msgpack replaces org.msgpack:msgpack-core

Status: Promoted → ADR-0028 · Raised: 2026-10-06 · Serves: vision-mercury-composable · Thread: minimalist-msgpack

Proposal. Replace the engine's one third-party MessagePack dependency with a module of this repository, written from the published specification (spec.md, last modified 2017-08-09): a streaming MsgPackWriter and MsgPackReader (org.platformlambda.mini.msgpack, with MsgPackFormat, MsgPackType and one checked MsgPackException extends IOException) for the nil, bool, int, float, str, bin, array and map families, with no extension types - Eric's "minimalist" rule: no custom types - and no dependency beyond java.base. platform-core's MsgPack (the event payload codec and the general purpose packMapOrList pair), CanonicalPackager and the HTTP relay read and write through it; the value layer keeps its _T/_D encoding, its null-transport rule and its 64-level depth bound unchanged. The module lives in system/, beside minimalist-kafka, because platform-core must depend on it and extensions/ depend on platform-core (Eric agreed, 2026-10-06). A decision would commit the project to owning a wire codec - the format table, the smallest-format rule it shares with msgpack-core and the Rust engine's rmp, the robustness checks and their tests - and to the three behaviour changes below.

Why now. The field's scanners (Mend, Snyk) flag msgpack-core 0.9.12 for CVE-2026-90472 (stack exhaustion in MessageUnpacker.unpackValue()) and CVE-2026-90473 (a map 32 count overflow in skipValue()); the advisories name 0.9.13 as the fix, which is not published (2026-10-06: Maven Central 404, GitHub's latest release v0.9.12). The engine reaches neither method (#513) and bounds its own reader at 64 levels (#514), but a flagged library at the serialization foundation can block a field release regardless of reachability, and the wait has no date. The engine uses a small part of MessagePack, so that part is written here. Eric's criteria for a replacement (2026-10-06): at par or faster than msgpack-core; virtual-thread friendly; no deprecated libraries; no unsafe operations.

What was built (branch feature/minimalist-msgpack, merged as PR #517, squash 527ac5eb). The writer uses the smallest format for every value with the integer rule msgpack-core and rmp share (-32..127 one byte, larger non-negative values the smallest unsigned width, smaller negative values the smallest signed width), float32 and float64 bit for bit, UTF-8 under the shortest str header, the shortest bin, array and map headers; short ASCII text is written straight into the buffer. The reader is a cursor: nextFormat() peeks, the read methods consume one value or header each, and the robustness rules hold for bytes from outside the process: every read is bounded by the array window; str, bin and ext lengths and array and map counts are 32-bit unsigned and checked against the remaining bytes before anything is allocated or consumed (N elements need N bytes, N entries 2N, so the CVE-2026-90473 header df 80 00 00 00 is refused at the header); 0xc1 is refused; skipValue() is iterative (100,000 nested arrays skip without stack); a failed read leaves the position unchanged; every failure is the one checked exception. Extension values are recognized and skipped, never decoded. Multi-byte fields go through VarHandle byte-array views (big-endian), the sanctioned intrinsic that replaced sun.misc.Unsafe; there is no reflection, no synchronized, no ThreadLocal, no lock, and a reader or writer is created per call. Tests: 134 in the module (the specification's format table pinned byte by byte, hand-derived vectors at every format boundary, non-minimal encodings, every hostile-header shape, every ext format skipped, a seeded random corpus that round-trips and whose every proper prefix is refused, JaCoCo 90% line and branch gate) and three regression tests in platform-core for the behaviour changes.

Evidence. - Byte identity. The canonical package vectors (an independent oracle, byte-identical with the Rust engine) pass unchanged on the new codec, as do MsgPackTest, CanonicalPackagerTest and EventEnvelopeTest. A 20,000-document seeded random corpus (16.9 MB; every integer boundary, all four UTF-8 widths, unpaired surrogates, nulls in maps and lists, nesting to depth 4) packs to byte-identical output through the old and the new MsgPack, and each backend decodes the other's corpus with 0 mismatches (the harness is benchmark/msgpack-codec-harness/, outside the reactor because it needs msgpack-core on its classpath). - Performance. Separate JVMs per backend, same machine otherwise idle, three runs each, best of 5 rounds of 2 s after 3 s of warm-up, three payload shapes through MsgPack.pack/unpack (the value layer included, so this is what the engine sees); the table, method and environment are in docs/test-reports/minimalist-msgpack-benchmark.md. Best of three runs: the 395-byte event envelope packs in 0.54 and unpacks in 0.55 of msgpack-core's time, the 8 KB payload packs in 0.39 and unpacks in 0.72, and the 7 KB list of 50 records is at par (pack 0.96, unpack 1.03, within the run-to-run spread of about 4%).

  • Virtual threads and safety. No shared or thread-local state, no lock, no Unsafe, no deprecated API, java.base only, compiled for Java 21. msgpack-core allocated an 8 KB MessageBuffer per newDefaultPacker call and MsgPack.packMapOrList wrote it through a synchronized ByteArrayOutputStream and copied twice; the small-envelope gain is mostly that overhead.

Options. (a) The in-house codec. Recommended: the dependency is gone for good, the codec is 900 lines the team reads, the bytes are proven identical, and the next scanner finding against a MessagePack library is not the engine's problem. Cost: owning a wire codec (its tests are the guard). (b) Wait for msgpack-core 0.9.13 (the open thread's plan): no date, and the next CVE costs the same wait. (c) Another library (msgpack-jackson depends on msgpack-core; the rest are small or unmaintained): swaps one supply-chain exposure for another and keeps an extension-type surface the engine never uses. (d) Suppress the finding in the field's scanner: not this repository's decision, and it recurs on every scan.

Behaviour changes a decision accepts (each pinned by a test in MsgPackTest): (1) org.msgpack.* no longer arrives transitively; an application that used it directly declares msgpack-core itself or moves to the new reader and writer. (2) Every decoding failure of MsgPack.unpack is an IOException, which EventEnvelope reports as IllegalArgumentException as its contract always said; msgpack-core also threw its own unchecked exceptions, which AsyncHttpClient caught by name and now need not. (3) A uint 64 above Long.MAX_VALUE, which another encoder may send, reads as a BigInteger instead of failing - as CanonicalPackager and the Rust engine (rmpv keeps a u64) already do. Unchanged: an extension value reads as null, nulls in maps follow serializer.null.transport, the 64-level limit, a Float as float32 in the event codec, lenient UTF-8 and str/bin cross-acceptance on read (msgpack-core's defaults).

Open questions. (1) Release vehicle: the next patch release, or after the field accepts 4.12.20? (2) The Rust engine needs no change (rmp/rmpv are pure Rust and not affected); the shared vectors stay the parity proof. (3) The msgpack-core-cve-upgrade thread becomes moot if this is accepted. Promotion to an ADR follows review and green CI (the RFC-0001/RFC-0002 method).

Resolution. Promoted → ADR-0028 (2026-10-06, Eric): option (a), the in-house codec. Accepted after PR #517 (squash 527ac5eb) merged with green CI: the module and the swap, 134 module tests under a 90% line-and-branch gate, three regression tests for the behaviour changes, the two-way differential and the benchmark (docs/test-reports/minimalist-msgpack-benchmark.md). The three behaviour changes are accepted as listed; the Rust engine needs no change; the msgpack-core-cve-upgrade thread closed as moot. The release vehicle is the next release (CHANGELOG Unreleased, Changed item 10).


RFC-0005 — Graph sets: a pack/unpack CLI, a Playground packaging panel, and sets + unpack in the deployment manifest

Status: Promoted → ADR-0027 · Raised: 2026-10-03 · Serves: vision-mercury-composable · Thread: graph-set-packaging

Proposal. The first consumer of the canonical packager (ADR-0026), from Eric's design notes of 2026-10-03; the review and the sprint plan are in draft-design-specs/graph-set-packaging-and-deployment.md. (1) A command-line packager — pack, unpack, inspect — that is a thin front over the engine's own packager in each repo (Java helpers/graph-packager, Rust tools/graph-packager), never injects a timestamp, and runs the gate's static checks at pack time; signing and verification stay a separate utility, with a detached <set>.pack.sig as the shared convention. (2) A Playground panel that assembles a set from dropped or imported graph JSON files with manifest key-values and (3) downloads <set>.pack, packing on the engine through a dev-mode POST /api/graph/pack (and inspecting through /unpack) rather than in the browser. (4) The deployment manifest gains sets (packed files read from the manifest's location) and unpack (a file:/ folder with read and write access — classpath: is rejected, Eric's ruling): before the gate, each set is unpacked into readable JSON files and a generated manifest in that folder, which compiles as the next manifest in sequence — so the automation list stays a list of manifests (the allowlist of ADR-0011) and the later-wins rule of 2026-09-25 applies unchanged; a set registers all of its graphs or none; a duplicate involving a set logs an ERROR; names are validated before any path is built. A decision would commit the project to the .pack artifact and its entry convention (<graph-id>.json, root name = id, optional graph_id entry point), to the sets + unpack manifest schema, to all-or-none registration per set, and to the generated-manifest mechanism, on both engines.

Options. (a) Generated manifest in the unpack folder, compiled in sequence — reuses every manifest mechanism, leaves readable files for operators and for import graph from. Recommended. (b) Compile the unpacked maps from memory, no files — simpler, but the operator cannot read what was deployed and the import fallback cannot find it; Eric's concept asks for files. (c) Treat the unpack folder as a bare deployed location — breaks the manifest-as-allowlist rule. (d) Pack in the browser — a third implementation of the wire contract to keep byte-identical. The nine open choices (extension, pack-time gate, all-or-none, log levels, graph_id, name agreement, where packing happens, module homes, inspect in the Playground) are tabled in the spec with recommendations.

Settled (Eric, 2026-10-03). The artifact is <set>.pack (D1, simplicity); D2 to D9 as recommended: the gate's static checks run at pack time, a set registers all of its graphs or none, a duplicate involving a set logs an ERROR while the loose-manifest override keeps its WARN, graph_id is an optional entry point verified against the entries, the root node's name must equal the entry's id at pack and at unpack, the panel packs on the engine through POST /api/graph/pack, the module homes are helpers/graph-packager (Java) and tools/graph-packager (Rust), and inspecting a dropped .pack in the Playground is in scope. The open questions: pack --from-manifest <graphs.yaml> is in; the generated manifest is documented in the open as the implicit next entry of the automation list; a set's version shows in list graphs and in the deploy INFO line. unpack is a file:/ folder with read and write access, classpath: rejected. Promotion to an ADR follows the implementation (the RFC-0001/RFC-0002 method: implement on a branch, promote after review and green CI).

Resolution. Promoted → ADR-0027 (2026-10-06, Eric): option (a), the generated manifest in the unpack folder, with D1 to D9 and the three answers above. Accepted after the first two work packages shipped, ahead of the rest of the sprint: the gate as one shared method and the command-line packager (the Java engine's PR #508 and the Rust engine's PR #356, Increment 158). Added at promotion (Eric): a set holds one graph or more, because packing a graph alone is how one graph is signed; both engines' tests pin a set of one graph to the same bytes. The loader, the endpoints, the panel and the documentation (WP3 to WP6) follow under the ADR.


RFC-0004 — A bracket-lookup plugin for tariff tables (f:decimalBracket)

Status: Withdrawn · Raised: 2026-10-01 · Serves: vision-mercury-composable · Thread: none

Proposal. A plugin in the f:lookup family, f:decimalBracket(amount, bands, scale, mode), taking an ordered table of { upTo, rate } bands (and an optional open final band) and returning the banded amount as a canonical decimal string, so a tariff schedule that arrives as data stays on the graph. Raised by an external review of the DECIMAL statement. Options. (a) the plugin; (b) leave a fixed schedule unrolled in DECIMAL with min and max, one line per band, and a schedule that arrives with each request in a graph.task function. Resolution. Withdrawn (2026-10-01, Eric): option (b). A static schedule is graph data that the product owner certifies on the graph, and it unrolls into lines that can be read; bands supplied at run time are not graph data and belong in a function. The plugin would also force rulings the engine has no need to own: marginal bands or the whole amount at the band's rate, an inclusive or an exclusive upper bound, and the open final band — the edge-case chase clean-knowledge-design-over-engine-coverage warns against. The unrolled pattern is documented in the DECIMAL guide.


RFC-0003 — Expose the for_each iteration index to the statements of a graph.math loop

Status: Parked · Raised: 2026-10-01 · Serves: vision-mercury-composable · Thread: none

Proposal. GraphMath.executeForEach counts the iteration and does not store it. Store it for the duration of the iteration, for example model.<node>.index (0-based) and model.<node>.count, overwritten on each pass and absent after the loop, so a statement can address the last line or the Nth line ({model.index} == {model.count} - 1 ? residual : share, inside a DECIMAL ternary; a taken IF would end the walk). Raised by an external review of the DECIMAL statement; both engines would carry it. Options. (a) store index and count; (b) store nothing and compute an allocation residual outside the loop (amount - share * n, which already goes to a named party without an index); (c) a graph.task function for the rare per-line output list. Resolution. Parked (2026-10-01, Eric): defer until a field case needs a residual on a specific line of a per-line output list. The loop-free residual covers allocation to a named party today. Reactivate with that case in hand; the change is small and additive, but it is one more engine surface that both engines must carry for ever.


RFC-0002 — Canonical MsgPack packager: sorted-key maps and a manifest as one deterministic byte array

Status: Promoted → ADR-0026 · Raised: 2026-09-30 · Serves: vision-mercury-composable · Thread: canonical-msgpack-packager

Motivation. Some installations must promote a set of related documents (knowledge graphs today, but equally flows, rules or tables) as one artifact whose identity can be recorded, compared and, where the field wants it, protected. Loose files cannot do that. Each one is deployed and validated alone, JSON text is not a stable artifact (key order and whitespace vary), and there is no single thing to hash. MsgPack does not fix this by itself: a map has no guaranteed order, and one value has several valid byte encodings, so two packagings of the same content can differ, and their hashes with them. Both engines already use MsgPack (Java through msgpack-core, platform-core/.../serializers/MsgPack.java; Rust through rmpv, crates/platform-core), so the smallest useful piece is a deterministic packager. Whether a package is then hashed, signed or neither is a deployment decision and stays outside it.

Proposal.

  1. The packager. A small utility beside MsgPack in platform-core (and its Rust twin) that turns maps into one byte array. It first converts every map to an ordered map with keys sorted recursively (at every depth, including maps inside lists; list order is kept), then writes the result as MsgPack under the canonical profile (item 3). The ordering is done by the packager itself (Eric, 2026-10-01): the Gson serializer has no ordered-keys option, and an ordered-keys option such as Jackson's sorts by String order (UTF-16), which differs from another engine's byte order above U+FFFF. The input map may be of any kind; its own order never reaches the bytes. The bytes are written through the MsgPack library directly, not through the platform's general MsgPack.pack, which drops nulls unless configured, packs a Float as float32 and writes a BigDecimal zero as "0.00" - none of which the profile allows. The same content gives the same bytes, in either engine.
  2. Package structure: a manifest metadata map plus the maps. The package is one MsgPack map with two parts:
  3. manifest, a metadata map. The packager writes format and format_version; everything else is caller-defined string fields, recorded but never interpreted by the engine. For graphs, the convention is that graph_id holds the graph ID of the graph the package delivers (the id the deployment manifest lists, POST /api/graph/{graph_id} serves, and the file <graph_id>.json holds), with the other maps as its subgraphs. A set name, a version or a certification state can sit beside it;
  4. maps, the packed maps, keyed by entry name.
{ "manifest": { "format": "mercury-package", "format_version": "1", "graph_id": "quote", ... },
  "maps":     { "quote-fees.json": { ...keys sorted recursively... }, "quote.json": { ... } } }

Multiple maps are saved in sorted filename order. Entry names are file names, ordered by their UTF-8 bytes (never OS listing order or locale collation). Because maps is keyed by name and every map is key-sorted, that order needs no separate rule. manifest sorts before maps, so a reader can read the metadata before decoding any map. A duplicate entry name, or a caller field named format or format_version, is an error. 3. Canonical MsgPack profile, identical in every engine. - Keys are text, in ascending order of their UTF-8 bytes (not Java's UTF-16 String order, which differs for supplementary characters). A non-text key is converted to text, as the existing serializer does; a collision after conversion, or a null key, is an error. - Null values are written as nil and never dropped (the general serializer omits null-valued entries unless supportNulls is set). - Integers use the smallest encoding, fixints first. - Floats are float64 and finite only: NaN and Infinity are rejected. (Amended 2026-10-01: a Float, which MsgPack.java packs as float32, is accepted and widened through its shortest decimal text; see the Resolution.) - Text and bytes are MsgPack str and bin, each with the shortest header. - Exact numbers travel as strings, following RFC-0001 including its zero rule, a zero of any scale being "0" (the existing serializer already packs BigInteger and BigDecimal as strings, but writes a BigDecimal zero as "0.00", so the packager applies the rule itself), and a date is an ISO-8601 string. No extension types, no timestamps; booleans and nil use their single forms. - Any other type is rejected, naming its path, rather than stringified. 4. Integrity is outside the packager, entirely the user application's decision (Eric, 2026-10-01). Nothing inside the package refers to how it is protected: no signature, hash, key id or timestamp, and the framework carries no hash mode, no verifier seam and no key. The packager produces deterministic bytes; the application chooses whether to protect those exact stored bytes, with which algorithm (SHA-256 recorded in a release record or a sidecar, a detached signature from its own signer, a KMS, openssl, or nothing), and where the proof is kept. An earlier draft had the engine implement none and hash and call a route-addressed verifier for signature; that is withdrawn so that the framework owns no algorithm, key rotation or fail-closed policy, which belong to the field. 5. Reading. unpack returns ordered maps (insertion order preserved, never a hash-ordered map) and the manifest. A strict read, the default, also re-encodes the decoded content canonically and rejects the package if the bytes differ, so an accepted package has exactly one byte form; a non-strict read decodes anything that is valid in the profile's types. The decoder rejects a non-text key, a duplicate key, an extension type, bytes after the value and nesting beyond a fixed bound (64), so untrusted bytes cannot exhaust the stack. 6. Tooling. Deferred. A pack that builds a package from a folder or a list of files (JSON to start with) and an unpack that writes the maps back as readable JSON, exact numbers kept as text, are the natural next step; the source files remain what people read and certify, and the package is only the deployment artifact. 7. Parity, and the Rust interop. One vector file, canonical-package-vectors.json, is byte-identical in the Java and Rust repositories and run by both engines' suites. Its expected bytes come from an independent encoder written from this specification, not from either engine, so an engine that matches the file matches every other engine that does. It holds: - values: integers at every encoding boundary, float64 including -0.0, str and bin header boundaries, Unicode (and an unnormalized e + combining accent), map and list header boundaries (15 and 16), nulls kept, keys sorted at depth, keys whose UTF-8 and UTF-16 orders differ, exact numbers as strings (the RFC-0001 zero rule included); - packages: the graph-set example in both entry orders (same bytes), entry names ordered by UTF-8 bytes, manifest fields sorted, an empty package, each with its expected hex and SHA-256; - a generated corpus of 60 packages of random nested documents from a seeded generator, a differential test that shows a divergence in a rarely used corner of the profile as a byte difference; - rejection cases: Float, NaN, Infinity, an unsupported type, a duplicate entry name, a caller field named format or format_version; and on read, non-canonical integer width, out-of-order keys, a float32, trailing bytes, a non-map, a missing or extra top-level key, a wrong format or version, a non-text manifest field, an entry that is not a map, a duplicate key, a non-text key, an extension type, a truncated package, and the nesting bound (sixty-four nested lists decode, sixty-five are refused). The cases only a strict read rejects are marked.

The Rust twin runs the same file; an engine-to-engine drive (the same documents packed by each engine, the bytes compared, and each engine's strict read accepting the other's bytes) follows with it.

A decision would commit every engine to the canonical profile as a wire contract, the manifest + maps structure, and the rule that integrity never lives inside the package. It adds one packager per engine and no dependency.

First consumer, deliberately out of scope. A graph-set loader is the intended first consumer and would be raised as its own RFC. It would register all graphs or none, define precedence against graph.model.automation manifests (the later-loaded source wins, as for manifest lists), verify that graph_id names one of the packed graphs, and could also check static graph.extension targets at load, declaring that it cannot see through flow:// or targets computed at run time.

Deferred until field use asks for it: the folder pack and unpack tooling; trusted timestamps; per-entry records or hashes in the manifest, to show which map changed between versions; hot reload; two versions loaded side by side; compression.

Options. - (a) A generic canonical packager, integrity external and optional (above). One artifact, and the framework owns no signature scheme. Recommended. - (b) An embedded signature envelope, [payload, signature]. One file carries its own signature, but the format is bound to one scheme and the framework owns algorithms, key rotation and timestamps; the none and hash modes need a degenerate envelope. - (c) Canonical JSON (RFC 8785) plus an external hash. Human-readable and diffable, but it needs a canonicalizer in each engine, its number rules conflict with strings for exact numbers (RFC-0001), and MsgPack is already the bus format in Java and Rust. - (d) A zip of files plus a manifest of per-entry hashes. Readable without a decoder, but it needs a two-level hash scheme, because zip bytes vary with entry order and timestamps. - (e) Leave it to adopters. No engine change, but each adopter re-solves canonical encoding.

Settled (Eric, 2026-10-01). Digital signature, the hash mode and the verifier seam are out of the packager and left to the user application (item 4); the work is the key ordering and the packaging into MsgPack; byte-for-byte compatibility with the Rust engine is a requirement and is enforced by the shared vector file and a later engine-to-engine drive (item 7).

Implemented as proposed in the first Java PR, to confirm at review: - graph_id stays a documented convention that the packager never interprets, because a graph-set loader can check it against the packed entry names. - A strict read is the default. - Non-finite doubles are rejected; a Float was rejected here and is now widened (see the Resolution). The packager is faithful to a value's type, so the integer 1 and the float 1.0 are different content, and strings are written as given (no Unicode normalization); both are declared in the class documentation. - msgpack-core and rmpv both choose the smallest integer encoding: checked on 21 integers at every encoding boundary and the str headers, all identical bytes (the vectors run the same cases in both engines). - The Java packager is org.platformlambda.core.serializers.CanonicalPackager beside MsgPack: a builder (manifest, add, build), encode, decode and unpack; it needs no new dependency. - The mercury-python and mercury-nodejs language packs do not carry it: they are minimalist LLM extensions that serve functions to a Java or Rust application over Event-over-HTTP, as if local, and carry no event script or minigraph, so they never read a graph package. (mercury-go is the agent-memory tool, not a language pack.)

Resolution. Promoted → ADR-0026 (2026-10-01): option (a), a generic canonical packager with integrity left to the user application. Delivered in the Java engine's PR #481 (the packager, 14 + 5 tests and the shared vector file), PR #482 (the nesting bound pinned) and PR #483 (the Sonar findings), and the Rust engine's PR #339 (Increment 147); all of the shared file passes in both engines. The folder pack / unpack tooling and the graph-set loader RFC remain deferred. Amended (2026-10-01, Eric, before the v4.12.20 release): a Float is accepted and widened to float64 through its shortest decimal text instead of being rejected (the open question about widening a Float); NaN and Infinity stay rejected and a float32 on the wire still fails the strict read.


RFC-0001 — Exact decimal arithmetic: a DECIMAL: statement for graph.math and an explicit plugin family

Status: Promoted → ADR-0025 · Raised: 2026-09-30 · Serves: vision-mercury-composable · Thread: decimal-mode

Motivation. Knowledge graphs are a natural home for financial rules (settling contracts, rates, fees). Money and rate math must be exact, and reproducible bit-for-bit across runs and across engines. Today every numeric path is IEEE double or long:

Where Current behaviour Consequence
Math dialect values Value.NumberValue(double); literals go through Double.parseDouble (minigraph/math/Value.java, Parser.java:333) 0.1 + 0.2 gives 0.30000000000000004
Dialect functions MathFunction.apply(double...); round is Math.round (EvalContext.java:33) round(-2.5) gives -2
Arithmetic plugins SimplePluginUtils.promoteNumber: integers become Long, strings try Long then Double; reduceNumbers uses long math when every input is whole, double otherwise f:div(7, 2) gives 3 (integer truncation); the Rust twin asserts the same
f:round BigDecimal.valueOf(double).setScale(dp, HALF_UP).doubleValue() (RoundNumbers.java) Returns a double again. f:round(-2.5) gives -3, disagreeing with the dialect's round(-2.5) = -2
Rendering BigDecimal.valueOf(d).stripTrailingZeros().toPlainString() (Evaluator.java:239) Deterministic, but renders the double's value, not the intended decimal

This reopens an earlier ruling, deliberately. The current guidance (ruled 2026-09-25, recorded with the typed-arithmetic decision) is that exact-decimal money belongs in a graph.task function and that BigDecimal is not added to the dialect, keeping the math package minimal. That works, but it hides the formulas in code, while the point of a knowledge graph is that owners read and certify rules on the graph itself. This RFC asks whether that trade still holds; option (c) below is the existing ruling.

Proposal. Add a DECIMAL: statement to graph.math, the high-precision COMPUTE:, with identical semantics in every engine that executes graphs. COMPUTE: keeps its meaning, so existing graphs are untouched by construction: there is no graph-level mode, no application default and no CompileGraph check. Exactness is declared where it is needed, statement by statement, the way CONDITION: declares a boolean instead of letting COMPUTE: infer one from its operators. One rule does reach existing statements: numeric strings compare as numbers (item 3), a READ item at release.

  1. The statement. DECIMAL: var -> expression evaluates the expression with exact decimal arithmetic and stores the result at {node}.result.{var} as a canonical decimal string (item 6). The tag joins COMPUTE: and CONDITION: in the statement recognizer, and it is valid in graph.math nodes only (graph.js, which is deprecated, already rejects any tag it does not know). A DECIMAL: statement computes a number: a comparison may appear inside a ternary test, but a boolean result is an error naming the statement (CONDITION: is the boolean statement).
  2. Value model and reading. In Java, add DecimalValue(BigDecimal) and a decimal literal node beside the double ones (Value and Expr are sealed with exhaustive switches, so the compiler finds every site) and evaluate a DECIMAL: statement with a parallel decimal evaluator, leaving the double path untouched. graph.math renders each {selector} into the expression text and then parses it, so the parser never sees a Java type: numeric literals, substituted numbers included, parse from text straight to a decimal (the lexer already reads fraction and exponent forms), never through a double. A Long or Integer value is exact. A Double or Float value is inexact by nature, and its Java type is gone once a value is text, so GraphMath converts such a value before it renders it: through the shortest decimal text it prints as, at its minimal scale and in plain notation (5.0E-4 is 0.0005, 100.0 is 100), so a number and the same decimal written as a string give the same answer. This is the lenient choice, and it is declared, not enforced: the guide says that a double already computed in floating point (a COMPUTE: result, a client's own arithmetic, a JSON number longer than a double holds) is only as exact as that computation, so sending money as strings is a conscious decision, and f:validate asserts it for callers who insist. Every value, number or string, is rendered into the statement text, so the evaluator sees literals and not sources: a substituted string is indistinguishable from one the author typed. The read rule therefore lives in the evaluator, and substitution does not change. A decimal read from the state machine works in either form: a BigDecimal renders as a number literal, and its canonical string renders as a number literal in an arithmetic position and as a string literal where text is quoted (IF, CONDITION, a comparison). A DECIMAL: statement computes numbers, so its selectors always render in the arithmetic (unquoted) form, even inside a ternary test, and + always adds; a string literal the author types in the expression converts if it is a canonical decimal (plain notation: an optional minus sign, digits without leading zeros, an optional fraction), and any other non-numeric operand is an error naming it. Outside a DECIMAL: statement a string that is not a canonical number is never converted: in an arithmetic position it still renders unquoted and parses as a number, exactly as today, and in a boolean position it stays text.
  3. Operators. + - * are exact, with a specified result scale (+/-: the larger operand scale; *: the sum of scales) so both engines agree; a scale is never negative (a literal such as 1e3 parses to 1000, scale 0). / never truncates (7 / 2 gives 3.5): a quotient that terminates is exact, at the smallest scale that represents it and is not below the dividend's scale minus the divisor's (BigDecimal.divide), and a non-terminating one uses a fixed division context of 34 significant digits (decimal128) with HALF_EVEN, until the author applies an explicit scale; division by zero is an error naming the operator. % is defined on decimals. ** and pow with a whole-number exponent are exact, the exponent bounded (proposed 999) so an expression cannot exhaust memory. Comparisons use numeric value (2.0 == 2.00 is true). Numeric strings compare as numbers, everywhere (Eric, 2026-09-30). In ==, !=, <, <=, > and >=, in IF, CONDITION, COMPUTE: and DECIMAL: alike, a string operand that is a canonical number is converted to a number before the comparison, so '200' == '200', 200 == 200 and 200 == '200' are the same comparison, and '9.5' > '10.25' compares 9.5 with 10.25. A string that is not a canonical number keeps today's behaviour: two strings compare as text, and a number against such a string is an error naming the operands. Today 200 == '200' and '9.5' > 10.25 are errors, '9.5' > '10.25' is true (text order) and '1.0' == '1' is false. The comparison is exact in both evaluators: a number operand is taken as the decimal text it prints as (BigDecimal.valueOf(double)) and a string as the decimal it spells, so two distinct 20-digit ids never collapse into equal numbers, and no precision guard is needed. READ at release: a graph that compared two numeric strings as text now compares them as numbers.
  4. Rounding is always explicit. round(x, scale, mode) takes HALF_UP | HALF_EVEN | HALF_DOWN | UP | DOWN | CEILING | FLOOR and returns a decimal at exactly that scale. The one- and two-argument forms are refused in a DECIMAL: statement, so there is no hidden default to configure; COMPUTE: keeps Math.round. floor, ceil, abs, min and max are exact.
  5. Operations that cannot be exact are refused, at run time. In a DECIMAL: statement sqrt, log, log10, exp, trigonometry, pow with a fractional exponent, random(), and the constants PI and E raise an error naming the node and the statement. They are refused at run time rather than gated at compile time: a compile-time check would be a partial gate that cannot see values arriving through mapped inputs. An author who needs them keeps that step in a COMPUTE: statement or uses a graph.task function.
  6. Strings at rest, BigDecimal only in flight. A DECIMAL: result is stored in the state machine as its canonical string, never as a BigDecimal. The state machine does not keep Java types across a serialization boundary: graph.suspend persists the model namespace to a pluggable store and graph.resume merges it back without conversion, and every graph.task and graph.extension hop is an event envelope. The platform's MsgPack serializer writes a BigDecimal as a string (a zero at scale 2 as "0.00") and reads it back as a String, and a small Long comes back as an Integer, so a BigDecimal kept in memory would change type at a suspension point, and IF, which quotes text, would compare it differently after the resume than before. A string is the same before and after, and the read rule in item 2 makes it a number wherever graph.math meets it. The JSON serializer also writes a BigDecimal as a plain-notation string, so a decimal never travels as a JSON or MsgPack number, which standard parsers and MsgPack's float types would round-trip through a double. That covers graph JSON, the exported graph, the run's output.*, a suspension record, and a canonical MsgPack package (RFC-0002); literals in node properties are text already and parse exactly. Canonical string form: plain notation, never scientific; keeps its computed scale (round(10.5, 2, HALF_UP) gives "10.50"); a zero of any scale is "0" (Eric, 2026-09-30). The JSON serializer already writes that; the MsgPack serializer writes a BigDecimal zero as "0.00", which is one more reason to store the canonical string rather than a BigDecimal, and the canonical packager in RFC-0002 applies the zero rule itself. This is also the grammar item 2 reads, so what a DECIMAL: statement writes is always what it reads back. A BigDecimal has no negative zero, so nothing further needs normalizing.
  7. No mode to mix. There is no graph-level mode, so there is nothing to mix, nothing for CompileGraph to check and nothing for a subgraph to inherit: exactness travels with the data (canonical strings at rest), and each statement declares its arithmetic. The hazards are an author using COMPUTE: on decimal strings, which computes in binary floating point exactly as it does today, and a double that was computed in floating point reaching a DECIMAL: statement (item 2). The guide says to use DECIMAL: for money, to send money as strings, and to keep a COMPUTE: result out of a DECIMAL: statement, and it names COMPUTE: as the floating-point statement; the limits are declared in the guide, not enforced.
  8. Plugins. Add an explicit decimal family for flows and mapper nodes: f:decimalAdd, f:decimalSubtract, f:decimalMultiply, f:decimalDiv, f:decimalMod, f:decimalRound(x, scale, mode) and f:decimalCompare (camelCase, like every simple plugin; Eric, 2026-09-30). The existing f:add family keeps its behaviour, so nothing changes silently. Explicit names beat a hidden mode for plugins, which run outside any one graph's context. Today promoteNumber rejects a BigDecimal by name, so the f:add family fails loudly on a decimal instead of degrading it to a double. The plugins are the second delivery step (see Delivery).
  9. Parity, enforced by shared test vectors. A committed JSON file of {statement or plugin call, inputs, expected canonical string or expected error} (an error is an engine-neutral code that each engine matches against its own message) runs in every executing engine's test suite, alongside the drift-tested claims registry. It must cover: the classic traps (0.1 + 0.2, 1.005 at scale 2, ±2.5 and ±0.5 in every rounding mode, 1/3 and 2/3 in the division context); scale propagation through + - * /; zero at several scales; large magnitudes and the exponent bound; how a Long, a BigDecimal, a canonical string, a non-canonical string and a converted Double behave in a DECIMAL: statement; the comparison matrix in both evaluators (a number, a canonical string, a non-canonical string and a non-numeric string on each side of the six operators, long digit ids included); a MsgPack round trip of a model holding decimal strings, as graph.suspend and graph.resume do it; the refused-operation errors; and unchanged COMPUTE: results.
  10. A side fix independent of decimal arithmetic: document, or align, the dialect round(-2.5) = -2 versus plugin f:round(-2.5) = -3 discrepancy.

Delivery (Eric, 2026-09-30). The first implementation is Java graph.math only: items 1 to 7 and 9. It is the DECIMAL: statement in GraphMath and the statement recognizer, the decimal evaluator in the minigraph-playground-engine math package, the docs (skills-reference.md, the in-Playground help and minigraph-commands.json), a claim for the statement (the math-expression-dialect claim keeps describing COMPUTE:), and the shared vectors; item 3's comparison rule is part of it and reaches the double evaluator. The f:decimal* plugins (item 8) and the Rust twin follow as separate PRs against the same vectors. graph.data.mapper arithmetic and f:lookup numeric keys are unchanged.

A decision would commit every executing engine to one written decimal specification (the DECIMAL: statement, result scales, division context, rounding modes, canonical string form, strings at rest, the numeric-string comparison rule), a shared conformance-vector file maintained in lock-step, and one new Value variant plus a plugin family per engine.

Options. - (a) A DECIMAL: statement (above). Explicit and declared where it is needed, like CONDITION:; no graph-level state, and existing graphs untouched. Recommended. - (b) Replace double with decimal everywhere. Simplest to reason about, but it changes every statement's result from a number to a string and the rendering of every existing result. - (c) Leave the core unchanged and ship a decimal function library for graph.task (the existing ruling). No engine change, but formulas become opaque code again, and every adopter reinvents rounding and serialization. - (d) Fixed-point integers (minor units, e.g. cents, as long). Exact and fast for sums, but awkward for rates, percentages, per-period amounts and currencies of different scale, and division still needs a rounding policy. - (e) A graph-level numeric: decimal mode. Zero compatibility risk, but one more thing to configure, and a mixed-mode limit between graphs that CompileGraph cannot see; the statement declares exactness where it is needed. - (f) Type-directed arithmetic with nothing declared. No new syntax, but a graph that passes numeric strings into arithmetic would flip from a number to a string result.

Settled (Eric, 2026-09-30). A fixed decimal128 division context (34 digits, HALF_EVEN) with no configuration; the computed scale kept in canonical output, and a zero of any scale written "0"; a Double accepted in a DECIMAL: statement through its shortest decimal text, declared in the guide as a conscious decision (lenient); scope stays graph.math, so graph.data.mapper arithmetic and f:lookup numeric keys are unchanged; delivery in three separate PRs against the same vectors, Java graph.math first, then the f:decimal* plugins, then the Rust twin; decimals stored as canonical strings at rest, because graph.suspend and every hop serialize the state (item 6); numeric strings comparing as numbers (item 3); and the DECIMAL: statement, the high-precision COMPUTE:, in place of a graph-level mode (item 1), with rounding always explicit and no graph-level default.

Still open: - The comparison rule and existing statements. Implemented as proposed in the first PR: IF, CONDITION and COMPUTE: get the rule too, so '9.5' > '10.25' and '1.0' == '1' change for existing graphs (a READ item at release). The alternative leaves them as they are today, and {model.status} == '200' keeps failing there; confirm at review. - Rust type. The Rust twin would use an arbitrary-precision crate. bigdecimal matches Java BigDecimal semantics best and is already in that workspace's lockfile (0.4.10, through apache-avro); a fixed 96-bit type (e.g. rust_decimal, about 28 digits) cannot reproduce a 34-digit context. (verify bigdecimal's rounding-mode coverage and result-scale behaviour against the shared vectors when the Rust PR starts) - Exponent bound. Proposed 999 for ** and pow; confirm when the evaluator lands. - Release. Which version carries each delivery step? The language packs (mercury-python, mercury-nodejs) need no engine change for the decimal work: they host functions over Event-over-HTTP and never evaluate a statement or a plugin; a function of theirs that returns money returns a plain-notation string, which a DECIMAL statement or a decimal plugin reads (mercury-go is the agent-memory tool, not a language pack).

Resolution. Promoted → ADR-0025 (2026-09-30): option (a), the DECIMAL: statement. Delivered in PR #471 (Java graph.math, with the numeric-string comparison rule) and PR #472 (item 10, the round alignment); items 8 (the f:decimal* plugins) and the Rust twin follow as separate PRs against the shared vectors.