Status: executable v0.1 architecture
Date: 2026-08-28
Authority: observational / experimental; no merge or approval authority
IDKMesh already has a rich architectural vocabulary: IDKGraph, Work Units, quality-diversity simulation, independent verification, a guarded self-evolution loop, Free Resource Mesh, and zero-cost compute routing. The weak point was the mathematical center of the live evolution observer: repository events were previously translated into small additive hand-authored score deltas.
That is useful for a first prototype, but it has three problems:
The Mathematical Evolution Kernel turns the most useful formulas already proposed in the project into deterministic, machine-tested primitives and connects them to GitHub Actions without increasing integration authority.
The governing idea is:
observe -> update uncertain beliefs -> preserve diversity -> allocate experiments
-> compare Pareto alternatives -> test homeostasis/invariants
-> retain evidence -> human/governance integration decision
No scalar score is allowed to become merge authority.
For each repository-health dimension d, maintain a Beta belief
p_d ~ Beta(alpha_d, beta_d)
with posterior mean
mu_d = alpha_d / (alpha_d + beta_d).
A normalized repository event contributes signed soft evidence e in [-1,1] with strength s:
alpha' = alpha + s * max(e, 0)
beta' = beta + s * max(-e, 0).
This is deliberately weaker than saying “a merged PR improved product quality by 0.012.” A merge is only evidence whose calibration must eventually be learned from downstream outcomes.
Posterior variance is
Var[p] = alpha beta / ((alpha+beta)^2 (alpha+beta+1)).
The observer also emits conservative approximate confidence bounds. Positive dimensions use the lower bound as the cautious signal; risk_debt uses the upper bound.
They are appropriate for a v0 kernel because they are:
[0,1];They are not claimed to be the final model for every metric. Continuous/ordinal outcomes can later use richer distributions.
Nominal verifier count is not independent evidence count. For a binary vote v_i from a verifier with reliability r_i, the information contribution is modeled as log odds
ell_i = log(r_i / (1-r_i)).
A positive vote adds ell_i; a negative vote subtracts it.
If a group of size n has approximate within-group error correlation rho, use the equicorrelation effective sample size
n_eff = n / (1 + (n-1) rho).
Each member of that group receives weight
w = 1 / (1 + (n-1) rho),
so the group’s total information weight is n_eff rather than n.
The posterior log odds become
logit P(correct | votes)
= logit P(correct)
+ sum_i w_i * sign(v_i) * log(r_i/(1-r_i)).
This extends the existing correlated-verifier experiments into a reusable aggregation primitive. It is still a model: group labels and rho are hypotheses and must be estimated/validated rather than treated as truth.
High-level task and architecture selection should not collapse immediately to one utility number.
For candidate i, use a vector such as
z_i = (
impact,
information_gain,
unlock,
diversity,
-risk,
-cost,
-review_burden
).
Candidate a dominates candidate b iff a is no worse in every objective and strictly better in at least one.
The kernel implements:
The first mechanism prevents a policy weight from hiding important trade-offs. The second prevents the frontier from collapsing around one region of objective space.
This is a natural bridge between IDKGraph task value and the existing quality-diversity simulation.
A small Work Unit may be valuable because it unlocks many downstream tasks.
For directed task graph distance d(i,j), define
Unlock(i) = sum_{j in Desc(i)} value_j * exp(-lambda * d(i,j)).
The kernel computes this using shortest directed distance. This gives upstream bridge tasks a measurable value without pretending graph centrality is correctness evidence.
Future IDKGraph projections can feed this directly into the Pareto vector.
When several experimental strategies/agents/adapters are available, always choosing the current empirical best causes premature convergence.
The kernel implements UCB1-style allocation:
UCB_i = mean_reward_i
+ c * sqrt(log(total_pulls + 1) / pulls_i).
An unseen arm receives infinite exploration priority.
Good uses include allocating a bounded experiment budget among:
UCB chooses what to test next. It does not grant authority to integrate the result.
For longer-horizon policy mixtures, use exponentiated-gradient / multiplicative weights:
w_i' proportional to w_i * exp(eta * reward_i).
After normalization, add an exploration floor epsilon:
x_i' = (1-epsilon) * normalized(w_i') + epsilon/K.
For small eta, this is closely related to discrete replicator dynamics: policies doing better than the population average gain mass, while the exploration floor prevents extinction from finite early evidence.
The intended use is experimental budget share, not constitutional authority.
For activity shares p_i, normalized Shannon entropy is
H_norm = -sum_i p_i log2 p_i / log2 K.
H_norm = 0 means observed activity is concentrated in one category. H_norm = 1 means the observed support is uniform.
The live evolution observer tracks:
Low entropy is a signal for possible over-concentration, not an instruction to create artificial activity.
For two empirical behavior/outcome distributions P and Q, use Jensen-Shannon divergence
JSD(P,Q) = 1/2 KL(P || M) + 1/2 KL(Q || M),
M = (P+Q)/2.
With base-2 logs, JSD in [0,1].
This is useful for the heterogeneous-worker milestone: two adapters are valuable when they provide different evidence/failure modes, not merely different names.
A repository should not maximize every variable. It should remain inside healthy operating ranges.
For state dimension x_j, target t_j, scale s_j, and importance q_j, define
V(R) = sum_j q_j * ((x_j - t_j) / s_j)^2.
V is a Lyapunov-style diagnostic potential: lower means the measured state is closer to configured healthy target bands.
For bounded low-risk automation, a conservative condition is
V_after <= V_before + tolerance
in addition to hard invariants, tests, and governance rules.
The live observer reports this condition, but does not auto-merge based on it.
This prevents a weighted scalar fitness increase from being called “improvement” when the system moves farther from important safety/homeostatic targets.
A GitHub-hosted runner is ephemeral. Updating state/evolution-state.json during a run does not persist by itself.
The evolution workflow therefore uses a read-only checkpoint protocol:
trusted main run N
-> upload evolution-checkpoint-v2-N artifact
trusted main run N+1
-> GitHub Actions API finds latest successful run from an allowlisted trusted event
-> exact run-bound artifact + SHA-256 manifest are verified
-> state/ledger schema and lineage invariants are verified
-> first-party actions/download-artifact restores checkpoint-N
-> Bayesian update
-> upload evolution-checkpoint-v2-(N+1)
Security boundary:
contents: read + actions: read;The v2 artifact namespace is a deliberate trust-epoch boundary: legacy
checkpoints without provenance manifests are not candidates. The first v2 run
starts from the checked-in deterministic seed; later v2 runs preserve that
validated lineage.
This is real cross-iteration memory without bypassing issue #35’s branch-protection gate.
Mathematical Evolution Kernel workflowOn relevant pushes, PRs, manual dispatch, and a weekly schedule it:
IDKMesh Evolution LoopIt now:
| Layer | Algorithm | Purpose | Authority ceiling |
|---|---|---|---|
| health belief | Beta Bayesian update | accumulate uncertain evidence | observation only |
| verifier evidence | reliability log odds + effective sample size | discount correlated evidence | evidence only |
| task/architecture candidates | Pareto fronts + crowding | preserve trade-offs | recommendation |
| task graph | discounted unlock value | value prerequisite bridges | recommendation |
| experiment allocation | UCB | explore under uncertainty | bounded experiment choice |
| policy mixture | multiplicative weights | adapt budget shares | experiment budget only |
| diversity | entropy + JSD | detect concentration / heterogeneity | diagnostic |
| self-maintenance | homeostatic potential | prevent unstable metric chasing | additional gate, never sole authority |
The remaining scientific task is to replace more hand-authored evidence strength with observed outcome relationships.
A future calibration dataset should link event/action classes to delayed outcomes such as:
Then compare alternative models by held-out predictive performance and calibration rather than by narrative plausibility.
The target evolution is:
hand-authored soft priors
-> measured posteriors
-> calibrated predictive models
-> bounded policy experiments
-> independently reviewed policy updates
That gives IDKMesh a mathematical learning loop without confusing optimization with governance.