This page documents AgentMerger and AgentTranslation, the Aurora classes used to rebuild Aurora behavior from clients or DNA.
Use these classes when Aurora behavior already exists somewhere else and you want to reconstruct it inside a new Aurora client:
AgentMergercombines several sources into one Aurora client.AgentTranslationrebuilds one fresh Aurora client from DNA alone.
The most important point is that the result is still an Aurora client. After reconstruction, you can attach a SummonerIdentity, inspect agent.identity, add keyed receivers, inspect replay state, and export Aurora DNA again.
Import the module directly as:
from summoner.aurora.agentmerger import AgentMerger, AgentTranslationNote
Both names are also re-exported from summoner.aurora. This page uses the direct module path so the reference matches the public Aurora modules.
If you need the full baseline constructor semantics, read the core merger page alongside this one:
Summoner.client.merger→ClientMergerSummoner.client.merger→ClientTranslation
The table below gives a quick orientation before the method reference starts.
| Class | Start from | Use when |
|---|---|---|
AgentMerger |
imported clients, DNA paths, DNA lists, or wrapped sources | You want one composite Aurora client assembled from several inputs |
AgentTranslation |
a DNA list | You want one fresh Aurora client reconstructed from DNA alone |
The snippet below shows the Aurora part of the workflow. For a full reconstruction flow including hooks, senders, and state handlers, combine this page with the core merger docs.
from summoner.aurora import AgentMerger
agent = AgentMerger([{"dna_path": "aurora_agent.json"}], name="aurora:merged")
agent.initiate_receivers()
identity = agent.attach_identity(store_dir="./identity")
identity.id("id.json", password=b"strong-passphrase")Like the core merger layer, Aurora merger and translation may execute code from DNA via exec() or eval(). Use only with trusted DNA.
Aurora keyed receivers are not the same as plain @receive(...) handlers.
To preserve keyed receiver behavior across DNA export and import:
- export Aurora DNA with
agent.dna(flavor="aurora"), or - export Aurora DNA with
agent.aurora_dna(...)
The exact export contract is documented in SummonerAgent.
If you export using core DNA in a lossy mode:
- keyed receivers are downgraded to plain
receiveentries, - lock and replay semantics are not reconstructible from that DNA alone,
AgentMergerandAgentTranslationcan only replay the plain receiver behavior that remains.
def __init__(
self,
named_clients: list[Any],
name: Optional[str] = None,
rebind_globals: Optional[dict[str, Any]] = None,
allow_context_imports: bool = True,
verbose_context_imports: bool = False,
close_subclients: bool = True,
) -> NoneCreates an Aurora-aware composite client by inheriting the normal ClientMerger construction flow and layering Aurora receiver replay and Aurora client behavior onto it.
Normal merge behavior remains the same as the core merger:
- sources may be imported clients, DNA lists, DNA paths, or wrapper dicts,
- handler replay still happens later via
initiate_all()or individualinitiate_*methods, - non-Aurora handlers follow the core merger behavior.
What Aurora adds is that the resulting object is itself an Aurora client:
- it can host a
SummonerIdentity, - it can replay Aurora keyed receivers during
initiate_receivers(), - it continues to expose the shared Aurora client helpers documented on SummonerAgent.
These inputs have the same meaning as in ClientMerger.__init__:
named_clientsnamerebind_globalsallow_context_importsverbose_context_importsclose_subclients
For the full constructor contract, see Summoner.client.merger.
Creates an AgentMerger instance.
from summoner.aurora import AgentMerger
agent = AgentMerger(
[{"dna_path": "agent_dna.json"}],
name="aurora:merged",
)def __init__(
self,
dna_list: list[dict[str, Any]],
name: Optional[str] = None,
var_name: Optional[str] = None,
rebind_globals: Optional[dict[str, Any]] = None,
allow_context_imports: bool = True,
verbose_context_imports: bool = False,
) -> NoneCreates a fresh Aurora client from a DNA list by inheriting the normal ClientTranslation construction flow and layering Aurora receiver replay and Aurora client behavior onto it.
What Aurora adds is the same as for AgentMerger:
- hosted identity binding,
- replay of Aurora keyed receivers during
initiate_receivers(), - continued access to the shared Aurora client helpers documented on SummonerAgent.
These inputs have the same meaning as in ClientTranslation.__init__:
dna_listnamevar_namerebind_globalsallow_context_importsverbose_context_imports
For the full constructor contract, see Summoner.client.merger.
Creates an AgentTranslation instance.
from summoner.aurora import AgentTranslation
agent = AgentTranslation(
dna_list=aurora_dna_list,
name="aurora:translated",
)identity: Optional[SummonerIdentity]Both classes expose their attached identity through the identity attribute, just like SummonerAgent.
This attribute is None until you call attach_identity(...). After attachment, it holds the exact SummonerIdentity instance currently hosted by the merged or translated client.
Attachment and identity-file initialization are separate steps. A newly attached identity may still need id(...) before session, envelope, peer-tracking, or continuity workflows are meaningful.
Optional[SummonerIdentity]
- Read
agent.identitywhen you want the full identity engine after attachment. - Call
require_identity()when the workflow should fail immediately if no identity is attached. - Call
has_identity()when you only need to test whether one is present.
@staticmethod
def identity_versions() -> dict[str, str]Returns the public identity compatibility versions exposed by these classes.
The contract is the same as on SummonerAgent. This is useful when the reconstructed client is part of a diagnostic, audit, or compatibility-reporting workflow.
Returns a dictionary with the keys:
integrationcontrolsid_recordenvelopepayload_encryptionhistory_proofsessions_storepeer_keys_storereplay_store
from summoner.aurora import AgentMerger
versions = AgentMerger.identity_versions()
controls_version = versions["controls"]def attach_identity(
self,
identity: Optional[SummonerIdentity] = None,
controls: Optional[object] = None,
**summoner_identity_kwargs: Any,
) -> SummonerIdentityAttaches a SummonerIdentity to the merged or translated client.
The contract is the same as on SummonerAgent: you can either attach an existing identity or construct one inline from keyword arguments. If controls is provided, the method attaches those controls before storing the identity on agent.identity.
This is the usual step when a reconstructed Aurora client needs to operate under an active principal after merger or translation.
- Type:
Optional[SummonerIdentity] - Meaning: Existing identity object to attach.
- Default:
None
- Type:
Optional[object] - Meaning: Optional controls object to attach before storing the identity on the client.
- Default:
None
- Type:
Any - Meaning: Keyword arguments passed to
SummonerIdentity(...)whenidentityis not supplied. - Validation: If
identityis provided, you must not also provide constructor kwargs.
Returns the attached SummonerIdentity.
- If both
identityandsummoner_identity_kwargsare provided,ValueErroris raised. - If
identityis provided but is not aSummonerIdentity,TypeErroris raised.
from summoner.aurora import AgentMerger
agent = AgentMerger([{"dna_path": "aurora_agent.json"}], name="aurora:merged")
identity = agent.attach_identity(store_dir="./identity")
identity.id("id.json", password=b"strong-passphrase")The same pattern works on AgentTranslation.
def detach_identity(self) -> Optional[SummonerIdentity]Detaches the currently hosted identity, if any, and clears agent.identity.
The detached identity object itself is returned unchanged. The method does not close the identity, reset its internal stores, or remove attached controls. It only removes the host reference from the current reconstructed client.
Returns the detached SummonerIdentity, or None if no identity was attached.
from summoner.aurora import AgentMerger
identity = agent.detach_identity()
if identity is not None:
standby = AgentMerger([{"dna_path": "standby_agent.json"}], name="aurora:standby")
standby.attach_identity(identity)def require_identity(self) -> SummonerIdentityReturns the currently attached identity.
Use this when the reconstructed client must already have an active identity and the absence of one should be treated as an immediate error.
This is an attachment check only. It does not verify that id(...) has already loaded or generated the local identity file.
Returns the current SummonerIdentity.
Raises RuntimeError if no identity is attached.
identity = agent.require_identity()def has_identity(self) -> boolReturns whether an identity is currently attached to the reconstructed Aurora client.
This is a lightweight attachment check only. It returns True as soon as attach_identity(...) stores a SummonerIdentity on the client, even if id(...) has not been called yet.
Returns True when agent.identity is populated, otherwise False.
if not agent.has_identity():
agent.attach_identity(store_dir="./identity")def initiate_receivers(self) -> NoneReplays receiver handlers onto the merged client, including both:
- normal core
@receive(...)handlers, - Aurora
@keyed_receive(...)handlers.
At a high level, AgentMerger.initiate_receivers() does two passes:
- replays the normal core receivers,
- performs an Aurora-specific pass for keyed receivers.
During the Aurora pass:
- imported-client sources are inspected for
client._dna_aurora_receivers, - DNA sources are inspected for entries whose
typeisaurora:keyed_receive, - stored
key_byandseq_byextractor specifications are resolved back into strings or callables, - each keyed receiver is replayed onto the merged client via
self.keyed_receive(...).
For imported Aurora clients, the merger:
- clones the original handler into the merged client context,
- resolves the keyed extractor and optional sequence extractor,
- preserves
priorityandseq_history_max_entries.
For Aurora DNA entries, the merger:
- compiles the handler from stored source text in the DNA sandbox,
- reconstructs extractor specifications from the stored Aurora fields,
- replays the handler as a keyed receiver on the merged client.
For imported-client Aurora receivers, replay failures are logged with a warning and the merger continues with the remaining imported keyed receivers.
For Aurora DNA entries, replay errors propagate to the caller instead of being wrapped in a warning-and-continue path.
Returns None.
from summoner.aurora import AgentMerger
agent = AgentMerger(
[{"dna_path": "aurora_agent.json"}],
name="aurora:merged",
)
agent.initiate_receivers()def initiate_receivers(self) -> NoneReplays receiver handlers from the DNA list onto the translated client, including both:
- normal core
receiveentries, - Aurora
aurora:keyed_receiveentries.
At a high level, AgentTranslation.initiate_receivers():
- replays the normal core receivers,
- scans the DNA list for Aurora keyed receiver entries,
- compiles each handler from its stored source,
- resolves the serialized
key_byandseq_byextractor specifications, - replays the handler using
self.keyed_receive(...).
Errors while compiling a DNA handler or resolving serialized extractor specifications propagate to the caller.
Returns None.
from summoner.aurora import AgentTranslation
agent = AgentTranslation(dna_list=aurora_dna_list, name="aurora:translated")
agent.initiate_receivers()After AgentMerger or AgentTranslation has been constructed, the resulting object still exposes the Aurora client helpers below. The exact contract for each helper is the same as on SummonerAgent, so this table points you to the page that expands those shared methods in full.
| Shared method family | Where the full contract is documented | Why you might use it here |
|---|---|---|
keyed_receive(...) |
SummonerAgent | Add new keyed handlers directly on the merged or translated client |
clear_keyed_receive_replay_state(...) and keyed_receive_replay_stats() |
SummonerAgent | Inspect or reset replay memory for imported keyed receivers |
core_dna(...), aurora_dna(...), and dna(...) |
SummonerAgent | Re-export the reconstructed client after additional edits |
The list below is a useful final checklist when working with reconstructed Aurora clients.
- Aurora-aware receiver replay only applies when the source actually contains Aurora keyed receiver metadata.
- Plain receive handlers are still replayed by the inherited core merger logic.
- Identity binding works the same way here as on
SummonerAgent, because the reconstructed object is still an Aurora client.
« Previous: Summoner.aurora.agentclass | Next: Summoner.aurora.identity »