Files
pad/internal/server
xarmian e8e2a698b8 test(chat): sibling-DM coverage for inbox, unread and ensure (TASK-4060) (#2299)
* test(chat): sibling-DM coverage for inbox, unread and ensure (TASK-4060)

From the lead's post-merge rule-3a round on #2296. TestChat_AgentCannotReachSiblingAgentDM
now also covers the endpoints that could reveal bravo's DM without naming it:
alpha's inbox and unread summary carry no row for it and their totals exclude
it, with bravo's DM holding unread rows. Alpha ensuring agent_key "bravo" is
refused 400 with no DM bucket allocated and no conversation created, which is
where the DM bucket assertion can actually move. The delete case targets
bravo's own message so an author check cannot mask a leak, and the header
comment says which layer catches a single-layer leak and that the bucket
claim is allocation only.

Claude-Session: https://claude.ai/code/session_01KYZ6vrKNro953q9kfdSGFd

* test(chat): make the ensure case's bucket and row checks able to fail (TASK-4060, r1)

Lead ruling on r1: the ensure case's DM-bucket and row-count assertions were
vacuous. The fixture's API ensures had already allocated the owner's ChatDM
bucket, and "bravo" already had a DM, so a charge or a create before the
refusal could not show. Both DMs are now seeded through the store, and alpha
is also refused naming "charlie", which has no DM yet. The seed comment now
says which unread row a leak would expose.

Claude-Session: https://claude.ai/code/session_01KYZ6vrKNro953q9kfdSGFd

* test(chat): comments state what the sibling-DM cases prove (TASK-4060, r2)

Lead ruling on r2, comment-only: the delete case's rationale now says what
bravo's own message catches (alpha resolved as bravo would delete it), and
the header describes the single-layer leak behaviour instead of citing an
off-repo mutant id. The header also names the second ensure.

Claude-Session: https://claude.ai/code/session_01KYZ6vrKNro953q9kfdSGFd
2026-10-24 06:10:59 -04:00
..