Skip to content

Suspend a persona through its owned parts in one call - #6131

Merged
joelteply merged 3 commits into
fable/persona-engine-objectsfrom
codex/persona-suspend-tree
Nov 18, 2026
Merged

joelteply merged 3 commits into
fable/persona-engine-objectsfrom
codex/persona-suspend-tree

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Stacked on #6130. PersonaUnit delegates suspend to its declared PersonaParts. The same declaration supplies the child traversal and typed results. A pending or failed child retains custody and siblings report their own results. Six crate tests passed locally, including a failure and pending learning fence in the same traversal followed by a retry. Native adapters and the serving caller still belong to the engine integration. This change does not put suspension on the warm handoff path.

joelteply added a commit that referenced this pull request Nov 18, 2026
…nces are tagged; a partial unit cannot be built (Codex on #6130)

- Roles::stage returns the unit and its copy-in fence on every refusal (Refused { reason, returned })
  and refuses a fence for another persona, epoch or direction.
- Roles::handoff takes no fence: it binds next once her copy-in lands and leaves the previous
  mind AwaitingCopyOut, so no read of her blocks starts before she stops being active. The
  completion owner begins the copy-out after the bind and attaches it with begin_retire, which
  returns the fence on refusal (nobody retiring, already moving, wrong tag). release_retired
  waits for it to land; the next handoff waits for the release.
- Fence carries a FenceTag (persona, epoch, direction).
- PersonaUnit::assemble and PartialMove are gone: the only constructor takes a complete
  PersonaParts (Codex's single declaration, #6131), so a partial move is unrepresentable.
- Contract tests use non-Clone, drop-counted units and fences: a refusal that drops custody fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit bbdecfc into fable/persona-engine-objects Nov 18, 2026
49 of 50 checks passed
@joelteply
joelteply deleted the codex/persona-suspend-tree branch November 18, 2026 06:12
joelteply added a commit that referenced this pull request Nov 18, 2026
…API before integration) (#6130)

* The persona engine's objects: PersonaUnit moves whole, Roles holds exactly one active mind, Tier and NextPolicy are traits

CONTINUUM-ENGINE 4.14, API before integration (Codex). One mind decodes at a time by
construction: Roles has one active place; the next is staged as data under its copy-in fence;
handoff binds her only after that fence and moves the previous mind to retiring under its
copy-out fence; release_retired gives her back to her tier only once it lands. PersonaUnit owns
her five parts and assemble() refuses a partial move by name. Tier (one contract for device,
host, unified and flash) and NextPolicy (who is next, learnable) are the traits the native
adapters over the fork's llama_persona_* / llama_state_seq_* calls implement next. The engine is
libllama called through its API in-process: no llama-server, no launch flags, no slot count.

Contract tests (pipeline/tests.rs): one active mind and the next staged not decoding;
fence-before-ready; retire-after-handoff with the previous retirement landing first;
refuse-partial; no mind in two places. Lints deny unwrap/expect/panic.

Replaces #6129 (a lane count on llama-server's --parallel), closed per Joel: objects, not flags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Cascade persona suspension through its declared parts

* Poll sibling suspension futures together while fences are pending

* Exercise the independent persona engine in CI scope fixtures

* Every refusal returns custody; the copy-out begins after the bind; fences are tagged; a partial unit cannot be built (Codex on #6130)

- Roles::stage returns the unit and its copy-in fence on every refusal (Refused { reason, returned })
  and refuses a fence for another persona, epoch or direction.
- Roles::handoff takes no fence: it binds next once her copy-in lands and leaves the previous
  mind AwaitingCopyOut, so no read of her blocks starts before she stops being active. The
  completion owner begins the copy-out after the bind and attaches it with begin_retire, which
  returns the fence on refusal (nobody retiring, already moving, wrong tag). release_retired
  waits for it to land; the next handoff waits for the release.
- Fence carries a FenceTag (persona, epoch, direction).
- PersonaUnit::assemble and PartialMove are gone: the only constructor takes a complete
  PersonaParts (Codex's single declaration, #6131), so a partial move is unrepresentable.
- Contract tests use non-Clone, drop-counted units and fences: a refusal that drops custody fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* The Core describes the exact copy-out to begin; Tier::begin takes that typed descriptor (Codex on #6130)

Tier::copy_in/copy_out(PersonaId) become Tier::begin(FenceTag): the adapter is handed her persona,
epoch and direction, and the fence it returns carries the same tag. Roles::awaiting_copy_out
returns the FenceTag of the mind awaiting her copy-out, so the completion owner begins exactly
that transfer with no second lookup by id that could name another generation. Test: a test tier
begins the described copy-out (accepted, released with her epoch); a transfer of a stale epoch is
refused with its fence returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Persona engine tests: the test part's behaviours are one enum, and each test expect names its precondition (state_as_flags, unjustified_unwraps)

Codex's lifecycle fixture held release_after_retry and failure as two bools (four states, three
used): now Behaviour { Ready, PendingOnce, Fails }. Each expect in the pipeline contract tests
carries its same-line justification.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant