Skip to content

Coordinated multi-agent OmSh

MultiAgentTransitionShield protects two or more agents in one parallel environment step. Each protected role owns a separate TransitionShield controller, IOP posterior, monotone reasoning-level floor, and carried safety budget. The wrapper evaluates every proposed action from the same pre-state, resolves every replacement, steps the base game once with the final joint action, and then updates every controller from that realized transition.

Do not approximate this by nesting single-focal wrappers. The outer wrapper would observe another agent's augmented proposal rather than its executed primitive action, action resolution would depend on wrapper order, and the two controllers could accidentally share one mutable Bayesian posterior.

Role-conditioned pretraining

The original wm/D.pkl buffer is stored relative to focal player_0: its tuple contains player 0's action followed by the other agents' actions in environment order. extract_level0_dataset and prepare_om_training_inputs accept focal_idx and buffer_focal_idx so a global-state buffer can be reoriented without changing action semantics.

This is valid only when the stored observation is a shared/global state. The initial experiment is therefore restricted to two-agent Markov Stag Hunt, whose observation is agent-agnostic. Its OM notebook accepts focal_idx=1, uses the matching pretrained focal policy, and writes the second role's artifacts under:

exports/gridworlds/markov_stag_hunt/om/agents/player_1/

The default player-0 paths remain unchanged. Shield bundles and exact-model diagnostics are also role-separated (*_player_1.pkl / *_player_1.json) so building the second certificate cannot invalidate or overwrite the first.

Experiment entry point

After the player-1 IOP exists, the Markov Stag Hunt experiment notebook accepts:

shielded_agent_ids=player_0,player_1

This currently requires shield_action_mode=pure. If no explicit shield_version is supplied, the notebook adds an agent-set version suffix so the two-shield result cannot overwrite the primary one-shield condition.

The base labelled environment remains the authoritative standard history for player_0. The coordinated wrapper additionally records completed-episode reward and observed safety for every other protected agent. Experiment diagnostics export these rows to tables/<artifact>_per_agent_episodes.csv.gz and include per-agent summaries in the diagnostic JSON.

Certificate scope

Each role's value-iteration result remains a certificate inside that role's own learned induced model. Simultaneously shielding the modelled opponent changes its live policy, so the experiment is empirical evidence about joint shielding rather than a new arbitrary-opponent theorem. The two live IOP posteriors are updated with the final primitive joint action, not the policies' pre-projection proposals.