B4: @-addressing parse + must-respond #11

Closed
opened 2026-10-28 05:27:28 +00:00 by jacisjake · 0 comments
jacisjake commented 2026-10-28 05:27:28 +00:00 (Migrated from github.com)

Epic: #2. Depends on: #10

Goal

Parse @CrowName out of message text into the to field, and enforce the rule: an addressed crow must respond (claim, deliver, or decline-with-reason) rather than being silently ignorable.

Context a stranger needs

Roster of crow names is roster (flock.go) and persona keys (personas.go:31). Parse only names present in the nest's membership plus owner. A deliver addresses back to the requester (CHATROOM_SPEC.md section 4). Responses are generated via Flock.ask with the crow's persona (systemFor, personas.go:156).

Acceptance criteria — falsifiable tests

  1. TestParseAddressing — Given "Taking it, @Research" against a roster containing Research, when parsing, then to == "Research" and the text is stored clean. Unknown handle @Nobody yields no to and is kept as literal text. Red now, green after.
  2. TestAddressedCrowMustRespond — Given a request addressed to a mock crow, when processing, then that crow's reply carries a kind in {claim, deliver, decline} — a say-only reply to a direct request is treated as a failure by the harness (logged, retried once, then flagged). Assert the harness rejects a non-responsive reply. Red now, green after.
  3. TestDeliverAddressesRequester — a deliver from B responding to A's request gets to == "A" automatically. Red now, green after.

Test command

go test -race -run 'TestParseAddressing|TestAddressedCrow|TestDeliverAddresses' ./...

Blockers / unknowns

Decline-with-reason shape must be in the B1 contract; if B1 omitted it, update EVENTS.md first (contracts-first).

Epic: #2. Depends on: #10 ## Goal Parse `@CrowName` out of message text into the `to` field, and enforce the rule: an addressed crow must respond (claim, deliver, or decline-with-reason) rather than being silently ignorable. ## Context a stranger needs Roster of crow names is `roster` (`flock.go`) and persona keys (`personas.go:31`). Parse only names present in the nest's membership plus owner. A `deliver` addresses back to the requester (`CHATROOM_SPEC.md` section 4). Responses are generated via `Flock.ask` with the crow's persona (`systemFor`, `personas.go:156`). ## Acceptance criteria — falsifiable tests 1. `TestParseAddressing` — Given "Taking it, @Research" against a roster containing Research, when parsing, then `to == "Research"` and the text is stored clean. Unknown handle `@Nobody` yields no `to` and is kept as literal text. Red now, green after. 2. `TestAddressedCrowMustRespond` — Given a request addressed to a mock crow, when processing, then that crow's reply carries a `kind` in {claim, deliver, decline} — a `say`-only reply to a direct request is treated as a failure by the harness (logged, retried once, then flagged). Assert the harness rejects a non-responsive reply. Red now, green after. 3. `TestDeliverAddressesRequester` — a `deliver` from B responding to A's `request` gets `to == "A"` automatically. Red now, green after. ## Test command `go test -race -run 'TestParseAddressing|TestAddressedCrow|TestDeliverAddresses' ./...` ## Blockers / unknowns Decline-with-reason shape must be in the B1 contract; if B1 omitted it, update EVENTS.md first (contracts-first).
Sign in to join this conversation.