Skip to content

docs(openapi): publish the size warning on say-signed's {text} param - #82

Closed
jefriidan15 wants to merge 1 commit into
flop-labs:mainfrom
jefriidan15:docs/signed-say-text-param
Closed

jefriidan15 wants to merge 1 commit into
flop-labs:mainfrom
jefriidan15:docs/signed-say-text-param

Conversation

@jefriidan15

Copy link
Copy Markdown

The two URL write lanes carry the same {text} path segment, but only one described it. /r/{room}/say/{nick}/{text} publishes the practical size budget — "the URL is the size limit in practice: 4096 ASCII characters fit, one CJK character is 9 bytes encoded — use POST for long non-Latin text" — while /r/{room}/say-signed/{did}/{sig}/{nonce}/{text} published a bare schema with no description at all.

That is backwards. The signed lane has strictly less URL budget than the unsigned one: a 56-character DID, an 86-character signature and a nonce all sit in the path ahead of the text. It is the lane where a caller is most likely to build a URL that no proxy will carry, and it was the lane that said nothing about it. A code generator reads maxLength: 4096 as a promise that 4096 characters of any script fit; on this lane that is further from true than anywhere else in the document.

The fix is the same one the did/sig/nonce schemas already got in this file: one definition, published everywhere the field appears. _TEXT_PATH_PARAM is hoisted next to _TEXT_SCHEMA and used by both lanes, so the two cannot drift into two different strengths again — which is how the weakest copy became the real contract last time.

No behaviour change; the served surface is unchanged apart from the added description.

Verification

test_openapi_limits_are_the_limits_the_server_enforces is extended to assert the signed lanes text param publishes the same maxLength**and** the same description as the unsigned lane, rather than checking the unsigned lane alone. It fails onmain`:

E       AssertionError: assert None == "URL-encoded message body. The URL is the size limit in practice: ..."

Full suite, uv run --group dev python -m pytest tests:

321 passed in 131.78s (0:02:11)

ruff check src/manifest.py tests/http/test_docs.py — All checks passed.

The signed URL write lane carried a bare `{text}` schema while the unsigned
say lane carried the size-limit description and the practical byte budget.
The signed lane has strictly less URL room — did/sig/nonce sit in the path
ahead of the text — so it is the lane that most needs the 'use POST for long
non-Latin text' warning, yet it published nothing machine-readable about size
beyond maxLength.

Hoist the shared `{text}` path param into one _TEXT_PATH_PARAM and use it on
both lanes, so the two URL write lanes publish one identical text contract.
Extend test_openapi_limits_are_the_limits_the_server_enforces to assert the
signed lane's text param matches the unsigned lane's description and maxLength.

sv commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #111 — same fix (hoisting the say-signed lane's text-size description into a shared _TEXT_PATH_PARAM), filed independently for the same issue (#76). Closing in favor of #111, which has a marginally more precise drift-proofing test. Thanks for catching this gap.


Generated by Claude Code

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