This commit is contained in:
2026-06-21 20:10:03 +02:00
parent cb7054113a
commit 49b9fa2830
4 changed files with 1803 additions and 0 deletions
@@ -0,0 +1,480 @@
# Tripartite Synapse — Pseudocode v11
> Companion: `tripartite_synapse_v11_biology.md` explains the biology of every variable.
> Changes from v10: each component now carries its own PARAMETERS and EXTERNAL INTERFACE
> blocks; behaviors are organized into functional groups within each context; pool-filling
> primitives return their increment (applied by the caller); the astrocyte no longer writes
> PRE's drive (the spillover brake is PRE reading its own cleft).
---
## Functional groups (the uniform template, applied within each context)
```
RECEIVE take in resources + signals that arrived from outside
BEHAVE the component's defining action
EMIT send out — signals (messages) and resources (shipments) across the boundary
SENSE deposit the fast trace that records the behavior
RECOVER refill own private pools consumed by behaving
EVALUATE judge the behavior — strength (needs dopamine) + endurance (interrupted success)
DECAY let traces recede, closing their windows
```
Groups sit inside the DAY contexts (Option A): execution contexts (AP/bAP/CONTINUOUS) carry
BEHAVE/EMIT/SENSE/endurance-EVALUATE; replenishment contexts (NOT_AP/NOT_bAP) carry
RECEIVE/RECOVER/strength-EVALUATE/DECAY. Not every component uses every group.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS (each component writes, others read)
glutamate PRE → POST, ASTRO forward transmitter; ASTRO clears it
astro_Dserine ASTRO → POST NMDA co-agonist gate
retro_NO POST → PRE (+) "release reached a responsive target"
retro_eCB POST → PRE () DSE: "over-driven, release less"
SHIPMENT CHANNELS (source writes, target reads in its RECEIVE)
soma_ship_dend SOMA→DEND soma_ship_axon SOMA→AXON
dend_ship_post DEND→POST axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve
amount = min(rate, ceiling - pool)·Δt
budget -= amount·cost // intrinsic refill cost
return amount
refill(c from supply S) -> amount: // CONTESTED supply
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε))
S -= demand·factor // consumes shared supply
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // DIRECTED transfer
amount = min(from_budget·frac, demand_sig) // demand_sig = propagated tag
from_budget -= amount·(1 + cost)
return amount // caller writes shipment channel
```
---
## SHARED parameters (organism / physical / universal plasticity machinery)
```
// organism broadcasts (external; arrive as local levels)
dopamine NE ACh
// physical (external)
glucose // vascular energy ceiling — root
geometry // dendritic topology — bAP attenuation
// universal plasticity gates (same mechanism in every component)
elig dop_thr tag_thr tag_expiry // strength: eligibility → tag
traj_thr endur_thr // endurance: interrupted-success → need
// universal NIGHT
decay_rate capacity_decay_rate recycle
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
// decay-time convention: each *= decay(τ) means relax toward 0 with time-constant τ
```
---
---
# DAY
---
## PRE
```
// PARAMETERS (pre)
// K_release half-max Ca²⁺ for release release_cost gate to release
// fusion_cost per unit NT_flux vatpase_cost per unit RRP refilled
// spillover cleft level for autobrake brake autoreceptor factor
//
// EXTERNAL INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE astro_lactate[syn] ← ASTRO (primary fuel) ; axon_ship_pre ← AXON (fuel)
// retro_NO, retro_eCB ← POST (backward messages)
// pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// READ glutamate (own cleft, autobrake) ; dopamine (VTA, gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | AP:
// SENSE
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release or fail
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted local success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local)
if RRP > 0:
NT_flux = RRP × drive
// EMIT
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
pre_budget += refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY
pre_fast_trace *= decay(100ms); pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min); pre_tag *= decay(hr)
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
```
---
## POST
```
// PARAMETERS (post)
// K_AMPA half-max glu for AMPA AMPA_Ca Ca fraction via AMPA
// AMPA_cost NMDA_cost bAP_cost pka_cost traffic_cost req_cost
// Mg_eject Vm to eject Mg block Dserine_thr NMDA co-agonist gate
// Ca_STP fill-slots threshold Ca_TAG tagging threshold
// eCB_thr Vm for endocannabinoid (DSE) drift baseline (STD relaxation)
// NO_synth_cost eCB_synth_cost
//
// EXTERNAL INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND
// post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// READ glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP (via dend_structure.bAP_fidelity)
// dopamine (VTA, stabilizes tag)
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | NOT_bAP:
// RECEIVE
post_budget += refill(post from astro_lactate[syn] + dend_ship_post)
// BEHAVE + SENSE — three Ca sources feed post_fast_trace
a = sat(glutamate, K_AMPA) // SOURCE 1: AMPA
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0: // SOURCE 2: NMDA
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+)
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ()
if Vm > eCB_thr: retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE — STP fill slots (Ca-driven, private reserve); else STD drift (consequence)
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace), post_structure.slot_ceiling)
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline)
// EVALUATE (endurance) — interrupted local success (own Ca climbing toward tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// EVALUATE (strength) — CANDIDATE then STABLE (dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// DECAY
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_tag *= decay(hr); dopamine *= decay(ms)
DAY | bAP:
// BEHAVE + SENSE — SOURCE 3: bAP amplifies an existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
// PARAMETERS (dend)
// prop_cost branch_Ca_cost integrate_cost translate_cost
//
// EXTERNAL INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA
// dend_material, dend_energy ← SOMA(NIGHT)
// READ SOMA.fired (bAP trigger) ; POST.Vm + spine spillover (to integrate)
// dopamine ; ACh (commit-threshold context)
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
DAY | bAP:
// BEHAVE — propagate bAP (may fall short if depleted), integrate spines
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, dend_budget, geometry)
dend_budget -= prop_cost × reached
// EVALUATE (endurance) — propagation cut short while branch strongly active (LOCAL)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
// SENSE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT — propagated bAP to spines; integrated voltage to soma
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// RECEIVE
dend_budget += refill(dend from astro_lactate[branch] + soma_ship_dend)
// EMIT — ship budget downstream to spines (demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// EVALUATE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// BEHAVE — local translation if tagged (fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
// DECAY
dend_fast_trace *= decay(300ms); dend_possible_tag *= decay(s)
dend_endurance_need *= decay(min); dend_tag *= decay(hr)
```
---
## SOMA
```
// PARAMETERS (soma)
// ap_cost nuclear_cost creb_cost mito_output (self-fuel rate)
// inactivation ap_amp ap_contrib base_recovery
// τ_Na τ_adapt τ_nuclear τ_align
//
// EXTERNAL INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE self (mitochondria, ROOT) ; branch_Vm ← DEND
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
DAY | AP:
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE — fire if able
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// EVALUATE (endurance) — fuel cut a firing train approaching CREB (LOCAL)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost // EMIT: fired → AXON, DEND
// SENSE — three traces from one AP
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// EVALUATE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// BEHAVE — bottom-up refractory alignment (suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// RECOVER — recovery rate sped by alignment trace
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// RECEIVE — self-replenish (private root) + integrate input
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
branch_Vm = integrate(DEND.branch_Vm, branches)
// EMIT — ship downstream (demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// DECAY
soma_adaptation *= decay(τ_adapt); soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
soma_tag *= decay(hr); dopamine *= decay(ms)
```
---
## AXON
```
// PARAMETERS (axon)
// prop_cost budget_factor (depleted-propagation penalty)
//
// EXTERNAL INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO
// axon_material, axon_energy ← SOMA(NIGHT)
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
// BEHAVE — propagate (degraded if depleted)
if axon_budget < prop_cost:
reliability *= budget_factor
// EVALUATE (endurance) — propagating a strong train when fuel failed (LOCAL)
if axon_fast_trace > traj_thr: axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT — delivered APs reach boutons
// SENSE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// RECEIVE
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// EMIT — ship budget to boutons (demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// EVALUATE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// DECAY
axon_fast_trace *= decay(s); axon_possible_tag *= decay(s)
axon_endurance_need *= decay(min); axon_tag *= decay(hr)
```
---
## ASTRO
```
// PARAMETERS (astro)
// K_Dserine half-max Ca for D-serine Ds_max Ds_frac Ds_cost
// EAAT_cost per unit glutamate cleared lactate_cost per unit exported
// spillover overflow threshold overload lockdown threshold
//
// EXTERNAL INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// READ glutamate ← PRE (clearance + spillover) ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE — root production, capped by glucose
astro_central_budget += glycolysis(glucose)·Δt
// EMIT — demand-weighted lactate allocation across territory
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE — clear glutamate; supply tonic D-serine
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// SENSE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// BEHAVE + EMIT — D-serine pulse (demand-driven, budget-limited)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// EVALUATE (endurance) — ran out of synthesis under high own demand (LOCAL)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// EVALUATE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
astro_tag[i] *= decay(hr)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
System-wide consolidation (not a per-component DAY cycle). Build ceilings from DAY evidence.
```
NIGHT | 1 REPLENISH & DISTRIBUTE
// energy economy: astrocyte central → astrosynapses (astro_tag-weighted)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
// material economy: soma → branch/axon → spine/bouton
soma_budget += overnight_mito()·Δt; soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material·f_dend; axon_material += soma_material·f_axon; soma_material -= …
post_material += dend_material·f_spine; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·f[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve·f[·]·Δt
NIGHT | 2 STRENGTH COMMITS (raise structure)
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
NIGHT | 2b ENDURANCE COMMITS (raise budget_ceiling) — no dopamine; competes with step 2
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
NIGHT | 3 PASSIVE DECAY (both ceilings, by neglect)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint; budget_ceiling += full_cap_maint
else: structure += maint·frac; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // material recovered, energy not
{pre,post,astro}_material += |net_change|·recycle·frac
NIGHT | 4 HOMEOSTATIC SCALING
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 CLEAR TRACES
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY per context, per component: RECEIVE → BEHAVE/EMIT/SENSE → RECOVER → EVALUATE → DECAY
behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition (refill = contested, fill = private, ship = directed)
fast_trace + dopamine coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
NIGHT tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → freed material funds the rest
LOCAL every evaluation uses only own state + arrived signals; coupling is via channels.
```
@@ -0,0 +1,480 @@
# Tripartite Synapse — Pseudocode v11
> Companion: `tripartite_synapse_v11_biology.md` explains the biology of every variable.
> Changes from v10: each component now carries its own PARAMETERS and EXTERNAL INTERFACE
> blocks; behaviors are organized into functional groups within each context; pool-filling
> primitives return their increment (applied by the caller); the astrocyte no longer writes
> PRE's drive (the spillover brake is PRE reading its own cleft).
---
## Functional groups (the uniform template, applied within each context)
```
RECEIVE take in resources + signals that arrived from outside
BEHAVE the component's defining action
EMIT send out — signals (messages) and resources (shipments) across the boundary
SENSE deposit the fast trace that records the behavior
RECOVER refill own private pools consumed by behaving
EVALUATE judge the behavior — strength (needs dopamine) + endurance (interrupted success)
DECAY let traces recede, closing their windows
```
Groups sit inside the DAY contexts (Option A): execution contexts (AP/bAP/CONTINUOUS) carry
BEHAVE/EMIT/SENSE/endurance-EVALUATE; replenishment contexts (NOT_AP/NOT_bAP) carry
RECEIVE/RECOVER/strength-EVALUATE/DECAY. Not every component uses every group.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS (each component writes, others read)
glutamate PRE → POST, ASTRO forward transmitter; ASTRO clears it
astro_Dserine ASTRO → POST NMDA co-agonist gate
retro_NO POST → PRE (+) "release reached a responsive target"
retro_eCB POST → PRE () DSE: "over-driven, release less"
SHIPMENT CHANNELS (source writes, target reads in its RECEIVE)
soma_ship_dend SOMA→DEND soma_ship_axon SOMA→AXON
dend_ship_post DEND→POST axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve
amount = min(rate, ceiling - pool)·Δt
budget -= amount·cost // intrinsic refill cost
return amount
refill(c from supply S) -> amount: // CONTESTED supply
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε))
S -= demand·factor // consumes shared supply
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // DIRECTED transfer
amount = min(from_budget·frac, demand_sig) // demand_sig = propagated tag
from_budget -= amount·(1 + cost)
return amount // caller writes shipment channel
```
---
## SHARED parameters (organism / physical / universal plasticity machinery)
```
// organism broadcasts (external; arrive as local levels)
dopamine NE ACh
// physical (external)
glucose // vascular energy ceiling — root
geometry // dendritic topology — bAP attenuation
// universal plasticity gates (same mechanism in every component)
elig dop_thr tag_thr tag_expiry // strength: eligibility → tag
traj_thr endur_thr // endurance: interrupted-success → need
// universal NIGHT
decay_rate capacity_decay_rate recycle
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
// decay-time convention: each *= decay(τ) means relax toward 0 with time-constant τ
```
---
---
# DAY
---
## PRE
```
// PARAMETERS (pre)
// K_release half-max Ca²⁺ for release release_cost gate to release
// fusion_cost per unit NT_flux vatpase_cost per unit RRP refilled
// spillover cleft level for autobrake brake autoreceptor factor
//
// EXTERNAL INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE astro_lactate[syn] ← ASTRO (primary fuel) ; axon_ship_pre ← AXON (fuel)
// retro_NO, retro_eCB ← POST (backward messages)
// pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// READ glutamate (own cleft, autobrake) ; dopamine (VTA, gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | AP:
// SENSE
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release or fail
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted local success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local)
if RRP > 0:
NT_flux = RRP × drive
// EMIT
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
pre_budget += refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY
pre_fast_trace *= decay(100ms); pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min); pre_tag *= decay(hr)
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
```
---
## POST
```
// PARAMETERS (post)
// K_AMPA half-max glu for AMPA AMPA_Ca Ca fraction via AMPA
// AMPA_cost NMDA_cost bAP_cost pka_cost traffic_cost req_cost
// Mg_eject Vm to eject Mg block Dserine_thr NMDA co-agonist gate
// Ca_STP fill-slots threshold Ca_TAG tagging threshold
// eCB_thr Vm for endocannabinoid (DSE) drift baseline (STD relaxation)
// NO_synth_cost eCB_synth_cost
//
// EXTERNAL INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND
// post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// READ glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP (via dend_structure.bAP_fidelity)
// dopamine (VTA, stabilizes tag)
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | NOT_bAP:
// RECEIVE
post_budget += refill(post from astro_lactate[syn] + dend_ship_post)
// BEHAVE + SENSE — three Ca sources feed post_fast_trace
a = sat(glutamate, K_AMPA) // SOURCE 1: AMPA
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0: // SOURCE 2: NMDA
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+)
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ()
if Vm > eCB_thr: retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE — STP fill slots (Ca-driven, private reserve); else STD drift (consequence)
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace), post_structure.slot_ceiling)
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline)
// EVALUATE (endurance) — interrupted local success (own Ca climbing toward tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// EVALUATE (strength) — CANDIDATE then STABLE (dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// DECAY
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_tag *= decay(hr); dopamine *= decay(ms)
DAY | bAP:
// BEHAVE + SENSE — SOURCE 3: bAP amplifies an existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
// PARAMETERS (dend)
// prop_cost branch_Ca_cost integrate_cost translate_cost
//
// EXTERNAL INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA
// dend_material, dend_energy ← SOMA(NIGHT)
// READ SOMA.fired (bAP trigger) ; POST.Vm + spine spillover (to integrate)
// dopamine ; ACh (commit-threshold context)
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
DAY | bAP:
// BEHAVE — propagate bAP (may fall short if depleted), integrate spines
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, dend_budget, geometry)
dend_budget -= prop_cost × reached
// EVALUATE (endurance) — propagation cut short while branch strongly active (LOCAL)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
// SENSE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT — propagated bAP to spines; integrated voltage to soma
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// RECEIVE
dend_budget += refill(dend from astro_lactate[branch] + soma_ship_dend)
// EMIT — ship budget downstream to spines (demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// EVALUATE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// BEHAVE — local translation if tagged (fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
// DECAY
dend_fast_trace *= decay(300ms); dend_possible_tag *= decay(s)
dend_endurance_need *= decay(min); dend_tag *= decay(hr)
```
---
## SOMA
```
// PARAMETERS (soma)
// ap_cost nuclear_cost creb_cost mito_output (self-fuel rate)
// inactivation ap_amp ap_contrib base_recovery
// τ_Na τ_adapt τ_nuclear τ_align
//
// EXTERNAL INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE self (mitochondria, ROOT) ; branch_Vm ← DEND
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
DAY | AP:
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE — fire if able
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// EVALUATE (endurance) — fuel cut a firing train approaching CREB (LOCAL)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost // EMIT: fired → AXON, DEND
// SENSE — three traces from one AP
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// EVALUATE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// BEHAVE — bottom-up refractory alignment (suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// RECOVER — recovery rate sped by alignment trace
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// RECEIVE — self-replenish (private root) + integrate input
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
branch_Vm = integrate(DEND.branch_Vm, branches)
// EMIT — ship downstream (demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// DECAY
soma_adaptation *= decay(τ_adapt); soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
soma_tag *= decay(hr); dopamine *= decay(ms)
```
---
## AXON
```
// PARAMETERS (axon)
// prop_cost budget_factor (depleted-propagation penalty)
//
// EXTERNAL INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO
// axon_material, axon_energy ← SOMA(NIGHT)
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
// BEHAVE — propagate (degraded if depleted)
if axon_budget < prop_cost:
reliability *= budget_factor
// EVALUATE (endurance) — propagating a strong train when fuel failed (LOCAL)
if axon_fast_trace > traj_thr: axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT — delivered APs reach boutons
// SENSE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// RECEIVE
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// EMIT — ship budget to boutons (demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// EVALUATE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// DECAY
axon_fast_trace *= decay(s); axon_possible_tag *= decay(s)
axon_endurance_need *= decay(min); axon_tag *= decay(hr)
```
---
## ASTRO
```
// PARAMETERS (astro)
// K_Dserine half-max Ca for D-serine Ds_max Ds_frac Ds_cost
// EAAT_cost per unit glutamate cleared lactate_cost per unit exported
// spillover overflow threshold overload lockdown threshold
//
// EXTERNAL INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// READ glutamate ← PRE (clearance + spillover) ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE — root production, capped by glucose
astro_central_budget += glycolysis(glucose)·Δt
// EMIT — demand-weighted lactate allocation across territory
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE — clear glutamate; supply tonic D-serine
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// SENSE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// BEHAVE + EMIT — D-serine pulse (demand-driven, budget-limited)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// EVALUATE (endurance) — ran out of synthesis under high own demand (LOCAL)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// EVALUATE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
astro_tag[i] *= decay(hr)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
System-wide consolidation (not a per-component DAY cycle). Build ceilings from DAY evidence.
```
NIGHT | 1 REPLENISH & DISTRIBUTE
// energy economy: astrocyte central → astrosynapses (astro_tag-weighted)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
// material economy: soma → branch/axon → spine/bouton
soma_budget += overnight_mito()·Δt; soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material·f_dend; axon_material += soma_material·f_axon; soma_material -= …
post_material += dend_material·f_spine; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·f[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve·f[·]·Δt
NIGHT | 2 STRENGTH COMMITS (raise structure)
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
NIGHT | 2b ENDURANCE COMMITS (raise budget_ceiling) — no dopamine; competes with step 2
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
NIGHT | 3 PASSIVE DECAY (both ceilings, by neglect)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint; budget_ceiling += full_cap_maint
else: structure += maint·frac; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // material recovered, energy not
{pre,post,astro}_material += |net_change|·recycle·frac
NIGHT | 4 HOMEOSTATIC SCALING
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 CLEAR TRACES
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY per context, per component: RECEIVE → BEHAVE/EMIT/SENSE → RECOVER → EVALUATE → DECAY
behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition (refill = contested, fill = private, ship = directed)
fast_trace + dopamine coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
NIGHT tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → freed material funds the rest
LOCAL every evaluation uses only own state + arrived signals; coupling is via channels.
```
@@ -0,0 +1,333 @@
# Tripartite Synapse — Biological Reference (companion to v10 pseudocode)
> This document explains what each variable and behavior in `tripartite_synapse_v10_pseudocode.md`
> conflates biologically. The pseudocode aggregates many molecular details into single
> variables for clarity; here each aggregation is unpacked. Read the pseudocode for the
> logic; read this when you need to know what a variable physically represents.
---
## The three synaptic components and their support structures
A SYNAPSE is composed of three first-class components:
- **PRE** — presynaptic bouton (the axon's terminal at this synapse)
- **POST** — postsynaptic spine (the dendrite's terminal at this synapse)
- **ASTRO** — astrosynapse, the perisynaptic astrocytic process (the astrocyte's terminal)
Each has an upstream support structure that supplies it:
- **AXON** supplies PRE (transmission + transport from soma)
- **DEND** supplies POST (integration + transport from soma)
- the **astrocyte cell body** supplies ASTRO (energy + ECM material)
- **SOMA** is the integrating center and the root of neuronal material
The compartment analogy: AXON:PRE = DEND:POST = astrocyte-body:ASTRO = supply line : terminal.
---
## Resource variables
### DAY budget (one per component)
Aggregates fast energy AND fast consumables — everything needed to run moment-to-moment.
- **pre_budget** — ATP for VGCC gating, vesicle fusion (SNARE), VATPase vesicle refill,
plus fast consumables: vesicle membrane lipids, synaptotagmin recycling.
- **post_budget** — ATP for the NaK pump (membrane reset after current), NMDA current
handling, plus fast actin monomers for transient spine changes and receptor-recycling lipids.
- **dend_budget** — ATP for bAP propagation (NaK reset along branch), local translation
(ribosome running cost), SERCA Ca²⁺ resequestration, plus fast mRNA consumed by translation.
- **soma_budget** — ATP for AP generation (Na⁺/K⁺ currents + NaK reset), CREB
phosphorylation, nuclear Ca²⁺ handling, plus shipping running costs.
- **axon_budget** — ATP for AP propagation at nodes of Ranvier, kinesin/dynein motor
running cost, fast myelin maintenance.
- **astro_central_budget** — ATP from glycolysis at the astrocyte cell body; funds EAAT
clearance, serine→D-serine synthesis, lactate export, fast process motility.
### astro_lactate[i]
Lactate exported from the astrocyte cell body to synapse i. Biologically: glucose →
(glycolysis) → lactate, released into extracellular space, absorbed by neuronal MCT2
transporters, converted to pyruvate → TCA → ATP in the neuron's mitochondria. The astrocyte
is the primary fast-energy supplier to pre, post, and dend.
### NIGHT energy (one per component) — NOT recoverable
ATP for structural assembly. Distinct from DAY budget because it is spent on building, and
the work of assembly is thermodynamically gone once done (cannot be recovered by disassembly).
- pre_energy: RIM/Munc13 incorporation, VGCC clustering.
- post_energy: CaMKII anchoring, actin polymerization, PSD scaffold remodeling.
- dend_energy: mitochondria incorporation, cytoskeletal reinforcement.
- soma_energy: ribosome biogenesis, ion-channel incorporation.
- axon_energy: myelination, microtubule stabilization.
- astro_energy: process retraction, ECM secretion, racemase upregulation.
### NIGHT material (one per component) — RECOVERABLE
Slow structural proteins. Recoverable because disassembly (LTD) returns the proteins to a
reusable pool (ubiquitin-proteasome → amino acids; internalized receptors → endosomal reserve).
- **soma_material** (root) — all neuronal structural proteins from CREB-driven synthesis:
AMPA subunits, PSD scaffold, AZ scaffold, mRNA transcripts (Arc, BDNF), organelles.
- **dend_material** — from soma: Arc/plasticity mRNA, mitochondria, cytoskeletal proteins,
AMPA subunits in transit to spines.
- **post_material** — from dend: AMPA receptor subunits (GluA1/2), PSD scaffold (PSD-95,
SHANK, Homer), structural actin, CaMKII.
- **axon_material** — from soma: kinesin/dynein motors, microtubule components, myelin proteins.
- **pre_material** — from axon: RIM, Munc13, VGCC subunits, structural vesicle proteins.
- **astro_material** (root: astrocyte cell body) — EAAT proteins, serine racemase, ECM
proteins (Glypicans, Thrombospondins), process cytoskeleton.
**Why energy and material are separate in NIGHT but combined in DAY:** during DAY both are
fast consumables replenished on the same timescale, so one `budget` variable suffices. During
NIGHT they diverge — material is recoverable after LTD, energy is not — so they must be two
variables. This asymmetry (material returns to the pool, energy is gone) is what makes one
synapse's depression genuinely fund another's potentiation.
---
## Structural variables (strength ceilings — written in NIGHT)
Each aggregates several correlated structural properties into one capacity.
- **pre_structure** — active zone capacity:
slot_ceiling (number of vesicle docking slots) + VGCC_coupling (Ca²⁺-channel proximity to
slots, sets release efficiency) + refill_ceiling (max RRP replenishment rate).
- **post_structure** — spine sensitivity capacity:
slot_ceiling (number of PSD anchoring slots for AMPA) + spine_volume (local reserve and
actin machinery) + reserve_ceiling (endosomal AMPA pool size).
- **dend_structure** — branch capacity:
bAP_fidelity(position) (mitochondrial density sets propagation strength, attenuates with
distance) + translation_ceiling (local mRNA capacity) + transport_speed (cytoskeletal integrity).
- **soma_structure** — somatic output capacity:
baseline_threshold (inverse: ion-channel density at axon initial segment) + AP_reliability
(Na⁺ channel density) + synthesis_ceiling (ribosome density + CREB machinery).
- **axon_structure** — axonal capacity:
propagation reliability (myelination density) + transport_ceiling (motor density + microtubule
integrity) + mitochondrial density.
- **astro_structure** — astrosynaptic environmental capacity:
perisynaptic_distance⁻¹ (wall proximity — closer = more glutamate contained) + EAAT_density
(clearance ceiling) + Dserine_tonic (baseline co-agonist) + ECM_integrity.
**Self-reinforcing both directions:** tighter wrap + more tonic D-serine make future
potentiation easier; looser wrap + zero tonic D-serine make future depression easier.
---
## Budget ceilings (endurance ceilings — written in NIGHT)
- **{component}_budget_ceiling** — the maximum fuel the component can hold / the maximum
duration of sustained behavior. Biologically: mitochondrial density and local fuel-storage
capacity. Built by activity-driven mitochondrial biogenesis; lost by mitophagy when idle.
Parallel to structure: structure is strength capacity, budget_ceiling is endurance capacity.
---
## Trace variables
### fast_trace (one per component) — DAY only, decays automatically
The local record of recent activity that biases the next behavior.
- **pre_fast_trace** — residual presynaptic Ca²⁺ after spikes (τ≈100ms). Biases NT release
(facilitation) and provides tagging eligibility.
- **post_fast_trace** — spine Ca²⁺ amplitude × rise-speed (τ≈tens ms). Encodes the LTP-vs-LTD
instruction (fast rise → CaMKII → potentiation; slow rise → phosphatase → depression).
- **dend_fast_trace** — branch Ca²⁺ from bAP + spine spillover (τ≈300ms). Integrates branch co-activity.
- **soma_fast_trace** — nuclear Ca²⁺ from each AP (τ≈seconds). Drives toward CREB activation.
- **axon_fast_trace** — propagation load (τ≈seconds). High load → Na⁺ inactivation at branch
points → propagation failure (this is axonal short-term depression).
- **astro_fast_trace** — perisynaptic Ca²⁺ from mGluR5 activation by glutamate spillover
(τ≈seconds). Drives D-serine release.
### soma timing traces (emergent refractory + adaptation + alignment)
- **soma_Na_inactivation** (τ≈ms) — sodium-channel inactivation after an AP. Its recovery IS
the refractory period (emergent, not a hardcoded timer). High → absolute refractory; decaying
→ relative refractory; recovered → normal.
- **soma_adaptation** (τ≈100s of ms) — slow K⁺ channel (SK/M-type) activation accumulating
over a spike train, raising threshold. This is spike-frequency adaptation.
- **soma_refractory_alignment** — deposited when a suprathreshold input arrives during
refractoriness (a missed coincidence). Speeds future recovery so the soma aligns to its input
rhythm. Bottom-up: no rhythm is represented; alignment emerges from accumulated local
mismatches and decays when mismatches stop (self-limiting).
### possible_tag (one per component) — intermediate, τ≈smin
Graded accumulation of tagging eligibility. For POST, this is the CANDIDATE tag lifetime.
### endurance_need (one per component) — intermediate, τ≈smin
Deposited when budget depletion interrupts a behavior that was on a LOCALLY successful
trajectory. Records that fuel — not structure, not significance — was the binding constraint
on a forming success. Requires NO dopamine (homeostatic, not associative).
**Local success proxy per component** (each uses only its own state + arrived signals):
- PRE: own fast_trace high (was releasing strongly), optionally amplified by retrograde
messenger (endocannabinoid / NO / BDNF) that has arrived.
- POST: own Ca²⁺ climbing toward tagging threshold (naturally local).
- DEND: own branch strongly active (high branch voltage/Ca²⁺) when propagation fell short.
- SOMA: own nuclear Ca²⁺ climbing toward CREB.
- AXON: own propagation load high (was carrying a strong train).
- ASTRO: own local glutamate/Ca²⁺ high (was under heavy clearance/D-serine demand).
### tag (one per component) — DAY→NIGHT bridge, τ≈hours
The validated record of significance that survives to NIGHT and gates strength commits.
Formed by coincidence of local eligibility + non-local validation (dopamine).
**POST is special — two-phase, three coincidences:**
- CANDIDATE: local Ca²⁺ above threshold + astrosynapse D-serine present (coincidence 1).
- amplified when bAP confirms soma fired (coincidence 2).
- STABLE: CANDIDATE + dopamine within stabilization window (coincidence 3).
Biologically: early CaMKII creates a labile tag (early-LTP); PKA driven by dopamine via D1R
stabilizes it (late-LTP). Without dopamine, the candidate degrades — early-LTP reverses.
---
## Behaviors — biological meaning
### PRE | AP — neurotransmitter release
`NT_flux = RRP × sat(pre_fast_trace, K_release)` models continuous NT release proportional to
the readily-releasable pool and a saturating Ca²⁺ drive (synaptotagmin's cooperative Ca²⁺
sensitivity, simplified to a saturating curve). RRP depletes as released (short-term depression
as a consequence) and refills via VATPase (energy-throttled, so low budget deepens depression).
The mGluR2/3 brake is presynaptic autoinhibition by spillover (Gi → reduced VGCC opening).
### POST | NOT_bAP — three calcium sources, two plasticity cases
- **Source 1 (AMPA):** glutamate opens AMPA → depolarizing current + small Ca²⁺; the
depolarization begins ejecting the NMDA Mg²⁺ block.
- **Source 2 (NMDA):** if depolarized enough (Mg²⁺ ejected) AND D-serine present (astrocyte
co-agonist) AND glutamate bound → large Ca²⁺ influx. This is the coincidence detector.
- **Source 3 (bAP, separate context):** back-propagating AP adds depolarization + Ca²⁺,
amplifying an existing signal supralinearly.
- **Case 1 (STP):** high Ca²⁺ drives AMPA receptors from the local reserve to the surface,
bounded by the anchoring-slot ceiling. Fast, reversible, NO dopamine. When Ca²⁺ falls,
receptors drift back — short-term depression as a passive consequence, never signaled.
- **Case 2 (LTP tag):** high Ca²⁺ + (later) dopamine sets the tag that NIGHT uses to raise the
slot ceiling. NIGHT builds slots; DAY fills them.
### DEND | bAP — bidirectional signaling
Propagates the bAP from soma toward spines (fidelity attenuates with distance — distal spines
get weaker confirmation, are harder to potentiate) and integrates spine signals toward the soma.
### SOMA | AP — integration, firing, emergent timing
Fires when integrated branch input exceeds a threshold that is the baseline (from structure)
raised by adaptation and modulated by neuromodulators, gated by the emergent refractory state.
Each AP deposits three traces (inactivation → refractory, adaptation → threshold rise, nuclear
Ca²⁺ → plasticity). The soma is the coincidence detector at the cellular scale (nuclear Ca²⁺ +
dopamine → CREB), and the production bottleneck: its tag gates how much material all downstream
components get in NIGHT.
### AXON | AP — reliable propagation with frequency-dependent failure
Propagation reliability is set by myelination and degraded by high-frequency load (Na⁺
inactivation at branch points = axonal STD). The axon also transports material to boutons and
sets the timescale of presynaptic structural commits.
### ASTRO | CONTINUOUS — gatekeeper and energy hub
Clears glutamate (EAAT), supplies D-serine (the NMDA co-agonist that gates postsynaptic LTP),
and distributes lactate to the territory by demand-weighting (active synapses generating more
clearance load pull more fuel; slow synapses get less). The same spillover that excites the
astrocyte (mGluR5 → Ca²⁺ → D-serine) also brakes the presynapse (mGluR2/3 → Gi) — one signal,
opposite effects via different receptors. The astrocyte is the energy root and the gain control
of the whole synapse.
---
## NIGHT operations — biological meaning
- **Step 1 (replenish/distribute):** overnight protein synthesis peaks (CREB-driven, gated by
soma_tag — corresponds to slow-wave-sleep replay). Soma material flows to branches/axon then
spines/boutons; astrocyte material flows to astrosynapses, tag-weighted.
- **Step 2 (strength commits):** tagged components build structure — more slots, tighter
coupling, tighter astrosynaptic wrap. Coherence bonus when pre+post+astro all tagged (the
whole synapse agrees). astro_structure self-reinforces.
- **Step 2b (endurance commits):** components with high endurance_need build budget_ceiling —
mitochondrial biogenesis. Competes with step 2 for the same material/energy.
- **Step 3 (passive decay):** both ceilings decay; maintenance from the remaining pool resists
decay only where sufficient. Depotentiation and endurance-loss are both by neglect — no
signal weakens anything; unmaintained capacity simply drifts down. Recovered material (not
energy) returns to pools.
- **Step 4 (homeostatic scaling):** if the soma fired too much overall, all synapses scale down
proportionally (sleep-associated global downscaling), preserving relative differences.
- **Step 5 (clear traces):** fast traces, possible tags, endurance needs, and soma timing traces
reset; tags below expiry clear, above-expiry tags carry forward (multi-night consolidation);
structure and budget_ceiling persist.
### Shockwave lockdown
Emergency global astrocytic Ca²⁺ wave → GABA + ATP release → mass AMPA internalization and
hyperpolarization. Bypasses budget gates. A circuit breaker against runaway excitation.
---
## Pool-filling: private reserve vs contested supply
The pseudocode uses two filling primitives, distinguished by where the resource comes from.
**`fill` (private reserve).** The pool is replenished from a source the component owns
outright, uncontested by siblings, bounded by the component's own ceiling and a rate cap.
- RRP refill — vesicles mobilized from the bouton's own reserve pool toward the docking-slot
ceiling, rate-limited by VATPase. The reserve is private to the bouton.
- SOMA self-replenish — the soma fuels itself from its own mitochondria toward its budget
ceiling. No other component draws on it.
**`refill` (contested supply).** The pool is replenished from a supply that multiple
components compete for, rationed by demand (gap to ceiling).
- pre/post/dend/axon budgets — drawn from astrocytic lactate (shared across all synapses the
astrocyte wraps) plus shipment from soma/axon/dendrite (shared across downstream targets).
**Neither primitive (their own forms).** Some inflows are not fills toward a ceiling:
- AMPA surface insertion — Ca²⁺-driven rate from the spine's private endosomal reserve, with
an explicit passive drift-back (short-term depression) when Ca²⁺ is low. Not a steady fill.
- D-serine release — demand-driven (saturating in astro Ca²⁺) and budget-limited, like NT
release; a release process, not a pool top-up.
- Root productions — `glycolysis(glucose)` at the astrocyte and `CREB_synth(soma_tag)` at the
soma are the system's energy and material roots: raw inflows capped only by the external
vascular supply, not fills toward an internal ceiling.
The distinction matters biologically: a private reserve guarantees a component some autonomy
(the bouton can refill its RRP from its own vesicles even when lactate is scarce), while a
contested supply couples a component's fate to its neighbours' demands (operational budget
fails first where many active synapses compete for the same lactate).
---
## PRE ↔ POST interaction: local computation, message-only coupling
The presynapse and postsynapse never read each other's internal state. They interact only
by writing to and reading from shared cleft channels. Each side computes entirely locally on
what it has: its own variables plus whatever signals have arrived in the cleft. This is the
message-passing realization of the locality principle.
**Forward channel — glutamate (PRE → POST and ASTRO).** The presynapse writes glutamate via
NT_flux. The postsynapse reads it (AMPA, NMDA) and the astrosynapse reads it (clearance,
mGluR5). The astrosynapse clears it. PRE never knows whether POST responded — it only emits.
**Gate channel — astro_Dserine (ASTRO → POST).** The astrosynapse writes D-serine; the
postsynapse reads it as the obligatory NMDA co-agonist. POST cannot open NMDA without this
arrived signal, but it does not read the astrocyte's state — only the delivered D-serine.
**Backward channel + — retro_NO (POST → PRE).** When the postsynapse's NMDA opens (Mg²⁺
ejected, D-serine present, glutamate bound), nNOS — physically tethered to the NMDA receptor
through PSD-95 — synthesises nitric oxide (and, on a slower timescale, BDNF is released).
These diffuse retrogradely to the presynapse. Biologically this is the classic retrograde
messenger of LTP: it tells the bouton that its release landed on a postsynapse that genuinely
responded. In the model, POST emits `retro_NO` proportional to its own NMDA-driven calcium —
computed purely from POST's local state — and PRE reads it as `retro_NO_local`.
`retro_NO_local` is exactly the grounding of the presynaptic endurance signal. The
presynapse's local success proxy is "I was releasing strongly" (`pre_fast_trace` high). On
its own that only says the bouton was working hard, not that the work mattered. `retro_NO`
adds the missing confirmation — that the postsynapse responded — without PRE ever reading
POST's calcium. So PRE deposits endurance need as `pre_fast_trace × (1 + retro_NO_local)`:
strong release that was confirmed effective makes the strongest claim that fuel, not
futility, was what interrupted a forming success. retro_NO is short-lived (NO degrades and
diffuses within seconds), so the channel decays fast — confirmation must be recent to count.
**Backward channel — retro_eCB (POST → PRE).** When the postsynapse is strongly
depolarised, it synthesises endocannabinoids (2-AG, anandamide) that diffuse retrogradely and
bind presynaptic CB1 receptors, suppressing release. This is depolarisation-induced
suppression of excitation (DSE) — a homeostatic negative feedback: an over-driven postsynapse
tells the presynapse to release less. In the model, POST emits `retro_eCB` from its own
membrane potential, and PRE reads it as `retro_eCB_local`, which reduces the release drive
`sat(...) × (1 - retro_eCB_local)`. Again POST computes from its own state; PRE adjusts from
the arrived signal; neither reads the other's interior.
The two backward channels are opposite-signed messages the postsynapse sends about its own
condition: retro_NO says "your input was effective — worth sustaining," retro_eCB says "I am
saturated — ease off." Together with the forward glutamate and the D-serine gate, they make
the synapse a fully message-coupled system of locally-computing components.
**Why RRP refill is in NOT_AP only.** During an AP the bouton releases — RRP depletes. Refill
(VATPase reloading vesicles from the reserve pool) is a recovery process that proceeds between
spikes. Placing `fill(RRP, ...)` only in the NOT_AP context makes the AP context pure
depletion and the NOT_AP context pure recovery. A consequence falls out for free: during
sustained high-frequency firing there are many AP steps and few NOT_AP steps, so RRP depletes
faster than it recovers — short-term depression deepens with frequency, with no explicit
depression rule. The release itself is throttled further when budget is low (VATPase refill
is energy-limited), coupling metabolic state to the depth of depression.
@@ -0,0 +1,510 @@
# Tripartite Synapse — Pseudocode v10
> Companion document: `tripartite_synapse_v10_biology.md` explains the biological
> meaning of every variable and behavior. This document is the logic only.
---
## Conventions
```
SCOPE = { DAY, NIGHT }
CONTEXT = { AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS }
COMPONENTS = { PRE, POST, DEND, SOMA, AXON, ASTRO }
DAY variables
budget fast resource (energy + consumables), consumed by behavior
fast_trace local record, decays in mss, biases next behavior
possible_tag accumulates from fast_trace, decays in smin
endurance_need accumulates on interrupted local success, decays in smin
DAY→NIGHT bridge
tag decays in hours; POST: CANDIDATE → STABLE
NIGHT variables
energy assembly ATP, NOT recoverable
material structural proteins, RECOVERABLE after decay
structure strength ceiling — READ in DAY, WRITTEN in NIGHT
budget_ceiling endurance ceiling — READ in DAY, WRITTEN in NIGHT
LOCALITY RULE
every evaluation uses only local state + signals that have arrived.
no component reads another compartment's internal state.
CLEFT MESSAGE CHANNELS (the only PRE/POST/ASTRO interaction — each writes, others read)
glutamate PRE → POST, ASTRO (forward transmitter; cleared by ASTRO)
astro_Dserine ASTRO → POST (NMDA co-agonist gate)
retro_NO POST → PRE (+) (NO/BDNF: "release reached a responsive target")
retro_eCB POST → PRE () (endocannabinoid: "over-driven, suppress release" = DSE)
Each channel decays/clears; a component reads a channel into a local copy and computes locally.
```
---
## Saturating form (used wherever a graded signal drives output)
```
sat(x, K) = x / (K + x)
```
---
## Fixed parameters
```
K_release K_AMPA K_Dserine
Mg_eject Ca_STP Ca_TAG eCB_thr
elig dop_thr tag_thr tag_expiry
traj_thr endur_thr
spillover inactivation overload
homeostatic_ceiling decay_rate capacity_decay_rate recycle
dopamine NE ACh // organism broadcast (external)
glucose // vascular ceiling (external)
geometry // dendritic topology (external)
```
---
---
# DAY
Execution contexts (AP, bAP, CONTINUOUS): run behavior, spend budget, deposit traces.
Replenishment contexts (NOT_AP, NOT_bAP): competitive refill, ship downstream, decay traces, set tags.
---
## Pool-filling primitives
Two shapes share the core "rise toward a ceiling, bounded by the gap, paying budget":
```
// PRIVATE: fill own pool from own reserve toward own ceiling, at a rate cap
fill(pool, ceiling, rate_cap, cost, budget):
amount = min(rate_cap, ceiling - pool)·Δt // bounded by rate AND gap
pool += amount
budget -= amount·cost
// CONTESTED: fill toward ceiling by a rationed share of a shared supply S
refill(component c from supply S):
demand = c.budget_ceiling - c.budget // claim = gap to ceiling
total = Σ demand over components on S
factor = min(1, S / (total + ε))
c.budget += demand × factor // never exceeds ceiling
S -= demand × factor
```
Choose by source: a pool drawn from a **private reserve** uses `fill`; a pool drawn from a
**contested shared supply** uses `refill`. The distinction is biologically real — RRP comes
from the bouton's private reserve pool, while operational budget comes from astrocytic lactate
that neighbours compete for.
---
## PRE
```
// ─── PRESYNAPSE EXTERNAL INTERFACE ────────────────────────────────────────
// PRE computes locally. Everything below crosses its boundary as a signal it
// emits or a resource/signal it receives. It never reads another component's state.
//
// OUTPUT (PRE writes; others read)
// glutamate → POST, ASTRO forward transmitter; ASTRO clears it
//
// RESOURCES IN (others write; PRE reads in NOT_AP)
// astro_lactate[syn] ← ASTRO primary fast fuel → pre_budget
// axon_ship_pre ← AXON secondary fuel → pre_budget
// ship(axon_budget → pre_budget, gap_to(pre))
// pre_material ← AXON (NIGHT) AZ proteins (RIM, Munc13, VGCC subunits)
// pre_energy ← SOMA (NIGHT) assembly ATP for active-zone construction
//
// BACKWARD MESSAGES IN (POST writes from its own state; PRE reads)
// retro_NO (+) ← POST "release reached a responsive target" → endurance
// retro_eCB () ← POST DSE: "over-driven, release less" → brake
//
// CLEFT SELF-FEEDBACK (PRE reads the channel it writes)
// glutamate ← cleft spillover autoreceptor brake (mGluR2/3 on PRE)
//
// ORGANISM BROADCAST IN (external; arrives as a local level)
// dopamine ← VTA gates pre_tag (the non-local coincidence)
// NE, ACh ← LC, basal excitability/threshold context
//
// OWN STRUCTURE (written NIGHT, read DAY)
// pre_structure slot_ceiling, VGCC_coupling, refill_ceiling
// pre_budget_ceiling endurance ceiling (bounds replenishment)
//
// EMERGENCY
// shockwave_lockdown ← ASTRO global Ca²⁺ wave overrides PRE
// ──────────────────────────────────────────────────────────────────────────
DAY | AP:
// SENSE — deposit fast trace (residual Ca²⁺ from this spike; also drives release)
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release, or fail if depleted
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted LOCAL success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local) // received DSE brake
if RRP > 0:
NT_flux = RRP × drive
// EMIT — glutamate into cleft (read by POST, ASTRO)
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autoreceptor brake
// no RECOVER here — RRP refills in NOT_AP; high-frequency firing depletes
// faster than it recovers → short-term depression deepens
DAY | NOT_AP:
// RECEIVE — latch arrived backward messages; replenish budget (contested supply)
retro_NO_local = retro_NO
retro_eCB_local = retro_eCB
refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER — refill RRP from private reserve toward its ceiling
fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength) — eligibility → possible_tag → tag (needs dopamine)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY — all traces and channels recede, closing their windows
pre_fast_trace *= decay(100ms)
pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min)
pre_tag *= decay(hr)
dopamine *= decay(ms) // broadcast transient fades
retro_NO *= decay(s); retro_eCB *= decay(s) // backward channels clear
```
---
## POST
```
DAY | NOT_bAP:
refill(post from astro_lactate[syn] + dend_ship_post)
// SOURCE 1 — AMPA: current + small Ca + begins Mg ejection
a = sat(glutamate, K_AMPA)
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
// SOURCE 2 — NMDA: large Ca if local coincidence
if Vm > Mg_eject and astro_Dserine > thr and glutamate > 0:
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// POST → PRE (+): nNOS coupled to NMDA emits NO/BDNF — "your release was effective"
// backward brake to PRE (): strong depolarization → endocannabinoid (DSE)
if Vm > eCB_thr:
retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
// POST → PRE (): "I am over-driven — reduce release"
post_fast_trace *= decay(ms)
// CASE 1 — short-term potentiation: fill slots from private reserve (no dopamine)
// NOT generic fill(): rate is Ca-driven, and the else-branch is the STD consequence
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace),
post_structure.slot_ceiling) // private: spine endosomal reserve
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline) // STD = consequence
// interrupted success (LOCAL: my Ca was climbing toward a tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// CASE 2 — tagging CANDIDATE
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_budget -= pka_cost
dopamine *= decay(ms)
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag // STABLE
post_tag *= decay(hr)
DAY | bAP:
// SOURCE 3 — bAP: depolarization + Ca, amplifies existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
DAY | bAP:
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity,
dend_budget, geometry)
dend_budget -= prop_cost × reached
// interrupted success (LOCAL: my branch was strongly active)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_fast_trace *= decay(300ms)
dend_budget -= branch_Ca_cost
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
dend_fast_trace *= decay(300ms); dend_endurance_need *= decay(min)
refill(dend from astro_lactate[branch] + soma_ship_dend)
ship(dend_budget → post_budget, gap_to(post))
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
dend_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
dend_tag *= decay(hr)
if dend_tag > tag_expiry and dend_budget > translate_cost:
dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
```
---
## SOMA
```
DAY | AP:
threshold = soma_structure.baseline / (1) // baseline strength
× (1 + soma_adaptation)
× neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// interrupted success (LOCAL: nuclear Ca climbing toward CREB)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca() // → plasticity
soma_budget -= nuclear_cost
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
soma_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_tag *= decay(hr); soma_budget -= creb_cost
DAY | NOT_AP:
// bottom-up alignment: suprathreshold input during refractory (LOCAL)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
soma_adaptation *= decay(τ_adapt)
soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_endurance_need *= decay(min)
fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget) // private: own mitochondria, no external cost
branch_Vm = integrate(DEND.branch_Vm, branches)
ship(soma_budget → dend_budget, gap_to(dend))
ship(soma_budget → axon_budget, gap_to(axon))
```
---
## AXON
```
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
if axon_budget < prop_cost:
reliability *= budget_factor
// interrupted success (LOCAL: I was propagating a strong train)
if axon_fast_trace > traj_thr:
axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
axon_fast_trace *= decay(s); axon_endurance_need *= decay(min)
refill(axon from soma_ship_axon + astro_lactate[shaft])
ship(axon_budget → pre_budget, gap_to(pre))
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
axon_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
axon_tag *= decay(hr)
```
---
## ASTRO
```
DAY | CONTINUOUS:
astro_central_budget += glycolysis(glucose)·Δt // root, capped by glucose
// demand-weighted lactate allocation across territory
for each astrosynapse i:
demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand · lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor
astro_central_budget -= astro_lactate[i] × lactate_cost
// per-astrosynapse fast operation (synapse i)
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt
astro_central_budget -= clearance × EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
// interrupted success (LOCAL: I was under high demand)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
astro_Dserine[i] += got; astro_central_budget -= got × Ds_cost
drive_pre[i] *= brake // same signal, PRE brake
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
astro_possible_tag[i] *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
astro_tag[i] *= decay(hr)
astro_endurance_need[i] *= decay(min)
if astro_fast_trace[i] > overload: trigger(lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
Build ceilings (structure = strength, budget_ceiling = endurance) from DAY evidence.
Two economies (energy: astrocyte→astrosynapse ; material: soma→spine/bouton) compete.
Unmaintained ceilings decay; recovered material funds the rest.
---
## Step 1 — Replenish and distribute
```
NIGHT | 1:
// energy economy (astrocyte central → astrosynapses, tag-weighted)
astro_central_budget += overnight_glycolysis(glucose)·Δt
astro_central_energy += overnight_astro_energy()·Δt
astro_central_material += astro_cellbody_synth()·Δt
W = Σ astro_tag[i] over astro_tag[i] > tag_expiry
for each i with astro_tag[i] > tag_expiry:
w = astro_tag[i]/W
astro_energy[i] += astro_central_energy × w
astro_material[i] += astro_central_material × w
// material economy (soma → branch/axon → spine/bouton)
soma_budget += overnight_mito()·Δt
soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material × f_dend; axon_material += soma_material × f_axon
soma_material -= (f_dend + f_axon)·soma_material
post_material += dend_material × f_spine; dend_material -= f_spine·dend_material
pre_material += axon_material × f_bouton; axon_material -= f_bouton·axon_material
{pre,post,dend,axon}_energy += soma_energy × f_energy[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve × f[·]·Δt
```
## Step 2 — Strength commits (raise structure)
```
NIGHT | 2:
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? bonus : 1
for each component c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy × f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ × assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
// astro_structure self-reinforcing: higher → future LTP easier
```
## Step 2b — Endurance commits (raise budget_ceiling)
```
NIGHT | 2b:
// driven by endurance_need (interrupted local success), NO dopamine
// competes with step 2 for the SAME material + energy
for each component c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material × f_cap, c_energy × f_cap)
c_budget_ceiling += Δ
c_material -= Δ; c_energy -= Δ × biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
```
## Step 3 — Passive decay (both ceilings, by neglect)
```
NIGHT | 3:
remaining = total_material - consumed_by_commits
maint = remaining × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost:
structure += full_maint; budget_ceiling += full_cap_maint
else:
structure += maint × frac; budget_ceiling += maint × cap_frac
// both drift down — depotentiation / endurance-loss by neglect
for each synapse with net_change < 0:
rec = |net_change| × recycle
{pre,post,astro}_material += rec × frac // material recovered, energy not
```
## Step 4 — Homeostatic scaling
```
NIGHT | 4:
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse:
post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction × recycle
```
## Step 5 — Clear traces
```
NIGHT | 5:
all fast_trace = 0; all possible_tag = 0; all endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition; consumes budget; deposits fast_trace.
fast_trace + non-local coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
traces decay in NOT/CONTINUOUS contexts.
NIGHT tag → raise structure
endurance_need → raise budget_ceiling
both draw the SAME material + energy → strength and endurance compete
unmaintained ceilings decay → freed material funds the rest.
LOCALITY every evaluation uses only local state + arrived signals.
cross-compartment influence travels only as signals that become local.
```