Skip to content

Answer an unbound file binding as no file, not a refusal - #2348

Merged
leaf-agent merged 2 commits into
mainfrom
unbound-file-binding-reads-null
Oct 11, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
unbound-file-binding-reads-null

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A page whose file editor names a binding it lacks is a designed state: the file-editor author instructions say a copied page "explains that it is unavailable", and the developer worked example (examples/developer/file-editor.html) ships unbound. The server answered its read with 400, so Chrome logged "Failed to load resource" on every live page holding one. That broke test_a_composed_page_does_not_offer_history_it_does_not_have from #2202 on, since the corpus composes the unbound example and the suite rejects every console error.

GET /api/files/<id> now answers an unbound id with 200 and null, as /favicon.ico answers 204 to keep the console clean. The browser transport (runtime/file-api.js) turns that null into the same "No file is bound as ''." failure the editor already showed, so the reader sees no change. A save against an unbound id still refuses with 400, and a malformed bindings entry now says so rather than reading as unbound.

Tests: the HTTP door test asserts the null read and the refused save; the sample editor test asserts the explanation's text instead of consuming the 400 it no longer produces.

This was written by Claude Code on behalf of max-sixty

A page whose file editor names a binding it lacks is a designed state: the
file-editor author instructions say a copied page "explains that it is
unavailable", and the developer worked example ships unbound. The server
answered its read with 400, so Chrome logged "Failed to load resource" on
every live page holding one. That broke
test_a_composed_page_does_not_offer_history_it_does_not_have from #2202 on,
since the corpus composes the unbound example and the suite rejects every
console error.

GET /api/files/<id> now answers an unbound id with 200 and `null`, as
/favicon.ico answers 204 to keep the console clean. The browser transport
turns that null into the same "No file is bound as '<id>'." failure the
editor already showed, so the reader sees no change. A save against an
unbound id still refuses with 400, and a malformed bindings entry now says
so rather than reading as unbound.

Tests: the HTTP door test asserts the null read and the refused save; the
sample editor test asserts the explanation's text instead of consuming the
400 it no longer produces.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A malformed binding entry is still treated as missing.

@leaf-agent
leaf-agent merged commit 6971f34 into main Oct 11, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the unbound-file-binding-reads-null branch October 11, 2026 05:32
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