Enforce claim classes (#5) per request mode: solo/split first-claim-wins (a second claim on the same request is refused and the refuser is told who owns it); conspiracy accepts every claim.
Acceptance criteria — falsifiable tests
TestSoloSecondClaimRefused — Given a stored solo request R addressed nobody, when Hugin claims R, then 201 + to becomes R's author; when Munin then claims R, then 409 whose message names "Hugin". Red now (no claim bookkeeping), green after.
TestConspiracyMultipleClaims — Given a stored conspiracy request R, when Hugin claims and Munin claims, then both 201 and both claims stored with refers_to == R.msg_id. Red now, green after.
TestSplitSubtaskFirstClaimWins — Given a split request with two subtask messages (mode split, refers_to = parent), two claims on the same subtask: second 409; claims on different subtasks: both 201. Red now, green after.
Test command
go test -race -run 'TestSoloSecondClaimRefused|TestConspiracyMultipleClaims|TestSplitSubtaskFirstClaimWins' .
Blockers / unknowns
Reads mode from the request record (C1). Split subtask creation may be stubbed via direct msgs.Append in tests.
Epic: #21. Depends on: #22
## Goal
Enforce claim classes (#5) per request mode: solo/split first-claim-wins (a second claim on the same request is refused and the refuser is told who owns it); conspiracy accepts every claim.
## Acceptance criteria — falsifiable tests
1. `TestSoloSecondClaimRefused` — Given a stored solo request R addressed nobody, when Hugin claims R, then 201 + `to` becomes R's author; when Munin then claims R, then 409 whose `message` names "Hugin". Red now (no claim bookkeeping), green after.
2. `TestConspiracyMultipleClaims` — Given a stored conspiracy request R, when Hugin claims and Munin claims, then both 201 and both claims stored with `refers_to == R.msg_id`. Red now, green after.
3. `TestSplitSubtaskFirstClaimWins` — Given a split request with two subtask messages (mode `split`, `refers_to` = parent), two claims on the *same* subtask: second 409; claims on *different* subtasks: both 201. Red now, green after.
## Test command
`go test -race -run 'TestSoloSecondClaimRefused|TestConspiracyMultipleClaims|TestSplitSubtaskFirstClaimWins' .`
## Blockers / unknowns
Reads `mode` from the request record (C1). Split subtask creation may be stubbed via direct `msgs.Append` in tests.
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: #21. Depends on: #22
Goal
Enforce claim classes (#5) per request mode: solo/split first-claim-wins (a second claim on the same request is refused and the refuser is told who owns it); conspiracy accepts every claim.
Acceptance criteria — falsifiable tests
TestSoloSecondClaimRefused— Given a stored solo request R addressed nobody, when Hugin claims R, then 201 +tobecomes R's author; when Munin then claims R, then 409 whosemessagenames "Hugin". Red now (no claim bookkeeping), green after.TestConspiracyMultipleClaims— Given a stored conspiracy request R, when Hugin claims and Munin claims, then both 201 and both claims stored withrefers_to == R.msg_id. Red now, green after.TestSplitSubtaskFirstClaimWins— Given a split request with two subtask messages (modesplit,refers_to= parent), two claims on the same subtask: second 409; claims on different subtasks: both 201. Red now, green after.Test command
go test -race -run 'TestSoloSecondClaimRefused|TestConspiracyMultipleClaims|TestSplitSubtaskFirstClaimWins' .Blockers / unknowns
Reads
modefrom the request record (C1). Split subtask creation may be stubbed via directmsgs.Appendin tests.