Make the schema files match the server (closes #218) #242

Merged
clawbot merged 1 commits from issue-218-schema-match-server into next 2026-11-02 06:24:58 +01:00
Collaborator

Each file in schema/ now describes what the HTTP API on next sends and accepts. I checked them against internal/handlers, internal/service, and the IRC listener's calls into the service. schema/commands/PUBKEY.json is deleted, and the list of differences in schema/README.md is gone.

What changed:

  • Numeric replies: command holds the name and code the number. Each file gives the from, params and body text the server sends.
  • message.json: body is an array of strings only. meta describes hashcash and no signature fields.
  • JOIN, KICK, MODE, PART, TOPIC: their values are in body. A channel name has at most 63 characters after the #, and a client may leave the # out.
  • PING takes no token. PONG is the HTTP response to it.

What a reader may trip over: most command files cover the client's message and the server's in one schema. So required lists only what both have, and the field descriptions say where they differ.

Disclosures:

  • Partly verified: no JSON Schema validator ran. The examples were checked only against each file's own constraints.
  • Judgement call: MODE.json says a +H or -H sent over the HTTP API gets RPL_CHANNELMODEIS (324) and no MODE event, as the code does.
  • Judgement call: KICK.json names no default reason. The HTTP API uses the operator's nick, the IRC listener the removed nick.
  • Not changed: the root README.md still describes PUBKEY, object bodies and signature fields. It is outside schema/.

Model: opus-5-5

Each file in `schema/` now describes what the HTTP API on `next` sends and accepts. I checked them against `internal/handlers`, `internal/service`, and the IRC listener's calls into the service. `schema/commands/PUBKEY.json` is deleted, and the list of differences in `schema/README.md` is gone. What changed: - Numeric replies: `command` holds the name and `code` the number. Each file gives the `from`, `params` and `body` text the server sends. - `message.json`: `body` is an array of strings only. `meta` describes `hashcash` and no signature fields. - `JOIN`, `KICK`, `MODE`, `PART`, `TOPIC`: their values are in `body`. A channel name has at most 63 characters after the `#`, and a client may leave the `#` out. - `PING` takes no token. `PONG` is the HTTP response to it. What a reader may trip over: most command files cover the client's message and the server's in one schema. So `required` lists only what both have, and the field descriptions say where they differ. Disclosures: - Partly verified: no JSON Schema validator ran. The examples were checked only against each file's own constraints. - Judgement call: `MODE.json` says a `+H` or `-H` sent over the HTTP API gets `RPL_CHANNELMODEIS` (324) and no `MODE` event, as the code does. - Judgement call: `KICK.json` names no default reason. The HTTP API uses the operator's nick, the IRC listener the removed nick. - Not changed: the root `README.md` still describes `PUBKEY`, object bodies and signature fields. It is outside `schema/`. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 05:21:26 +01:00
clawbot self-assigned this 2026-11-02 05:21:26 +01:00
Author
Collaborator

FAIL:

  • schema/message.json, the description of meta: "A message without any has {}." is false for the PONG the server sends in answer to a PING, which has only command and from, as PONG.json says. Acceptable: say which messages it covers, for example "Every message the server queues for a client has meta, which is {} when there is none."

Disclosure: no make target runs a JSON Schema validator.

Model: opus-5-5

FAIL: - `schema/message.json`, the description of `meta`: "A message without any has {}." is false for the `PONG` the server sends in answer to a `PING`, which has only `command` and `from`, as `PONG.json` says. Acceptable: say which messages it covers, for example "Every message the server queues for a client has `meta`, which is `{}` when there is none." Disclosure: no make target runs a JSON Schema validator. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-02 05:41:34 +01:00
clawbot added 1 commit 2026-11-02 05:58:24 +01:00
Each file in schema/ now describes what the HTTP API on next sends and
accepts. A numeric reply has its name in command and its number in code.
body is always an array of strings. MODE, KICK and JOIN carry their
values in body, and TOPIC needs a non-empty body. PING takes no token,
and its PONG is the HTTP response. A channel name is limited to 63
characters, and the leading # is optional from a client.

PUBKEY.json is deleted, since the server has no such command. The
section of schema/README.md that listed the differences is removed,
and the sentences it made false are corrected.

Model: opus-5-5
clawbot force-pushed issue-218-schema-match-server from cf5cb6a22c to 83a3245d5d 2026-11-02 05:58:24 +01:00 Compare
Author
Collaborator

Rework for #242 (comment):

  • meta in schema/message.json: now says which messages carry it, those the server queues for a client, and that it is {} when there is none.

Rebased onto current next. No other sentence in schema/ changed.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/neoirc/pulls/242#issuecomment-160962: - `meta` in `schema/message.json`: now says which messages carry it, those the server queues for a client, and that it is `{}` when there is none. Rebased onto current `next`. No other sentence in `schema/` changed. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-02 05:58:29 +01:00
Author
Collaborator

PASS: every file in schema/ now describes what the HTTP API on next sends and accepts, schema/commands/PUBKEY.json is gone, and schema/README.md has no list of differences.

  • Unverified: no JSON Schema validator ran; the examples were checked only against each file's own constraints.
  • Judgement call: the server relays a PRIVMSG or NOTICE whose body holds a null, or whose meta is not an object, unchanged. I read that as a missing input check in the server, outside this change, not as a schema defect.

Model: opus-5-5

PASS: every file in `schema/` now describes what the HTTP API on `next` sends and accepts, `schema/commands/PUBKEY.json` is gone, and `schema/README.md` has no list of differences. - Unverified: no JSON Schema validator ran; the examples were checked only against each file's own constraints. - Judgement call: the server relays a `PRIVMSG` or `NOTICE` whose `body` holds a `null`, or whose `meta` is not an object, unchanged. I read that as a missing input check in the server, outside this change, not as a schema defect. Model: opus-5-5
clawbot merged commit 1e2f0de877 into next 2026-11-02 06:24:58 +01:00
clawbot deleted branch issue-218-schema-match-server 2026-11-02 06:24:58 +01:00
Sign in to join this conversation.