Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,89 @@
only when it carries the label `_Ingested` and a key. A query that listed a node's labels now sees `_Ingested`
among them.

3. **The agent tools' address check and globs follow one rule in both packs, and a pattern is matched in bounded time
(the code-quality round of 2026-11-29, in lockstep with the Python pack).**
- *Addresses.* The web tools' address check read an IPv4-mapped IPv6 address written in hex (`::ffff:7f00:1`) as
public, where the dotted spelling of the same address was loopback and the Python twin refused both; and its
list of blocks was shorter than the twin's. Both packs carry one table now, the same text. An IPv4 address is
refused inside the special-purpose blocks that are not globally reachable (the documentation, benchmarking
and protocol-assignment blocks are new here) and the shared address space. An IPv6 address is reached only
inside the global unicast block `2000::/3`, outside `2001::/23`, `2001:db8::/32`, `2002::/16` and `3fff::/20`:
every other IPv6 address is refused, an IPv4-mapped one in any spelling among them. The table is read by the
runtime's own subnet list (`net.BlockList`), so the module parses no address itself.
- *Globs.* A pattern that ends in `**` returned nothing from `file.list` and `file.search`, and the twin's
`Path.glob` read `**` differently from one Python version to the next. Both packs compile a glob by one
grammar: `**` is any run of folders and, at the end of a pattern, everything beneath; a slash at the end names
folders only; a symbolic link is an entry and is never descended into; `..` and an absolute pattern are a 400
by name. A name is matched item by item, so the time is bounded by the pattern's length times the name's
however many stars the pattern has - as a regular expression, three stars against a name of 1,500 characters
did not finish in two minutes, with the event loop blocked - and the walk enters only the folders a pattern
can still match beneath. The host patterns of `tools.web.allow` are matched by the same function.
- *Smaller differences.* The HTML reader looks a name from a page up in its tables' own keys only
(`&constructor;` gave the text of a function, and a `<constructor>` element was a heading); a crawl that
starts on an address literal, or on a host written with a dot at its end, follows its links; an allowlist
entry that starts with a class (`[ab].example.com`, which was read as the address `ab`) is a pattern, and one
with a bracket that never closes is the pattern it spells, where it was a 500 at the first request;
`file.write` under a file is 400 `<path> is not a directory`; a redirect to an address that cannot be read is
a 400.

**Upgrade note:** the agent tools are in no release yet. For an application that runs them from `main`: an
IPv4-mapped address, the documentation and benchmarking blocks, and every IPv6 address outside the global unicast
block are refused unless `tools.web.allow.private=true` - on a network that reaches IPv4 sites through
`64:ff9b::/96`, that includes every such site.

