fix: refresh general turns at every execution boundary

This commit is contained in:
2026-08-05 02:05:07 +00:00
parent 5932ab9386
commit f765fe610f
2 changed files with 20 additions and 4 deletions
@@ -215,6 +215,20 @@ describe('reserved turn daemon lease', () => {
expect(harness.generalFindMany).toHaveBeenCalledTimes(2);
});
it('re-reads a general queue while retaining its execution lease', async () => {
const harness = buildHarness();
await harness.store.prepareTurnsForExecution(7);
harness.store.shiftGeneralTurns(7, -1);
expect(harness.getRevision()).toMatchObject({ leaseOwner: 'daemon-1' });
expect(harness.store.getGeneralTurn(7, 0).action).toBe('휴식');
await harness.store.prepareTurnsForExecution(7);
expect(harness.store.getGeneralTurn(7, 0).action).toBe('che_훈련');
expect(harness.generalFindMany).toHaveBeenCalledTimes(2);
});
it('rejects an active foreign lease before reading the queue', async () => {
const harness = buildHarness({
revision: 4,