Colony Control Plane, Stigmergic Pressure, and Falsification-Gated Actuation
Agentic software can preserve task state while still forgetting the consequences of prior actions. Codomyrmex studies a narrow control-plane question: after a caller reports a failed action at one software location, can the system deterministically increase friction for a materially similar proposal at that location without changing an unrelated target? Its Colony Control Plane records consequence reports and couples them to target-indexed signal pressure, agent trust, role labels, resource accounting, adversarial checks, and an explicit EXECUTE/HOLD/REFUSE gate.
The implementation comprises 8 cooperating subsystems. The ordinary
Model Context Protocol path remains caller-reported and unattested.
Optional and required ColonyKernel attestation modes
instead bind proposal, verdict, authorization, execution receipt, and
outcome in a signed, hash-linked local ledger. That ledger protects
lifecycle linkage but does not independently observe external actuation
or establish deployment safety. Consequence records can use file-backed
SQLite; the default MCP kernel and signal field remain
process-local.
Evaluation is limited to implementation properties and controlled fixtures. At composition time, the scoped Colony Kernel surface contains 845 passing tests with 78.3% branch coverage, 0 Ruff errors, and 0 ty diagnostics. A paired deterministic replay moves the same-target proposal from 0.875/EXECUTE to 0.725/HOLD after a reported failure while leaving an unrelated target unchanged. Separate fixtures exercise trust promotion, bounded arithmetic, linear signal decay, local attestation integrity, and interface behavior. These results support reproducible software contracts, not ecological optimality, calibrated risk, production harm reduction, or generalization to external workloads.
The report contributes the typed control plane, transparent gate, coupled local feedback, authenticated local lifecycle option, and source-bound publication workflow. Generated variables, figures, citations, claim boundaries, and release receipts tie the rendered report to the evaluated checkout. End-to-end external-actuation attestation, restart-persistent field storage, representative benchmarks, and independent deployment validation remain open.
Keywords: ai-agents, model-context-protocol, mcp, multi-agent, orchestration, colony-control-plane, stigmergy, artificial-ecology, agentic-software-engineering, falsification-worker, actuation-gate, trust-scoring
Corresponding author: Daniel Ari Friedman
Tool-using language-model agents can browse, retrieve, call APIs, edit repositories, and run software (Nakano et al. 2021; Karpas et al. 2022; Yao et al. 2023; Schick et al. 2023; Qin et al. 2023; Patil et al. 2023). Once an agent can alter persistent state, success is not only a planning problem. It is also an authorization, accounting, and feedback problem: what evidence should be inspected before an action, what should be recorded afterward, and how should that record affect the next proposal?
Long-horizon environments and software-agent benchmarks increasingly evaluate stateful, multi-step interaction rather than isolated text generation (Yang et al. 2024b, 2024a; Liu et al. 2023; Zhou et al. 2023; Xie et al. 2024; Trivedi et al. 2024). Security evaluations likewise treat tool misuse, prompt injection, privacy leakage, and trajectory-level effects as system properties (Greshake et al. 2023; Debenedetti et al. 2024; Ruan et al. 2023; Zhang et al. 2024). These results motivate explicit controls between a model’s proposal and consequential actuation.
Contemporary orchestration frameworks provide routing, checkpoints, memory, roles, and multi-agent coordination (AI 2024; Wu et al. 2023; Inc. 2024). Codomyrmex does not claim those systems lack state. It targets a narrower integration question:
Can a recorded failure at one software location deterministically increase the admission cost of a later proposal at that same location, without changing the later model’s context or weights?
The question is deliberately local and falsifiable. A convincing positive result requires a paired case: hold agent, proposal, and budget factors fixed; add the failed outcome at one target; show that the same-target score does not increase and that an unrelated target is unchanged.
Codomyrmex uses “colony” and “pheromone” as engineering metaphors for
a shared control plane. Stigmergy describes coordination mediated
through changes to a shared environment rather than direct pairwise
messages (Grassé
1959; Parunak 1997; Bonabeau et al. 1999). In the
implementation, the shared environment is a typed, process-local signal
field. FAILURE records caller-reported adverse outcomes,
RISK records prospective concerns, and the gate scores
their maximum at the proposal target.
The project specification’s design criterion is that the colony should become “harder to fool after every failed action.” This manuscript narrows that phrase to an implemented contract:
max(RISK, FAILURE);This does not make the system deception-proof. The ordinary MCP path
accepts caller-reported outcomes without attesting them against a prior
EXECUTE authorization. Optional and required ColonyKernel
attestation modes locally bind the lifecycle from proposal through
outcome, but the ledger does not independently observe external
actuation or establish deployment safety. The default field and
consequence database are also in-memory and disappear on process
restart. The paired feedback claim is therefore process-local,
report-dependent, and reversible.
The paper contributes five concrete artifacts.
The contribution is a reference implementation and evidence boundary, not a completed production-security system.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. This distinction lets the implementation be reproducible without turning a reproducible fixture into a scientific calibration claim.
ColonyKernel.propose_action first runs deterministic
falsification, checks the resource budget, loads the agent profile,
refreshes its role label, and asks ActuationGate for a
decision. Ordinary scoring uses
max(RISK, FAILURE)
(weight 0.3);Budget failure, SANDBOX, trust below 0.3, and CRITICAL falsification are early returns. The higher role labels are inferred trust tiers and intended specializations; the current gate does not enforce a complete action-by-role permission matrix.
record_outcome is a separate caller operation. It
updates the consequence store, resource ledger, trust profile, role
label, and signal field. A failed test report deposits a FAST FAILURE
trace; a clean report reinforces/deposits SUCCESS. On the ordinary MCP
path, proposal and outcome are not linked by a consumed authorization
ledger, so “outcome” means a submitted report unless explicitly
qualified. In optional or required attestation mode, the kernel locally
requires and consumes the linked authorization/receipt chain; this
authenticates ledger linkage, not external execution.
The 8 MCP tools expose this stateful kernel through JSON-shaped requests and responses. A module-level singleton shares state across calls in one server process. File-backed SQLite can persist consequence records when configured, but the field has no restart-persistent backend.
The implementation combines ideas from several established areas without claiming to replace them:
Codomyrmex’s specific combination is a target-indexed signal field coupled to a transparent software-actuation gate and consequence ledger. Comparative superiority over other frameworks is not established in this release.
The executed evidence is the scoped Colony Kernel quality gate and deterministic fixtures. The proposed 4-condition, 20-run benchmark has not been executed. No population refusal rate, throughput advantage, production harm reduction, or long-run convergence claim is reported. The paper treats ordinary-path unlinked outcome reporting, external-actuation attestation, SANDBOX bootstrap, persistence, role permissions, and external calibration as open engineering work.
Section 2 states only the invariants supported by the runtime recurrence and gate arithmetic. Section 3 describes subsystem behavior and call sequencing. Section 4 separates the proposed external study from the live configuration. Section 5 reports executed gates, deterministic fixtures, and analytical score cases. Section 6 compares related systems and states limitations. Section 7 offers a bounded conceptual analogy rather than a formal equivalence. Section 8 documents the build and evidence chain. Section 9 summarizes the supported claim and next tests. Section 13 records design alternatives and remaining tradeoffs.
This section states the mathematical properties that follow from the checked-in implementation. It deliberately separates three kinds of statement:
The gate score is a design score, not a probability of safety. The trust process is a bounded accounting rule, not a Bayesian posterior. No claim below establishes production safety, optimality, differential privacy, or long-run ecological convergence.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The equations in this section state consequences of the current implementation; they are not a claim that the selected constants are universal or empirically calibrated. Notation is fixed in Section 12; in particular, denotes hazard, denotes risk clearance, and denotes human feedback.
Let
be the finite set of compound location–signal keys present at tick
,
where
contains FAILURE, SUCCESS, RISK,
NEED, DEPENDENCY, and
HUMAN_PRIORITY. Over any finite analysis horizon, choose a
finite universe
containing the keys that appear and represent an absent or deleted key
by zero. The projected field state is then
This capped non-negative cube is a complete metric space under the supremum metric and a complete lattice under the coordinate-wise order. It is not a vector space: negative scaling and unrestricted addition leave the state space.
For key , let be the evaporation amount stored for that key during step , and let be the effective deposits applied during the step, after source and trust multipliers. A redeposit may replace the stored decay class; when it does not, write the constant amount as . With the convention “evaporate, then deposit,” the implemented update can be represented as
The 3 configured evaporation amounts are , , and strength units per tick. A caller may deposit at another point in the scheduler cycle, so exact within-tick values depend on operation order; the range and monotonicity results below do not.
Lemma 1 (range invariance). If , then for every finite sequence of non-negative deposits.
Proof. The inner maximum is non-negative and the outer minimum is at most . Induction over completes the argument.
Lemma 2 (passive linear decay). With no deposits and a fixed stored decay amount for ticks,
Proof. Apply the subtract-and-floor operation repeatedly. Before the first floor event, exactly is removed per tick; after the value reaches zero, further applications leave it at zero.
A trace with current strength therefore disappears after at most
ticks without reinforcement. This is finite forgetting, not exponential half-life. For a unit trace, FAST, NORMAL, and SLOW disappear after 4, 10, and 50 discrete ticks, respectively (the ceiling matters when is not integral).
The witness retains prospective RISK and caller-reported
FAILURE as separate channels. The gate uses their maximum
as effective local hazard pressure:
The risk-clearance component is the piecewise function
Proposition 1 (local monotonicity). Holding all
other gate inputs fixed, increasing either RISK or
FAILURE pressure at the proposal target cannot increase the
gate score.
Proof. The maximum in Equation 5 is coordinate-wise non-decreasing, while in Equation 6 is non-increasing. Its gate coefficient is positive.
Deterministic paired case. A caller-reported failed
outcome deposits a base-strength 2.0 FAILURE signal from
source TEST. The source multiplier 1.5 produces effective
pressure 3.000. For an authorized lower-tier agent with a complete
proposal, clear budget, and no prior pressure, the ordinary score
changes from
to
Thus the same-target decision changes from EXECUTE to HOLD, while an otherwise identical proposal at another target remains at 0.875. An executed integration test checks all three claims. Passive decay eventually restores the clear-field score. This is the precise implemented meaning of “harder to pass after local failure”; it is neither permanent nor a proof that deception is prevented.
For proposals that reach ordinary scoring,
where , , uses the generated trust-credit tiers and optional 0.25 recent-failure penalty, and is generated from zero through 3 missing fields with a 0.35 penalty per field.
Four checks can bypass ordinary thresholding:
SANDBOX returns REFUSE;Otherwise yields EXECUTE, yields HOLD, and yields REFUSE.
Proposition 2 (score boundedness). Every ordinary score is in .
Proof. Every component is in , every coefficient is non-negative, and the coefficients sum to 1.0. The implementation additionally clips the sum to .
Proposition 3 (component monotonicity). On the ordinary path, improving budget approval, risk clearance, trust credit, or completeness while holding the other components fixed cannot reduce . Increasing local hazard or activating the recent-failure penalty cannot increase .
These are arithmetic monotonicity statements. They do not imply that is calibrated to real-world harm. Such calibration would require linked proposals, independently observed and externally attested outcomes, representative workloads, and held-out evaluation.
Figure 2 visualizes the exact score tiers and the continuous completeness envelope used only to make the discontinuities legible.
A third decision can be useful when revision supplies information, but it does not automatically dominate a binary gate. Let and be expected losses from EXECUTE and REFUSE at observed state . Let be revision cost and let be the evidence available after revision. HOLD has lower expected loss only when
The current implementation returns actionable evidence requests, but it does not estimate any term in Equation 10. HOLD is therefore an auditable design choice and a future empirical hypothesis, not a proved optimum.
For recorded outcome , trust follows
with
This proves boundedness by construction. It does not prove convergence. With continuing random non-zero increments, a clipped constant-step process can continue moving indefinitely.
If tests pass independently with probability , with no repairs and neutral human feedback, the expected unclipped increment is
The drift is zero at , positive above it, and negative below it. This is a balance point for expected increments—not a unique trust equilibrium—because the update contains no state-dependent restoring term.
Starting from
,
an all-success path adds 0.04 per outcome until clipping. The first 3
recorded successes satisfy the generated promotion contract for
REPAIR_ANT. This is a deterministic path claim, not an
expected hitting time for an imperfect agent. Moreover, the ordinary MCP
path accepts caller-reported outcomes without linking them to a prior
EXECUTE decision. Optional and required local attestation modes can
enforce lifecycle linkage, but they do not make a submitted outcome an
independent observation of competence. The three-record bootstrap must
therefore be treated as supervised evidence, not autonomous proof of
competence.
The integrated gate now holds a reference to the same
ConsequenceMemory used by the kernel. 3 recent failures
reduce trust credit by 0.25 before weighting. This wiring property and
its score effect are contract-tested.
The released mechanism is deterministic and does not provide differential privacy. Under replacement adjacency, one record can change a trust increment from its maximum to its minimum , so the one-step global sensitivity is at most
Clipping may reduce the realized difference near a boundary but does not lower this global bound. Any future noisy release would also need an explicit adjacency relation, composition accounting across repeated queries, and a utility analysis (Dwork and Roth 2014).
The more immediate integrity issue is the boundary between ledger
authentication and external observation. The ordinary
colony_record_outcome path constructs a proposal from
caller input and requires no outstanding, matching, previously EXECUTEd
proposal. Optional or required kernel attestation instead binds and
consumes a local authorization/receipt chain. Even there, the ledger
authenticates submitted lifecycle events; it does not independently
observe the external action or establish that the action was safe. Trust
and local pressure therefore remain evidence about recorded events, not
independently verified ground truth. This limitation bounds every causal
and security claim in the manuscript.
Table 1 separates proved implementation properties, deterministic contract cases, open empirical hypotheses, and claims that are false for this release.
| Statement | Status | Evidence required |
|---|---|---|
| Field values remain in | Proved implementation invariant | Recurrence and saturation tests |
| A passive trace decays linearly and disappears in finite ticks | Proved implementation invariant | Exact tick tests |
| More same-target RISK or FAILURE pressure cannot increase the ordinary score | Proved arithmetic invariant | Monotonicity and paired integration tests |
| One canonical failed outcome moves the paired lower-tier case from 0.875/EXECUTE to 0.725/HOLD | Verified deterministic case | Real subsystem integration test |
| Gate score lies in | Proved arithmetic invariant | Component ranges and clip |
| Trust lies in | Proved implementation invariant | Clipped update |
| The gate lowers production harm | Open empirical hypothesis | Linked, externally attested, representative trials |
| HOLD improves decisions | Open value-of-information hypothesis | Revision-cost and outcome study |
| The ecology converges or is optimal | Not established | A specified stochastic model and external validation |
| Published trust is differentially private | False for the current release | A randomized mechanism and privacy accounting |
The result is intentionally narrower than an abstract theory of agent societies. It is a checkable contract for this implementation and a map of what must be measured before stronger claims are warranted.
The Colony Control Plane is realised as a single Python package
(codomyrmex.colony_kernel) with shared value objects and
enumerations in models.py, canonical subsystem
implementations in standalone modules, and the ColonyKernel
integration class orchestrating their lifecycle. The design keeps
communication explicit: subsystems exchange typed models, while the
kernel owns cross-subsystem sequencing and state transitions.
Table 2 enumerates the 8 subsystem roles used by the control plane.
| Subsystem | Primary Module | Responsibility |
|---|---|---|
| PheromoneStore | pheromone_store.py |
Stores typed location signals; deposits, queries, reinforces, and subtractively decays traces. |
| ResourceLedger | resource_ledger.py |
Checks and consumes 7-dimensional, period-scoped resource budgets. |
| ActuationGate | actuation_gate.py |
Combines budget approval, effective local hazard, trust, and completeness into EXECUTE / HOLD / REFUSE. |
| ConsequenceMemory | consequence_memory.py |
Stores reported outcomes and profiles; computes trust deltas and recent-failure counts. Default storage is in memory. |
| RoleAdapter | role_adapter.py |
Infers role labels from trust and proposal count; only SANDBOX has role-specific gate behavior. |
| PruningDaemon | pruning_daemon.py |
Nominates stale or duplicate modules; mutation is a separate explicit API. |
| FalsificationWorker | falsification/ |
Runs 11 deterministic checks across 10 attack-vector categories and deposits finding signals. |
| ColonyKernel | kernel.py |
Owns subsystem instances and sequences the high-level proposal, outcome, status, pruning, and tick APIs. |
Unless a table or experiment explicitly says otherwise, the numeric weights, thresholds, decay settings, and effort profiles described below are current implementation defaults and example/initial values. They are configurable policy parameters, not calibrated universal constants; tuning them requires rerunning the focused contract tests and regenerating the dependent evidence bundle.
The integration entry point is ColonyKernel,
instantiated once by the default MCP adapter. Its high-level methods
coordinate the components, while lower-level classes remain importable
for standalone use and testing.
Figure 3 illustrates the
control-plane topology: ColonyKernel at the centre, each of
the 7 operational subsystem classes at the leaves, all sharing the
models.py value-object contract.
The PheromoneStore encapsulates process-local
environmental memory in the tradition of stigmergic coordination (Grassé
1959; Dorigo and
Stützle 2004). Rather than requiring direct agent-to-agent
messages, the running kernel writes typed traces into a shared in-memory
TraceField and reads them during gate evaluation.
Unreinforced traces lose a fixed amount per tick and are removed at
zero. This is an engineering analogy to stigmergy, not a claim that the
store implements biological chemistry or variational free-energy
minimisation.
Signal types. The store recognises 6 signal types
(SignalType enum), each with distinct ecological
meaning:
Table 3 lists the signal classes and their effect on the gate.
| Signal Type | Ecological Analogue | Decay Class | Effect on Gate |
|---|---|---|---|
FAILURE |
Trail avoidance pheromone | FAST |
Records failed outcome reports; the gate scores the maximum of local FAILURE and RISK pressure. |
SUCCESS |
Trail amplification pheromone | SLOW |
Reinforced on passing outcomes and retained as positive local
history; it does not reduce risk_ok directly. |
RISK |
Caution marker | FAST |
Prospective concern channel; combined with FAILURE through a maximum when computing local hazard pressure. |
NEED |
Resource request | NORMAL |
Broadcast by agents requiring attention at a location; does not feed gate pressure directly. |
DEPENDENCY |
Usage trace | SLOW |
Deposited by record_outcome to signal active module
consumption; a strength ≥ 2.0 vetoes PruningDaemon
nomination. |
HUMAN_PRIORITY |
Operator-injected signal | SLOW |
Receives the HUMAN source multiplier and remains visible to diagnostics; it is not a gate override. |
Decay rates. Each signal is assigned one of 3
DecayRate classes. The enum value is a multiplier
applied to the base subtraction
strength units per tick. The runtime update is linear and floored at
zero, as formalized in Equation 2.
Table 4 records unit-trace behavior for each decay class.
| Class | Source multiplier | Subtraction | Unit trace after one tick | Unit-trace extinction | |
|---|---|---|---|---|---|
FAST |
3.0 | 0.3/tick | 70% | 4 discrete ticks | |
NORMAL |
1.0 | 0.1/tick | 90% | 10 discrete ticks | |
SLOW |
0.2 | 0.02/tick | 98% | 50 discrete ticks |
Extinction scales with deposited strength and reinforcement. The table therefore does not assign a universal half-life to a class; it gives a reproducible unit-trace example. FAST warnings clear quickly, while SLOW success, dependency, and priority traces retain more history.
Trust multipliers by source. Not all sources carry
equal epistemic weight. The PheromoneStore scales a
signal’s effective initial strength by the depositing source’s trust
multiplier before writing to the TraceField:
The effective-strength calculation in Equation 15 determines the initial trace written to the field.
where source_multiplier is HUMAN×2.0, TEST×1.5,
SECURITY×1.5, AGENT×1.0, or RUNTIME×1.0. The optional
trust_factor is supplied only on selected kernel deposits;
many runtime and test deposits use its neutral default.
Compound key addressing. Each pheromone occupies a
unique position in the TraceField identified by the
compound key "{location}:{signal_type.value}". This allows
FAILURE and SUCCESS signals at the same module path to be tracked and
decayed independently, preserving the sign and type of the colony’s
accumulated evidence.
The generated unit-trace trajectories and their assumptions appear in Figure 1.
The ResourceLedger enforces a multi-dimensional budget
envelope over the colony’s resource consumption (Bonabeau et al. 1999). Rather than
tracking a single scalar cost, it maintains 7 independent dimensions of
ResourceCost:
Table 5 lists the dimensions enforced by the ledger.
| Dimension | Type | Description |
|---|---|---|
llm_calls |
int |
Number of LLM API invocations. |
runtime_seconds |
float |
Wall-clock execution time. |
risk_level |
float ∈ [0.0,1.0] |
Aggregate risk fraction of the action. |
human_attention_minutes |
float |
Estimated operator review time. |
merge_risk |
float ∈ [0.0,1.0] |
Probability of merge conflicts or integration failures. |
doc_debt |
float |
Documentation gap accumulation score. |
security_exposure |
float ∈ [0.0,1.0] |
Estimated security surface increase. |
The ledger’s can_afford method returns an
(approved, reason) pair after checking whether the proposed
estimate, added to usage in the current reset period, would breach any
dimension. A false approval bypasses ordinary scoring
(gate_score = 0.0) because budget failure is an early
return rather than a score penalty. The final decision depends on the
calling mode. In standalone mode,
ActuationGate.evaluate(proposal, profile) performs the
ledger check and returns REFUSE; in integrated mode,
ColonyKernel supplies budget_approved=False
and the gate returns HOLD so a caller may retry after the
period resets. On a submitted outcome report, consume uses
outcome["cost"] when it is a valid resource-cost mapping
and otherwise falls back to the proposal estimate. The accumulator
resets when elapsed time crosses the configured
period_seconds; this is a fixed-period reset from the last
start or reset, not a continuously sliding window.
The actuation gate is the colony’s central advisory decision layer: it aggregates signals from the resource ledger, pheromone field, agent trust store, and proposal completeness into a scalar gate score, then routes that score to one of 3 decisions.
Parameter status. The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. In particular, the weights, thresholds, trust deltas, decay amounts, and presentation ranges below describe the current release snapshot. “Configured” therefore means “declared by the current runtime/configuration contract,” not “validated as optimal for every deployment.” The numerical details in this subsection are example/initial values that can be tuned through their owning runtime or presentation configuration. Any tuning should rerun the contract suite and regenerate the dependent tables, figures, captions, and provenance before a new interpretation is made.
The gate score is a weighted linear combination of 4 normalised components (Equation 16):
clamped to after summation: .
The weights sum to 1.0. In the implementation, the code components
budget_ok, risk_ok, trust_ok, and
completeness are the glossary quantities
,
,
,
and
,
respectively. Each component is described below.
budget_ok
()
is binary resource headroom. A false approval bypasses ordinary scoring;
each proposal receives a fresh pre-check.
risk_ok
():
The gate senses both RISK and FAILURE at the proposal target and defines
effective local hazard as their maximum. It maps that pressure through
two module-level constants:
Table 6 defines the discrete mapping from effective local hazard pressure to the normalised score component.
max(RISK, FAILURE) pressure |
risk_ok |
|---|---|
(_HIGH_RISK_THRESHOLD) |
0.0 |
(_MEDIUM_RISK_THRESHOLD) |
0.5 |
| 1.0 |
A location accumulating either prospective RISK findings or reported failed outcomes can therefore lose risk credit until the relevant trace decays. SUCCESS is retained as a separate diagnostic channel and does not cancel the maximum.
trust_ok
():
Agent trust score normalised to gate range. The gate reads
AgentTrustProfile.trust_score and maps it as follows:
Table 7 gives the hard floor and two scoring tiers for trust.
trust_score |
trust_ok |
|---|---|
| 1.0 | |
| 0.5 | |
hard REFUSE (early return, gate_score = 0.0) |
A new agent starts at trust_score = 0.1; profiles
between the hard floor and full-credit threshold receive 0.5 trust
credit.
Trust penalty. When ConsequenceMemory
is available and the agent’s recent-failure count reaches 3, the gate
applies:
This decrement reduces trust_ok — the gate’s normalised
trust contribution for this evaluation only. It does not modify the
agent’s persistent trust_score stored in
ConsequenceMemory. The agent’s durable trust record is
updated separately on each record_outcome call; the gate
penalty is a single-evaluation correction that makes the gate more
conservative while an agent is on a losing streak, without permanently
penalising the agent’s history.
completeness
():
Evidence mass of the proposal. The gate inspects 3 fields:
rollback_plan, evidence, and
expected_outcome.
The proposal-completeness expression in Equation 18 supplies the ordinary score component for incomplete proposals.
The rendered result tables compute all discrete completeness values from that expression.
The gate maps the numeric score to a ternary verdict:
Table 8 gives the three threshold bands.
| Score Range | Decision | Effect |
|---|---|---|
| EXECUTE | Advisory approval returned; the kernel does not perform or enforce the action. | |
| HOLD | Revision or recovery evidence returned; the kernel does not maintain a requeue. | |
| REFUSE | Refusal returned and, in the integrated path, FAILURE pressure deposited at the target. |
Four safety conditions bypass the numeric score entirely, evaluated in order before gate scoring begins:
Budget failure. A False return from
ResourceLedger.can_afford causes an immediate hard override
with gate_score = 0.0. Standalone gate evaluation returns
REFUSE; kernel/caller-supplied budget failure returns
HOLD for requeue after the budget period resets. No further
evaluation occurs.
SANDBOX role. Agents with role
SANDBOX always receive REFUSE regardless of trust score,
pheromone state, or proposal quality. The entry label is held until at
least 3 proposals and the live promotion threshold are
satisfied.
Trust floor. A trust_score < 0.3
triggers an early REFUSE with gate_score = 0.0.
Critical falsification. Any
CRITICAL finding from the FalsificationWorker
triggers an immediate REFUSE with the finding’s remediation attached to
GateResult.required_evidence.
Table 23 in Section 5 is generated from the live weights, thresholds, tier mappings, and missing-field penalty. This avoids maintaining a second, hand-calculated worked example in prose.
The ConsequenceMemory subsystem stores each reported
ConsequenceRecord and the derived agent profile. It uses
SQLite WAL mode when configured with a file path. The kernel and MCP
defaults use :memory:, so records survive only for the
process lifetime unless an operator supplies a persistent database path.
On the ordinary MCP path, the outcome endpoint does not attest reports
against a prior EXECUTE record, so the database is an audit log of
submitted outcomes rather than independent ground truth. Optional kernel
attestation provides a separate linked lifecycle path; required mode
rejects the ordinary outcome method and requires a proposal, EXECUTE
verdict, authorization, execution receipt, and signed outcome event.
Neither mode independently observes external actuation.
The schema comprises three tables: consequences (one row
per submitted consequence report), agent_profiles (one row
per agent, containing current trust state and role), and
consequence_history (a chronological sequence of
consequence IDs per agent, capped at the most recent 200 rows).
Trust delta computation. When a
ConsequenceRecord is persisted with
trust_delta == 0.0, the memory computes it from outcome
fields:
The durable trust update is computed by Equation 19. Notation follows Section 12; is a trust increment, not a field signal.
where
if tests passed else
;
is applied when
;
is the parsed human feedback score and
. The increment is clamped to keep
trust_score within
.
recent_failures() and gate coupling.
The ConsequenceMemory exposes a
recent_failures(agent_id, window=10) method that the
ActuationGate queries when a consequence-memory reference
is provided. When failed reports among the agent’s 10 most recent
consequence records reach 3 or more, the gate applies an additional
decrement to trust_ok—the normalized trust contribution for
that evaluation—not to the persistent trust_score. The
durable score is updated separately from the submitted test and
human-feedback fields on record_outcome. This is a
report-dependent feedback loop, not an independently observed
performance measure.
Agent roles are not assigned at registration — they are inferred
deterministically by RoleAdapter.infer_role from a trust
profile’s trust_score and total_proposals
count. New agents enter at trust 0.1 (the SANDBOX score
from AgentTrustProfile default). The AgentRole
enum defines exactly 5 roles:
Table 9 summarises the kernel-facing role ladder.
| Role label | Trust Required | Minimum Proposals | Intended specialization |
|---|---|---|---|
SANDBOX |
Any | < 3 | Entry/quarantine label; the current gate refuses every proposal, including read-only proposals. |
REPAIR_ANT |
≥ 0.2 | ≥ 3 | Patch, test-fix, documentation update. |
MEMORY_ANT |
≥ 0.35 | ≥ 3 | Archive, index, summarise. |
DISPATCHER |
≥ 0.5 | ≥ 3 | Delegate, coordinate, route tasks. |
GUARD_ANT |
≥ 0.7 | ≥ 3 | Security review, gate audit, archive authority. |
Promotion is governed by the RoleAdapter.infer_role
ladder shown in the table. An agent must first accumulate at least 3
total proposals; before that minimum, it remains SANDBOX
regardless of trust score. Once the proposal minimum is met, the four
thresholds are generated directly from the live adapter. The
trust_promote_threshold runtime projection records the
first promotion floor (0.2); it is not a separate general threshold.
Role inference runs on proposal and outcome cycles. The live gate enforces the SANDBOX override but does not implement a per-action permission matrix for the four higher role labels; those labels currently express trust tiers and intended specializations. Outcome recording persists a changed role. The transition out of SANDBOX depends on externally recorded outcomes, which are not yet linked to prior authorized execution.
RoleAdapter also exposes a standalone
assign_role() API that is not called by the kernel’s
proposal path. This specialization-based path applies higher trust
thresholds (0.8 for REPAIR_ANT and MEMORY_ANT, 0.85 for GUARD_ANT) and
matches action types (e.g. test_fix,
doc_write, security_scan) to role labels. It
is a separate interface for callers that want action-aware role
assignment; the kernel path uses only the trust-and-proposal-count
ladder above.
The PruningDaemon performs periodic ecological thinning
of the colony’s module registry, identifying stale or redundant
components before they accumulate into structural debt. It is the
colony’s analogue of the biological apoptosis mechanism (Bonabeau et al.
1999).
The daemon operates by scanning a module_registry dict
(mapping dotted module paths to usage metadata) and classifying each
entry according to four confidence tiers:
Table 10 records the nomination confidence tiers.
| Condition | Confidence | Reason Tag |
|---|---|---|
call_count == 0 and last_used == 0.0 |
0.9 | never used since registration |
| Duplicate of another module | 0.85 | duplicate of <surviving_module> |
| Zero calls, last used > 30 days ago | 0.7 | no calls; last used N days ago |
| Low call count (< 5), last used > 30 days | 0.5 | low usage (N calls); last used N days ago |
Before classifying any module, the daemon checks the colony’s
PheromoneStore for a DEPENDENCY signal at that
path. A pheromone strength ≥ 2.0 indicates the module is actively
consumed; the candidate is suppressed regardless of call-count metadata.
Pheromones act as a veto on the daemon’s statistical inference: a module
that is genuinely active can receive DEPENDENCY deposits from reported
outcomes and thereby suppress nomination.
The normal scan path returns PruningCandidate reports
sorted by confidence. Explicit non-dry-run pruning APIs can archive
candidates, so safe deployment must keep nomination and actuation
separately authorized. The daemon does not autonomously schedule
deletion, and stale-document detection remains incomplete.
The FalsificationWorker is the colony’s deterministic
adversarial-review component. It runs 11 heuristic checks grouped into
the 10 AttackVector categories, without an LLM call. The
design is motivated by falsifiability (Popper 2002), but each check is a
software heuristic rather than a scientific test of truth.
Attack vector taxonomy. The 10 attack vectors are
defined in the AttackVector enum. Severity weights follow
_SEVERITY_RANK (LOW=1, MEDIUM=2, HIGH=3, CRITICAL=4):
Table 11 lists the canonical adversarial vectors.
| Vector | Typical Severity | Weight | Description |
|---|---|---|---|
NO_ROLLBACK |
HIGH | 3 | Plan lacks a concrete, non-placeholder rollback path. |
NO_TEST_VALUE |
HIGH | 3 | Plan includes no automated test coverage assertion. |
SCOPE_CREEP |
MEDIUM–HIGH | 2–3 | Plan’s scope is vague or reaches beyond its stated target. |
FALSE_METRIC |
LOW–MEDIUM | 1–2 | Expected outcome is absent, tautological, or non-falsifiable. |
CIRCULAR_ARCHITECTURE |
MEDIUM–HIGH | 2–3 | Proposed changes introduce circular import dependencies. |
DEPENDENCY_RISK |
MEDIUM | 2 | Plan introduces at least 3 unvetted external packages. |
SECURITY_RISK |
HIGH | 3 | Plan touches security-sensitive surface without a review annotation. |
OVER_BROAD_MODULE |
MEDIUM | 2 | Module rationale uses at least 5 responsibility verbs. |
HIDDEN_MAINTENANCE_COST |
MEDIUM | 2 | Plan does not account for long-term upkeep burden. |
PREMATURE_ABSTRACTION |
LOW | 1 | Plan introduces a generic abstraction without demonstrated need. |
The CIRCULAR_ARCHITECTURE check has repository-aware and
plan-only modes. With a repo_root, it parses Python imports
and uses depth-first traversal with a recursion stack to find cycles.
Without a repository root, it inspects declared dependencies for
self-reference and parent–child patterns.
Pheromone deposits are best-effort. HIGH and CRITICAL findings deposit FAILURE; MEDIUM findings deposit RISK; LOW findings deposit neither. The kernel may add a further RISK trace for non-refused proposals with MEDIUM-or-higher findings.
Each check returns a FalsificationFinding with fields
for the attacked claim, vector, severity, evidence, and remediation. The
evaluate_plan() method runs all 11 checks and returns a
FalsificationReport with an overall verdict:
The report verdict and gate decision are distinct. Only a CRITICAL finding is a gate hard override. HIGH findings appear in the reason and pheromone field but do not by themselves force REFUSE; ordinary score components determine the result.
Figure 4 shows all 10 canonical attack vectors ranked by maximum severity weight. The current deterministic checks top out at HIGH severity; the CRITICAL class remains part of the actuation-gate override contract.
Beyond the eight primary subsystems, the Colony Kernel package includes several supporting modules that strengthen verification, configuration, and research extensibility. These modules are part of the checked-in codebase and are exercised by the test suite, but they are not counted among the eight primary control-plane subsystems because they serve verification, configuration, or research roles rather than runtime actuation.
config_loader.py)config_loader.py loads YAML-backed configuration from
config/colony_kernel/ (kernel.yaml,
roles.yaml, decay_rates.yaml). It provides
structured defaults for gate thresholds, trust boundaries, role
promotion criteria, and pheromone evaporation rates. The manuscript
variable generator reads the same live constants from source, so the
configuration file and the code are kept in sync by the
float_mirrors and exact_mirrors validation in
variables.py.
invariants.py)invariants.py contains executable design-by-contract
predicates that check selected properties of the runtime state:
gate-weight conservation, trust-score range, pheromone-strength bounds,
role-ladder monotonicity, and enum-value separation. The function
all_invariants_hold() runs all checks against live
constants; these predicates are distinct from the SMT obligations in
formal.py because they execute against runtime values
rather than symbolic expressions.
reference.py)reference.py provides an independent deterministic
reimplementation of the gate-scoring arithmetic with parameters that
mirror the live gate constants (execute threshold, hold threshold, trust
hard floor, etc.). It is used for differential testing: the reference
gate and the production ActuationGate should produce
identical scores for identical inputs. This module is mentioned in Section 11.3 as part of the
refinement-test bridge.
formal.py)formal.py defines runtime obligations and an optional
solver-neutral result bridge. The KernelFormalSnapshot
dataclass captures a bounded kernel state;
runtime_obligations() evaluates selected properties (weight
conservation, trust range, pressure monotonicity, unrelated-target
locality, authorized outcome linkage) against that snapshot. The
optional Z3 backend in formal_verification/z3_bridge.py
translates a subset of these obligations into solver expressions,
returning proved, refuted,
unknown, timeout, or unavailable
(when Z3 is not installed). The bridge proves or refutes only the
encoded bounded obligations; it does not establish whole-program
refinement or production safety.
attestation.py)attestation.py implements a versioned, hash-chained
execution ledger that binds proposal, verdict, authorization, execution
receipt, outcome, rejection, and error events under a configurable
signer. The default HMACSigner uses constant-time
comparison; an optional Ed25519Signer uses the
cryptography library with a delayed import. The ledger
supports optional and required attestation modes: in required mode,
unlinked outcomes and duplicate nonces are rejected. This ledger is not
automatically inserted into the default caller-reported MCP path, so the
release does not claim that every outcome report is authenticated. The
ledger is exercised by focused tests for replay, omission, duplication,
nonce reuse, and unauthorized relinking.
The AttestationLedger is an optional additive component,
not one of the 8 core subsystems. ColonyKernelConfig
accepts an attestation_mode of disabled
(default), optional, or required. When
disabled, attestation_ledger is None and the
kernel operates without the ledger; when optional or
required, the ledger is instantiated and the kernel records
proposal, verdict, authorization, receipt, and outcome events. In
required mode, record_outcome rejects outcomes
that lack a prior authorized execution receipt.
replay.py)replay.py provides the fixed-input paired-locality
replay used to generate the deterministic fixture evidence reported in
Section 5.2. The function
run_paired_locality_replay() constructs a real
ColonyKernel instance, runs the paired scenario, and
returns both semantic and file digests. The replay is repeated for
semantic equality; it is not an attestation, causal estimate, or
external workload result.
research/)The research/ subpackage contains offline-first adapters
that are not called by the production gate:
benchmark.py — run_paired_benchmark()
executes deterministic synthetic baseline and mediated traces and
computes descriptive safety, utility, refusal, and trace metrics. The
paired cases are synthetic; they demonstrate analysis plumbing, not
calibration or generalization.metrics.py — descriptive log loss, Brier score,
calibration error, selective risk, and bootstrap confidence
intervals.persistent_store.py — SQLite WAL persistence adapter
with crash-injection boundaries for durability testing.probabilistic.py —
KernelProbabilisticAdapter declares an observation model,
latent-state space, priors, likelihoods, transitions, preferences, and
policy horizon. It is research plumbing, not an integrated Active
Inference controller.schemas.py — versioned cases, traces, manifests, and
leakage reports.These adapters preserve the boundary between deterministic runtime contracts and research interpretations. They are exercised by focused tests but do not relabel deterministic gate scores as probabilistic outputs.
The feedback path is composed from separate public operations.
propose_action returns a decision but does not actuate.
With attestation disabled or optional, record_outcome
accepts a later caller report without requiring a matching
authorization. Optional mode also exposes a linked path; required mode
rejects the ordinary method and admits only
record_attested_outcome after authorization and an
execution receipt. The pseudocode separates those contracts.
Algorithm 1: Colony Kernel Pressure Loop and Attestation Boundary
Input: ActionProposal p from any agent
Output: GateResult verdict; side effects on PheromoneStore,
ResourceLedger, ConsequenceMemory
PROPOSE(p):
findings ← FalsificationWorker.analyze(p)
[11 checks; HIGH+ deposits FAILURE, MEDIUM deposits RISK]
budget_approved ← ResourceLedger.check_budget(p.budget_estimate)
profile ← ConsequenceMemory.get_profile(p.agent_id)
profile.total_proposals ← profile.total_proposals + 1
ConsequenceMemory.save_profile(profile)
RoleAdapter.update(profile)
witness ← ActuationGate.witness_state(p)
hazard ← max(witness.RISK, witness.FAILURE)
if budget_approved is false:
decision ← HOLD; gate_score ← 0.0; goto POST_GATE
if profile.role is SANDBOX or profile.trust_score < 0.3:
decision ← REFUSE; gate_score ← 0.0; goto POST_GATE
if any CRITICAL finding:
decision ← REFUSE; gate_score ← 0.0; goto POST_GATE
trust_ok ← 1.0 if profile.trust_score >= 0.6 else 0.5
if ConsequenceMemory.recent_failures(p.agent_id) >= 3:
trust_ok ← max(0.0, trust_ok - 0.25)
hazard_ok ← 0.0 if hazard >= 6.0
| 0.5 if hazard >= 3.0
| 1.0 otherwise
missing ← [f for f in [rollback_plan, evidence, expected_outcome] if absent]
completeness ← max(0.0, 1.0 - len(missing) * 0.35) if missing else 1.0
gate_score ← 0.3 + hazard_ok * 0.3
+ trust_ok * 0.25 + completeness * 0.15
gate_score ← max(0.0, min(1.0, gate_score))
decision ← EXECUTE if gate_score >= 0.75
| HOLD if gate_score >= 0.5
| REFUSE otherwise
POST_GATE:
if decision is REFUSE: deposit FAILURE at p.target
return GateResult(decision, gate_score, reason, required_evidence)
ORDINARY PATH: CALLER MAY ACTUATE AFTER EXECUTE; THE KERNEL DOES NOT ENFORCE THIS STEP.
ORDINARY_REPORT(p, outcome, tests_passed):
[Available only when attestation is disabled or optional]
[No consumed authorization or duplicate-report check]
record ← ConsequenceMemory.record(reported consequence)
ResourceLedger.consume(outcome.cost or p.budget_estimate)
if tests_passed and no repair: deposit/reinforce SUCCESS
if tests failed: deposit FAST FAILURE
deposit SLOW DEPENDENCY at p.target
profile ← ConsequenceMemory.get_profile(p.agent_id)
if RoleAdapter.update(profile): ConsequenceMemory.save_profile(profile)
return record
ATTESTED_REPORT(p, outcome, tests_passed):
require an attested EXECUTE verdict for p
authorization ← authorize_execution(p.proposal_id)
caller actuates only after authorization
execution ← record_execution_receipt(authorization, caller receipt)
append signed outcome event linked to execution
apply the same consequence, budget, trust, role, and signal updates
[Required mode rejects ORDINARY_REPORT; local linkage does not observe actuation]
TICK(): subtract each trace's per-tick evaporation and check budget rollover
PRUNING_REPORT(registry): scan and return candidates; do not archive by default
The loop is a deterministic feedback pattern produced by explicit kernel calls: agents propose; callers optionally execute approved work; callers separately report outcomes; trust and local traces then affect later evaluations. Failed outcomes raise same-target hazard pressure and lower the reporting agent’s trust. This can move later proposals from EXECUTE to HOLD or REFUSE, but the effect is bounded by decay and depends on the accuracy of the submitted outcome. The authenticated path protects linkage and integrity of that submission, not its external truth.
On the ordinary path, the generated weights are budget 0.3, hazard 0.3, trust 0.25, and completeness 0.15. Hard overrides intentionally dominate that arithmetic. The score is therefore a transparent policy composition, not a learned collective judgment or calibrated safety probability.
Figure 5 maps the conceptual data dependencies as a 8-stage loop. It shows which state feeds later decisions; it is not a literal call-order trace, because outcome recording is a separate caller action and falsification runs before scoring.
This section separates a proposed external benchmark from the configuration and contract checks that were actually executed for this release. The comparative benchmark has not been run, its baselines are not implemented as released adapters, and no raw trial traces are included. Its purpose here is to make the next empirical test explicit without presenting planned work as evidence.
Parameter status. The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The protocol values reserved in this section are therefore starting points for a preregistered study, not observations or claims about the correct operating point. A study should report every changed value, its authority (runtime policy, configuration, or presentation), and the regenerated artifact hashes.
Table 12 makes the distinction explicit before the proposed trial design and the live runtime configuration are described.
| Parameter class | Examples in this release | Interpretation and authority |
|---|---|---|
| Runtime policy | Gate weights, thresholds, trust deltas, decay constants | Current code-defined behavior; tune by changing the runtime policy and rerun the contract suite. |
| Presentation | Plot horizon, grid density, trust slices, checkpoint selection | Reproducible display choices; tune without changing kernel semantics, but regenerate figures and captions. |
| Proposed protocol | Agent count, workload size, warm-up, trial count, seed, baseline conditions | Initial study-design values; they are not completed experiments or observed sample sizes. |
Table 13 is the release’s claim-status ledger.
| Evidence surface | Release status | Permitted inference |
|---|---|---|
| Colony Kernel unit/integration suite | Executed during variable generation | Checked deterministic behavior under test inputs |
| Ruff and ty checks | Executed; fail closed | No scoped lint/type diagnostics in this snapshot |
| Formula-derived figures and tables | Regenerated from configuration and constants | Arithmetic consequences of the policy |
| Local authenticated lifecycle ledger | Executed deterministic fixture | Hash/signature/linkage integrity, not external actuation truth |
| 4-condition benchmark | Proposed, not executed | No comparative conclusion |
| Production deployment study | Absent | No production safety or performance conclusion |
The proposed study varies the gate policy while holding the ordered workload and reported outcomes constant:
Conditions 2–4 are design specifications, not checked-in drop-in implementations. Implementing and testing them is a prerequisite to executing the benchmark.
Table 14 defines the outcomes that a future benchmark must actually record rather than infer from gate decisions alone.
| Variable | Required operational definition |
|---|---|
| Decision distribution | EXECUTE/HOLD/REFUSE counts per condition and paired workload item |
| Externally attested failure rate | Failed, independently observed outcomes divided by consumed EXECUTE authorizations |
| Budget efficiency | Consumed resource units per externally attested successful task |
| Trust path | Per-agent trust before and after every consumed outcome record |
| Throughput | Externally attested completed workload items per run |
| Recovery latency | Proposals/ticks from first HOLD until EXECUTE, REFUSE, or expiry |
The study should test, rather than assume:
A lower raw error count is insufficient if a policy simply executes less. Results must report denominators, throughput, and paired workload effects.
The checked-in configuration reserves 20 run indices, 5 agents, 50 workload items, and 10 warm-up ticks. These are planning parameters only. Before use, the study must provide:
“Independent trial” should be used only when randomness or independently sampled workloads justify independence. Replaying an identical deterministic trace produces replications for reproducibility, not independent statistical samples.
The default profile begins at trust 0.1 and SANDBOX. The current gate refuses all SANDBOX proposals, including read-only actions, while trust increases only through reported outcomes. Consequently, a trial cannot bootstrap autonomously from this state. A credible benchmark must choose and document one of two approaches:
The present all-success trajectory is a deterministic contract fixture using submitted outcomes. It must not be described as naturally earned autonomous authority.
For paired workload items, report condition-by-item decisions and outcomes before aggregate statistics. Binary externally attested failure outcomes can be analyzed with paired methods or a mixed-effects model that accounts for workload and agent. Ternary gate decisions require a multinomial or ordinal model appropriate to the design. Pre-register exclusions, multiplicity correction, missing-outcome treatment, and stopping rules. Effect sizes with uncertainty intervals are primary; significance tests are secondary.
The integrated kernel runs falsification, checks the budget, loads the agent profile, updates its role label, and evaluates the gate. Table 15 gives the configured routing bands.
| Outcome | Condition on ordinary score | Runtime meaning |
|---|---|---|
| EXECUTE | score ≥ 0.75 | Caller may actuate |
| HOLD | 0.5 ≤ score < 0.75 | Return revision/recovery requirements |
| REFUSE | score < 0.5 | Reject and deposit FAILURE |
Budget failure, SANDBOX, trust below 0.3, and CRITICAL falsification are evaluated as early returns. Integrated budget failure yields HOLD; standalone gate use yields REFUSE. The score is a policy value, not a calibrated probability.
Table 16 identifies each ordinary score component and its live runtime input.
| Component | Weight | Runtime input |
|---|---|---|
| Budget | 0.3 | Binary result of the resource pre-check |
| Local hazard | 0.3 | Piecewise credit from max(RISK, FAILURE) |
| Trust | 0.25 | Tiered trust credit with optional recent-failure penalty |
| Completeness | 0.15 | Presence of rollback, evidence, and expected outcome |
Weights and thresholds are code-defined policy constants with documentation mirrors in YAML. The current release has not calibrated them against external outcomes.
6 SignalType values share a capped field. Each trace
stores its own subtractive evaporation amount at deposit time; Table 17 reports the 3
configured classes.
| Class | Subtraction per tick | Unit trace at report tick | Typical channels |
|---|---|---|---|
| FAST | 0.3 | 100% lost | FAILURE, RISK |
| NORMAL | 0.1 | generated in Table 25 | NEED/default |
| SLOW | 0.02 | 80% retained | SUCCESS, DEPENDENCY, HUMAN_PRIORITY |
The runtime caps field strength at 10.0 and floors at zero. Deposits can have source and trust multipliers, so lifetime scales with effective initial strength. The model does not use exponential half-lives.
Values in Table 18 are loaded
from config/colony_kernel/kernel.yaml by the manuscript
generator.
| Dimension | Cap |
|---|---|
| LLM calls | 500 |
| Runtime seconds | 3600 |
| Cumulative risk level | 0.8 |
| Security exposure | 0.5 |
The ledger has 7 dimensions in total. The pre-check does not consume
resources; record_outcome consumes a caller-supplied cost
when valid or falls back to the proposal estimate.
Table 19 distinguishes inferred labels from the authorization behavior that is actually enforced.
| Role | Trust threshold after ≥3 records | Live authorization behavior |
|---|---|---|
| SANDBOX | entry/default | Every proposal hard-refused |
| REPAIR_ANT | 0.2 | No role-specific action matrix beyond leaving SANDBOX |
| MEMORY_ANT | 0.35 | No role-specific action matrix |
| DISPATCHER | 0.5 | No role-specific action matrix |
| GUARD_ANT | 0.7 | No role-specific action matrix |
The labels encode a deterministic ladder and intended specializations. They should not be reported as enforced capabilities until the gate validates action type against role.
The worker runs 11 checks grouped into these 10 enum categories:
SECURITY_RISKNO_ROLLBACKNO_TEST_VALUESCOPE_CREEPCIRCULAR_ARCHITECTUREFALSE_METRICHIDDEN_MAINTENANCE_COSTDEPENDENCY_RISKOVER_BROAD_MODULEPREMATURE_ABSTRACTIONHIGH or CRITICAL findings deposit FAILURE; MEDIUM findings deposit RISK. Only CRITICAL findings are gate hard overrides. The worker’s PASS/CONDITIONAL/FAIL report is not itself the gate decision.
3 YAML files under config/colony_kernel/ document/load
kernel budget policy, role metadata, and decay metadata. Runtime
authority is mixed:
kernel.yaml is loaded for budget defaults and carries
documentation mirrors for some gate constants;role_adapter.py;actuation_gate.py; andDecayRate and the
base store constant.The manuscript therefore identifies each value’s runtime authority instead of claiming that every parameter is dynamically configurable. The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result.
Table 20 records the build-facing tools and generated snapshot facts.
| Component | Snapshot |
|---|---|
| Python | 3.13.11 |
| Package manager | uv |
| Test runner | pytest + pytest-cov |
| Linter | Ruff |
| Type checker | ty |
| Config version | 1.3.0 |
| Generated | 2026-08-24T13:27:56Z |
“Generated” is an artifact timestamp. Exact dependency resolution
comes from uv.lock, not from version ranges in prose.
The authoritative route runs from the repository root. Its locked dependency group and explicit paths avoid relying on a template project or an untracked wrapper:
uv sync --locked --group docs
uv run --locked --group docs python scripts/z_generate_manuscript_variables.py
uv run --locked --group docs python scripts/generate_manuscript_figures.py
uv run --locked --group docs python scripts/compile_manuscript.py \
--manuscript-dir output/manuscript --output-dir output --check --skip-generate
uv run --locked --group docs python scripts/compile_manuscript.py \
--manuscript-dir output/manuscript --output-dir output \
--pdf --bookends --pdf-engine lualatex --pdf-standard ua-2 --skip-generate
uv run --locked --group docs python scripts/validate_manuscript_integrity.py \
--require-rendered --online-bibliographyVariable generation reruns the scoped tests, branch coverage, Ruff, and ty checks and fails on a non-zero gate. Figure generation reads that snapshot and produces the 18 registered images. Compilation hydrates Markdown, resolves cross-references and citations, renders semantic HTML, hashes an unbookended content PDF, then produces the final distribution PDF with visible first/last bookends in one Pandoc/LaTeX pass. The final PDF hash belongs only in the detached publication manifest, which avoids circular self-hashing.
This route binds internal evidence to output/paper.pdf,
output/paper-content.pdf, and
output/paper.html. It does not prove that the proposed
external benchmark has been executed or that the requested PDF standard
conforms until an external validator reports success.
This section reports only evidence reproducible from the checked-in Colony Kernel. It distinguishes:
No external multi-condition benchmark trace ships with this snapshot. Accordingly, this section reports no production effect size, confidence interval, ecological optimum, or population-level safety rate.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The analytical figures and deterministic fixtures below should be read as reproducible policy probes, not as measurements of a deployed agent population. Their numerical settings are current example/initial values, not universal constants; they can be tuned through the owning code or configuration, with the full evidence chain regenerated after each change.
The fail-closed manuscript generator reruns the Colony Kernel tests and refuses to emit release variables if pytest, Ruff, or ty returns non-zero. Table 21 is therefore a snapshot of executed release gates, not a manually entered scorecard.
| Gate | Snapshot result | Interpretation |
|---|---|---|
| pytest | 845 passing tests | Real tests under tests/unit/colony_kernel/ |
| branch coverage | 78.3% | Scoped to src/codomyrmex/colony_kernel |
| Ruff | 0 findings | Zero required for variable generation |
| ty | 0 diagnostics | Zero required for variable generation |
The suite spans 26 test modules and exercises the 8 named subsystems, their integration class, and the 8-tool MCP adapter. Coverage and passing tests establish exercised behavior under the suite; they do not establish that untested faults, adversarial outcome reports, or deployment failures are absent.
The source snapshot contains 8190 nonblank, noncomment lines across 16 top-level Colony Kernel Python files. These counts describe scope, not quality. The exact commands and evidence limitations are recorded in Section 8.
The central implemented claim is evaluated as a paired deterministic
case using a real ColonyKernel,
PheromoneStore, ActuationGate, and in-memory
ConsequenceMemory—without mocks.
The fixture uses an authorized agent with trust 0.5, no recent failures, a fully specified proposal, an available budget, and an initially clear target. It then records a failed outcome at that target from another agent and reevaluates both the same target and an unrelated target. Table 22 gives the exact results.
| Evaluation | Local RISK | Local FAILURE | Effective hazard | Score | Decision |
|---|---|---|---|---|---|
| Same target, before failure | 0.000 | 0.000 | 0.000 | 0.875 | EXECUTE |
| Same target, after failed outcome | 0.000 | 3.000 | 3.000 | 0.725 | HOLD |
| Unrelated target, after failed outcome | 0.000 | 0.000 | 0.000 | 0.875 | EXECUTE |
| Same target, after 20 passive ticks | 0.000 | 0.000 | 0.000 | 0.875 | EXECUTE |
The failed outcome deposits nominal FAILURE strength 2.0 from source TEST. The 1.5 source multiplier yields pressure 3.000, changing the hazard credit from full to medium. The resulting score change is
The test also establishes locality: the unrelated target is unchanged. A second test establishes reversibility after passive decay. These facts support a bounded statement: the recorded failure increases friction for later same-location action in the running process. They do not show that the original outcome report was truthful, that the effect persists across restarts, or that the gate reduces real-world harm.
The same fixture is replayed twice by
run_paired_locality_replay with fixed proposal identities
and no random draws. The generated semantic digest is af96389d
d276627c 853eeae9 15a54d9a 536e13ff c4d7b74e 9e9f6277 d8b0aabc;
the retained JSON artifact is
output/data/colony_kernel_replay.json with file digest
7752c0ab d462aa70 dcbc5e24 d9f8c691 c3b240e6 eeaf573b 29fc89df
a6be5617. Repeatability is an assertion of semantic equality for
this fixture, not evidence that the caller-reported outcome was attested
or that the implementation is deterministic under concurrency, restart,
or external workloads.
Figure 6 summarizes the four semantic states and the repeatability assertion in a compact visual form.
The ordinary gate score has 4 non-negative weighted components. Because trust credit, hazard credit, and completeness are discrete, not every real number in is attainable.
For a lower-tier authorized agent with clear budget and hazard, the score is
Here , , and for the stated clear-field, lower-tier case; the only varying term is the attainable completeness credit .
Each coefficient and the lower trust credit are injected from the live gate. Runtime completeness has a finite attainable set because each missing field incurs the generated penalty. Thus the threshold is exact while the discrete input mapping can create gaps; the generated cases below expose those gaps without a second arithmetic source in prose.
Table 23 records representative, formula-checked cases.
| Condition | Budget credit | Hazard credit | Trust credit | Completeness | Score | Decision |
|---|---|---|---|---|---|---|
| SANDBOX, otherwise clear | — | — | — | — | 0.000 | REFUSE override |
| Trust 0.29, otherwise clear | — | — | — | — | 0.000 | REFUSE override |
| Lower trust, clear, no completeness fields | 1.00 | 1.00 | 0.50 | 0.00 | 0.725 | HOLD |
| Lower trust, clear, one of three fields present | 1.00 | 1.00 | 0.50 | 0.30 | 0.770 | EXECUTE |
| Lower trust, medium hazard, complete | 1.00 | 0.50 | 0.50 | 1.00 | 0.725 | HOLD |
| Full trust, high hazard, complete | 1.00 | 0.00 | 1.00 | 1.00 | 0.700 | HOLD |
| Full trust, clear, complete | 1.00 | 1.00 | 1.00 | 1.00 | 1.000 | EXECUTE |
Figure 7 visualizes the controlled slice with budget and completeness fixed at 1.0 and no recent-failure penalty. The vertical discontinuities come from the trust hard floor and trust-credit tier; the horizontal discontinuities come from effective hazard thresholds at 3.0 and 6.0. The pressure axis should be read as , not RISK alone.
A new profile begins at trust 0.1 and role SANDBOX. Along the artificial all-success path, each recorded clean outcome adds 0.04. Table 24 reports exact checkpoints.
| Recorded outcomes | Trust | Inferred role | Gate implication |
|---|---|---|---|
| 0 | 0.100 | SANDBOX | Role override refuses |
| 3 | 0.220 | REPAIR_ANT | Role changes, but trust remains below the gate floor |
| 5 | 0.300 | REPAIR_ANT | Ordinary scoring reachable |
| 6 | 0.340 | REPAIR_ANT | Ordinary scoring reachable |
| 9 | 0.460 | MEMORY_ANT | Ordinary scoring reachable |
| 12 | 0.580 | DISPATCHER | Ordinary scoring reachable |
| 15 | 0.700 | GUARD_ANT | Ordinary scoring reachable |
The role ladder’s first threshold (0.2) is below the gate’s independent trust hard floor (0.3). Exiting SANDBOX therefore does not itself authorize a proposal.
Figure 8 plots this deterministic path. It is not a convergence plot: alternating or stochastic outcomes need not converge, and the current constant-step clipped update has no restoring term.
The fixture is also not an attested credential protocol. The ordinary MCP outcome tool does not require a matching prior EXECUTE record, so an operator or client can submit the reports that drive this path. Local lifecycle attestation can protect linkage, but does not independently verify competence or external execution. This remains a deployment blocker for adversarial trust.
The field subtracts 0.3, 0.1, or 0.02 per tick for FAST, NORMAL, or SLOW traces, respectively, then removes traces at zero. Table 25 gives the exact integer-tick path for a unit deposit with no reinforcement.
| Tick | FAST | NORMAL | SLOW |
|---|---|---|---|
| 0 | 1.00 | 1.00 | 1.00 |
| 1 | 0.70 | 0.90 | 0.98 |
| 2 | 0.40 | 0.80 | 0.96 |
| 4 | 0.00 | 0.60 | 0.92 |
| 8 | 0.00 | 0.20 | 0.84 |
| 10 | 0.00 | 0.00 | 0.80 |
Accordingly, a FAST unit trace has lost 100% after 10 ticks, while a SLOW unit trace retains 80%. Figure 1 plots the same recurrence continuously for legibility and states the integer-tick runtime interpretation in its caption.
The package exposes the 8 MCP tools summarized in Table 26.
| Tool | State effect |
|---|---|
colony_propose_action |
Runs falsification and gate evaluation; may deposit traces |
colony_record_outcome |
Accepts a reported outcome; updates memory, budget, trust, role, and traces |
colony_agent_profile |
Reads one profile |
colony_status |
Reads the kernel snapshot |
colony_pheromone_query |
Reads typed pressure |
colony_falsify_plan |
Runs deterministic heuristic review; may deposit traces |
colony_pruning_report |
Reads pruning candidates |
colony_tick |
Advances decay and period-reset checks |
Requests and responses are self-contained JSON-shaped documents, but
calls are not stateless. A module-level ColonyKernel
singleton shares state across calls within one server process. By
default its consequence database is :memory: and its field
is in-memory; restarting the process loses both. Supplying a file-backed
SQLite path can persist consequence records, but the pheromone field
still has no restart-persistent backend.
The default MCP compatibility path still has a proposal–outcome
linkage gap: colony_propose_action does not return a
durable authorization record consumed by
colony_record_outcome, and the outcome tool synthesizes a
proposal from caller input. The additive AttestationLedger
provides proposal, verdict, authorization, receipt, outcome, rejection,
and error events and rejects duplicate nonces. Optional mode records
proposal/verdict events and offers a fully linked outcome route while
preserving the ordinary caller-report method. Required mode rejects that
ordinary method and makes the linked route mandatory. The default MCP
singleton does not enable either mode, and even a valid local chain does
not independently observe external actuation. This release therefore
does not claim that every outcome report is authenticated or externally
true.
The current release has not executed the proposed 20-trial, 4-condition benchmark. Consequently:
This boundary is a result in its own right: it identifies exactly what the internal contract suite establishes and what the next empirical study must supply.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. This distinction is central to the scholarship: the paper contributes an inspectable implementation and a falsifiable evaluation agenda, not a claim that a hand-specified policy has already been calibrated or shown superior.
The unit of analysis in this paper is the Colony Kernel, not every subsystem distributed with Codomyrmex. The broader repository includes agent, orchestration, model-integration, identity, and other facilities. The claims made here concern the kernel path that combines proposal data, budget state, pheromone readings, consequence-derived trust, role inference, falsification findings, and a ternary gate decision.
This distinction matters for both novelty and evaluation. The Colony Kernel can be used as a control-plane component, but the present artifact does not show that every Codomyrmex action is mediated by it, that external clients cannot bypass it, or that a gate decision is enforced by an operating-system or cloud authorization layer.
SWE-bench evaluates model-generated patches against real repository issues, while SWE-agent shows that the agent-computer interface materially shapes software-engineering performance (Yang et al. 2024b, 2024a). These projects motivate evaluating a control plane in the same environments where agents inspect files, run tools, and modify persistent state. They do not provide evidence for the Colony Kernel until the kernel is actually evaluated as part of such a workflow.
LangGraph, AutoGen, and CrewAI provide stateful graphs, conversational multi-agent composition, and role-oriented orchestration, respectively (AI 2024; Wu et al. 2023; Inc. 2024). Their current designs include state or memory facilities, so the Colony Kernel’s positioning does not depend on claiming that other frameworks are stateless or lack cross-session mechanisms. The narrower distinction is architectural: the kernel exposes a deterministic proposal-evaluation path over explicit budget, effective local hazard, trust, and completeness inputs. Whether that path improves outcomes when integrated with another runtime is an empirical question, not a property established by juxtaposing feature lists.
The Model Context Protocol supplies a standard tool-exposure
interface. The referenced official line is revision 2026-07-28 (Model Context Protocol Contributors
2026), whereas the current Codomyrmex client and server
advertise 2025-06-18. The revisions match:
false; therefore not established: Codomyrmex
advertises 2025-06-18, while the referenced official revision is
2026-07-28. This is a source-level revision measurement, not a
conformance suite. The kernel tools are callable through Codomyrmex’s
implemented interface, but compatibility with the current official line
must be tested rather than assumed. Protocol exposure is also not
enforcement: a client or tool path that does not invoke the gate is
outside the protection claimed here.
A deterministic governance prototype. The gate converts a specified kernel state and proposal into EXECUTE, HOLD, or REFUSE. This makes the decision path inspectable and testable.
Not a complete agent runtime. The kernel itself does not generate proposals, choose models, execute arbitrary tools, or guarantee that a downstream runtime obeys its verdict. Other Codomyrmex packages may provide adjacent capabilities, but they are not evidence for the kernel claims in this paper.
Process-lifetime by default. The MCP module owns a single kernel instance within one process. Consequence memory defaults to SQLite in-memory mode, and the pheromone field is in memory. A caller can choose a file-backed database for consequence records; the default does not provide cross-session persistence, and file-backed consequence records do not by themselves persist the whole kernel or pheromone field.
Not a per-role authorization system. RoleAdapter infers labels from trust and proposal count, and SANDBOX is a hard gate condition. The other role labels do not currently define or enforce an action-by-role permission matrix.
Not a security boundary. Trust scores are mutable
state associated with caller-supplied agent identifiers, not unforgeable
capability tokens. The default outcome path remains caller-reported.
Optional AttestationLedger mode offers a fully linked local
route while preserving the ordinary method; required mode rejects the
ordinary method and requires proposal, EXECUTE verdict, authorization,
execution receipt, and outcome events. The ledger does not prove that an
external observer saw a safe or useful action and is not automatically
enabled for every interface.
Not production- or scale-validated. The checked-in tests exercise internal contracts. The manuscript does not release the repeated-trial traces, production replays, concurrent load results, or external benchmark runs needed for effectiveness or scaling claims.
Not an integrated Active Inference implementation. The core kernel remains deterministic and has no posterior or expected-free-energy policy optimizer. A separate, explicit probabilistic adapter now declares states, observations, likelihoods, priors, transitions, preferences, horizon, and seed for offline research; its presence does not turn gate scores into probabilities or connect that model to production actuation. The comparison in Section 7 remains a design crosswalk.
Grassé introduced stigmergy to describe coordination mediated by changes to a shared environment (Grassé 1959). Digital-pheromone systems later adapted this idea to software-agent coordination (Parunak 1997), while ant-colony optimization formalized reinforcement and evaporation for search (Dorigo and Stützle 2004). The Colony Kernel borrows the environmental-trace idea; it does not implement an ant-colony optimization algorithm.
The TraceField stores strengths under compound location and signal-type keys. Evaporation occurs only when the kernel is explicitly ticked, subtracting a configured amount and deleting depleted markers. This is a deterministic, discrete-time store rather than a continuous diffusion field. Its coordination scope is also bounded by process lifetime in the default MCP configuration.
Signal types must not be conflated. A failed outcome deposits FAILURE and changes the responsible agent’s consequence history; prospective checks may deposit RISK. The gate retains these raw readings for diagnosis and uses their maximum as effective local hazard. Thus a reported failure can tighten a later same-target decision without being silently relabeled as RISK. This coupling is process-local and only as trustworthy as the unattested report that created the FAILURE signal.
Computational-trust research treats trust as contextual, evidence-dependent, and distinct from simple identity (Marsh 1994; Sabater and Sierra 2005). FIRE combines direct interaction with witness, role-based, and certified evidence (Huynh et al. 2006). These sources provide comparison points, not validation of the Colony Kernel’s scalar score.
The current kernel uses fixed outcome deltas and clamps the resulting score to a bounded range. It does not estimate a calibrated probability of competence, benevolence, integrity, or future safety. It also does not import witness reputation or certified credentials into the trust update. Two agents with the same score but different sample sizes can therefore receive the same trust tier, and an outcome record has meaning only to the extent that the caller and record are trustworthy.
Role inference is deterministic categorization over this heuristic history. The labels may be useful for routing, explanation, or future policy definition, but only implemented gate conditions have authorization effect. Calling the labels a permission ladder would overstate the artifact until each action class is checked against an explicit policy.
Capability security requires authority that cannot be obtained merely by naming another principal, while least privilege requires each component to receive only the authority it needs (Miller and Shapiro 2003; Saltzer and Schroeder 1975). A scalar trust score indexed by agent identifier is not such a capability. The gate may contribute evidence to a broader authorization decision, but it must be paired with authenticated identities, non-bypassable mediation, sandboxing, constrained credentials, and downstream policy enforcement.
NIST Zero Trust Architecture likewise requires a broader resource-centric control system, including policy decision and enforcement points, identity and device evidence, and continuous evaluation (Rose et al. 2020). The Colony Kernel is compatible with the general practice of reevaluating proposed actions, but it is not an implementation or certification of NIST SP 800-207.
Tool-using agents can be redirected by untrusted content, can misuse available tools, and can fail in high-impact simulated environments. AgentDojo and InjecAgent operationalize prompt-injection attacks against tool-integrated agents, and ToolEmu evaluates risks in high-stakes tool use (Debenedetti et al. 2024; Zhan et al. 2024; Ruan et al. 2023). These are appropriate future falsification workloads. They have not been run in this manuscript, so they should not be cited as evidence that the gate reduces attack success.
Runtime-assurance work provides another useful comparison. Simplex architectures interpose a decision mechanism capable of switching from an advanced controller to a verified-safe baseline (Seto et al. 1998). The Colony Kernel also interposes a decision, but it has no verified fallback controller or formal safety invariant. The comparison identifies an engineering direction rather than an inherited guarantee.
| Evaluation question | Suitable evidence | Status in this paper |
|---|---|---|
| Does the gate improve repository-task outcomes? | Controlled SWE-bench or SWE-agent integration with a baseline | Not run |
| Does it reduce unsafe tool use under indirect injection? | AgentDojo or InjecAgent attack-success comparison | Not run |
| Does it reduce high-impact tool failures? | ToolEmu scenarios with linked proposal, verdict, and outcome traces | Not run |
| Can the local lifecycle chain reject forgery and replay? | Signed/hash-linked deterministic ledger tests | Supported for local ledger mechanics |
| Can clients bypass mediation or forge external actuation evidence? | Authenticated end-to-end deployment adversarial tests | Not run |
| Does state survive restart and concurrent access? | Persistence and concurrency tests under a declared deployment configuration | Not established for the default MCP service |
| Are HOLD and REFUSE calibrated to downstream harm? | Held-out outcomes with calibration and utility analysis | Not evaluated |
Table 27 states the minimum comparisons needed before making effectiveness or deployment claims.
Friston’s Free Energy Principle (Friston 2010) frames intelligent behavior as minimization of variational free energy—the gap between an agent’s generative model and its sensory observations. A full mapping of the Colony Kernel onto this framework would require an explicit generative model over observations and hidden states, an implemented posterior approximation, and policy selection under expected free energy (Friston et al. 2017).
Section 7 develops this analogy explicitly by proposing a generative-model interpretation of colony observations, hidden states, and policy selection. That treatment is a conceptual reconstruction of the implemented heuristics, not evidence that the current kernel performs variational Bayesian inference or minimizes canonical expected free energy. High failure pheromone concentrations can be read as coarse, persistent prediction-error signals, but the mapping remains an engineering interpretation rather than a proof of formal equivalence.
The benchmark protocol in Section 4 remains unexecuted as a repeated comparative study. Configured agent counts, scenarios, and expected rates are protocol parameters or analytical fixtures, not observations. A publication-quality experiment requires released traces, explicit baselines, linked proposal-to-outcome records, predeclared outcomes, and an analysis appropriate to ternary gate decisions.
The current system is synchronous and single-process by default. It has no demonstrated throughput envelope, distributed consistency model, or merge protocol for independent pheromone fields and trust histories. File-backed consequence storage can be evaluated as one deployment option, but it should not be described as persistence of the complete control plane.
The gate weights, trust deltas, role thresholds, decay amounts, and falsification checks are hand-authored heuristics. They are auditable, but auditability is not calibration. Future learning or optimization should predict downstream repair, harm, or policy violation on held-out data; fitting a model to reproduce the existing EXECUTE/HOLD/REFUSE labels would merely imitate the current rule.
Adjacent wallet, HMAC challenge-response, physiological-signal, persona, and spatial world-model modules are outside the evaluated gate path. This paper makes no zero-knowledge, wallet-ownership, coercion-detection, physiological-authentication, or trajectory-aware gating claim on their behalf.
The resulting position is deliberately modest. The Colony Kernel is an inspectable software experiment in consequence-aware gating. Its deterministic contracts are testable now. Persistence across sessions, enforceable role authority, resistance to adversarial clients, and improved safety on realistic workloads remain implementation and evaluation targets. The relevant comparison with prior work is therefore at the level of control-plane decomposition and measurement design; it should not be read as an empirical comparison with the cited systems.
Active inference provides a vocabulary for relating perception, belief, action, and learning under uncertainty (Friston 2010; Friston et al. 2017). That vocabulary can help ask sharper questions about the Colony Kernel. It does not, by itself, make the kernel an active-inference system.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The active-inference correspondence below is therefore a research scaffold: it identifies missing model components and testable upgrade steps, not a retrospective theoretical certification of the current heuristic gate. The deterministic settings used in this crosswalk are example/initial engineering values that can be tuned through their owning code or configuration; tuning them does not create a probabilistic model or an empirical Active Inference result.
The core implementation is deterministic and heuristic. It does not integrate a probabilistic generative model, maintain a variational posterior, estimate precision from data, evaluate policies over a planning horizon, or minimize expected free energy. A separate offline research adapter declares these objects for explicit experiments, but it is not called by the production gate and does not relabel deterministic scores. This section therefore presents a conceptual crosswalk and an implementation agenda. Its correspondences are analogies to be tested, not formal equivalences or empirical results.
In a canonical variational treatment, an agent specifies a joint density over observations and latent states , and maintains an approximate posterior . Variational free energy may be written as
so minimizing in Equation 22 with respect to makes the approximation approach the posterior under the stated model. Active inference additionally evaluates policies using predicted future observations, preferences, and expected free energy (Friston 2010; Friston et al. 2017).
For a Colony Kernel implementation to satisfy that description, the software would need to represent at least:
The checked-in kernel has deterministic state variables and thresholds instead. Giving those variables names borrowed from active inference does not supply the missing model or inference procedure.
The crosswalk in Figure 9 is therefore a reading aid, not a model diagram. The crosswalk identifies where a future probabilistic implementation might attach to the existing interfaces.
| Active Inference term | Suggested Colony Kernel analogue | Status in the current implementation |
|---|---|---|
| Observation | Strengths returned by TraceField sensing | Concrete numeric state, but not samples from a declared likelihood |
| Hidden state | Agent competence or location risk | Interpretive latent quantities; no corresponding random variables are represented |
| Approximate posterior | Agent trust score or inferred role | Fixed-delta summary and deterministic label, not a probability distribution |
| Policy | ActionProposal | One proposed action, not a policy sequence evaluated over future states |
| Expected free energy | Gate score | Hand-weighted threshold score, not an EFE calculation |
| Precision weighting | Signal source multipliers | Configured deposit weights, not estimated inverse variances |
| Learning | Consequence-derived trust update | Clipped heuristic increments, not posterior or parameter learning |
| Markov blanket | ActuationGate boundary | Software mediation metaphor, not a demonstrated conditional-independence blanket |
Table 28 makes each analogy’s non-equivalence explicit.
The trust score summarizes selected outcome fields by adding fixed positive and negative deltas and clamping the result. It does not retain the sufficient statistics of a declared likelihood, and two agents with different evidence volumes can share the same score. A Beta distribution can be proposed as a future model for binary outcomes, but that model would require explicit assumptions about exchangeability, dependence, nonstationarity, repair events, and human feedback. It cannot be inferred from the current scalar update.
The RoleAdapter adds no Bayesian step. It maps the heuristic score and proposal count to a named tier. Those names remain operating labels; apart from implemented gate conditions such as SANDBOX, they do not constitute a probabilistic belief state or a per-action authorization policy.
The pheromone field is useful as a stigmergic store: one operation changes shared environmental state that a later operation can sense. This follows the broad environmental coordination idea in stigmergy (Grassé 1959; Parunak 1997). Within the default MCP server, however, that shared state lasts only for the process and does not constitute a shared generative model.
The signal semantics are also discrete implementation choices. FAILURE and RISK occupy different keys, while the gate computes effective hazard as their maximum. A reported FAILURE can therefore lower the next same-target gate score without becoming a Bayesian risk prior or changing the stored RISK channel. Likewise, source multipliers express configured deposit strength; without a noise model or estimated variance, they are not statistical precision.
Evaporation subtracts a configured amount on each explicit tick and removes depleted markers. It is not exponential Bayesian forgetting, and elapsed wall-clock time has no effect unless a caller advances the kernel.
The gate combines budget approval, tiered effective hazard, trust, and completeness terms, plus hard conditions, into a deterministic score. No probability distribution over future outcomes is generated, and no alternative policy sequence is rolled out. The gate score should therefore not be identified with , with a probability of safety, or with an upper bound on harm.
HOLD admits a limited epistemic analogy. A caller may respond to HOLD by supplying better evidence or revising a plan, which can reduce uncertainty for a human or downstream system. The kernel itself does not choose an information-gathering action, compute expected information gain, or guarantee that the revision is informative. HOLD is a request for revision under deterministic rules, not a literal active-inference policy.
EXECUTE has the same boundary. It means that the proposal cleared the current rule under the current state. It does not mean that expected free energy was minimized or that the action is safe.
Environmental traces can coordinate successive operations without direct messages, and variational-ecology work offers one theoretical language for studying coupled agents and environments (Ramstead et al. 2019). The Colony Kernel provides a small engineering example of environmental state being sensed after earlier deposits. Demonstrating collective inference would require more: agent-specific models, a shared observation process, and evidence that updates improve posterior prediction or policy selection.
A Markov blanket is a conditional-independence structure in a probabilistic graphical model (Pearl 1988). The ActuationGate is a software boundary between a proposal and a verdict, but this alone does not establish the conditional independencies of a Markov blanket. Calling the gate a blanket is acceptable only as a clearly marked metaphor for mediation.
The process boundary matters here as well. The default MCP singleton lets multiple calls within one process encounter the same in-memory field. Restarting the process removes that field, and a file-backed consequence database does not restore it. Cross-session collective belief propagation is therefore not an implemented property.
Turning the analogy into a scientific model would require a new implementation and a new evaluation, not a relabeling of the existing score.
Specify the generative model. Define observable events, latent quantities, likelihoods, priors, conditional independencies, and the time model. FAILURE, RISK, trust, and repair must have distinct semantics in that model.
Link evidence to actions. Each observation used for inference should be bound to an approved proposal, executed action, actor identity, and measured outcome. The current ability to submit an outcome without such a chain is unsuitable as an inference dataset.
Implement posterior inference. Maintain an explicit posterior approximation and test it using simulation-based calibration, posterior predictive checks, and held-out prediction. A scalar trust score may remain an interface projection, but it should not be treated as the posterior itself.
Define policies and preferences. Represent alternative action sequences, future state transitions, and preferred outcomes. Then compute or approximate expected free energy and compare its choices with both the deterministic gate and observed downstream outcomes.
Calibrate against consequences. Learning should target repair cost, policy violation, or another independently observed outcome. Training a model to predict the existing EXECUTE/HOLD/REFUSE label would reproduce the current rule rather than validate it.
Run a comparative experiment. Release seeds, traces, baselines, and failure analyses for the deterministic gate and the probabilistic alternative. Evidence that the latter improves calibration or utility would support the upgrade; conceptual similarity alone would not.
These steps could yield an active-inference-inspired successor. They would still not prove that the software is formally equivalent to a biological active-inference model; that is a separate mathematical claim requiring explicit definitions and proof.
Active inference is useful here as a question generator. It asks what the kernel observes, which uncertainty it represents, how evidence changes belief, and how present action is valued against possible futures. The current answers are deterministic strengths, fixed trust deltas, categorical role labels, and thresholded gate decisions.
That architecture may be a practical substrate for later probabilistic work, but the present Colony Kernel performs neither variational Bayesian inference nor expected-free- energy minimization. The honest correspondence is schematic: a map of where formal components might be built, with the unmapped territory left visible.
This section describes the evidence that the checked-in manuscript route actually regenerates. It is a scoped build record, not a claim that every Codomyrmex module was tested, that the Git worktree had no uncommitted edits, or that the proposed external benchmark in Section 4.1 was executed.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The generated snapshot binds the rendered numbers to one configuration and source state; it does not turn those values into fitted or externally validated parameters.
Table 29 separates the claims supported by the release route from claims that require additional evidence.
| Evidence surface | Regenerated by this route | Not established |
|---|---|---|
| Colony Kernel tests | Pass/fail count for tests/unit/colony_kernel/ |
Correctness outside exercised cases |
| Branch coverage | Coverage of src/codomyrmex/colony_kernel against the
configured 60.0% floor |
Coverage of the full Codomyrmex package |
| Static checks | Ruff and ty status for
src/codomyrmex/colony_kernel |
Repository-wide lint or type cleanliness |
| Manuscript variables | Token map computed from current files, configuration, and gate outputs | A signed or independently attested release |
| Figures | 18 regenerated visual assets sourced from the variable snapshot and documented constants | Measurements from an external agent population |
| Figure accessibility | Configured captions, concise alternatives, extended descriptions, redundant encodings, and palette-contrast checks | Usability with every assistive technology, display, print process, or reader |
| Claim audit | Machine-readable claim classes, evidence paths, citations, and boundaries | A claim ledger does not create evidence missing from the cited paths |
| Bibliography audit | Pandoc citations separated from cross-references; cited primary locators resolved and unused records rejected | Registry resolution does not validate every argument made by a source |
| Paired replay | Fixed-input semantic replay with repeat-run equality and JSON digest | External-actuation attestation, concurrency, restart durability, or external effectiveness |
| Local attestation | Signed, hash-linked proposal/verdict/authorization/receipt/outcome fixture | Independent observation of external actuation or deployment safety |
| Render | Hydrated Markdown, semantic HTML, content PDF, and bookended distribution PDF | Byte-identical output across machines and dates |
| PDF conformance | qpdf --check, pdfinfo tagging fields, and
the matching veraPDF PDF/UA validation profile are required by the
compiler for the current content and distribution PDFs |
Universal usability across assistive technologies, displays, print processes, or readers |
The current content and distribution PDFs have an independent veraPDF
PDF/UA pass recorded in
output/validation/paper-content-pdf-validation.json and
output/validation/paper-pdf-validation.json. The compiler
treats this as a required gate whenever a non-none
--pdf-standard is requested: a receipt must show
Tagged: yes, Suspects: no, the matching
veraPDF flavour, a compliant validation result, and an overall
passed value. This is artifact-specific conformance
evidence for the rendered files; it does not establish universal
usability across assistive technologies, displays, print processes, or
readers.
The variable generator fails when the scoped pytest process, branch-coverage threshold, Ruff, or ty fails. Rendering normally invokes this generator before consuming the hydrated manuscript. “Fail closed” in this paper therefore refers to those named, scoped gates. It does not imply that unrelated repository tests or external benchmark requirements are part of the same decision.
Table 30 records the manuscript configuration identity injected into this render.
| Property | Rendered value | Source |
|---|---|---|
| Configuration digest | 141058fd c6ae2a41 12583c31 70b3951e 4d1e7d82 ce0b7651 0e80ebe3 57f4c3d8 |
Full SHA-256 over the raw bytes of
docs/manuscript/config.yaml |
| Experiment replay seed | 0 |
Explicit protocol input; the current paired replay uses no random draws |
| Manuscript version | 1.3.0 | paper.version in the same YAML file |
| GitHub release tag | v1.3.0-paper |
publication.release_tag in the same YAML file |
| First author | Daniel Ari Friedman | First entry under authors |
| Keywords | ai-agents, model-context-protocol, mcp, multi-agent, orchestration, colony-control-plane, stigmergy, artificial-ecology, agentic-software-engineering, falsification-worker, actuation-gate, trust-scoring | keywords list |
| Generation time | 2026-08-24T13:27:56Z | UTC time when the variable map was computed |
Hydration is also pinned as a build input rather than inferred from
whichever template happens to be importable. The current snapshot
records repository docxology/template, revision
0cb18ad052c1253c0b4e2f3b397fc67c75f6f0a0, and entrypoint
infrastructure.rendering.manuscript_injection.write_resolved_manuscript_tree.
The observed mode is canonical-pinned and the pinned
checkout dirty-state flag is false. A canonical-pinned mode
requires the recorded clean checkout; a standalone clone may use the
project-local strict successor only when the sibling checkout is
unavailable.
Protocol compatibility is measured rather than inferred from the MCP
name. The referenced official line is revision
2026-07-28 (Model Context Protocol
Contributors 2026), while the current client and server
sources advertise 2025-06-18. Equality is
false; the resulting status is not established:
Codomyrmex advertises 2025-06-18, while the referenced official revision
is 2026-07-28. This string-level check is provenance evidence,
not a protocol conformance or interoperability test.
The configuration digest is a compact change detector for one file. The generated snapshot also records the source commit, worktree state, environment fingerprint, the first-party Colony Kernel/manuscript source digest, lockfile/project hashes, and the authoritative inventory digest below. These values are integrity metadata, not signatures or authenticity proofs.
The generator reads the current filesystem. It can include
uncommitted edits, and it does not reject such a state. A release that
needs later reconstruction should record the commit and submodule
revisions, git status --porcelain=v1, any retained diff,
the full SHA-256 of uv.lock, and hashes of the emitted
evidence and publication files. Table 32 records the identity
fields retained for that reconstruction.
Table 31 reports live inventory values available to the manuscript. These are counts of files or definitions visible during generation; they are not all newly created artifacts.
| Inventory | Rendered count | Counting rule |
|---|---|---|
| Colony Kernel test modules | 26 | test_*.py directly under
tests/unit/colony_kernel/ |
| Colony Kernel YAML files | 3 | *.yaml and *.yml directly under
config/colony_kernel/ |
| Colony Kernel MCP tools | 8 | @mcp_tool definitions in mcp_tools.py |
| Colony Kernel documentation files | 3 | *.md directly under
docs/modules/colony_kernel/ |
| Top-level Colony Kernel Python files | 16 | *.py directly under
src/codomyrmex/colony_kernel/ |
| Reproducibility fact | Rendered value |
|---|---|
| Source commit | 899e5765 884d3686 2eb00449 969ea3a9 01230580 |
| Worktree dirty | true |
| Worktree status SHA-256 | 7f5df43d 3db73f1a 023d30ce 60bf4c69 1ed1cecb 7ad7cc20 9fac27c0 8872435b |
| Environment fingerprint | dc82a6bf 4fb221c8 c277cf46 41a09910 6c8d86e3 89a5e6c5 77bea24e a79d419f |
| Colony Kernel/manuscript source SHA-256 | b4c1daf7 565c65ff 0767bfdd 71e42523 1dd578ba f87914c3 46c90677 eae15195 |
pyproject.toml SHA-256 |
02dbbd13 f622f048 3e87ab6d 8bf64f5f 2bf97d76 79f98b4c dcd13220 07781713 |
uv.lock SHA-256 |
0655ac0c 8fa29985 f111d347 0a6baf5c f2454cac 27a84ab1 e4502349 e4dc20f9 |
| Authoritative inventory SHA-256 | 5b66adb4 14be3826 0f3f7cb6 1f923d49 25bc8dc7 2fec9d2d 02dd33a9 c2bb7790 |
| Inventory module / MCP file / decorator / workflow counts | 130 / 152 / 627 /
37 |
| Fixed-input replay artifact | output/data/colony_kernel_replay.json |
| Replay semantic digest | af96389d d276627c 853eeae9 15a54d9a 536e13ff c4d7b74e 9e9f6277 d8b0aabc |
| Replay record SHA-256 | b49f284d 3e311bcf ccb8f9b1 ce4f6639 719d34d1 f135ab0e 1e476190 d4dfdf26 |
| Replay file SHA-256 | 7752c0ab d462aa70 dcbc5e24 d9f8c691 c3b240e6 eeaf573b 29fc89df a6be5617 |
| Replay assertions / decisions | repeatable=true; same-target=HOLD;
unrelated=EXECUTE; recovered=EXECUTE |
Long hexadecimal identifiers in this table are grouped with spaces only to create line-break opportunities in the rendered document. Remove whitespace before comparing them with the machine-readable replay, configuration, or provenance artifacts.
The project uses the following output conventions:
output/data/manuscript_variables.json stores the
complete rendered token map;output/data/colony_kernel_coverage.json stores the
fresh scoped coverage report;output/data/colony_kernel_replay.json stores the
fixed-input paired replay, semantic assertions, provenance, and
digests;output/data/bibliography_audit.json stores
cited/unused/missing inventories, primary locators, registry title
checks, and any access-limited resolution; online mode also records the
resolution source. ISBN checks use exact Open Library edition metadata
first, then an identifier-checked Open Library search retry and Google
Books feed fallback; a loose title match is never sufficient;output/manuscript/ stores token-resolved section copies
plus config.yaml and the bibliography used by the
renderer;output/figures/ stores the 18 generated PNG figures and
figure_registry.json, whose entries record caption, concise
alternative, extended description, evidence class, byte size, and full
SHA-256 for each PNG, while its schema-level provenance records the
source commit, dirty state, and Colony Kernel / manuscript source
digest;docs/manuscript/claim_ledger.yaml records the active
claim audit. The integrity validator checks that every listed
source/evidence path exists and that cited bibliography keys
resolve;output/paper.html, the unbookended
output/paper-content.pdf, the bookended
output/paper.pdf, and PDF validation receipts; andpython -m codomyrmex.release publication prepare writes
the portable output/release/codomyrmex-1.3.0/ bundle with
citation metadata, Zenodo deposit metadata, detached checksums,
reproducibility inputs, and publication_manifest.json.PDF presentation layout is configuration-backed. The current initial
margin is 0.58in; it is a tunable presentation setting, not
a scientific constant or calibrated result. Changing it requires
regenerating the variables, figures, HTML/PDF, and integrity manifest,
followed by visual inspection. Layout changes do not alter the
underlying runtime measurements.
The generated replay JSON is the machine-readable semantic evidence record for the paired fixture; its file digest is injected into the manuscript at generation time.
These paths are generated workspace outputs. Their presence alone does not show that they are current; the successful command log and artifact hashes are needed to bind them to a particular run.
Table 33 repeats the same generated values reported in Table 21.
| Gate | Rendered result | Exact scope |
|---|---|---|
| pytest | 845 passed | tests/unit/colony_kernel/ |
| branch coverage | 78.3% | src/codomyrmex/colony_kernel; 60.0% project floor |
| Ruff | 0 findings | src/codomyrmex/colony_kernel |
| ty | 0 diagnostics | src/codomyrmex/colony_kernel |
The generator deletes the prior coverage JSON before invoking pytest, requires a newly written report with a branch-coverage percentage, and raises on a non-zero subprocess result. Ruff and ty are also rerun rather than read from a cached scorecard. The test count is parsed from the same scoped pytest process, with a collection-only fallback if the summary cannot be parsed.
The suite introduces no prohibited mock framework and includes real value objects, filesystem cases, and both in-memory and SQLite-backed cases. That testing style checks more integration behavior than isolated substitutes would, but it neither reproduces a production deployment nor validates the truth of caller-reported outcomes.
The supported route begins at the Codomyrmex repository root:
uv sync --locked --group docs
uv run --locked --group docs python scripts/z_generate_manuscript_variables.py
uv run --locked --group docs python scripts/generate_manuscript_figures.py
uv run --locked --group docs python scripts/compile_manuscript.py \
--manuscript-dir output/manuscript --output-dir output \
--check --skip-generate
uv run --locked --group docs python scripts/compile_manuscript.py \
--manuscript-dir output/manuscript --output-dir output \
--pdf --bookends --pdf-engine lualatex --pdf-standard ua-2 --skip-generate
uv run --locked --group docs python scripts/validate_manuscript_integrity.py \
--require-rendered --online-bibliographyThe scoped evidence gates and package-wide static gates can be inspected directly:
uv run --locked pytest tests/unit/colony_kernel/ \
--cov=src/codomyrmex/colony_kernel \
--cov-branch \
--cov-report=json:output/data/colony_kernel_coverage.json \
--cov-report=term
uv run --locked ruff check src scripts tests
uv run --locked ruff format --check src scripts tests
uv run --locked ty check
uv run --locked python scripts/replay_colony_kernel.pyThe variable producer isolates this scoped branch-coverage run from any parent pytest-cov session by assigning it a dedicated raw-data file and removing inherited pytest-cov bootstrap variables. This prevents a repository-wide statement-coverage run from attempting to combine incompatible branch-coverage data.
After those files exist, the detached publication bundle and non-mutating remote plans are produced and verified with:
uv run --locked python -m codomyrmex.release publication prepare \
--validation-receipt output/data/bibliography_audit.json \
--validation-receipt output/validation/paper-content-pdf-validation.json \
--validation-receipt output/validation/paper-pdf-validation.json
uv run --locked python -m codomyrmex.release publication verify \
output/release/codomyrmex-1.3.0
uv run --locked --group docs python scripts/validate_manuscript_integrity.py \
--require-rendered --require-source-current
uv run --locked python -m codomyrmex.release publication plan \
output/release/codomyrmex-1.3.0 --target github
uv run --locked python -m codomyrmex.release publication plan \
output/release/codomyrmex-1.3.0 --target zenodo-sandboxscripts/compile_manuscript.py --check --skip-generate
checks the hydrated section set for unresolved double-brace variable
patterns without rerunning the gates. Omitting
--skip-generate deliberately regenerates the variables
first.
Table 34 records the environment facts that are available to this manuscript without inventing cross-platform certification.
| Component | Release fact | Reproducibility role |
|---|---|---|
| Python | 3.13.11 | Interpreter used by variable generation |
| uv | Resolved from the installed tool | Installs the locked dependency graph |
uv.lock |
Repository lockfile | Pins Python package resolution |
| pytest / pytest-cov | Development dependencies | Executes tests and branch coverage |
| Ruff / ty | Development dependencies | Executes scoped static gates |
| Pandoc / LuaLaTeX | Host tools | Produce semantic HTML and the requested tagged PDF standard; versions can affect layout |
| qpdf / pdfinfo / veraPDF | Host validators | qpdf checks structure; pdfinfo checks tagging metadata; veraPDF checks the requested conformance profile |
| SQLite | Python standard-library binding | Exercises consequence storage where configured |
uv sync --locked prevents lockfile changes, but it does
not pin host fonts, Pandoc, TeX packages, operating-system libraries, or
the current date. The generation timestamp and auto publication date
also change across runs. Consequently, the expected claim is semantic
regeneration with passing gates and resolved references—not universal
byte-for-byte identity.
Table 35 identifies what the current snapshot contains.
| Item | Status | Evidence path |
|---|---|---|
| Gate/test/type/lint values | Executed during variable generation | output/data/manuscript_variables.json |
| Branch details | Executed during variable generation | output/data/colony_kernel_coverage.json |
| Policy and taxonomy figures | Regenerated | output/figures/*.png |
| Deterministic contract cases | Executed by the Colony Kernel suite | tests/unit/colony_kernel/ |
| Paired replay artifact | Executed twice with fixed identities and compared semantically | scripts/replay_colony_kernel.py and
output/data/colony_kernel_replay.json |
| Local authenticated lifecycle | Executed with signed/hash-linked events | tests/unit/colony_kernel/test_kernel_attestation_integration.py |
| Citation inventory and locator audit | Executed over every retained record | output/data/bibliography_audit.json |
| Publication bundle | Prepared only after render and detached-hash verification | output/release/codomyrmex-1.3.0/publication_manifest.json |
| Four-condition benchmark | Proposed only | No raw trial artifact in this release |
| Production deployment | Not evaluated | No production trace artifact |
Core score calculations and tick updates are deterministic for fixed explicit inputs and state. The full build is not purely deterministic: proposal identifiers and timestamps may be created at runtime, the manuscript records a generation time, the publication date may be automatic, and renderer versions can alter layout. Replaying an identical policy case is therefore different from reproducing identical publication bytes.
The comparative study in Section 4.1 should not be promoted to “executed” until the artifacts in Table 36 exist and regenerate the reported analysis.
| Required artifact | Minimum content |
|---|---|
| Workload manifest | Stable item IDs, inputs, expected evaluation procedure, licenses, and exclusions |
| Baseline implementations | Versioned adapters for all four conditions with shared interfaces |
| Authorization/outcome ledger | Proposal, gate decision, consumed execution authorization, receipt, outcome, attester identity, and independent observation source |
| Raw event trace | Append-only ordered events, costs, decisions, outcomes, ticks, and errors |
| Run identity | Source commit, submodule revisions, full configuration and lockfile hashes, environment inventory |
| Analysis package | Script or notebook that regenerates tables, figures, uncertainty intervals, and exclusions |
| Negative evidence | Failed runs, missing outcomes, protocol deviations, and stopping decisions |
Until that package exists, the manuscript’s strongest supported conclusion remains the bounded one reported in Section 5: the checked implementation exhibits the tested local inhibition, recovery, scoring, and accounting behavior under its contract cases.
This paper presents the Colony Kernel as a deterministic, inspectable prototype for placing a control decision between an agent’s proposal and software actuation. Within the kernel evaluation path, a proposal is considered alongside budget headroom, local hazard pressure, consequence-derived trust, proposal completeness, the agent’s inferred role label, recent failures, and falsification findings. The result is an explicit EXECUTE, HOLD, or REFUSE decision rather than an implicit assumption that possession of a tool implies permission to use it.
The implementation evidence supports a bounded claim. The checked-in tests exercise the kernel’s data models, gate arithmetic, consequence updates, pheromone operations, role inference, and MCP-facing tools. These tests establish deterministic software contracts for the cases they cover. They do not establish production safety, robustness at scale, resistance to a strategic adversary, or improved task performance relative to another agent runtime.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The policy parameters and fixture inputs should therefore be changed only through a declared tuning or calibration protocol with regenerated tests, tables, figures, and provenance—not silently treated as universal constants.
Several boundaries are especially important. The default MCP server owns one kernel instance for the lifetime of its process. Its consequence database defaults to SQLite in-memory mode, and its pheromone field is also in memory. A caller may configure a file-backed SQLite path for consequence records, but that does not persist the complete kernel state or the pheromone field. The present artifact therefore does not support a claim that local pressure, trust, or gate state automatically survives process restarts, model swaps, or deployment across machines.
The role ladder is similarly narrower than an authorization hierarchy. RoleAdapter deterministically maps trust and proposal-count state to labels, and SANDBOX receives a hard gate override. The remaining role names do not currently carry an action-specific permission matrix. They describe inferred operating status; they are not cryptographic capabilities or independently enforced privilege scopes.
The FAILURE and RISK channels remain distinct in storage, but they are now coupled at the gate: local hazard is the maximum of the two sensed pressures. The paired contract test records a failed outcome, observes the resulting FAILURE pressure, and changes a complete same-target proposal from EXECUTE to HOLD while leaving an unrelated target unchanged. Passive tick decay later restores the original decision. This verifies a process-local locality invariant. It does not verify the truth of the outcome report. The ordinary MCP endpoint still accepts caller-supplied data without binding it to a prior EXECUTE authorization. Optional and required kernel modes provide a signed, hash-linked local lifecycle path, with required mode making that path mandatory, but the ledger does not independently observe actuation or establish that it was safe.
The architecture should be judged by tests that can fail, not by the biological metaphor. The following criteria separate contracts already exercised by the repository from claims that still require implementation or empirical evaluation.
The checked-in paired test submits identical proposals under identical agent, budget, completeness, and falsification state, varying only whether the target location has a reported failed outcome. The failed-location proposal receives a strictly lower score and a stricter decision; an unrelated location does not. The remaining falsification criterion is end-to-end external-actuation attestation: the same result must hold when FAILURE can only be created from a prior authorized action and an independently observed adverse outcome. The implemented local ledger is necessary lifecycle evidence, not completion of this criterion.
Two evaluations with the same complete kernel state and proposal must produce the same score, decision, and stated reasons. Complete state includes the inferred role, budget, effective local hazard, trust tier, completeness tier, recent-failure count, and any CRITICAL finding. This is a software determinism criterion; it is not a claim that the resulting decision is calibrated to real-world harm.
For clean outcomes and zero human feedback, trust should increase by the configured pass delta while the score remains below its upper clamp. At the boundary, the clamp must be included in the expected result. The analogous checks apply to failed tests, repair requirements, and negative feedback. Passing these checks establishes arithmetic consistency, not that the heuristic deltas are statistically optimal.
At each documented trust and proposal-count boundary, RoleAdapter should return the specified label. A separate negative test should confirm the current limit: beyond the SANDBOX override and other gate conditions, non-sandbox role labels alone do not enforce which action types an agent may perform. Any future per-role permission claim requires a policy matrix and action-level enforcement tests.
An external evaluation should test unlinked outcome submission, agent-identifier reuse, semantically empty completeness fields, process restart, concurrent clients, budget-window timing, and poisoning of shared state. These cases probe assumptions that deterministic unit tests cannot settle.
| Question | Evidence in this artifact | Publication-honest status |
|---|---|---|
| Is gate arithmetic deterministic for covered fixtures? | Checked-in unit and contract tests | Supported within the tested state space |
| Does reported FAILURE tighten same-target local gating? | Paired contract test over
max(RISK, FAILURE) |
Supported within one kernel process |
| Can the kernel authenticate a complete local lifecycle? | Signed and hash-linked proposal, verdict, authorization, receipt, and outcome fixture | Supported for local ledger integrity, not external truth |
| Do role labels enforce per-action permissions? | SANDBOX override; no general role/action matrix | Not implemented |
| Does colony state survive a default MCP process restart? | In-memory default database and field | No |
| Does the kernel reduce unsafe actuation on external workloads? | Proposed protocol; no released trial traces | Not yet evaluated |
| Does the kernel remain correct under production concurrency or scale? | Single-process implementation and local tests | Unverified |
Table 37 keeps implemented contracts separate from open external claims.
The experimental protocol in Section 4 is a specification for future evaluation. The repository does not currently provide the raw repeated-trial traces, baseline runs, or external workload results needed to estimate refusal rates, repair rates, latency, or safety benefit. Consequently, configured scenario counts and expected rates should not be read as measured outcomes.
The gate weights, trust deltas, decay amounts, role thresholds, and falsification checks are fixed engineering heuristics. They have not been calibrated against downstream harm or production repair cost. The falsification worker is also a deterministic proposal checker, not a proof of semantic safety: only CRITICAL findings independently force a gate refusal, and syntactically complete but misleading evidence may evade its checks.
Four implementation priorities follow directly from these limits. First, extend the implemented local authorization/receipt chain with deployment-specific, independently verifiable observation of external effects and actor identity. Second, persist and reconcile the entire field and budget state when cross-session behavior is required. Third, define and enforce an action-by-role authorization policy if role names are to carry security meaning. Fourth, run the proposed paired and external benchmarks with released traces, explicit baselines, and predeclared outcome measures before making effectiveness or scale claims.
The Colony Kernel’s present contribution is thus a testable control-plane scaffold. It makes selected state transitions and decision rules visible enough to inspect, replay within a process, and challenge. That is useful groundwork, but it is not yet evidence that the colony becomes safer merely by accumulating history. In this version, the record is evidence for a control decision—not a guarantee that the decision is correct.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. This roadmap is a scoped research program, not a catalogue of completed results. The current paper establishes the reproducible kernel contract, a fixed-input paired replay artifact, and the local authenticated lifecycle ledger. Subsequent milestones are conditional on their artifacts, metrics, falsifiers, and exit criteria. A status label therefore describes evidence available in the current repository, not a promise about delivery or scientific success.
The central question is whether a proposal-governance control plane can improve the safety–utility trade-off of agentic software work when its state is authenticated, evaluated under hostile inputs, and calibrated against independently observed consequences. The implementation currently supports a narrower statement: a caller-reported failure changes same-target local pressure in a running kernel process, and the deterministic gate responds according to its configured rule. The roadmap does not promote that mechanism into a claim of harm reduction, optimality, collective intelligence, or Active Inference.
The milestones are ordered by dependency. Replayable artifacts must precede external comparisons; local lifecycle authentication must precede deployment-specific external observation; externally attested outcomes must precede trust calibration; adversarial and held-out evaluation must precede claims about utility; and persistence/concurrency evidence must precede deployment-oriented interpretation. This ordering follows reproducibility and accountability principles rather than a calendar commitment (Peng 2011; Raji et al. 2020; Buhl et al. 2024).
The synthetic benchmark record retains 6 paired
observations with sample unit synthetic task-case pair, the
case-manifest digest
74e664af b4e22a35 873995a8 15e21dca 88118e2e eb20848e 39acf99b 110a2ca8,
paired execution volumes of 6 and 3, and the
difference direction mediated minus baseline. Its interval
uses paired percentile resampling (descriptive) at a
nominal 95% resampling reference level;
descriptive intervals over synthetic task-case pairs; not population confidence intervals.
The plotted mediator is
independent reference interpreter: codomyrmex.colony_kernel.reference.ReferenceGate,
and production gate parity is not_established. These
metadata bind the displayed fixture to its ordered task cases; they do
not turn synthetic pairs into an estimate of population risk or
utility.
The first executable evidence fixtures are separated by what they can and cannot establish. The attestation chain binds local lifecycle events, the paired benchmark exposes the safety–utility analysis plumbing, and the persistence fixture checks restart state. None is an external benchmark, causal estimate, or production security guarantee. The figures below are generated artifacts with declared boundaries, not evidence that the later research milestones have been completed.
The roadmap in Figure 10 is a dependency map, not a delivery timeline. Its future milestones are planning objects and must not be read as empirical evidence.
The first offline research fixtures are shown alongside the roadmap: the authenticated event chain in Figure 11, the paired safety–utility plumbing in Figure 12, the explicit calibration hold in Figure 13, and the restart check in Figure 14.
The complete configured program contains 8 milestones. Each row states what would be built, measured, falsified, and accepted; empty claims are not allowed to advance by narrative momentum.
Each configured row has two orthogonal state fields.
implementation_status records whether executable substrate
exists; evidence_status records whether the decisive study
has produced admissible evidence. Thus an adapter can be implemented
while its external study remains external_not_run, and a
prototype can exist while its held-out comparison remains unperformed.
The compact Status column below is only a display label; the two
machine-readable fields govern audit and promotion.
| ID | Milestone | Status | Hypothesis | Required artifact |
|---|---|---|---|---|
| R0 | Reproducible kernel contract | Implemented | The local control-plane contract can be replayed from the checked-in source and configuration. | Scoped tests, coverage record, variable map, figure registry, and rendered manuscript. |
| R1 | Local authenticated lifecycle ledger | Implemented | Optional and required kernel modes can bind proposal, verdict, authorization, execution receipt, and outcome records locally. | Signed, hash-linked local event ledger with nonce, actor, proposal digest, verdict, execution receipt, and outcome. |
| R2 | End-to-end external actuation attestation | Adapter_ready | Independently sourced execution evidence can distinguish actual external actuation from caller-reported lifecycle events. | Deployment-specific adapter that verifies execution identity, external receipt provenance, and outcome linkage. |
| R3 | Adversarial tool-use benchmark | Harness_ready | Gate-mediated proposals will change unsafe-action and recovery outcomes under hostile tool inputs. | Seeded AgentDojo, InjecAgent, or ToolEmu adapter with paired baseline traces. |
| R4 | Calibration and utility | Harness_ready | Gate scores can be calibrated against independently observed downstream consequences. | Held-out outcome dataset, baseline policies, calibration analysis, and preregistered configuration. |
| R5 | Persistence and concurrency | Harness_ready | Explicit persistence and concurrent access can preserve locality without violating isolation or ordering. | Restart, crash-recovery, multi-worker, and load scenarios under a declared deployment profile. |
| R6 | Probabilistic and Active Inference extension | Prototype_ready | An explicit generative model can improve prediction or policy selection beyond the heuristic projection. | Declared likelihood, posterior implementation, simulation-based calibration, and paired baselines. |
| R7 | Independent replication and promotion decision | Planned | The retained evidence package can be reproduced in an independent environment without widening the registered claim boundary. | Independent replay report, environment comparison, discrepancy ledger, and signed promotion decision. |
| ID | Decisive metric | Falsifier | Exit criterion |
|---|---|---|---|
| R0 | Replay agreement for gate, locality, decay, and provenance outputs. | Any replay depends on an undocumented input or produces a contradictory contract result. | Fresh generation and focused gates pass with hashes recorded. |
| R1 | Forgery, replay, sequence, actor, and linkage rejection in deterministic tests. | The local ledger accepts a forged, replayed, reordered, mismatched, or incomplete lifecycle. | Lifecycle integration tests pass and the external-observation boundary remains explicit. |
| R2 | Forgery and replay rejection, observation completeness, adapter overhead, and independently replayed traces. | A caller can report or relink an action or outcome without verifiable external execution evidence. | A declared deployment adapter passes adversarial tests and an independent verifier reproduces its evidence chain. |
| R3 | Attack success, harmful-action rate, task utility, refusal cost, and complete trace retention. | The mediated condition does not improve the preregistered safety-utility frontier. | Independent rerun reproduces paired estimates and failure analyses. |
| R4 | Log loss, calibration error, selective risk, repair cost, utility, and confidence intervals. | Scores remain miscalibrated or add friction without a defensible utility trade-off. | Held-out analysis and uncertainty intervals are released with raw traces. |
| R5 | Durability, ordering, isolation, throughput, latency, and recovery completeness. | Restart or concurrency causes silent signal loss, cross-target contamination, or unsafe duplicate actuation. | Scenario matrix passes with retained logs, seeds, environment, and artifact hashes. |
| R6 | Posterior predictive checks, held-out log loss, calibration, policy utility, and compute cost. | The probabilistic model fails calibration or utility comparisons, or its assumptions are not identifiable. | Model, assumptions, replay harness, and negative results are independently reproducible. |
| R7 | Artifact agreement, discrepancy count and severity, rerun completeness, and claim-ledger consistency. | Independent replay cannot reconstruct the decisive results or reveals an unreported dependency or claim mismatch. | An independent verifier reproduces or explicitly rejects each promoted result and all discrepancies remain retained. |
The evidence plan in Table 38 and decision contract
in Table 39 are generated
from docs/manuscript/config.yaml; they are not a second
authority for parameters or results. The variable snapshot records the
exact roadmap configuration, while the figure registry records the
rendered planning visual and its hash. R0 additionally retains the
replay’s semantic and file digests shown in Table 32. The implemented R0
row is accepted only when its configured artifact_paths
resolve to checked-in source or evidence surfaces. R1 is governed by the
same artifact-path requirement for the implemented local ledger. R2-R5
now have local adapters or harnesses, and R6 has a research prototype,
but those implementation artifacts do not satisfy their empirical exit
criteria. R2 remains evidence-open until its adapter is exercised
against deployment-specific, independently sourced observations; R3-R6
remain evidence-open until their declared external or held-out
comparisons are retained. R7 is blocked until those dependencies can be
independently replayed.
ResearchProgramOrchestrator supplies the local
dependency-control mechanism. It validates a directed acyclic graph,
executes ready tracks in deterministic topological order, records
exceptions as failures, and marks dependent tracks blocked. It does not
retry, hide, or promote a failed study, and a returned runner output is
not itself a scientific acceptance decision.
Every future study should retain the following minimum evidence bundle:
This entity–activity–agent separation is compatible with the W3C PROV data model, which is used here as a provenance vocabulary rather than as evidence that a result is correct (World Wide Web Consortium 2013). In particular, recording who or what generated an artifact and which activity used it supports auditability; scientific acceptance still depends on the milestone’s independent observations, falsifier, and replay.
This bundle turns a research result into a replay target. It does not require a claim to be positive: a well-specified null result or failed falsification attempt is publishable evidence when its inputs and analysis remain inspectable. Model cards and safety cases are useful reporting analogies, but their presence does not substitute for the linked execution evidence (Mitchell et al. 2019; Buhl et al. 2024).
Promotion from one milestone to the next requires all of the following:
If a milestone fails its falsifier, the next action is diagnosis, redesign, or a bounded negative result—not relabeling the failure as a successful ecological effect. In particular, training a predictor to reproduce EXECUTE/HOLD/REFUSE labels would validate the existing rule’s behavior, not its downstream usefulness. Utility must be measured against independently observed repair cost, policy violation, task completion, or other outcomes specified before analysis.
The final milestone depends on the distinctions in Section 7. A probabilistic extension must declare observations, latent states, likelihoods, priors, posteriors, policies, preferences, and an inference procedure. It must then be compared with the current deterministic gate using posterior predictive checks, simulation-based calibration, held-out log loss, utility, and compute cost. Naming a trust score a posterior or a gate score expected free energy would not satisfy that contract.
The roadmap therefore treats Active Inference as a falsifiable modeling direction rather than a retrospective interpretation. This is consistent with the current crosswalk’s claim boundary and with the broader positioning against tool-use security and runtime assurance: cited external benchmarks motivate adapters and threat models, but none is evidence for the Colony Kernel until the experiment is actually run (Debenedetti et al. 2024; Zhan et al. 2024; Ruan et al. 2023; Seto et al. 1998).
The current release documents and validates R0’s local contract, fixed-input replay, and reproducibility route plus R1’s authenticated local lifecycle ledger. It also provides implementation substrate for R2-R6 and dependency-aware execution bookkeeping. It does not claim that R2’s external study or any later milestone’s empirical evidence is complete, that the provisional settings are calibrated, or that the control plane is a security boundary. The appropriate scholarly contribution at this stage is a composable, inspectable research substrate with explicit failure conditions and a machine-readable path from configuration to prose, tables, figures, and artifacts.
The notation used in this crosswalk is fixed by Section 12. In particular, symbols in this section are translations of the glossary rather than new local aliases.
The repository uses several kinds of formal description: typed operational contracts, discrete recurrences, piecewise decision rules, executable invariants, AST-preservation rules, optional SMT obligations, and probabilistic inference components. These formalisms are complementary, but they are not interchangeable. A formula in a document is not a property of the software until the variables, state transition, implementation mapping, and verification boundary are made explicit.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. This section makes that translation chain inspectable. It does not claim that every formalism has been connected to the Colony Kernel, and it does not treat a shared word such as trust, state, or policy as evidence of semantic equivalence.
The crosswalk uses five links for every formal claim:
This discipline follows design-by-contract and formal-methods practice (Apt 2003), while the retained configuration, source anchors, and generated artifacts follow the broader requirements of reproducible and accountable computation (Peng 2011; Raji et al. 2020; Buhl et al. 2024).
The visual in Figure 15 shows correspondence as a chain with missing links, not as a proof graph. Every row prints its status, and the coloured strip repeats that status as a secondary scanning cue. The visual abbreviates the source-backed entries for print legibility; Table 40 and Table 41 retain their complete searchable wording.
The inventory summary in Figure 16 counts these documented statuses, while Figure 17 places the formalism rows beside the roadmap milestones. Neither visualization measures theorem coverage; both are navigation and claim-boundary aids.
The configured inventory contains 7 mappings: 4 implemented, 2
partial, and 1 research. The first table records the formal layer and
its current status; the second records the translation and evidence
boundary. Both tables are generated from
docs/manuscript/config.yaml and validated against the
current repository paths before rendering.
| ID | Mapping | Formal layer | Formal object | Status |
|---|---|---|---|---|
| F0 | Typed operational semantics | State-transition contract | Proposal, verdict, reported consequence, and kernel state transition | Implemented |
| F1 | Discrete dynamical recurrence | Bounded state recurrence | x_(j,t+1)=max(0, x_(j,t)-ε_j) for a trace without new deposits | Implemented |
| F2 | Piecewise decision semantics | Rule system with hard overrides | Weighted score, hazard tiers, and EXECUTE/HOLD/REFUSE precedence | Implemented |
| F3 | Runtime invariant predicates | Executable design-by-contract checks | Bounds, monotone role thresholds, enum separation, and gate-weight conservation | Partial |
| F4 | Structural code-change verification | AST-preservation rules | No deletion of public functions, no removed parameters, and order-compatible signatures | Implemented |
| F5 | SMT invariant proving | Satisfiability-based proof obligation | C AND not(invariant) is unsatisfiable | Partial |
| F6 | Probabilistic and Active Inference models | Generative model, posterior, and policy evaluation | p(o,s), q(s), transition/observation models, preferences, and expected free energy | Research |
| ID | Code anchor | Translation mechanism | Executable evidence | Claim boundary |
|---|---|---|---|---|
| F0 | ActionProposal; GateResult; ColonyKernel / propose_action; ColonyKernel / record_outcome; run_paired_locality_replay | Dataclasses and enums define the vocabulary; kernel sequencing defines the transition boundary. | Typed construction, lifecycle sequencing, repeatable replay, and serialized result tests. | Establishes a replayable interface and control-flow contract, not semantic safety or execution attestation. |
| F1 | PheromoneStore / evaporate; PheromoneStore / tick; TraceField / sense | Per-signal metadata supplies epsilon; integer ticks apply the floored subtraction and delete depleted markers. | Decay, floor, compound-key isolation, and stress/property scenarios. | Supports the stated recurrence under declared inputs; it is not exponential forgetting, wall-clock decay, or biological pheromone chemistry. |
| F2 | ActuationGate / witness_state; ActuationGate / evaluate; FalsificationWorker / evaluate_plan | Named thresholds and ordered branches implement the piecewise policy; no opaque learned scorer is implied. | Boundary, precedence, monotonicity, and adversarial-vector tests. | Proves only the coded policy properties; the score is not a probability of safety, harm, or utility. |
| F3 | all_invariants_hold; ColonySignal / post_init; ResourceCost / post_init | Predicates and constructor guards execute against live constants; a dedicated crosswalk test checks source alignment. | Direct invariant checks plus boundary regressions; cross-module coverage remains incomplete. | Runtime predicates detect selected violations for supplied states; they are not a complete proof of all kernel behaviors. |
| F4 | ChangeProposal; CodeChangeVerifier / verify; InvariantRule | Python source is parsed into ASTs and compared by pluggable rule functions before optional attestation. | Real-source AST regression tests for preserved public structure and custom rules. | Covers selected structural compatibility properties; it does not establish behavioral equivalence, security, or deployability. |
| F5 | KernelFormalSnapshot; runtime_obligations; prove_kernel_obligations | A solver-neutral obligation model and bounded kernel-specific Z3 encoding translate selected runtime bounds, weight conservation, pressure monotonicity, locality, and authorized linkage obligations into solver expressions. | Structured solver outcomes and counterexample handling are tested for the kernel-specific bounded encoding; the optional solver path reports unavailable when Z3 is absent. | The bridge proves or refutes the encoded bounded obligations; it does not establish whole-program refinement, production safety, or a proof of the Python kernel. |
| F6 | KernelProbabilisticAdapter; GenerativeModelSpec; BayesianNetwork; InferenceEngine / infer; VariationalFreeEnergy / compute; ActiveInferenceAgent | The explicit adapter declares kernel observations, latent states, priors, likelihoods, transitions, preferences, actions, and horizon while preserving the deterministic gate as the baseline. | Standalone Cerebrum tests and explicit adapter-schema tests; held-out posterior evaluation and production policy integration remain unexecuted. | The adapter is research plumbing, not an integrated Active Inference controller, calibrated safety model, or expected-free-energy implementation. |
Table 40 is the status view; Table 41 is the evidence and limitation view. Keeping both views explicit prevents an implemented row from being read as a universal proof.
The inventory distinguishes representation from
verification. For example, ActiveInferenceAgent
and InferenceEngine provide probabilistic components, but
their presence does not connect them to the Colony Kernel’s
deterministic gate. Conversely, the gate recurrence and the
AST-preservation rules have executable bridges but do not imply that the
resulting policy is safe or optimal.
The useful relationship among the layers is a sequence of constrained translations:
Operational semantics → recurrence. Typed
ColonySignal, ActionProposal, and
GateResult objects define the state vocabulary.
PheromoneStore then supplies a discrete transition for one
part of that state. The recurrence is a projection of the operational
state, not a complete semantics for the kernel.
Recurrence → decision rule. The gate observes the projected local field and applies a piecewise risk function plus hard overrides. Monotonicity of the recurrence or risk function can be proved arithmetically while the composition, ordering, and side effects still require integration tests.
Decision rule → invariant predicate. Bounds, threshold ordering, and weight conservation can be stated as executable predicates. These predicates should import the same runtime constants as the decision rule; copied constants create a second model that can pass while the implementation changes.
Invariant predicate → symbolic obligation. An SMT
bridge can prove a supplied obligation such as
being unsatisfiable. It proves the encoded obligation, not the Python
implementation, unless a sound state-to-symbol translation and a
correspondence theorem are supplied. The repository now includes a
kernel-specific, bounded encoding and a structured
unavailable result when optional Z3 is absent; the encoding
remains evidence about the stated obligations, not a whole-program
proof.
Deterministic state → probabilistic model. A probabilistic or Active-Inference model must introduce random variables, likelihoods, priors, transition dynamics, preferences, and an observation protocol. Deterministic pressure, trust, or gate scores may be observations or interface projections, but they are not posteriors or expected free energy without those definitions.
These relations are directional. A code path can instantiate a formal recurrence, while an equation cannot by itself establish that a caller, scheduler, or persistence layer actually follows the equation. The crosswalk therefore treats implementation evidence as necessary for a code claim and formal definitions as necessary for a mathematical claim; neither substitutes for the other.
The next work is deliberately staged so that each stronger connection depends on a weaker one being replayable:
The Section 10 milestones are the release-level plan; this section is the translation method that makes a milestone’s formal and executable parts composable. A future positive result may justify a stronger claim only after the relevant bridge is implemented, independently replayed, and shown not to collapse into a test of the same labels it is intended to validate.
The current release establishes several local correspondences and exposes their gaps. It does not provide a formal semantics for all modules, a proof-carrying build, a complete refinement proof from Python to SMT, a causal model of outcomes, or an integrated Active Inference controller. The appropriate scholarly claim is therefore methodological: Codomyrmex provides a substrate in which formal objects, code anchors, tests, and claim boundaries can be recorded together. Whether those connections produce better safety, utility, calibration, or generalization remains an empirical question.
This section is the authoritative notation glossary for the formalism in the manuscript. Symbols are reused only when they belong to the same formal layer; implementation names in code, table headings, and prose should follow these definitions. The glossary separates logical ticks, recorded outcomes, and paired statistical units so that deterministic fixtures are not mistaken for sampled data. The index and field terms are collected in Table 42, gate terms in Table 43, trust terms in Table 44, probabilistic terms in Table 45, and paired-statistics terms in Table 46.
| Symbol | Meaning | Scope and convention |
|---|---|---|
| Discrete scheduler tick | Signal-field evolution and passive decay. | |
| Ordered recorded outcome or lifecycle event | Trust updates and consequence accounting. | |
| Paired task-case index | One synthetic or future workload item observed under both conditions. | |
| Target location | A module, path, or other declared proposal target. | |
| Signal type | An element of , such as RISK or FAILURE. | |
| Compound location–signal key | A member of . | |
| Keys present at tick ; | is a finite analysis-horizon universe containing the observed keys. | |
| Capped field strength for key at tick | Never use for this quantity; is reserved for a latent state in the probabilistic layer. | |
| Effective deposit applied during a field update | Includes the configured source and optional trust multipliers. | |
| Evaporation amount for key during a field update | Positive strength units per logical tick; denotes a fixed value. | |
| Field-strength cap | The runtime maximum in the field recurrence. |
The field state is therefore written as in Section 2.1, with the implementation-specific lower and upper bounds injected into the equations. The canonical update is the evaporate-then-deposit recurrence in Equation 2. The symbol in earlier informal descriptions of a signal is replaced by or an explicitly named initial value.
| Symbol | Meaning | Scope and convention |
|---|---|---|
| Effective local hazard pressure | . | |
| Risk-clearance credit | A non-increasing piecewise map from effective hazard to the ordinary score component. | |
| Binary budget credit | The ordinary-score input for an approved budget. | |
| Trust credit | The normalized tiered trust input after any transient recent-failure penalty. | |
| Proposal-completeness credit | The normalized evidence-mass input derived from missing required fields. | |
| Gate component weights | Non-negative configured coefficients whose sum is the score scale. | |
| Ordinary gate score | The weighted score before or after the stated implementation clamp. | |
| Ternary decision map | Returns EXECUTE, HOLD, or REFUSE after hard overrides and thresholds. |
The gate score is written
This notation avoids the earlier collision between as a risk-credit function and as a trust-update term. It also reserves for hazard; human feedback is , not . The ordinary score and its hard overrides are specified in Section 2.3 and Section 3.
| Symbol | Meaning | Scope and convention |
|---|---|---|
| Trust score immediately before recorded outcome | Bounded implementation state, not a posterior. | |
| Net trust increment associated with outcome | Clipped when applied to . | |
| Test-pass or test-failure increment | The pass/fail component of . | |
| Repair contribution | A named trust-update term, not risk clearance. | |
| Parsed human-feedback value | Bounded by the configured feedback domain. | |
| Human-feedback coefficient | Multiplies in the trust update. | |
| Illustrative independent test-pass probability | A symbolic sensitivity variable in the drift relation; not an estimated probability in this report. |
The trust recurrence is
Here indexes a recorded report, not a scheduler tick or an independent statistical replicate. Ordinary MCP outcomes are caller-reported; the local attestation boundary does not turn them into independent observations.
The following symbols are reserved for the proposed probabilistic crosswalk and must not be used as synonyms for deterministic gate quantities:
| Symbol | Meaning |
|---|---|
| Observation | |
| Latent state | |
| Joint generative density | |
| Approximate posterior | |
| Candidate policy or action sequence | |
| Expected-free-energy quantity in the proposed model | |
| Variational free-energy functional |
The active-inference crosswalk in Section 7 is conceptual and unimplemented for the production gate. In particular, , , and a deterministic signal strength is not an observation sample from a declared likelihood without the additional model contract.
| Symbol | Meaning | Scope and convention |
|---|---|---|
| Paired task-case index | The same ordered case is compared across conditions. | |
| Condition label | Use explicit labels such as baseline and mediated; remains completeness in a gate equation. | |
| Binary harmful-action indicator | denotes harmful action for case under condition . | |
| Fixture utility score | A declared per-case score, not a universal welfare measure. | |
| Number of paired task cases | The denominator for case-level rates and paired differences. | |
| Paired harmful-action difference estimate | . | |
| Paired utility difference estimate | . | |
| Number of resampling draws | The current fixture uses a configured deterministic resampling count. |
Rates use the declared denominator of task cases in the relevant condition; trace-completeness rates use traces, and attack-success rates use declared attack cases. The current six-case record is a deterministic synthetic fixture. Its percentile-resampling intervals are descriptive summaries over paired cases, not population confidence intervals, p-values, or evidence of external effectiveness.
Let denote the configured directed acyclic graph of research tracks. An edge means that admissible completion evidence for is required before runner may execute. For each track , denotes implementation status and denotes empirical evidence status; these are separate categorical variables, so does not imply . The execution result records only the local orchestration attempt. Scientific promotion additionally requires the configured metric, falsifier, exit criterion, provenance, and independent replay.
This distinction prevents a completed Python call from being substituted for a completed empirical milestone and makes unavailable prerequisites explicit.
Formal sections should cite this glossary when introducing a symbol, and captions should name a quantity in words when a reader could confuse it with a probability, posterior, or population estimate. The formalism inventory in Section 11 records which of these objects have executable translations and which remain partial or research-stage.
This appendix records why the released Colony Kernel uses its present mechanisms and what each choice gives up. The decisions are engineering choices, not proofs that the selected policy is optimal. Where an alternative would require outcome data, the release treats calibration as future evaluation rather than retroactively presenting a hand-set constant as an empirical result.
The numeric values shown here are current implementation defaults or illustrative initial settings, not universal constants, fitted parameters, or empirical estimates. They are configurable and can be tuned or replaced through the corresponding runtime policy, configuration, or presentation inputs; after a change, regenerate the tests, tables, figures, and manuscript before interpreting the result. The appendix consequently distinguishes runtime defaults, presentation settings, and future-study inputs wherever their roles differ.
After its early-return checks, ActuationGate computes
the score in Equation 25:
where is budget credit, is local hazard credit derived from the larger of RISK and FAILURE pressure, is tiered trust credit, and is proposal completeness. The score is a routing policy, not a probability of safety or harm.
Table 47 summarizes the relevant alternatives.
| Policy family | Useful property | Cost or missing prerequisite |
|---|---|---|
| Weighted additive | Direct component decomposition; partial credit supports HOLD | Compensation among components; hand-set weights require external calibration |
| Multiplicative | A zero component can dominate without a separate rule | Small components suppress the whole score; interpretation depends on scaling |
| Explicit rule set | Named conditions are easy to audit | Interactions and ordering grow with the rule set |
| Learned scorer | Can estimate interactions from labeled outcomes | Requires representative, independently attested training and calibration data |
The implementation does not rely on the weighted sum for every condition. Missing budget in the integrated path, SANDBOX status, trust below 0.3, and CRITICAL findings take explicit branches. This hybrid keeps the ordinary score inspectable while reserving non-compensatory treatment for named conditions. It also means that analysis of the formula alone is insufficient to predict every gate result.
Each trace stores an evaporation amount when deposited. A passive tick uses
and removes a trace at zero. At the defaults, FAST, NORMAL, and SLOW subtract 0.3, 0.1, and 0.02 per tick. Equation 26 is exact for a trace with no new deposit, reinforcement, or read-side effect.
The choice makes expiry finite and contract tests easy to replay. Its tradeoffs are equally explicit: ticks are logical rather than wall-clock time, a larger effective deposit lasts longer, and repeated deposits can dominate the nominal class. Source and trust multipliers affect initial strength, while the field cap bounds accumulated strength. Deployments that need real-time semantics must define the scheduler-to-tick mapping rather than reinterpret a tick as an undocumented number of seconds.
ColonyKernelConfig defaults db_path to
:memory:. In that mode consequence rows and profiles
disappear when the process exits. ConsequenceMemory also
supports a caller supplied SQLite file path, while
db_path=None selects its pure in-memory list mode. The
pheromone field remains in memory in all three cases.
This design minimizes setup and keeps real SQLite behavior available to tests. It does not provide shared multi-process state, restart recovery for signal pressure, remote replication, migration management, or conflict resolution. A deployment requiring those properties needs an explicit state architecture; changing only the consequence database path is not sufficient.
The integrated outcome path applies fixed deltas and clips trust to . A clean reported outcome adds 0.04; a failed one changes trust by -0.08; repair and human-feedback terms can change the net update. The rule is transparent and supports exact fixtures such as Table 24.
The cost of that simplicity is that trust is neither a calibrated posterior nor an uncertainty interval. Equal scores can arise from different histories, and constant-step updates do not imply convergence to a unique equilibrium. More importantly, ordinary MCP outcomes are caller supplied and do not consume a durable prior EXECUTE record. Optional and required kernel modes now support local proposal/verdict/authorization/ receipt/outcome linkage, with required mode rejecting the ordinary method. Before trust is used in an adversarial setting, that local integrity chain must also be bound to independently observed external execution and authenticated deployment identities.
EXECUTE, HOLD, and REFUSE distinguish three operational states:
HOLD is useful only when revision can change a relevant input at acceptable cost. The release therefore does not claim that a three-way gate universally dominates a binary one. A benchmark must measure revision cost, delay, eventual decision, throughput, and outcome quality. The integrated and standalone budget paths also differ: an integrated budget failure yields HOLD, while the standalone gate with its own ledger returns REFUSE. Callers must choose the intended API rather than assume the labels are interchangeable.
The integrated proposal path runs deterministic checks before gate
scoring. The checks cover 10 canonical AttackVector
categories through 11 check functions. This order makes findings
available to the gate and makes the same input replayable without an LLM
call.
Deterministic heuristics have bounded, inspectable behavior, but they detect only the patterns they implement. The current checks top out at HIGH severity; CRITICAL remains an input class that would trigger the hard override. A clean report is not proof that a proposal is safe, and returning REFUSE does not physically prevent a separate caller from bypassing the kernel. Stronger deployments need an execution boundary that requires a consumed gate authorization, plus external isolation and monitoring.
The trust-score path maps profiles onto 5 labels: SANDBOX,
REPAIR_ANT, MEMORY_ANT, DISPATCHER, and GUARD_ANT. The labels provide a
readable lifecycle summary, and SANDBOX is an actual early gate refusal.
The other four labels do not currently enforce distinct action-type
matrices in ActuationGate.
This separation is important. A label taxonomy is inexpensive and auditable, but it is not a complete access-control system. The default lifecycle also has a bootstrap gap: new profiles begin in SANDBOX, the gate refuses their proposals, and trust rises only through submitted outcomes. An external study must either supply a fixed supervised calibration history or implement a narrowly constrained SANDBOX path with local lifecycle authentication and deployment-specific external observation.
The pheromone field lets later proposals query pressure by location and signal type without reconstructing every prior consequence record. It supports the paper’s bounded locality claim: a failure at one target can affect that target while an unrelated target remains unchanged.
The current implementation is a central in-process store, not a distributed stigmergic network. The release makes no asymptotic communication claim because actual cost depends on index structure, query pattern, agent topology, and synchronization design. A shared field reduces the API needed for the tested single-process case; it also creates a single-process state boundary and supplies no cross-host consistency protocol.
PruningDaemon.report() and the MCP
colony_pruning_report surface candidates; they do not move
files. PruningDaemon.archive(candidate, dry_run=True) is
also non-mutating by default. A direct caller can pass
dry_run=False, in which case the implementation moves an
existing in-repository path under docs/plans/archived/
after a containment check.
Keeping discovery separate from mutation makes review possible and prevents the MCP report tool from silently archiving code. The tradeoff is procedural: safety depends on which callers can invoke the lower-level archive method and on reviewing false-positive candidates. Confidence scores are heuristic rankings, not calibrated probabilities, and DEPENDENCY pressure is a veto signal only within the implemented scan rules.
The release route generates the 18 assets in Table 48. Captions in the body state the evidence class, fixed inputs, intended reading, and permitted inference. They are not reused as image alternatives: each figure instead has a concise structural alternative and a fuller description of layout, relationships, redundant encodings, and claim limits. This separation follows the distinction between chart semantics and prose description in accessible visualization research (Lundgard and Satyanarayan 2022), the evidence that visual communication depends on perceptual task and design rather than decoration (Franconeri et al. 2021), and guidance to provide a complete text equivalent for complex images (World Wide Web Consortium n.d.).
Colour remains useful for grouping, but it is not the only categorical channel. Labels, position, marker shape, line style, arrow direction, or printed status repeat the relevant distinction, and the palette is luminance-adjusted against the light figure background. This responds to documented scientific-communication failures caused by unsuitable colour maps (Crameri et al. 2020). The contract is intentionally bounded: metadata checks and contrast calculations do not prove usability with every reader, assistive technology, display, or print process.
| Asset and evidence class | Text alternative and extended description |
|---|---|
cover.png — schematic |
Short alternative: Codomyrmex cover: dark radial schematic of the Colony Kernel hub connected to 7 labelled control-plane subsystems. Extended description: A bright Colony Kernel hub sits at the centre of a dark field. Labelled nodes for pheromone storage, resources, gating, consequence memory, roles, pruning, and falsification surround it, joined by luminous spokes and signal trails. The composition is conceptual branding rather than a measured network. |
colony_pressure_loop.png — schematic |
Short alternative: Numbered circular flow from proposal submission through review, gate decision, caller actuation, outcome reporting, state update, and pheromone deposit. Extended description: Eight labelled cards form a clockwise loop. A proposal is falsification-checked, witnessed against state, and evaluated by the gate before a separate caller may actuate it. The caller then reports an outcome, which updates trust, budget, role, and local pheromone pressure for later proposals. Numbers and arrow direction, rather than colour alone, define the sequence. |
pheromone_decay.png — analytic |
Short alternative: Three directly labelled descending trajectories show FAST, NORMAL, and SLOW subtractive decay, each ending at its marked extinction tick. Extended description: All traces begin at strength 1.0 and decline linearly toward 0.0. FAST has the steepest slope and earliest vertical extinction marker, NORMAL is intermediate, and SLOW extends furthest to the right. Line style, endpoint label, and colour redundantly identify each class; the curves are analytical rather than observed time series. |
gate_score_heatmap.png — analytic |
Short alternative: Heatmap of REFUSE, HOLD, and EXECUTE regions over trust and effective hazard, with decision names and thresholds printed inside the policy map. Extended description: Trust increases from left to right and effective local hazard increases from bottom to top. A dark left band marks the hard trust-floor refusal region. Beyond it, labelled REFUSE, HOLD, and EXECUTE regions change at the configured hazard and score boundaries. Region position, printed names, and colour all encode the decision; the grid is formula-derived, not an observed distribution. |
trust_trajectory.png —
deterministic-fixture |
Short alternative: Stepwise trust trajectory crossing labelled role thresholds after clean reports, with the independent gate floor marked separately. Extended description: A monotone stair-step line starts at sandbox trust and rises after each caller-reported clean outcome. Horizontal threshold lines and directly named background bands show the inferred roles. A separate gate hard-floor line demonstrates that the first role promotion does not itself make ordinary scoring reachable. The path is a deterministic fixture, not a population trend. |
falsification_vectors.png —
code-taxonomy |
Short alternative: Horizontal severity chart placing every falsification category in a labelled LOW, MEDIUM, HIGH, or CRITICAL band with an initial printed on each marker. Extended description: Each row names one live adversarial vector. A line ends at that vector’s highest emitted severity rank, and the marker contains the severity initial. Rows are sorted from highest to lowest severity. The CRITICAL column is explicitly labelled even when empty because that class alone hard-refuses before scoring. The plot shows code taxonomy, not prevalence or detection rate. |
subsystem_architecture.png —
schematic |
Short alternative: Hub-and-spoke diagram with ColonyKernel at the centre and 7 labelled subsystem nodes around it. Extended description: ColonyKernel occupies the central hub. Radial spokes connect it bidirectionally to the labelled Pheromone Store, Resource Ledger, Actuation Gate, Consequence Memory, Role Adapter, Pruning Daemon, and Falsification Worker nodes. Subtitles state each node’s function, and arrowheads show information flow. The topology describes software ownership, not hosts, latency, or throughput. |
gate_score_3d.png — analytic |
Short alternative: Gate-score surface over trust and completeness with labelled HOLD and EXECUTE thresholds plus a projection of distinct trust slices. Extended description: The main panel rises across completeness and changes in discrete tiers across trust, with horizontal threshold planes marking HOLD and EXECUTE. A companion projection uses distinct line styles, point shapes, direct labels, and colour for selected trust slices. The continuous completeness surface is a visual envelope over a runtime input that is actually discrete. |
fep_correspondence.png —
conceptual-analogy |
Short alternative: Row-by-row correspondence diagram linking Free Energy Principle terms to named Colony Kernel artifacts and bounded engineering interpretations. Extended description: Each horizontal row begins with an FEP concept, points to a specific kernel artifact, and ends with an engineering interpretation. The repeated three-part layout and text labels carry the mapping; coloured row accents only aid scanning. A warning beneath the rows states that the current deterministic kernel is not a Bayesian controller and the correspondences are analogies, not equivalences. |
research_roadmap.png — research-plan |
Short alternative: 8 vertically connected milestone cards progress from implemented local contracts to a research-stage probabilistic extension. Extended description: Milestones run top to bottom through reproducibility, a local authenticated lifecycle ledger, external-actuation attestation, adversarial evaluation, calibration, persistence and concurrency, and a probabilistic extension. Every card prints its current status and an abbreviated required-evidence artifact. Directional arrows, sequence identifiers, and status text define the dependency order; colour is redundant and no milestone promises delivery or success. |
formalism_code_crosswalk.png —
formal-crosswalk |
Short alternative: 7-row, three-column crosswalk linking each formal object and printed status to code translation, evidence, and a claim limit. Extended description: Each row identifies a formalism and explicitly prints IMPLEMENTED, PARTIAL, or RESEARCH. The middle column abbreviates its typed code anchors and translation bridge; the final column abbreviates executable evidence and the strongest claim the evidence does not support. Alternating row shading and status-colour strips aid navigation, while the full wording remains available in searchable tables. |
replay_contract.png —
deterministic-fixture |
Short alternative: Four-state paired-locality replay showing clear, failed-target, unrelated-target, and recovered decisions while the unrelated target remains unchanged. Extended description: Four ordered states show an EXECUTE decision for a clear target, a caller-reported failure that moves the same target to HOLD, an unrelated target that remains at EXECUTE, and passive decay that restores the original decision. State order, decision words, score labels, and arrows carry the comparison; colours are redundant and the fixture is not causal or externally attested. |
attestation_event_chain.png —
authenticated-fixture |
Short alternative: Top-to-bottom authenticated event chain from proposal through verdict, authorization, execution receipt, and outcome. Extended description: Five numbered event nodes are connected top to bottom by directional arrows. Each row prints its event type, actor, hash prefix, and signature state. The chain order binds proposal, gate verdict, authorization, caller-supplied execution receipt, and caller-supplied outcome digests under the configured signer. The linked structure establishes fixture-level ledger integrity only; it does not verify external actuation, safety, or usefulness. |
safety_utility_frontier.png —
offline-synthetic |
Short alternative: Scatter plot comparing directly labelled always-execute and independent-reference-gate conditions on harmful-action rate and fixture utility, using different marker shapes. Extended description: Harmful-action rate is on the horizontal axis and utility is on the vertical axis, both averaged over the same ordered synthetic task cases. One labelled point represents the always-execute baseline and a differently shaped labelled point represents the independent ReferenceGate-mediated condition; an arrow annotates the paired mediated-minus-baseline harm difference and its descriptive interval. The points come from deterministic synthetic cases. The utility display window is narrower than the full 0–1 score domain, but the printed point labels retain the exact score values. The mediator is not the production ActuationGate, parity is not established, and the interval does not imply population generalization or calibration. |
calibration_reliability.png —
calibration-status |
Short alternative: Reliability-diagram placeholder with an ideal diagonal and a prominent not_estimated status notice instead of invented calibration data. Extended description: The square plotting area shows only the ideal-reference diagonal. A central status card states that calibration is not_estimated and that expected calibration error is not_run. No bins or empirical points are drawn because gate and trust scores are not probabilities and the required held-out outcomes and declared confidence values are absent. |
persistence_recovery.png —
restart-fixture |
Short alternative: Restart-fixture bar chart comparing signal strength at deposit, after reopening SQLite storage, and after recovery, with values printed above the bars. Extended description: Three ordered bars report the signal’s strength when deposited, after the store is closed and reopened, and at the fixture’s recovery observation. Numeric labels are printed above the bars so height and colour are not the only encodings. The retained record supports a narrow logical durability check, not throughput, arbitrary crash survival, or persistence of all kernel state. |
formalism_coverage.png —
formalism-inventory |
Short alternative: Three vertical bars summarize implemented, partial, and research formalism mappings, with counts printed above each bar. Extended description: Three separate vertical bars partition all 7 configured formalism mappings into IMPLEMENTED, PARTIAL, and RESEARCH bridge statuses. Each bar prints its status and count above the bar, while a legend repeats the categories. Height, order, text, and colour provide redundant encodings. The inventory counts documented mappings, not proved theorems or semantic equivalences. |
research_status_matrix.png —
research-status |
Short alternative: Status dot matrix listing roadmap milestones and formalism mappings by labelled status columns, with one marker and row label per item. Extended description: Rows name configured roadmap stages and formalism mappings. Each row places a single marker under its printed IMPLEMENTED, PARTIAL, NEXT, PLANNED, or RESEARCH column, so horizontal position and text define the status independently of colour. The matrix is a configuration-backed navigation aid, not evidence that conditional work is complete or empirically successful. |
Every generator reads the manuscript variable snapshot and stamps a
version, compact configuration digest, and generation date. As explained
in Section 8, that footer identifies
the manuscript configuration used by the figure route; it does not hash
all source or authenticate the image. The generated
figure_registry.json adds the caption, concise alternative,
extended description, evidence-class label, byte size, and full SHA-256
for each PNG file. It is an accessibility and integrity inventory for
the emitted files, not an external signature or a usability study.
The gate weights and thresholds were selected as design constants. Replacing them with new hand-set values would change policy, not add evidence. A defensible calibration study should provide representative proposals, consumed execution records, independently observed and externally attested outcomes, costs of HOLD/revision, pre-registered metrics, held-out evaluation, and calibration diagnostics. A learned policy should remain subordinate to named hard conditions unless the study separately justifies changing those conditions.
The same replacement discipline applies to every decision in this appendix. A real-time field should be judged against replayability and scheduler failures; a durable state backend against migration and recovery tests; role-specific action policies against an explicit matrix; and automated pruning against measured false-positive costs. The present design is valuable because its boundaries are testable—not because it is the final design for every deployment.
The released design favors small deterministic mechanisms with inspectable inputs and explicit limitations. That choice enables the paired locality result and exact policy figures reported in Section 5. It does not establish external effectiveness, adversarial integrity, restart continuity, or optimal calibration. Those claims require the additional evidence package specified in Table 36.
We thank Marek Pawel Bargiel for conceptual comments on pressure-aware gating / colony-control framing.