Both languages honour the same spellings of TS_STORAGE_BACKEND - #1348
Merged
Conversation
resolve_backend says of itself that it "Mirrors StorageBackendConfig::resolve_decision", and nothing checked that it does. The engine accepts ten spellings across three backends and the plan carries its own copy of all ten. A spelling one side honours and the other does not is invisible from the outside: an unrecognised request does not fail, it falls through to auto-detection, which the docstring itself calls indistinguishable from having been honoured. The plan is what tells an operator which backend a deployment will get; the engine is what they actually get. The comparison is an EQUALITY, in both directions. Driving the plan with every rust spelling only shows that python honours everything rust does - it can never show a spelling python still advertises after rust dropped it, which is the direction that leaves the plan promising a forced backend the engine sends to auto. Both sets are parsed and compared, and the driven check is kept alongside so the parse cannot pass while the behaviour differs. Also pins the normalisation on both sides and the fall-through to Auto. Verified to fail on a spelling removed from the rust list, on a spelling removed from the python list, and on the trim-and-lowercase being dropped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bjmeetsfo
deleted the
both-languages-honour-the-same-backend-spellings
branch
September 8, 2026 20:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve_backendsays of itself:Nothing checked that it does. The engine accepts ten spellings across three backends, and the
plan carries its own copy of all ten:
A spelling one side honours and the other does not is invisible from the outside. An unrecognised
request does not fail — it falls through to auto-detection, which
resolve_backend's owndocstring calls out as "from the outside … indistinguishable from having been honoured". The
plan is what tells an operator which backend a deployment will get; the engine is what they
actually get.
The same shape already cost a production incident on the neighbouring rule:
TS_META_ADDR=localwas a sentinel to one implementation and a literal socket address to another, and every write on
a one-box failed. That pair is now guarded by #1343.
The comparison is an equality, in both directions
Driving the plan with every rust spelling only shows that python honours everything rust does. It
can never show a spelling python still advertises after rust dropped it — and that is the
direction where the plan promises a forced backend the engine quietly sends to auto-detection. So
both sets are parsed and compared for equality, with the driven check kept alongside, so the
parse cannot agree while the behaviour differs.
Also pinned: normalisation on both sides (rust
value.trim().to_ascii_lowercase(), python_clean(...).lower(), so" MatrixObject "is honoured by both), and the fall-through — anunknown value must land where no request lands.
It discriminates
objectremoved from the rust listpathremoved from the python list.trim().to_ascii_lowercase()removedOne correspondence is hand-written and cannot be derived: the rust variant names
(
MatrixObject,SharedPath,Raft) and the strings the plan reports are spelled differently.Exhaustiveness is asserted, so a new variant fails this file rather than being skipped by it.
A note on getting there — my first version asserted that an unknown request comes back
honoured=False. That was wrong about the code, not a finding:honouredanswers "did you getthe backend you asked for", so an absent request is trivially honoured. The check now compares
against what no request at all produces.
No production code changes.
🤖 Generated with Claude Code