Skip to content

fix: the loose-ends round - YAML 1.2.2 in both packs, and one rule for a URL, a time, a number and a switch - #153

Merged
acn-ericlaw merged 6 commits into
mainfrom
fix/loose-ends-2026-11-30
Nov 30, 2026
Merged

acn-ericlaw merged 6 commits into
mainfrom
fix/loose-ends-2026-11-30

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Contributor

What

The loose-ends round: the differences between the two packs that the defect round (#152) turned up and left, fixed here and in the Python pack in lockstep, with the maintainer's rulings of 2026-11-29 on YAML applied. Five commits: four areas and the CHANGELOG.

  • The configuration reader, REST automation and the host. Every YAML file is read by YAML 1.2.2 in both packs. A setting of the host that is no number, no duration or no switch stops the start by name. An upload is read by the pack's own reader instead of the runtime's form-data parser. A name every object carries (constructor, __proto__) is read as the caller sent it. A timer never fires at once for a long delay. The guides say how a file is read and recommend YAML 1.2.2.
  • Agent tools. One reader of a URL and of robots.txt in both packs. A search by regular expression runs outside the host and ends at a bound. Settings by one rule.
  • LLM helper. The settings are read when the helper starts. One rule for a switch, a time in milliseconds and a page list.
  • ask-person and agent-question. One reader of a time, a number, a duration and a switch. A signed payload has one spelling. A row keeps every digit.

Why

The maintainer's instruction after the defect round: another round "to address these and the remaining inconsistency and loose ends". And the rulings since:

  • "No need to support yes as boolean true for Rust, Python and Node because yes/no as boolean is not documented as supported. It is just the Java YAML reader being more relaxed."
  • "In YAML 1.2, it drops some 1.1 quirks to make it compatible with JSON. Therefore, it makes sense to adhere to newer specs v1.2.2."
  • "please document our recommendation of YAML 1.2.2 specs so that developers and their AI assistants do not try to use the YAML 1.1 additional syntax."

This pack's YAML library reads YAML 1.2 by default, so a configuration file changes little here. What goes is the yes/on reading that #152 gave rest.yaml to match the Python pack. What comes is exactness: a float keeps its point as text, and an integer is exact at any size.

Two principles run through the rest. A value is read by one rule in both packs, and a wrong one is refused by name, at start for a setting. And a text someone else controls - a model's regular expression, a site's robots.txt, a page's link - never decides how long a tool runs.

For the reviewer

Each of these is a decision where another behaviour was defensible.

The configuration reader

  1. The library's YAML 1.2 core schema, with the pack's own rows for an integer and a float. The library reads an integer through parseInt, which rounds above 2^53-1, and gives a float as a plain number, which loses 1.0. The pack's rows hold an integer exactly, a BigInt above 2^53-1, and a float with its point. The tags the library takes by default beyond the core schema are switched off.
  2. The merge key is not supported: << is an ordinary key. It is not in the YAML 1.2.2 core schema, and the Rust engine does not merge either. The Java engine does.
  3. A file with a tag outside the core schema does not load (!!binary, !!timestamp, !!set). This pack warned and went on before.
  4. 010 is 10. That is the core schema. The Java engine reads 8 and the Rust engine keeps it as text, so the guide tells a writer to avoid a leading zero.
  5. A key whose references leave it empty takes its default ('${NAME:}' with the variable unset), as in the Java reader. A literal empty text stays an empty text. rest.yaml does not change: there a reference that resolves to nothing stays as written and is refused where a value is needed.
  6. A tab is still read as two spaces, and the last of two equal keys still wins. Neither is YAML 1.2.2; the first is what the Java engine's ConfigReader does before parsing.
  7. Seven settings of the host can now stop the start: rest.automation, rest.server.port, rest.upload.max.bytes, event.stream.keep.alive, an entry's timeout, otel.forwarding, app.log.context. Where the Java engine has the setting, it reads a wrong value as off, as one second or as no server, without a word.

REST automation and the host

  1. The runtime's form-data parser is no longer used. parseUpload reads the body, the same function in both packs, pinned by 76 shared cases that run over the reader and over HTTP. The runtime's parser refused whole classes of bodies with one generic message, and the Python pack's could not be made to agree with it.
  2. filename* and name* are taken, as RFC 5987 writes them, in UTF-8 or ISO-8859-1. Measured on the Java engine's decoder (Netty 4.2.21), the pack departs in five places: name* is taken here and ignored there; the extended form wins wherever it stands; only those two charsets are taken, where the decoder takes any charset of the JVM; + is a plus sign; bytes that are not the charset are refused instead of replaced.
  3. A part with Content-Transfer-Encoding: base64 is refused. Both packs decoded it for a field before; the Java engine's decoder refuses it too.
  4. The client returns an edge's JSON error as an envelope from request() and send(), as stream() did. A payload that is neither an envelope nor that error body still raises.
  5. A request's maps stay ordinary objects. A name is defined, never assigned, and read as an own key, so constructor, toString and __proto__ are names like any other in a query, a form, a cookie, a header, a path parameter and an upload. Maps without a prototype would break strict deep equality with literals in callers' tests. A header named __proto__ is recovered from the raw headers, because the HTTP server drops it.
  6. A timer's delay is held to 2147483647 ms where it comes from a caller, such as x-ttl: the caller's header is never refused for it. A setting above that is refused at start.
  7. Every await that runs in order on purpose carries its reason on its line. The nine rows the defect round left - mcp-binding.mjs 5, demo-app.mjs 1, actuator.ts 1, bus.ts 2 - and one more in otel/export.ts.

Agent tools

  1. The web tools no longer use new URL to read a URL. Both packs carry one reader, writer and resolver. 103 of 210 probe URLs came out differently in the two packs before; none do now, nor on 59,999 generated URLs. A host is a name in letters, digits, hyphens, dots and underscores, an IPv4 address in dotted decimal, or an IPv6 address in brackets; an internationalized name must be in its xn-- form. The short form of an IPv6 address is still taken from the runtime.
  2. A URL is at most 8192 characters, counted in its one form. A page can write a link of any length, and each link is asked of robots.txt.
  3. robots.txt: the product token is compared whole, so a group for mercury is no longer the tools'. A robots.txt that cannot be read allows all, where RFC 9309 says to disallow on a server error.
  4. A regular expression never runs in the host. It runs in a worker thread, which costs 6 to 10 ms a search, and is ended at tools.file.search.timeout.ms with a 408. A literal is a substring test in the host; above 64 units it goes through the tools' own linear search, because the engine's includes took 11 seconds for a literal of 40,001 units on a line of 2,000,000.
  5. An argument is not text: "5" and "true" are a 400, because the catalog row types them integer and boolean. A setting takes the text forms. The LLM helper and ask-person take digits as text for a field, as their own documents say.
  6. The catalog rows are unchanged. file_search's row still says truncated means cut at max_results; it is now also set when the walk stopped at 20,000 entries.
  7. New exports: readUrl, resolveUrl, MAX_URL_LENGTH, and setScanLimit for the tests.

LLM helper

  1. The transcript store is built when the helper starts, as a client object without a connection. So llm.transcript.store: redis without its client stops the start, where it was a 503 on the first loop turn.
  2. A value above a maximum is refused by the field's existing message (... must be a whole number >= 1), as the defect round did for numbers above 2^53-1. The maxima are 2147483647 ms for a timer, 65535 for a port and 1000000d for the audit's retention.
  3. The keys of a feature that is off are not read: the Redis keys without redis, the audit keys without an audit store, llm.aws.api without Bedrock.

ask-person and agent-question

  1. A time needs Z or an offset, an upper-case T, and no white space around it. Both packs trimmed white space before, and this pack read a time without an offset as local time and 30 February as 2 March. The readers agree with a reference on 322,922 generated texts.
  2. The bytes under a ticket's signature must be the canonical JSON of its five fields. A ticket minted elsewhere with another spelling is malformed. Both packs agree with a reference on 200,074 generated payloads.
  3. A row can hold a BigInt. A row id, a sequence or a whole number in a waiting call's input above 2^53-1 is held exactly and written with JSON.rawJSON. Plain JSON.stringify of such a row throws. The health reply tells such a cursor as text, in both packs.
  4. A text setting keeps U+FEFF at its ends, since the trim is the 24 characters both runtimes share. A ticket key that carried one is a different key.
  5. The intake refuses an event whose requested_at or a wait's expires_at is no time.

Not fixed

Found in this round and left, the same in both packs unless said:

  • YAML, parser level: the library refuses an anchor name that ends in a colon. That is the 6 of 126,316 generated scalars on which this pack and the reference differ. It also refuses a document with more than 100 alias uses.
  • A number above 2^53-1 read from JSON text is rounded here and exact in the Python pack: the engine's answer, a row read back, a request body.
  • The wire codec refuses a map key named __proto__ on POST /api/event; the Python pack takes it.
  • Agent tools: "characters" are UTF-16 units here and code points there (a line cut to 500); charset labels differ (iso-8859-1, utf-16 with a mark); two href on one link; the order of two refusals in one request (10 of 351); file.search reads each file whole; the link de-duplication grows with the square of the links.
  • MCP binding: timeout_ms and mcp.call.timeout.ms still go through each runtime's own number reader.
  • otel.exporter.otlp.timeout and its connect timeout are read with a silent fallback.
  • .properties files take key=value lines only, without Java's escapes.
  • The ask-person and agent-question test files each hold one test name twice, from before this round.

Upgrade note

The agent tools, REST automation and the two person-in-the-loop extensions are in no release yet. For an application that runs them from main, and for the configuration file of any application:

  • A switch or a flag written yes or on stops the start: write true or false. rest.yaml took them as booleans since fix: the behaviours the code-quality round found - one rule in both packs for addresses, globs, numbers, tickets and rest.yaml flags #152; it no longer does.
  • info.app.version: 1.0 reads 1.0, not 1. A number above 2^53-1 in a file is a BigInt. A file with !!binary or !!timestamp does not load.
  • A setting that is no number, no duration or no switch stops the start by name, where it was a default or off. This includes a value a deployment never exercised.
  • A time sent to ask-person needs Z or an offset; without one it was read as local time.
  • A host in a URL outside letters, digits, hyphen, dot and underscore is refused; a URL in a result is in the one form.
  • A row of the question record can hold a BigInt id.

The CHANGELOG entries (Fixed 7 to 11) carry the full list.

Verification

Run on a clean checkout of this branch's last commit, not on the working tree.

  • npm test: 2935 tests, 2859 passed, 76 skipped, none failed (1466 tests and 1390 passed before this round). With a live Redis, PostgreSQL and Neo4j in throwaway local containers: 2927 passed and 8 skipped, none failed (the 8 need the live MCP recipe servers). CI has no such services, so that is their only run.
  • tsc --noEmit clean. The documentation site builds with mkdocs build --strict.
  • The analyzer bundled in SonarQube for IDE, run headless: 0 reported on the 20 source files this pull request touches.
  • The eleven shared vector files are byte-identical with the Python pack's copies.
  • Checked against references written without either pack's code: the YAML core schema (239 probes, none differ; 126,316 generated scalars, of which 6 differ here, all an anchor name the library refuses), a time (322,922 texts), a signed payload (200,074) and robots.txt (200,000 paths).
  • Pack against pack: 59,999 generated URLs and 6,730 joined links, 24,000 generated robots.txt files with 244,000 paths, and 719 number and switch probes of the agent tools: no difference.
  • The matchers: the robots.txt matcher against the Python pack's on 62,000 generated rules: no difference. A file of long rules that took 3 seconds a question, on the event loop, takes a few milliseconds.
  • The new tests were run against the code as it stood: the tests of each fixed behaviour fail there.
  • Not run: Node 22, the package's floor. It is not installed on the machine and CI runs Node 26 as well. The newest runtime features the changes use are JSON.rawJSON and String.prototype.isWellFormed, which Node 22 has. Windows.

Beside this pull request

Co-Authored-By: Claude Fable 5.2 noreply@anthropic.com

🤖 Generated with Claude Code

acn-ericlaw and others added 5 commits November 30, 2026 00:37
…one rule, and an upload by the pack's own reader

The configuration reader: a plain scalar is resolved by the core schema of
YAML 1.2.2 in both packs (the maintainer's ruling): true and false are the
booleans, 010 is 10, and yes, on, 16_000, 1:30, 0b101, a date and the
merge key are text or an ordinary key. It reads application.yml,
rest.yaml, app-log-context.yaml and the MCP binding's file. As text a
boolean is true or false and a float keeps its point. A key with no value
and one its references leave empty take the default; a reference sees an
override; a reference loop is logged and has no value.

Settings of the host follow the round's rule and stop the start by name:
rest.automation, rest.server.port, rest.upload.max.bytes,
event.stream.keep.alive, an entry's timeout, otel.forwarding,
app.log.context.

REST automation and the host: one upload reader in both packs, pinned by
76 shared cases over the reader and over HTTP, with filename* and name*
as RFC 5987 writes them; the client returns an edge's JSON error as the
failure it carries; a reply the wire codec refuses is the engines' 500; a
refusal while the request is read is traced; a name every object carries
(constructor, __proto__) is read as the caller sent it; a timer is held
to 2147483647 ms.

The awaits that run in order on purpose carry their reason on the line
(the MCP binding, the demo application, the actuator, the bus, the
forwarder).

The guides say how a file is read and recommend YAML 1.2.2 to whoever
writes one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…, a regex search that ends at a bound, settings by one rule

The web tools take a URL apart by one set of rules, write it back in one
form, refuse anything else by name and ask a site for exactly what was
checked; a URL is at most 8192 characters. robots.txt is read by the
tools' own RFC 9309 reader, a rule matched part by part between its
stars, so its time is its length plus the path's. file.search with
regex: true runs outside the host and ends at
tools.file.search.timeout.ms with a 408; a literal is a substring test.
A walk looks at 20,000 entries at most and says truncated. A tools.*
setting that is no number or no switch stops the start by name.
graph.ingest keeps a property named __proto__.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…switch, a time in milliseconds and a page list by one rule

A start-up step reads the settings a request falls back on and builds the
transcript store when one is named, so a wrong one stops the application
by name. A switch is true or false and any other value stops the start. A
time in milliseconds is at most 2147483647, the audit's retention at most
1000000d, a port at most 65535. In a page list white space is ignored
around a number and refused inside one. A path is blank by the same 24
characters in both packs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ration and a switch; a signed payload has one spelling

A time is a date, T, a time to the minute or the second, and Z or an
offset, read to the millisecond by one rule in both packs. A wait whose
expiry is past the year 9999 is a 400. turn, ttl, the list's since, before
and limit and every setting follow the number and duration rule; a switch
that is neither true nor false stops the boot. The bytes under a ticket's
signature are the canonical JSON of its five fields. A setting that sets
a timer is at most 2147483647 ms, a port at most 65535, a turn at most
2147483647. A required text is blank by the same 24 characters in both
packs. A graph is looked up among the configured ones only, and a row id
or a whole number above 2^53-1 is held and written with every digit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…er, ask-person and agent-question, the YAML 1.2.2 reader, REST automation and the host

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… of registers, not a depth of nesting

The test of a search by regular expression expected 30,000 nested groups to be refused. That is what the
engine's compiler does on a worker's 4 MB stack on macOS arm64: "Stack overflow". On CI's Linux x64 runner
the same Node 26.13.1 compiles the expression and runs it in about seven seconds, so the search answered
and the test failed with "expected a refusal" (run 46384505235). How deep an expression may nest is the
size of a stack, and differs from one platform to the next. Measured on one machine, the same expression
is "Regular expression too large" on a stack of 1 MB or 2 MB, "Stack overflow" on 4 MB, and runs on 8 MB
and more; with a 16 MB worker stack the test fails here as it did on CI.

The case is now 40,000 lookaheads, which need more registers than the engine has. The engine reads that
expression and refuses it when it first runs it, at every stack size from 1 MB to 64 MB, in milliseconds.
The case also runs on a folder without a file, which pins the worker's first run on an empty text:
without that run, the search of an empty folder answers.

No change of behaviour. The tools refuse what the engine cannot compile and end what does not finish
(tools.file.search.timeout.ms), as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit 6c4c5a6 into main Nov 30, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the fix/loose-ends-2026-11-30 branch November 30, 2026 18:12
acn-ericlaw added a commit that referenced this pull request Nov 30, 2026
… YAML 1.2.2, a value read by one rule and refused by name, no tool whose running time a model's or a site's text decides; the first CI run's failure on a test case that a platform's stack decided; the upload reader's refusal of a base64 part confirmed by the maintainer; the two rules in continuity, every kept finding with its reason, what the round found and left as a thread

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant