Use case
The behavior stack has four tests:
tests/unit/Become.test.ts
become replaces the current behaviour (default discardOld=true)
become with discardOld=false pushes onto a stack
unbecome pops the stack
unbecome cannot empty the stack below the initial behaviour
The file does not contain the word "restart".
That is the gap, because the interesting behaviour of the stack is what happens when it meets the rest of the lifecycle. src/internal/ActorCell.ts:1637 resets the stack to a single entry on restart — a deliberate decision with real consequences: an actor that has swapped into a "draining" or "authenticated" behaviour and then fails is silently returned to its initial behaviour. Nothing tests that.
Neither is the interaction with stashing tested. Restart discards the stash to dead letters (ActorCell.ts:1596) and resets the stack, so a message stashed under one behaviour and unstashed after a restart would be handled by a different one — except it is dead-lettered instead. That ordering is load-bearing and unbound.
For comparison, the neighbouring core-semantics files are substantially deeper: tests/unit/DeathWatch.test.ts has 14 cases across 562 lines, tests/unit/Supervision.test.ts has 30, tests/unit/DeathWatchOnBoundedMailbox.test.ts has 14 more for one hard interaction. Four cases with no lifecycle crossing makes this the thinnest core-semantics coverage in the repository relative to its bug surface.
Proposed shape
Cases worth having:
- A restart resets a stack several levels deep back to the initial behaviour.
- A restart with
stopChildrenOnRestart disabled does the same (the parked-restart resume path at ActorCell.ts:1640-1645 is a separate branch).
unbecome after a restart does not pop below the initial behaviour — the stack is genuinely reset, not merely truncated.
- A message stashed under behaviour B is dead-lettered rather than delivered to behaviour A after a restart.
- The typed behavior API reaches the same outcome, since
src/typed/ has its own path.
Acceptance
Verification status
Confirmed by reading. The four test names are transcribed from tests/unit/Become.test.ts; grep -ci restart on that file returns 0. The reset site (ActorCell.ts:1637), the stash-discard site (:1596) and the parked-restart resume path (:1640-1645) were read. Case counts for the comparison files were counted from their sources.
Use case
The behavior stack has four tests:
The file does not contain the word "restart".
That is the gap, because the interesting behaviour of the stack is what happens when it meets the rest of the lifecycle.
src/internal/ActorCell.ts:1637resets the stack to a single entry on restart — a deliberate decision with real consequences: an actor that has swapped into a "draining" or "authenticated" behaviour and then fails is silently returned to its initial behaviour. Nothing tests that.Neither is the interaction with stashing tested. Restart discards the stash to dead letters (
ActorCell.ts:1596) and resets the stack, so a message stashed under one behaviour and unstashed after a restart would be handled by a different one — except it is dead-lettered instead. That ordering is load-bearing and unbound.For comparison, the neighbouring core-semantics files are substantially deeper:
tests/unit/DeathWatch.test.tshas 14 cases across 562 lines,tests/unit/Supervision.test.tshas 30,tests/unit/DeathWatchOnBoundedMailbox.test.tshas 14 more for one hard interaction. Four cases with no lifecycle crossing makes this the thinnest core-semantics coverage in the repository relative to its bug surface.Proposed shape
Cases worth having:
stopChildrenOnRestartdisabled does the same (the parked-restart resume path atActorCell.ts:1640-1645is a separate branch).unbecomeafter a restart does not pop below the initial behaviour — the stack is genuinely reset, not merely truncated.src/typed/has its own path.Acceptance
stopChildrenOnRestart: falseresume path is covered.ActorCell.ts:1637makes at least one new test fail.Verification status
Confirmed by reading. The four test names are transcribed from
tests/unit/Become.test.ts;grep -ci restarton that file returns 0. The reset site (ActorCell.ts:1637), the stash-discard site (:1596) and the parked-restart resume path (:1640-1645) were read. Case counts for the comparison files were counted from their sources.