Message bodies are always arrays of strings (text lines) or objects
(structured data like PUBKEY). Never raw strings. This enables:
- Multiline messages without escape sequences
- Deterministic JSON canonicalization (RFC 8785 JCS) for signing
- Structured data where needed
Update all schemas: body fields use array type with string items.
Update message.json envelope: body is oneOf[array, object], id is UUID.
Update README: message envelope table, examples, and canonicalization docs.
Update schema/README.md: field types, examples with array bodies.
Replace c2s/s2c/s2s taxonomy with IRC-native structure:
- schema/commands/ — IRC command schemas (PRIVMSG, NOTICE, JOIN, PART,
QUIT, NICK, TOPIC, MODE, KICK, PING, PONG)
- schema/numerics/ — IRC numeric reply codes (001-004, 322-323, 332,
353, 366, 372-376, 401, 403, 433, 442, 482)
- schema/message.json — base envelope mapping IRC wire format to JSON
Messages use 'command' field with IRC command names or 3-digit numeric
codes. 'body' is a string (IRC trailing parameter), not object/array.
'from'/'to' map to IRC prefix and first parameter.
Federation uses the same IRC commands (no custom RELAY/LINK/SYNC).
Update README message format, command tables, and examples to match.
- Add IRC command/numeric mapping tables (C2S, S2C, S2S)
- Document structured message bodies (array/object, never raw strings)
- Document RFC 8785 JCS canonicalization for deterministic hashing
- Document Ed25519 signing/verification flow with TOFU key distribution
- Document PUBKEY message type for public key announcement
- Update message examples to use IRC command format
- Update curl examples to use command-based messages
- Note web client as convenience UI; primary interface is IRC-style clients
- Add schema/ to project structure
C2S (7): send, join, part, nick, topic, mode, ping
S2C (12): message, dm, notice, join, part, quit, nick, topic, mode, system, error, pong
S2S (6): relay, link, unlink, sync, ping, pong
Each message type has its own schema file under schema/{c2s,s2c,s2s}/.
schema/README.md provides an index of all types with descriptions.
- Document simplified endpoint structure
- Single message stream (GET /messages) for all message types
- Unified send (POST /messages) with 'to' field
- GET /state replaces separate /me and /channels
- GET /history for scrollback
- Update project status
- Use /state instead of /me for auth check
- Use /messages instead of /poll for message stream
- Use unified POST /messages with 'to' field for all sends
- Update part channel URL to DELETE /channels/{name}
- HandleState returns user info (id, nick) + joined channels in one response
- HandleGetMessages now serves unified message stream (was HandlePoll)
- HandleSendMessage accepts 'to' field for routing to #channel or nick
- HandleGetHistory supports scrollback for channels and DMs
- Remove separate HandleMe, HandleListChannels, HandleSendDM, HandleGetDMs, HandlePoll
The bare 'chatd' pattern matched the cmd/chatd/ directory,
preventing main.go from being tracked. Use /chatd to only
match the binary at the repo root.
- Fix stuttering type names (e.g. config.ConfigParams → config.Params)
- Add doc comments to all exported types/functions/methods
- Add package doc comments to all packages
- Fix JSON tags to camelCase
- Extract magic numbers to constants
- Add blank lines per nlreturn/wsl_v5 rules
- Use errors.Is() for error comparison
- Unexport NewLoggingResponseWriter (not used externally)
- Replace for-range on ctx.Done() with channel receive
- Rename unused parameters to _
- AGENTS.md: all changes via feature branches, no direct main commits
- internal/models/model.go: DB interface + Base struct for all models
- internal/models/channel.go: Channel model with DB access for relation queries
- Database.NewChannel() factory injects db reference into model instances
- Uses interface to avoid circular imports (models -> db)