Skip to content

fix(engine/2.0): stop rejecting valid engine postgres config - #30

Merged
wdawson merged 1 commit into
mainfrom
wils/engine-config-pool-and-schedules
Sep 1, 2026
Merged

fix(engine/2.0): stop rejecting valid engine postgres config#30
wdawson merged 1 commit into
mainfrom
wils/engine-config-pool-and-schedules

Conversation

@wdawson

@wdawson wdawson commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What

Three lines. The storage subtree closed every object with additionalProperties: false; this opens them.

-              "additionalProperties": false
+              "additionalProperties": true

Why not just document the missing fields

That was the first version of this PR, and it was the wrong fix. Enumerating engine config fields here creates a second place to update whenever engine config grows, and the failure mode when it is missed is a hard reject of a config the engine runs happily.

It had already been missed: target_session_attrs has been read by the engine for a while and was absent, and max_conns would have been the second instance in a month. Documenting them fixes today's two and leaves the mechanism that produced them.

The error was also unhelpful. Because the two postgres variants sit inside a oneOf, an unknown key fails every branch, so the message lands on the whole storage node rather than naming the field:

/storage/postgres must have required property 'data_path'
/storage/postgres must NOT have additional properties

This does not weaken the variants

The embedded and external variants are discriminated by required, not by additionalProperties, so opening the objects changes nothing about which one a config matches. Verified with ajv:

Case Result
example.yaml, embedded variant (regression) valid
external variant baseline valid
external + max_conns valid (was rejected)
external + target_session_attrs valid (was rejected)
embedded + max_conns valid
a schedules section of any shape valid
required key typo'd (passwrod) still rejected
embedded and external keys together (ambiguous) still rejected
optional key typo'd (sslmodee) now accepted — see below

What is given up

Typos in optional keys are no longer caught. Typos in required keys still are, because required catches them independently — so passwrod: p still fails, and only something like sslmodee: disable now slips through to be ignored by the engine.

That is the deliberate trade: the schema stops being a second source of truth that can reject valid config, and in exchange it stops catching one class of typo.

execution_logging still sets additionalProperties: false and is the next likely instance of the same problem. Left alone here rather than widened speculatively.

Context

Consumer side is ArcadeAI/monorepo#3754, which adds max_conns and schedules.max_concurrent_executions to the engine.


— Drake 🐉, Wils's agent

The storage subtree closed every object with `additionalProperties: false`, so
the schema had to enumerate each field the engine accepts or reject it. It fell
behind: `target_session_attrs` has been read by the engine for a while, and
`max_conns` joins it, and both were rejected. Because the two postgres variants
sit inside a `oneOf`, an unknown key fails every branch, so the error lands on
the whole `storage` node instead of naming the offending field.

Enumerating fields here means a second place to update whenever engine config
grows, and the failure mode when it is missed is a hard reject of a config the
engine runs happily. Open the subtree instead.

The variants are discriminated by `required`, not by `additionalProperties`, so
this does not weaken them: an embedded config still matches only the data_path
variant, an external one only the host variant, and a config carrying both is
still ambiguous and rejected. A typo in a required key is still caught by
`required`. What is given up is catching a typo in an optional key.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wdawson
wdawson force-pushed the wils/engine-config-pool-and-schedules branch from f5db1d3 to 8bc73c5 Compare September 1, 2026 18:15
@wdawson wdawson changed the title feat(engine/2.0): describe pool sizing and scheduler concurrency fix(engine/2.0): stop rejecting valid engine postgres config Sep 1, 2026
@wdawson
wdawson marked this pull request as ready for review September 1, 2026 18:17
@wdawson
wdawson requested a review from evantahler September 1, 2026 18:17
@wdawson
wdawson merged commit 899261e into main Sep 1, 2026
1 check passed
@wdawson
wdawson deleted the wils/engine-config-pool-and-schedules branch September 1, 2026 19:14
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.

2 participants