feat(server): moderator announces every move and attempt to both players
All move-event announcements in translator.ts and all attempted-move announcements in commit.ts now use audience 'both' so the moderator panel is a complete shared transcript for both players. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,20 @@ describe('hierarchy decision table', () => {
|
||||
expect(game.armed).toBeNull();
|
||||
expect(game.chess.history()).toContain('e4');
|
||||
});
|
||||
|
||||
it('attempted-move announcements are audience: both', () => {
|
||||
const r = handleCommit(game, 'w', { from: 'e4' }); // empty square -> no_such_piece
|
||||
expect(r.kind).toBe('announce');
|
||||
if (r.kind === 'announce') expect(r.announcements[0]!.audience).toBe('both');
|
||||
});
|
||||
|
||||
it('applied-move announcements are audience: both', () => {
|
||||
const r = handleCommit(game, 'w', { from: 'e2', to: 'e4' });
|
||||
expect(r.kind).toBe('applied');
|
||||
if (r.kind === 'applied') {
|
||||
for (const a of r.announcements) expect(a.audience).toBe('both');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('touch-move enforcement', () => {
|
||||
|
||||
Reference in New Issue
Block a user