An append-only message log per nest with durable storage and ordered replay, mirroring how Hub replays list history. This is the data structure the conversation runs on.
Context a stranger needs
Follow NestStore.save() (nests.go:133, atomic tmp+rename) for persistence and Hub.listStream/Subscribe (hub.go:17, hub.go:121) for the in-memory ordered history + numbered replay. IDs should be monotonically increasing per nest so Last-Event-ID works.
Acceptance criteria — falsifiable tests
TestMessageLogAppendOrder — Given a fresh log, when appending 3 messages, then reading returns them in append order with ids 1,2,3. Red now (type doesn't exist), green after.
TestMessageLogReplayFrom — Given 5 appended, when replaying after id 2, then returns messages 3,4,5 only. Red now, green after.
TestMessageLogPersists — Given messages appended, when the store reloads from its file path, then all messages are present (round-trip through the on-disk format). Red now, green after.
Test command
go test -race -run 'TestMessageLog' ./...
Blockers / unknowns
Storage location: extend .crows/ (add messages.jsonl or per-nest file). Decide during implementation; must survive server restart.
Epic: #2. Depends on: #8
## Goal
An append-only message log per nest with durable storage and ordered replay, mirroring how `Hub` replays list history. This is the data structure the conversation runs on.
## Context a stranger needs
Follow `NestStore.save()` (`nests.go:133`, atomic tmp+rename) for persistence and `Hub.listStream`/`Subscribe` (`hub.go:17`, `hub.go:121`) for the in-memory ordered history + numbered replay. IDs should be monotonically increasing per nest so `Last-Event-ID` works.
## Acceptance criteria — falsifiable tests
1. `TestMessageLogAppendOrder` — Given a fresh log, when appending 3 messages, then reading returns them in append order with ids 1,2,3. Red now (type doesn't exist), green after.
2. `TestMessageLogReplayFrom` — Given 5 appended, when replaying after id 2, then returns messages 3,4,5 only. Red now, green after.
3. `TestMessageLogPersists` — Given messages appended, when the store reloads from its file path, then all messages are present (round-trip through the on-disk format). Red now, green after.
## Test command
`go test -race -run 'TestMessageLog' ./...`
## Blockers / unknowns
Storage location: extend `.crows/` (add `messages.jsonl` or per-nest file). Decide during implementation; must survive server restart.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Epic: #2. Depends on: #8
Goal
An append-only message log per nest with durable storage and ordered replay, mirroring how
Hubreplays list history. This is the data structure the conversation runs on.Context a stranger needs
Follow
NestStore.save()(nests.go:133, atomic tmp+rename) for persistence andHub.listStream/Subscribe(hub.go:17,hub.go:121) for the in-memory ordered history + numbered replay. IDs should be monotonically increasing per nest soLast-Event-IDworks.Acceptance criteria — falsifiable tests
TestMessageLogAppendOrder— Given a fresh log, when appending 3 messages, then reading returns them in append order with ids 1,2,3. Red now (type doesn't exist), green after.TestMessageLogReplayFrom— Given 5 appended, when replaying after id 2, then returns messages 3,4,5 only. Red now, green after.TestMessageLogPersists— Given messages appended, when the store reloads from its file path, then all messages are present (round-trip through the on-disk format). Red now, green after.Test command
go test -race -run 'TestMessageLog' ./...Blockers / unknowns
Storage location: extend
.crows/(addmessages.jsonlor per-nest file). Decide during implementation; must survive server restart.