4. **The LLM helper reads a number, a duration and a page list by one rule in both packs, and a wrong
`llm.transcript.audit.grace` or `llm.transcript.audit.retention` stops the start**, in lockstep with the Python
pack. A number in a request or a setting was read by each pack's own reader: the Python twin took digits of any
script and refused the JSON float `16000.0`, which this pack cannot tell from `16000` and accepted. One rule now:
a JSON number with a whole value, or a string of the digits 0 to 9, with white space ignored around it (the 24
characters both runtimes' trim take, so U+FEFF is no longer one of them here), at most 9007199254740991; a
duration and a page list follow it, and the refusals keep their messages. The audit's grace and retention were
read inside the save of a loop's closing turn - a 503 after the model had been called, the turn unsaved; they
are read when the helper starts, and a wrong value stops the start by name as the other settings do. The shared
vectors gain a `numbers` section of 98 probes. **Upgrade note:** a number above 9007199254740991 is a 400.

5. **ask-person and agent-question: one rule for a well-formed ticket, and one for a row id and a stream's
cursor**, in lockstep with the Python pack. The packs answered a mangled ticket differently: this one accepted a
stray character after a payload and answered 403 for a part that is too short, where the twin answered 400. A
ticket is well-formed when it has its three parts, the payload and the signature are canonical unpadded base64url
from start to end, and the signature is the 32 bytes of the MAC: anything else is 400 `Ticket is malformed`, and
a well-formed ticket whose MAC does not verify is 403 `Ticket signature is invalid`. A second spelling of a valid
ticket - one that differs only in the unused bits of a last character - was accepted by both packs and is a 400.
In agent-question `Last-Event-ID` went through `Number()` (`1.0`, `1e3` and `0x10` passed); both packs read 1 to
19 digits from start to end, at most 9223372036854775807, and answer the 400 that was there for anything else;
above 2^53-1 the id is carried exactly, as a `BigInt`. The shared vectors are `ask-person-vectors.json` version 3
(146 cases) and `agent-question-vectors.json` version 4 (111 cases), byte-identical with the Python pack.
**Upgrade note:** none for a ticket the pack issued or an id it returned.

6. **REST automation and the host: an entry's flags as the Java engine reads them, the upload bound in bytes, a
limit on a request body, and the engines' error body where the host answered its own**, in lockstep with the
Python pack.
- A flag of an entry (`tracing`, `stream`, `upload`) was on only for the YAML boolean, so `tracing: "true"` and
`tracing: ${TRACING:true}` stayed off without a word. The boolean or the text `true` in any letter case turns
it on, as in the Java engine; `false`, no value and an empty one leave it off; any other value, which the
engine reads as off silently, fails the start: `rest[N] 'tracing' must be true or false`. `rest.yaml` is read
with the boolean words of the Python pack's reader and the engine's, so the single letters `y` and `n` are
text.
- The upload bound counted a text field by the length of its text; each field counts as the bytes of its part in
the body. A body past the bound is let go by unread, so the client takes the 413 instead of a broken
connection.
- `: ping` was written into the body of a stream that is not Server-Sent Events when the idle timer fired a
moment before the clock reached the deadline. A keep-alive is written only when a keep-alive interval has
passed.
- A reply the serializer refuses is 500 `Reply cannot be rendered` in the engines' error body, with the edge's
`http.request` record, and a streamed segment fails the stream in band; it was the host's catch-all 500 with
no record, and a stream was destroyed.
- A request body had no limit. The host reads at most 16 MiB into memory, as the Python pack does: a body over
it is 413 `Request body exceeds 16777216 bytes` in the engines' error body, and an envelope on
`POST /api/event` without REST automation.
- A part of an upload that is multipart itself is 400
`Upload takes text fields and files, not a nested multipart part`; it was delivered as a text field, or as a
file of that type. An upload whose parts do not follow the boundary its content type declares is a 400.

**Upgrade note:** an entry whose flag is written as anything but `true` or `false` stops the start - write `true`
or `false`. A request body over 16 MiB is refused; a file upload keeps its own bound, `rest.upload.max.bytes`.

### Changed

1. **The agent-question app reads the question record and writes nothing: the backend of the React UI (RFC-0014
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ binding (`flow:` or `service: http.flow.adapter` — flows run in the engines),
form of the engines' streaming upload: the files of a `multipart/form-data` body arrive in the request
map under the engines' keys (`filename`, `file_type`, `file_length`, the `upload` tags, `size`) with
their bytes in `contents`, read with `AsyncHttpRequest.files()`, all together within
`rest.upload.max.bytes` (16 MiB; 413 beyond it); the form's text fields become query parameters. The
edge is `node:http`, as the host is: no web framework and no new dependency.
`rest.upload.max.bytes` (16 MiB; 413 beyond it); the form's text fields become query parameters and
count, in bytes, toward the same bound. The edge is `node:http`, as the host is: no web framework and
no new dependency.

The pack's own applications are written this way: the ask-a-person main flow's reply page and endpoint
and the agent-question app's person's side are `rest.yaml` entries of their applications
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords: [configuration, reference, keys, substitution, overrides]
| `optional.health.dependencies` | health check routes reported but never affecting status | (empty) |
| `rest.automation` | REST automation on: the entries of `rest.yaml` served in front of the functions ([guide](rest-automation.md)) | `false` |
| `yaml.rest.automation` | the one location of `rest.yaml`: `classpath:` the resources folder, `file:` an absolute path, a relative path under the application file's folder | `classpath:/rest.yaml` |
| `rest.upload.max.bytes` | the bound on the files of one upload entry, together (413 beyond it) | `16777216` |
| `rest.upload.max.bytes` | the bound on one upload: its files and its text fields together, counted in bytes (413 beyond it) | `16777216` |
| `http.trace.id.header` | the trace-id header a traced entry reads when no W3C `traceparent` arrives (`trace.id.header` overrides it per entry) | `X-Trace-Id` |
| `http.correlation.id.header` | the business correlation-id header, always ensured and echoed (`correlation.id.header` per entry) | `X-Correlation-Id` |
| `http.traceparent.header` | a custom name for the W3C `traceparent` header, read only when the standard one is absent (`traceparent.header` per entry) | `traceparent` |
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/http-surface-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Mirrors the engines' `event.api.service`:
| `x-async: true` | drop-n-forget → HTTP 202 with ack envelope `{type: async, delivered: true, time}` |
| Reply | always envelope bytes, `content-type: application/octet-stream` |
| Handler outcome | rides **HTTP 200** with the status inside the envelope (including AppException and unexpected errors) |
| Transport failures | set the HTTP status too: 400 undecodable / missing route field, 403 private target, 404 unknown route (`Route X not found`), 408 timeout (`Timeout for N ms`) |
| Transport failures | set the HTTP status too: 400 undecodable / missing route field, 403 private target, 404 unknown route (`Route X not found`), 408 timeout (`Timeout for N ms`), 413 a body over the 16 MiB the host reads into memory (`Request body exceeds 16777216 bytes`) |
| Header hygiene | inbound `x-event-api` and `my_*` removed; the `my_cid` tag becomes the read-only `my_correlation_id` header (local bus deliveries inject the same view). Outbound, the client stamps the current context's business correlation-id back onto the event as the `my_cid` tag — the engines' PostOffice parity, so the business correlation-id continues across every hop |
| `accept: text/event-stream` | streaming-capable call to an interceptor target: a streamed reply rides the same call as SSE in the envelope-mode dialect; a single-shot reply stays byte-identical; a streaming reply to a NON-accepting caller → 406 `Streaming function requires a caller that accepts text/event-stream`. See [Event Streaming](streaming.md) |

Expand Down Expand Up @@ -57,10 +57,10 @@ first, in the engines' grammar; `POST /api/event` and the actuators are the defa
| Matching | the engines' precedence — the most specific route wins, `{param}` and a trailing `*`; a known path under another method → 405 `Method not allowed`; an unknown path → 404 `Resource not found`; `OPTIONS` → 204 with the entry's CORS `options` lines, 405 without a CORS block |
| Request to the function | the whole request as the `AsyncHttpRequest` map — method, url, headers (lowercased, after the request transform), path and query parameters (a form's fields among them), the body parsed by its content type (JSON → map or list, text types → text, else bytes), cookies, the `session` map an authentication function left; `x-ttl` carries the entry's timeout in ms |
| Reply | a returned value is the body; a returned `EventEnvelope` sets the status and headers (`set-cookie` values split on `\|`); the content type is the function's or negotiated from `Accept` (`text/html` wraps a map in the HTML shell; no `Accept` → no content type); a map or list is pretty-printed JSON with `null` entries omitted |
| Errors | the engines' body below with `content-type: application/json`: an `AppException` from the function or the authentication function (anything but `true` from the latter → 401 `Unauthorized`); 408 `Timeout for N ms` at the entry's timeout (1 s–5 min, 30 s default; an inbound `x-ttl` wins); 503 `Service X not reachable` for an unregistered function; 413 `Upload exceeds N bytes` |
| Errors | the engines' body below with `content-type: application/json`: an `AppException` from the function or the authentication function (anything but `true` from the latter → 401 `Unauthorized`); 408 `Timeout for N ms` at the entry's timeout (1 s–5 min, 30 s default; an inbound `x-ttl` wins); 503 `Service X not reachable` for an unregistered function; 413 `Upload exceeds N bytes`; 413 `Request body exceeds 16777216 bytes` for a body over the 16 MiB the host reads into memory; 500 `Reply cannot be rendered` for a reply the serializer refuses |
| Correlation and tracing | `X-Correlation-Id` (or `http.correlation.id.header`) always ensured and echoed, delivered as `my_correlation_id`; with `tracing: true` a W3C `traceparent`, else `X-Trace-Id` (`http.trace.id.header`), else a fresh id, and the `http.request` record plus the function's round-trip record |
| `stream: true` | an interceptor's segments rendered progressively: Server-Sent Events (`event:`/`data:` frames, `event: done` at the end, `event: error` in band, `: ping` keep-alives every `event.stream.keep.alive`) for a `text/event-stream` head or `Accept`, chunked text or JSON lines otherwise; the entry's timeout is the idle allowance, the head's `x-ttl` overrides it; a keep-alive that cannot be written ends the stream |
| `upload: true` | a `POST` entry's `multipart/form-data` files in the request map (`filename`, `file_type`, `file_length`, `upload`, `size`, bytes in `contents`), the form's text fields as query parameters, no body; all files together within `rest.upload.max.bytes` (16 MiB) |
| `stream: true` | an interceptor's segments rendered progressively: Server-Sent Events (`event:`/`data:` frames, `event: done` at the end, `event: error` in band, `: ping` keep-alives every `event.stream.keep.alive`) for a `text/event-stream` head or `Accept`, chunked text or JSON lines otherwise; the entry's timeout is the idle allowance, the head's `x-ttl` overrides it; a keep-alive that cannot be written ends the stream; a segment the serializer refuses fails it in band with 500 `Reply cannot be rendered` |
| `upload: true` | a `POST` entry's `multipart/form-data` files in the request map (`filename`, `file_type`, `file_length`, `upload`, `size`, bytes in `contents`), the form's text fields as query parameters, no body; the files and the text fields together, counted in bytes, within `rest.upload.max.bytes` (16 MiB); a part that is multipart itself → 400 `Upload takes text fields and files, not a nested multipart part` |
| Precedence | a `rest.yaml` entry, then an extension's mounted routes (`Platform.addRoutes`), then the static folder (under the `static-content` block's `no-cache-pages` and `filter`), then the error signature below |

## Static content
Expand Down
Loading
Loading