(#40) Relay — Quill posts requests on the owner's behalf #48

Merged
jacisjake merged 2 commits from task/40-quill-relay into main 2026-10-28 14:58:09 +00:00
jacisjake commented 2026-10-28 14:49:06 +00:00 (Migrated from github.com)

What was addressed

  • Quill's single Flock.ask reply can now open with RELAY {"crow":...,"task":...}: a valid relay posts a request authored by Quill (to the named crow, refers_to the owner message, tagged_by harness) and runs it through the normal must-respond trigger.
  • Invalid relay JSON or a crow outside the nest's core posts one Quill say back to the requester (I could not find <crow> in this nest.; name omitted when the JSON was broken) and nothing else.
  • No RELAY prefix keeps #38 behavior: one Quill deliver. The exactly one model call assertion still holds.
  • Extracted the POST handler's trigger switch plus deliver/divergence hook into Server.triggerResponse, called from both the handler and respondQuill — identical behavior for existing flows (full suite proves it).
  • EVENTS.md Nests section documents relays riding the existing record shape; no new fields.

How to test / validate

  • gofmt -l . prints nothing
  • go vet ./... clean
  • go test -race -count=1 -timeout 180s . → ok somanycrows (all tests, incl. the four new relay_test.go ones)
  • RED was captured first (f6edc8a), excerpt:
    --- FAIL: TestQuillRelayPostsRequest — Quill never posted the relay request /
    --- FAIL: TestQuillRelayUnknownCrowStalls — the unknown-crow reply must be a Quill say /
    --- FAIL: TestQuillRelayNotAnsweredTwice — a relay must not also deliver, got 1 delivers
  • go test -race -run 'TestQuillRelay|TestQuill' -v . → all PASS

Configurations or dependencies

  • No new env vars, keys or guardrail changes; mock/local brains only in tests

Closes #40
Epic: #36

## What was addressed - Quill's single `Flock.ask` reply can now open with `RELAY {"crow":...,"task":...}`: a valid relay posts a `request` authored by Quill (`to` the named crow, `refers_to` the owner message, `tagged_by` harness) and runs it through the normal must-respond trigger. - Invalid relay JSON or a crow outside the nest's core posts one Quill `say` back to the requester (`I could not find <crow> in this nest.`; name omitted when the JSON was broken) and nothing else. - No RELAY prefix keeps #38 behavior: one Quill `deliver`. The `exactly one model call` assertion still holds. - Extracted the POST handler's trigger switch plus deliver/divergence hook into `Server.triggerResponse`, called from both the handler and `respondQuill` — identical behavior for existing flows (full suite proves it). - `EVENTS.md` Nests section documents relays riding the existing record shape; no new fields. ## How to test / validate - [ ] `gofmt -l .` prints nothing - [ ] `go vet ./...` clean - [ ] `go test -race -count=1 -timeout 180s .` → `ok somanycrows` (all tests, incl. the four new `relay_test.go` ones) - [ ] RED was captured first (`f6edc8a`), excerpt: `--- FAIL: TestQuillRelayPostsRequest — Quill never posted the relay request` / `--- FAIL: TestQuillRelayUnknownCrowStalls — the unknown-crow reply must be a Quill say` / `--- FAIL: TestQuillRelayNotAnsweredTwice — a relay must not also deliver, got 1 delivers` - [ ] `go test -race -run 'TestQuillRelay|TestQuill' -v .` → all PASS ## Configurations or dependencies - [ ] No new env vars, keys or guardrail changes; mock/local brains only in tests Closes #40 Epic: #36
Sign in to join this conversation.