Personal fork of prime agent. Mirror of: https://mnemosyne.sigilzero.dev/sigilzero/prime-agent

fix(pa-daemon): idle passivation never discards state a revival cannot restore (#3206)

The settled gates behind the whole-worker idle passivation and the settled-child kernel release missed two pieces of unrestorable state: - A live background bash() handle in the session's kernel: the kernel snapshot cannot resurrect a live process, so a passivation (or kernel release) would kill it. TS gates this via isSessionActive's hasBackgroundWork arm; the port already had the probe for the continuation quiescence gates and now consults it here too. - A non-empty RLM child registry (whole-worker only): the port does not rebuild a revived session's subagent registry from the spawn ledger (TS listPassiveRlmSubagents does), so stopping a worker with child records revives it with an empty rlm.list_subagents/collect/ delete_subagent view and orphans its children. The trait method is renamed can_passivate_settled_session -> can_passivate_worker: it now answers the whole-worker question (settled gates plus the registry rule), while release_settled_child_kernel keeps consuming only the shared settled gates - releasing a kernel loses no registry state. Disclosed divergence: TS evicts trees whose children are all settled, because it restores passive subagents after a revival. The port holds a worker while its child registry is non-empty, until a ledger-backed registry restore is ported.


Author Sebastian Müller Committer GitHub Date Commit Parent 332fe80e
+163 -78
6 changed files
+163 -78
6 changed files