(#10) POST nest messages + event-driven response #17

Merged
jacisjake merged 2 commits from task/10-post-nest-messages into main 2026-10-28 09:39:11 +00:00
jacisjake commented 2026-10-28 09:35:03 +00:00 (Migrated from github.com)
  • nestapi.go: POST /api/nests/{id}/messages (guardrails: length, membership, crow-postable kinds, rate limit reuse; Jev-first tagging per A1) and GET /api/nests/{id}/messages (log read).
  • Event-driven trigger: a request addressed to a member crow invokes exactly one crow through Flock.ask under budget/timeout/flight-log; unaddressed say summons nobody (no idle loops).
  • Flock.ClassifyKind + JevClient.ClassifyKind: the A1 tagger above the confidence band, probabilities written to the flight log (Event.Prob) for calibration.
  • Hub.OpenNest/PublishNest and GET /api/events?nest_id= — nests share the replay/Last-Event-ID machinery. Nest ids (slugs) can't collide with list ids (hex), so one map serves both.
  • cmdServe wires the message store (.crows/messages/).

Closes #10 · Epic: #2

Red (impl absent):

s.getNestMessages undefined / s.hub.OpenNest undefined
FAIL somanycrows [build failed]

Green (after):

--- PASS: TestPostMessageToNest
--- PASS: TestPostMessageUnknownNest
--- PASS: TestPostMessageTriggersOneResponse
--- PASS: TestNoIdleResponse
--- PASS: TestNestStreamSSE
go test -race . → ok somanycrows (41 tests)
- `nestapi.go`: `POST /api/nests/{id}/messages` (guardrails: length, membership, crow-postable kinds, rate limit reuse; Jev-first tagging per A1) and `GET /api/nests/{id}/messages` (log read). - Event-driven trigger: a `request` addressed to a member crow invokes exactly one crow through `Flock.ask` under budget/timeout/flight-log; unaddressed `say` summons nobody (no idle loops). - `Flock.ClassifyKind` + `JevClient.ClassifyKind`: the A1 tagger above the confidence band, probabilities written to the flight log (`Event.Prob`) for calibration. - `Hub.OpenNest`/`PublishNest` and `GET /api/events?nest_id=` — nests share the replay/Last-Event-ID machinery. Nest ids (slugs) can't collide with list ids (hex), so one map serves both. - `cmdServe` wires the message store (`.crows/messages/`). Closes #10 · Epic: #2 **Red (impl absent):** ``` s.getNestMessages undefined / s.hub.OpenNest undefined FAIL somanycrows [build failed] ``` **Green (after):** ``` --- PASS: TestPostMessageToNest --- PASS: TestPostMessageUnknownNest --- PASS: TestPostMessageTriggersOneResponse --- PASS: TestNoIdleResponse --- PASS: TestNestStreamSSE go test -race . → ok somanycrows (41 tests) ```
Sign in to join this conversation.