blockference.GridWorld(dimension, positions, affordances=...)stores(y, x)positions and applies deterministic simultaneous actions.blockference.ActiveGridference(grid, planning_length, env_state, affordances, max_policies)ownsA,B,C,D, andE. UpdatingErebuildsB;max_policiesprevents unbounded policy enumeration.blockference.BlockferenceAgent(A, B, **kwargs)is the optional upstream pymdp adapter. Installactive-blockference[pymdp]to use it.blockference.ExperimentConfig.from_dict(mapping)rejects unknown keys and validates dimensions, coordinates, action labels, engine, and paths.simulation.initial_stateremains the single-agent compatibility default; forn_agents > 1providesimulation.initial_stateswith one distinct start coordinate per agent (a multi-agent run without it fails fast).blockference.envs.DiscreteEnvironmentis the runtime-checkable environment protocol;GridWorldconforms and adds losslessserialize()/load().blockference.io.atomic_replace(path, writer)publishes any file atomically;parse_trajectory_records(df)normalizes a trajectory into typed, orderedTrajectoryRecordvalues for backend/persistence parity.
from blockference import ExperimentConfig, run_pipeline
config = ExperimentConfig.from_dict({
"name": "demo",
"seed": 7,
"grid": {"dimension": 3, "planning_length": 1},
"simulation": {"timesteps": 4, "runs": 1, "n_agents": 1,
"target": "random", "initial_state": [0, 0]},
})
result = run_pipeline(config, output_root="output")
print(result.ok, result.paths.run_dir)run_grid(dimension, n_agents, timesteps, *, output_path, planning_length, max_policies, target, initial_state, initial_states, affordances, seed, runs, engine) is the typed primitive wrapper. Engine names are radcad and cadcad.
Run the complete local release gate with uv run python scripts/release_check.py.
blockference run --config CONFIG
blockference pipeline --config CONFIG [--output-root ROOT] [--run-name NAME]
blockference validation --run-dir RUN_DIRECTORY
plot_trajectory, plot_action_distribution, plot_belief_heatmap,
plot_efe, and animate_trajectory return the written path. plot_efe
consumes the persisted efe vectors and plots the minimum policy EFE per step.