Repository navigation
docs(openapi): publish ?format on every negotiable operation (#658) - #659
Merged
Merged
Conversation
…bs#658) Seven operations declare both text/plain and application/json on their 200, so `?format=json` is the switch that picks between them. Only two published the parameter: `/r/{room}` and `/rooms`, each carrying its own copy of the prose. The other five — POST /r/{room}, /r/{room}/say/..., /say-signed/..., /r/events and /kv/{ns} — honour the switch at runtime and documented nothing, so a generated client reads them as text-only and never asks for the JSON. Hoist the parameter into one `_FORMAT_PARAM` constant and attach it to all seven, replacing the two divergent copies. No handler changes: the server behaviour was already correct, the document was not. The regression derives the negotiable set from the responses rather than listing operations, so a new dual-lane operation is covered the day it is added, and asserts one shared spelling of the description so the two sides cannot drift apart again. It also round-trips `/r/events` — a lane that had no parameter at all — text/plain by default, application/json on ?format=json. Filed against ba868a3.
sv
added a commit
that referenced
this pull request
Sep 2, 2026
Folds [Unreleased] into a dated section and moves the version everywhere that declares it. Six commits since v0.11.2. Two data-loss and retention fixes are the reason to cut this now rather than wait: a single message larger than the compaction budget emptied its whole room (#274), and COMPACT_MAX_LINES bound before the byte budget for any record under ~1 KB, so rooms kept 7.6% of the retention they promise (#393). PATCH rather than MINOR, and the one judgment call worth naming is #659: it publishes `?format` on five operations that already honoured it, so the document changed and the service did not. No route, response field or cap moved, and a client written against the old schema still works — which is a documentation fix by this file's own definition of the public API. Bump it to 0.12.0 instead if you read a newly-documented parameter as added surface. Version declarations moved together, as tests/test_mcp.py and tests/http/ test_docs.py require: pyproject.toml, mcp/src/technocore_mcp/server.py, mcp/server.json, mcp/worker/pyproject.toml and mcp/worker/README.md. Deployer notes are in the CHANGELOG entries; the two that matter are disk (a busy room's file now grows toward the full 5 MiB it was always documented to keep) and /humans (the header is correct but nothing caches it until the CDN rule marks the path eligible).
sv
added a commit
that referenced
this pull request
Sep 2, 2026
Folds [Unreleased] into a dated section and moves the version everywhere that declares it. Six commits since v0.11.2. Two data-loss and retention fixes are the reason to cut this now rather than wait: a single message larger than the compaction budget emptied its whole room (#274), and COMPACT_MAX_LINES bound before the byte budget for any record under ~1 KB, so rooms kept 7.6% of the retention they promise (#393). PATCH rather than MINOR, and the one judgment call worth naming is #659: it publishes `?format` on five operations that already honoured it, so the document changed and the service did not. No route, response field or cap moved, and a client written against the old schema still works — which is a documentation fix by this file's own definition of the public API. Bump it to 0.12.0 instead if you read a newly-documented parameter as added surface. Version declarations moved together, as tests/test_mcp.py and tests/http/ test_docs.py require: pyproject.toml, mcp/src/technocore_mcp/server.py, mcp/server.json, mcp/worker/pyproject.toml and mcp/worker/README.md. Deployer notes are in the CHANGELOG entries; the two that matter are disk (a busy room's file now grows toward the full 5 MiB it was always documented to keep) and /humans (the header is correct but nothing caches it until the CDN rule marks the path eligible).
WIZARDspace
added a commit
to WIZARDspace/technocore-chat
that referenced
this pull request
Sep 2, 2026
…ce-occupancy-510 Conflict in src/manifest.py: flop-labs#659 added _FORMAT_PARAM to listNotes' parameters while this branch added _KEYS_PARAM. Both are kept — the operation honours both switches at runtime, and flop-labs#659's regression derives the negotiable set from the responses, so a _text_or_json 200 without a published format parameter fails it. Ordered as elsewhere in the document: path, then domain query params, then format.
This was referenced Sep 2, 2026
zkasuran
added a commit
to zkasuran/technocore-chat
that referenced
this pull request
Sep 3, 2026
…kept flop-labs#659 landed the same shared `?format` parameter on main while this branch carried its own, so the merge left two identical definitions and the second shadowed the first. Keeps main's and folds in the note on why the schema publishes no `enum`. `openapi_document` is byte-identical either way (sha256 9a57d6ad1225359f, 59577 bytes), so nothing served changes.
zkasuran
added a commit
to zkasuran/technocore-chat
that referenced
this pull request
Sep 3, 2026
flop-labs#659 hoisted the shared ?format parameter and attached it to seven of the ten operations whose handlers negotiate, which is the headline this branch claimed. That part is upstream now, so these files go back to main's version and the branch narrows to the three lanes flop-labs#659 did not reach.
zkasuran
added a commit
to zkasuran/technocore-chat
that referenced
this pull request
Sep 3, 2026
postNote, writeNote and writeNoteSigned answer application/json on ?format=json
with a {ns, key, bytes, ts} receipt, and declared neither the parameter nor the
media type nor the shape. flop-labs#659 attached the shared parameter to the seven read
lanes; these three were the remainder. One new schema, main's _FORMAT_PARAM, and
_text_or_json in place of _plain on the three 200s.
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.
Closes #658.
?format=jsonis honoured by seven operations and published by two. The other five answerapplication/jsonat runtime and document no way to ask for it, so a client generated from the spec reads them as text-only.Measured on
ba868a3— operations whose 200 declares bothtext/plainandapplication/json:?format=jsonGET /r/{room}GET /roomsPOST /r/{room}GET /r/{room}/say/{nick}/{text}GET /r/{room}/say-signed/{did}/{sig}/{nonce}/{text}GET /r/eventsGET /kv/{ns}The two that do publish it carried separate copies of the prose, already drifted: one warns that a typo is ignored, the other omits that sentence.
What this changes
Hoists the parameter into a single
_FORMAT_PARAMconstant and attaches it to all seven, replacing both copies. No handler changes — the server was already correct; the document was not.extra/manifest.pygoes 1532 -> 1526 code lines (six fewer, the duplicate objects collapse);sz.py --checkstays green.Regression
test_every_negotiable_response_publishes_the_switch_that_negotiates_itderives the negotiable set from the responses instead of listing operations, so a new dual-lane operation is covered the day it is added rather than the day someone remembers this test. It also asserts a single spelling of the description, which is what stops the two sides drifting again, and round-trips/r/eventslive:text/plainby default,application/jsonon?format=json.RED on unpatched
src/manifest.py(test only, patch stashed):GREEN with the patch:
1 passed.Gates
pytestfull suite: 635 passed (tests/http/test_docs.py: 69 passed)ruff check .: cleanruff format --check .: clean (77 files)sz.py --check: exit 0Scope note:
/openapi.json,/configand the.well-known/*documents are JSON-only — notext/plainalternative — so they are not negotiable and are untouched.