From f60ab1a1da3dd883e9e92b27f64320e5649e7e97 Mon Sep 17 00:00:00 2001 From: ocrampal Date: Fri, 19 Jun 2026 11:16:56 +0200 Subject: [PATCH] v10 --- .../2026-06-19-biological-reference-v10.md | 244 ++++ .../2026-06-19-tripartite-synapse_v10.md | 432 +++++++ .../old/2026-06-15-tripartite_synapse_v8.md | 1035 +++++++++++++++++ 3 files changed, 1711 insertions(+) create mode 100644 elements/neuron/appunti/2026-06-19-biological-reference-v10.md create mode 100644 elements/neuron/appunti/2026-06-19-tripartite-synapse_v10.md create mode 100644 elements/neuron/appunti/old/2026-06-15-tripartite_synapse_v8.md diff --git a/elements/neuron/appunti/2026-06-19-biological-reference-v10.md b/elements/neuron/appunti/2026-06-19-biological-reference-v10.md new file mode 100644 index 0000000..6049eab --- /dev/null +++ b/elements/neuron/appunti/2026-06-19-biological-reference-v10.md @@ -0,0 +1,244 @@ +# 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, τ≈s–min +Graded accumulation of tagging eligibility. For POST, this is the CANDIDATE tag lifetime. + +### endurance_need (one per component) — intermediate, τ≈s–min +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. diff --git a/elements/neuron/appunti/2026-06-19-tripartite-synapse_v10.md b/elements/neuron/appunti/2026-06-19-tripartite-synapse_v10.md new file mode 100644 index 0000000..2cdcbf2 --- /dev/null +++ b/elements/neuron/appunti/2026-06-19-tripartite-synapse_v10.md @@ -0,0 +1,432 @@ +# 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 ms–s, biases next behavior + possible_tag accumulates from fast_trace, decays in s–min + endurance_need accumulates on interrupted local success, decays in s–min + +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. +``` + +--- + +## 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 +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. + +--- + +## Shared competitive replenishment (used by all NOT contexts) + +``` +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 +``` + +--- + +## PRE + +``` +DAY | AP: + if pre_budget < release_cost: + suppress(NT_flux) + if pre_fast_trace > traj_thr: // LOCAL success: I released strongly + pre_endurance_need += pre_fast_trace × (1 + retrograde_local) + exit + pre_fast_trace += spike_Ca(input_freq); pre_fast_trace *= decay(100ms) + drive = sat(pre_fast_trace, K_release) + if RRP > 0: + NT_flux = RRP × drive + glutamate += NT_flux·Δt; RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost + RRP += min(refill_rate, pre_structure.refill_ceiling)·Δt + RRP = clamp(RRP, 0, pre_structure.slot_ceiling) + pre_budget -= RRP_refill·vatpase_cost + if glutamate > spillover: drive *= brake + +DAY | NOT_AP: + pre_fast_trace *= decay(100ms); pre_endurance_need *= decay(min) + refill(pre from astro_lactate[syn] + axon_ship_pre) + RRP += min(refill_rate, pre_structure.refill_ceiling)·Δt + RRP = clamp(RRP, 0, pre_structure.slot_ceiling) + if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace + pre_possible_tag *= decay(s); dopamine *= decay(ms) + if dopamine > dop_thr and pre_possible_tag > tag_thr: + pre_tag += dopamine × pre_possible_tag + pre_tag *= decay(hr) +``` + +--- + +## 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 + + post_fast_trace *= decay(ms) + + // CASE 1 — short-term potentiation: fill slots (no dopamine) + 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) // 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) + soma_budget += mito_output·Δt // self-replenish (root) + 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. +``` diff --git a/elements/neuron/appunti/old/2026-06-15-tripartite_synapse_v8.md b/elements/neuron/appunti/old/2026-06-15-tripartite_synapse_v8.md new file mode 100644 index 0000000..4e77ad9 --- /dev/null +++ b/elements/neuron/appunti/old/2026-06-15-tripartite_synapse_v8.md @@ -0,0 +1,1035 @@ +--- +include_toc: true +--- + +# Tripartite Synapse — Pseudocode v8 + +## Unifying principles + +``` +1. CAPACITY vs OCCUPANCY + NIGHT builds containers (raises structural ceilings). + DAY fills containers (occupancy driven by calcium / activity). + Short-term potentiation = filling containers (fast, reversible, no dopamine). + Short-term depression = containers emptying when the driving signal decays + (passive consequence — never explicit). + +2. TWO PLASTICITY CASES (applies to every component) + Ca²⁺ high → short-term potentiation (fill slots, DAY, local) + Ca²⁺ high + dopamine → set tag → NIGHT raises the slot ceiling (long-term) + +3. THREE COMPETITIVE ECONOMIES, all capped by vascular_glucose_supply + Energy economy: astrocyte cell body → astrosynapses → synaptic budgets (DAY + NIGHT) + Material economy: soma → branches/axon → spines/boutons (NIGHT) + Each: central producer, capped output, demand/tag-weighted distribution. + +4. ABSTRACT BEHAVIORAL PATTERN (every component, every context) + given STRUCTURE (ceiling from last NIGHT) + in CONTEXT (local/global trigger) + if BUDGET sufficient → behavior runs, consumes budget, deposits FAST_TRACE + FAST_TRACE biases next behavior + creates tagging eligibility + eligibility + non-local coincidence → TAG (survives to NIGHT) + traces decay in NOT contexts (depotentiation by neglect, never explicit) + +5. SATURATING RESPONSE FORM (used everywhere a graded signal drives output) + response = signal / (K + signal) + little output at low signal, proportional in middle, saturates when high. + +6. DAY vs NIGHT variable naming + DAY: {component}_budget (fast energy + fast consumables, one variable) + NIGHT: {component}_energy (assembly ATP, NOT recoverable) + {component}_material (structural proteins, RECOVERABLE after LTD) +``` + +--- + +## Part 1 — Conventions + +``` +SCOPE = { DAY, NIGHT } +CONTEXT = { AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS } +COMPONENTS = { PRE, POST, DEND, SOMA, AXON, ASTRO } + +FIXED = imposed externally — constant during run +VAR = changes dynamically +FAST_TRACE = DAY only, decays automatically, biases next behavior +TAG = DAY→NIGHT bridge, decays slowly, gates structural commit + POST: CANDIDATE → STABLE phases +BUDGET = DAY operational resource (energy + consumables) +ENERGY = NIGHT assembly ATP (not recoverable) +MATERIAL = NIGHT structural proteins (recoverable after LTD) +STRUCTURE = capacity ceiling; READ in DAY, WRITTEN in NIGHT +``` + +--- + +## Part 2 — Fixed Parameters + +``` +// Saturation half-points (Option 2 form: x/(K+x)) +FIXED K_Ca_release // half-max Ca²⁺ for NT release +FIXED K_glu_AMPA // half-max glutamate for AMPA current +FIXED K_Ca_Dserine // half-max astro Ca²⁺ for D-serine release + +// Thresholds +FIXED Mg_eject_threshold // Vm to eject NMDA Mg²⁺ block +FIXED Ca_STP_threshold // Ca²⁺ for short-term potentiation (fill slots) +FIXED Ca_TAG_threshold // Ca²⁺ for tagging eligibility +FIXED eligibility_threshold +FIXED dopamine_threshold +FIXED tagging_threshold +FIXED tag_expiry_threshold +FIXED spillover_threshold +FIXED inactivation_threshold // soma Na⁺ inactivation gating refractory +FIXED homeostatic_ceiling +FIXED structural_decay_rate +FIXED recycling_fraction + +// Organism-level signals (externally driven) +FIXED dopamine_level +FIXED NE_level +FIXED ACh_level + +// Physical +FIXED vascular_glucose_supply // hard ceiling — root of energy economy +FIXED branch_geometry // bAP attenuation profile +``` + +--- + +## Part 3 — Resource Variables + +``` +// ── DAY BUDGETS (energy + fast consumables) ─────────────────────────── +VAR astro_budget // ROOT: glycolysis from vascular_glucose_supply (self-produced) +VAR pre_budget // from astro_lactate (primary) + axon shipment (secondary) +VAR post_budget // from astro_lactate (primary) + dend shipment (secondary) +VAR dend_budget // from astro_lactate (primary) + soma shipment (secondary) +VAR soma_budget // ROOT: own mitochondria (self-produced) +VAR axon_budget // from soma shipment (primary) + astro_lactate (secondary) + +// ── ENERGY ECONOMY: astrocyte central → astrosynapses ───────────────── +VAR astro_central_budget // cell body lactate production (DAY) +VAR astro_central_energy // cell body assembly ATP (NIGHT) +VAR astro_central_material // cell body structural proteins (NIGHT) +VAR astro_lactate[i] // demand-weighted export to synapse i (DAY) + +// ── NIGHT ENERGY (assembly ATP, not recoverable) ────────────────────── +VAR pre_energy, post_energy, dend_energy, soma_energy, axon_energy, astro_energy + +// ── NIGHT MATERIAL (structural proteins, recoverable) ───────────────── +VAR soma_material // ROOT: CREB-driven synthesis (soma_tag gated) +VAR dend_material // from soma_material +VAR post_material // from dend_material +VAR axon_material // from soma_material +VAR pre_material // from axon_material +VAR astro_material // from astro_central_material +``` + +--- + +## Part 4 — Structural Variables (capacity ceilings, WRITTEN in NIGHT) + +``` +VAR pre_structure // docking_slot_ceiling + VGCC_coupling + refill_ceiling +VAR post_structure // anchoring_slot_ceiling + spine_volume + reserve_ceiling +VAR dend_structure // bAP_fidelity(position) + translation_ceiling +VAR soma_structure // baseline_threshold⁻¹ + AP_reliability + synthesis_ceiling +VAR axon_structure // propagation_reliability + transport_ceiling +VAR astro_structure // perisynaptic_distance⁻¹ + EAAT_density + D_serine_tonic + // + ECM_integrity (SELF-REINFORCING both directions) +``` + +--- + +## Part 5 — Trace Variables + +``` +FAST_TRACE pre_fast_trace // residual Ca²⁺ τ≈100ms +FAST_TRACE post_fast_trace // spine Ca²⁺ × rise_speed τ≈tens ms +FAST_TRACE dend_fast_trace // branch Ca²⁺ τ≈300ms +FAST_TRACE soma_fast_trace // nuclear Ca²⁺ τ≈seconds +FAST_TRACE axon_fast_trace // propagation load τ≈seconds +FAST_TRACE astro_fast_trace // perisynaptic Ca²⁺ τ≈seconds + +// soma timing traces (emergent refractory + adaptation) +FAST_TRACE soma_Na_inactivation // fast — gates refractory τ≈ms +FAST_TRACE soma_adaptation // slow — spike-train threshold τ≈100s of ms +FAST_TRACE soma_refractory_alignment // bottom-up input-alignment trace + +VAR {component}_possible_tagging // intermediate τ≈seconds–minutes +TAG {component}_tag // slow τ≈hours; POST has CANDIDATE→STABLE +``` + +--- +--- +# SCOPE: DAY +Execution contexts consume budget, deposit traces, fill slots (occupancy). +NOT contexts replenish budget, ship downstream, decay traces, set tags. +STRUCTURE is READ only. + +--- + +## PRE + +### CONTEXT: AP +``` +scope DAY | context AP: + + if pre_budget < AP_release_cost: + suppress(NT_flux); exit context // depleted bouton silent + + // Fast trace: residual Ca²⁺ + pre_fast_trace += spike_Ca_influx(input_freq) + pre_fast_trace *= decay(τ=100ms) + pre_budget -= Ca_handling_cost + + // NT flux — saturating Ca²⁺ drive (Option 2) × current vesicle occupancy + Ca_drive = pre_fast_trace / (K_Ca_release + pre_fast_trace) + if RRP_level > 0: + NT_flux = RRP_level × Ca_drive + glutamate += NT_flux × Δt + RRP_level -= NT_flux × Δt // occupancy falls (STD consequence) + pre_budget -= NT_flux × fusion_cost + + // Refill docking slots — bounded by pre_structure ceiling (DAY fills NIGHT's container) + RRP_refill = min(refill_rate_constant, pre_structure.refill_ceiling) + RRP_level += RRP_refill × Δt + RRP_level = clamp(RRP_level, 0, pre_structure.docking_slot_ceiling) + pre_budget -= RRP_refill × VATPase_cost // throttled if budget low → STD deepens + + // Overflow brake (mGluR2/3 Gi) — cross-compartment, no pre cost + if glutamate > spillover_threshold: + Ca_drive *= mGluR_brake_factor +``` + +### CONTEXT: NOT_AP +``` +scope DAY | context NOT_AP: + + pre_fast_trace *= decay(τ=100ms) + + // Budget replenishment — two sources + pre_budget += astro_lactate[this_synapse] × pre_fraction // primary, fast, local + pre_budget += axon_shipment_to_pre // secondary, from soma via axon + + // Docking slots refill toward ceiling (STP recovery) + RRP_refill = min(refill_rate_constant, pre_structure.refill_ceiling) + RRP_level += RRP_refill × Δt + RRP_level = clamp(RRP_level, 0, pre_structure.docking_slot_ceiling) + pre_budget -= RRP_refill × VATPase_cost + + // Tagging: eligibility (local) + dopamine (non-local) coincide + if pre_fast_trace > eligibility_threshold: + pre_possible_tagging += pre_fast_trace + pre_possible_tagging *= decay(τ=seconds) + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and pre_possible_tagging > tagging_threshold: + pre_tag += dopamine_local × pre_possible_tagging + pre_tag *= decay(τ=hours) +``` + +--- + +## POST +Three calcium sources, two plasticity cases + +``` +// Ca²⁺ sources (all feed post_fast_trace): +// 1. AMPA opens → small Ca²⁺ + depolarization (begins ejecting Mg²⁺) +// 2. NMDA opens → large Ca²⁺ (needs: NT bound + D-serine + Mg²⁺ ejected) +// 3. bAP arrives → Ca²⁺ via VDCC + further depolarization +// +// Case 1 (DAY, local): Ca²⁺ high → fill anchoring slots (STP) +// Case 2 (DAY→NIGHT): Ca²⁺ high + dopamine → tag → NIGHT raises slot ceiling +// Depression: surface AMPA drift back to reserve when Ca²⁺ decays (consequence) +``` + +### CONTEXT: NOT_bAP +``` +scope DAY | context NOT_bAP: + + post_budget += astro_lactate[this_synapse] × post_fraction + post_budget += dend_shipment_to_post + + // SOURCE 1: AMPA opens — current + small Ca²⁺ + starts Mg²⁺ ejection + // current saturates with glutamate (Option 2), scaled by surface AMPA occupancy + AMPA_drive = glutamate / (K_glu_AMPA + glutamate) + AMPA_current = AMPA_drive × AMPA_surface // AMPA_surface = current occupancy + Vm += AMPA_current + post_fast_trace += AMPA_Ca_fraction × AMPA_current + post_budget -= AMPA_current_cost + + // SOURCE 2: NMDA opens — large Ca²⁺ if coincidence holds + if Vm > Mg_eject_threshold and astro_D_serine > D_serine_threshold and glutamate > 0: + Ca_influx = NMDA_Ca_influx(glutamate) + post_fast_trace += Ca_influx × rise_speed(Ca_influx) + post_budget -= NMDA_current_cost + + post_fast_trace *= decay(τ=tens_ms) + + // CASE 1 — SHORT-TERM POTENTIATION (no dopamine needed) + // Ca²⁺ high → pull AMPA from reserve to surface, bounded by slot ceiling + if post_fast_trace > Ca_STP_threshold: + AMPA_surface = min(AMPA_surface + Ca_driven_insertion(post_fast_trace), + post_structure.anchoring_slot_ceiling) // DAY fills NIGHT's container + post_budget -= AMPA_trafficking_cost + else: + // CONSEQUENCE — depression: receptors drift back to reserve as Ca²⁺ low + AMPA_surface = max(AMPA_surface - passive_drift_rate × Δt, baseline_surface) + // not explicit, not signaled — pure relaxation toward baseline occupancy + + // CASE 2 — tagging for long-term (CANDIDATE) + if post_fast_trace > Ca_TAG_threshold: + post_possible_tagging += post_fast_trace + post_possible_tagging *= decay(τ=minutes) // CANDIDATE lifetime + post_budget -= PKA_priming_cost + + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and post_possible_tagging > tagging_threshold: + post_tag += dopamine_local × post_possible_tagging // STABLE + post_tag *= decay(τ=hours) +``` + +### CONTEXT: bAP +``` +scope DAY | context bAP: + + // SOURCE 3: bAP — depolarization + Ca²⁺, amplifies existing signal + Vm += bAP_depolarization × dend_structure.bAP_fidelity + post_budget -= bAP_reset_cost + if post_possible_tagging > Ca_TAG_threshold: // coincidence: bAP finds CANDIDATE + post_fast_trace += bAP_Ca_boost() // supralinear summation > Ca_HIGH + // bAP alone with no prior Ca²⁺ → no boost, no tag (timing enforced by trace decay) +``` + +--- + +## DEND + +### CONTEXT: bAP +``` +scope DAY | context bAP: + + bAP_local = propagate_bAP(SOMA.AP_fired, dend_structure.bAP_fidelity, branch_geometry) + dend_budget -= bAP_propagation_cost + dend_fast_trace += bAP_Ca_influx(bAP_local) + spine_Ca_spillover(active_spines) + dend_fast_trace *= decay(τ=300ms) + dend_budget -= branch_Ca_handling_cost + branch_Vm = integrate(POST.Vm, all_spines) + dend_budget -= integration_cost +``` + +### CONTEXT: NOT_bAP +``` +scope DAY | context NOT_bAP: + + dend_fast_trace *= decay(τ=300ms) + + // Replenish (from soma + astrocyte), then ship to spines + dend_budget += soma_shipment_to_dend + astro_lactate[this_branch] × dend_fraction + dend_shipment_to_post = min(dend_budget × post_delivery_fraction, post_demand) + post_budget += dend_shipment_to_post + dend_budget -= dend_shipment_to_post + + // Tagging + if dend_fast_trace > eligibility_threshold: + dend_possible_tagging += dend_fast_trace + dend_possible_tagging *= decay(τ=seconds) + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and dend_possible_tagging > tagging_threshold: + dend_tag += dopamine_local × dend_possible_tagging + dend_tag *= decay(τ=hours) + + // Local translation (fills dend capacity faster) if tagged + budget + if dend_tag > tag_expiry_threshold and dend_budget > translation_cost: + dend_budget -= translation_cost // uses fast mRNA consumables in budget + + commit_threshold *= 1 / (1 + ACh_level × ACh_gain) +``` + +--- + +## SOMA +Emergent refractory + adaptation + bottom-up input alignment + +### CONTEXT: AP +``` +scope DAY | context AP: + + // Threshold = baseline(structure) raised by adaptation + neuromodulators + effective_threshold = soma_structure.baseline_threshold + × (1 + soma_adaptation) + × neuromod_factor(NE_level, ACh_level) + can_fire = (soma_Na_inactivation < inactivation_threshold) // refractory = emergent + + if branch_Vm > effective_threshold and can_fire: + AP_fired = True + soma_budget -= AP_generation_cost + + // Deposit three traces from one AP: + soma_Na_inactivation += AP_amplitude // fast → refractory gating + soma_adaptation += AP_contribution // slow → spike-train threshold rise + soma_fast_trace += nuclear_Ca_influx() // slow → plasticity tagging + soma_budget -= nuclear_Ca_handling_cost + + if soma_fast_trace > eligibility_threshold: + soma_possible_tagging += soma_fast_trace + soma_possible_tagging *= decay(τ=seconds) + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and soma_possible_tagging > tagging_threshold: + soma_tag += dopamine_local × soma_possible_tagging + soma_tag *= decay(τ=hours) + soma_budget -= CREB_phosphorylation_cost +``` + +### CONTEXT: NOT_AP +``` +scope DAY | context NOT_AP: + + // BOTTOM-UP ALIGNMENT: suprathreshold input during refractory = missed coincidence + // leaves a trace that speeds future recovery (potentiation of recovery, DAY) + if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold: + soma_refractory_alignment += (branch_Vm - effective_threshold) × soma_Na_inactivation + + // Recovery biased by alignment trace; alignment decays (depotentiation by neglect) + recovery_rate = base_recovery_rate × (1 + soma_refractory_alignment) + soma_Na_inactivation *= decay(τ_Na / recovery_rate) + soma_adaptation *= decay(τ_adaptation) + soma_fast_trace *= decay(τ_nuclear) + soma_refractory_alignment *= decay(τ_alignment) // self-limiting equilibrium + + // Self-replenish (own mitochondria) — soma is a root + soma_budget += mitochondria_output_rate × Δt + branch_Vm = integrate(DEND.branch_Vm, all_branches) + + // Ship budget downstream + soma_shipment_to_dend = min(soma_budget × dend_delivery_fraction, dend_demand(dend_tag)) + dend_budget += soma_shipment_to_dend; soma_budget -= soma_shipment_to_dend + shipping_cost + soma_shipment_to_axon = min(soma_budget × axon_delivery_fraction, axon_demand(axon_tag)) + axon_budget += soma_shipment_to_axon; soma_budget -= soma_shipment_to_axon + shipping_cost +``` + +--- + +## AXON + +### CONTEXT: AP +``` +scope DAY | context AP: + + propagation_reliability = axon_structure.propagation × (1 - failure_rate(axon_fast_trace)) + APs_delivered = AP_fired × propagation_reliability + axon_budget -= AP_propagation_cost × APs_delivered + axon_fast_trace += APs_delivered + axon_fast_trace *= decay(τ=seconds) // high load → failure → axonal STD +``` + +### CONTEXT: NOT_AP +``` +scope DAY | context NOT_AP: + + axon_fast_trace *= decay(τ=seconds) + axon_budget += soma_shipment_to_axon + astro_lactate[shaft] × axon_fraction + + // Ship to boutons + axon_shipment_to_pre = min(axon_budget × pre_delivery_fraction, pre_demand(pre_tag)) + pre_budget += axon_shipment_to_pre; axon_budget -= axon_shipment_to_pre + axon_shipping_cost + + if axon_fast_trace > eligibility_threshold: + axon_possible_tagging += axon_fast_trace + axon_possible_tagging *= decay(τ=seconds) + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and axon_possible_tagging > tagging_threshold: + axon_tag += dopamine_local × axon_possible_tagging + axon_tag *= decay(τ=hours) +``` + +--- + +## ASTRO +Demand-weighted energy distribution across the territory + +### CONTEXT: CONTINUOUS +``` +scope DAY | context CONTINUOUS: + + // ROOT production at cell body — capped by vasculature + astro_central_budget += glycolysis(vascular_glucose_supply) × Δt + + // DEMAND-WEIGHTED LACTATE ALLOCATION across all astrosynapses i + // demand rises with clearance load (activity) AND delivery efficiency (structure) + for each astrosynapse i in territory: + demand[i] = clearance_load[i] × astro_structure[i].delivery_efficiency + total_demand = sum(demand) + allocation_factor = min(1, astro_central_budget / (total_demand × lactate_cost + ε)) + for each astrosynapse i: + astro_lactate[i] = demand[i] × allocation_factor // slow synapse → low demand → little fuel + astro_central_budget -= astro_lactate[i] × lactate_cost + // delivered to that synapse's pre/post/dend budgets in their NOT contexts + + // Per-astrosynapse fast operation (one synapse i shown) + glutamate[i] -= astro_structure[i].EAAT_density × glutamate[i] × Δt // clearance + astro_central_budget -= clearance × EAAT_ATP_cost + astro_D_serine[i] += astro_structure[i].D_serine_tonic × Δt // tonic baseline + + if glutamate[i] > spillover_threshold: + astro_fast_trace[i] += mGluR5_Ca_influx() + astro_fast_trace[i] *= decay(τ=seconds) + // D-serine pulse — saturating in astro Ca²⁺ (Option 2), budget-limited + Ds_drive = astro_fast_trace[i] / (K_Ca_Dserine + astro_fast_trace[i]) + D_serine_pulse = min(Ds_drive × Ds_max, astro_central_budget × Ds_fraction) + astro_D_serine[i] += D_serine_pulse + astro_central_budget -= D_serine_pulse × Ds_synthesis_cost + Ca_drive_pre[i] *= mGluR_brake_factor // simultaneous PRE brake + + if astro_fast_trace[i] > eligibility_threshold: + astro_possible_tagging[i] += astro_fast_trace[i] + astro_possible_tagging[i] *= decay(τ=seconds) + dopamine_local *= decay(τ=hundreds_ms) + if dopamine_local > dopamine_threshold and astro_possible_tagging[i] > tagging_threshold:varie + astro_tag[i] += dopamine_local × astro_possible_tagging[i] + astro_tag[i] *= decay(τ=hours) + + if astro_fast_trace[i] > OVERLOAD_threshold: + trigger(shockwave_lockdown) +``` + +--- +--- +# SCOPE: NIGHT +NIGHT builds containers (raises ceilings). Budgets/energy/material replenished. +Tags evaluated and cleared. Depotentiation = unmaintained decay (never explicit). + +--- + +## Step 1 — Replenish & Distribute (two economies) + +``` +scope NIGHT | step 1: + + // ── ENERGY ECONOMY: astrocyte cell body → astrosynapses ───────────── + astro_central_budget += overnight_glycolysis(vascular_glucose_supply) × Δt_night + astro_central_energy += overnight_astro_energy_synthesis() × Δt_night + astro_central_material += astrocyte_cellbody_synthesis() × Δt_night + + // distribute to tagged astrosynapses by astro_tag-weighted competition + total_w = sum(astro_tag[i] for taggable i) + for each astrosynapse i with astro_tag[i] > tag_expiry_threshold: + w = astro_tag[i] / total_w + astro_energy[i] += astro_central_energy × w + astro_material[i] += astro_central_material × w + astro_central_energy -= astro_energy[i]; astro_central_material -= astro_material[i] + + // ── MATERIAL ECONOMY: soma → branches/axon → spines/boutons ───────── + soma_budget += overnight_mitochondria_output() × Δt_night + soma_energy += overnight_soma_energy_reserve() × Δt_night + soma_material += CREB_driven_synthesis(soma_tag) × Δt_night // bottleneck, soma_tag gated + + dend_material += soma_material × dend_material_fraction + axon_material += soma_material × axon_material_fraction + soma_material -= (dend_material_fraction + axon_material_fraction) × soma_material + post_material += dend_material × spine_material_fraction; dend_material -= ... + pre_material += axon_material × bouton_material_fraction; axon_material -= ... + + // downstream assembly energy from soma; next-DAY budgets pre-loaded from astrocyte + {pre,post,dend,axon}_energy += soma_energy × {..}_energy_fraction + {pre,post,dend,axon}_budget += astro_lactate_reserve × {..}_fraction × Δt_night +``` + +## Step 2 — Structural Commits (build containers; parallel, independent) + +``` +scope NIGHT | step 2: + + coherence_bonus = (pre_tag, post_tag, astro_tag all > tag_expiry_threshold) + ? coherence_factor : 1.0 + + // each commit RAISES A CEILING (capacity), gated by tag, material, energy + // DAY then fills the raised ceiling via calcium-driven occupancy + + if pre_tag > tag_expiry_threshold: + Δ = min(slot_cost, pre_material, pre_energy × pre_fraction) + pre_structure.docking_slot_ceiling += Δ × coherence_bonus // MORE slots, not more vesicles + pre_material -= Δ; pre_energy -= Δ × assembly_cost + if Δ < slot_cost: queue(pre_deficit → next NIGHT) + + if post_tag > tag_expiry_threshold: + Δ = min(slot_cost, post_material, post_energy × post_fraction) + post_structure.anchoring_slot_ceiling += Δ × coherence_bonus // MORE slots for DAY to fill + post_material -= Δ; post_energy -= Δ × assembly_cost + if Δ < slot_cost: queue(post_deficit → next NIGHT) + + if dend_tag > tag_expiry_threshold: + Δ = min(branch_cost, dend_material, dend_energy × dend_fraction) + dend_structure += Δ × coherence_bonus + dend_material -= Δ; dend_energy -= Δ × assembly_cost + + if soma_tag > tag_expiry_threshold: + Δ = min(soma_cost, soma_material, soma_energy × soma_fraction) + soma_structure += Δ + soma_material -= Δ; soma_energy -= Δ × assembly_cost + + if axon_tag > tag_expiry_threshold: + Δ = min(axon_cost, axon_material, axon_energy × axon_fraction) + axon_structure += Δ + axon_material -= Δ; axon_energy -= Δ × assembly_cost + + if astro_tag[i] > tag_expiry_threshold: + Δ = min(process_cost, astro_material[i], astro_energy[i] × astro_fraction) + astro_structure[i] += Δ × coherence_bonus // walls IN, ECM, D-serine tonic ↑ + astro_material[i] -= Δ; astro_energy[i] -= Δ × assembly_cost + // SELF-REINFORCING: higher astro_structure → future LTP easier +``` + +## Step 3 — Passive Depotentiation (unmaintained decay) + +``` +scope NIGHT | step 3: + + remaining_material = total_material_pool - material_consumed_by_commits + maintenance_per_syn = remaining_material × maintenance_fraction / synapse_count + + for each synapse: + // all ceilings decay + {pre,post,dend,astro}_structure -= structural_decay_rate × Δt_night + // maintenance counters decay only where resources suffice + if maintenance_per_syn >= maintenance_cost: + {pre,post,dend,astro}_structure += full_maintenance // stable + else: + {pre,post,dend,astro}_structure += maintenance_per_syn × fractions + // shortfall → ceilings drift down → DEPOTENTIATION BY NEGLECT + + // material (not energy) recovered from shrinking structures → back to pools + for each synapse with net_structure_change < 0: + recovered = |net_structure_change| × recycling_fraction + {pre,post,astro}_material += recovered × fractions +``` + +## Step 4 — Homeostatic Scaling + +``` +scope NIGHT | step 4: + + if soma_tag > homeostatic_ceiling: + s = homeostatic_ceiling / soma_tag + for each synapse: + post_structure.anchoring_slot_ceiling *= s + pre_structure.docking_slot_ceiling *= s + soma_material += sum(ceiling_reduction) × recycling_fraction +``` + +## Step 5 — Clear Traces + +``` +scope NIGHT | step 5: + + all fast_traces = 0 + all possible_tagging = 0 + soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0 + for each tag: if tag < tag_expiry_threshold: tag = 0 // else carry to next NIGHT +``` + +--- + +## Summary — the model in one view + +``` +DAY fills containers (occupancy ↑ with Ca²⁺, ↓ when Ca²⁺ decays = STP/STD) + consumes budget; budget from astrocyte (demand-weighted) + soma shipments + deposits fast traces; eligibility + dopamine coincidence → tags +NIGHT builds containers (ceilings ↑) for tagged synapses, by two competing economies: + energy (astrocyte→astrosynapse) and material (soma→spine/bouton) + unmaintained ceilings decay → depotentiation by neglect + recovered material funds neighbors → conservation across the territory + +Joint criterion to be remembered: + active enough to be FUELED (win energy economy, generate Ca²⁺ + clearance demand) + + significant enough to be TAGGED (Ca²⁺ + dopamine coincidence) + → container built in NIGHT, filled in DAY, maintained while still earning resources +``` + + + +--- +--- +--- + +# Flows + +Per ora abbiamo in DAY il {component}_budget che raggruppa energy e material, e in NIGHT {component}_energy e {component}_material. + +This maps onto a real biological distinction. The astrocyte's lactate and the soma's ATP fund the running costs of the cell — everything that needs to happen just to keep the system operating from moment to moment. CREB-driven protein synthesis funds the capital investment — the slow, expensive structural changes that modify what the running system is capable of. These are two different budgets in the biological sense: operating expenditure versus capital expenditure. Combining them within DAY is correct because DAY is entirely operating expenditure. Keeping them separate in NIGHT is correct because NIGHT mixes operating expenditure with capital expenditure, and only the capital component is recoverable. + +Combining {component}_energy e {component}_material would hide the fact that dismantling a structure recovers biological building blocks but not the work that was done to assemble them — which is the thermodynamic reality of any construction and deconstruction process. + + +## Energy flow + +``` +VASCULAR SUPPLY + → ASTROCYTE CELL BODY + glucose → lactate (glycolysis) + → astro_budget (local ATP for clearance, D-serine, ECM, process motility) + → lactate exported to: + → pre_budget (ATP for VGCC, vesicle fusion, VATPase) + → post_budget (ATP for NaK pump, AMPA trafficking, actin) + → dend_budget (ATP for bAP propagation, local translation) + + → SOMA + soma has own mitochondria — partly self-fueled + soma_budget (ATP for AP generation, CREB, protein synthesis, shipping) + → dend_budget top-up (organelle delivery) + → axon_budget top-up (transport machinery) +``` + +## Material flow + +``` +SOMA + protein synthesis (CREB-driven, peaks in NIGHT) + → soma_material (receptors, scaffold proteins, organelles, mRNA) + → dend_material (branch receives proteins + mRNA from soma) + → post_material (spine receives receptors + actin from branch) + → axon_material (boutons receive AZ proteins + VGCCs from soma via axon) + → pre_material (bouton active zone proteins) + +ASTROSYNAPSE + ECM proteins synthesized in astrocyte cell body + → astro_material (Glypicans, Thrombospondins, serine for D-serine) + → cleft environment (ECM sealing, D-serine availability) +``` + +Yes, exactly. This is the essential abstract pattern. Let me state it precisely. + +# The Abstract Pattern + +A component operates within a structure set by the previous NIGHT. During DAY, in each context, it executes behaviors that cost budget and deposit fast traces. Fast traces are local records of recent activity that bias the next behavior and open an eligibility window for tagging. A tag forms when a local eligibility signal coincides with one or more non-local validation signals within the decay window of the trace — the number of required coincidences reflecting the spatial scale at which that component sits in the system. In contexts without triggering input, all traces decay, closing the windows they opened. At NIGHT, the tag magnitude drives a structural commit proportional to available material and energy — material being recoverable and energy not — with the structural change becoming the new ceiling within which the next DAY's behaviors will operate. What is not committed decays for lack of maintenance, and the resources freed by that decay partially fund the potentiation of what was. + +## DAY — The General Form + +Every DAY behavior follows this template: + +``` +given: STRUCTURE // the architectural ceiling left by NIGHT +in: CONTEXT // local or global triggering condition +if: BUDGET > cost // operational resources available +then: behavior executes + BUDGET -= cost // resources consumed + FAST_TRACE += f(behavior) // local record deposited +``` + +The fast trace then drives two parallel processes: + +**Within the same context** — the trace biases the next execution of the same behavior. This is the short-term modulation loop. It is entirely local and requires no external signal. + +**Across contexts** — the trace accumulates into `possible_tagging` when it exceeds the eligibility threshold. This is the bridge toward long-term change. It requires the trace to be sustained enough to survive into the NOT_AP or CONTINUOUS context. + +### The Tag Formation — Where Non-Locality Enters + +The abstract pattern for tag formation generalizes across all components but with different **coincidence requirements**: + +**PRE, DEND, SOMA, AXON, ASTRO — one non-local coincidence:** +``` +if FAST_TRACE > eligibility // local: this bouton was recently active + AND dopamine > threshold // non-local: organism-level reward signal +then: TAG += dopamine × possible_tagging +``` +One spatial scale beyond the local component is required. The organism must confirm that the recent activity was worth saving. + +**POST — two non-local coincidences:** +``` +// First coincidence (NOT_bAP context): +if FAST_TRACE > Ca_TAG_threshold // local: spine Ca²⁺ was high + AND D-serine > threshold // non-local 1: astrosynapse co-agonist +then: post_possible_tagging += FAST_TRACE // CANDIDATE + +// Second coincidence (bAP context): +if post_possible_tagging > threshold // local: CANDIDATE still present + AND bAP arrives // non-local 2: soma fired +then: FAST_TRACE amplified above Ca_HIGH + +// Tag stabilization (any context): +if post_possible_tagging > threshold // local: confirmed coincidence + AND dopamine > threshold // non-local 3: organism validation +then: TAG += dopamine × post_possible_tagging // STABLE +``` +Three spatial scales must align: astrosynapse, soma, organism. The postsynapse is the most constrained component — it requires the most non-local validation before committing. + +### Trace Recession — The Temporal Behavior + +In every NOT_AP or CONTINUOUS context, all traces decay: + +``` +FAST_TRACE *= decay(τ_fast) // ms to seconds — closes eligibility window +possible_tagging *= decay(τ_mid) // seconds to minutes — closes tagging window +TAG *= decay(τ_slow) // hours — closes commitment window +``` + +The decay is not a separate behavior — it is the passive consequence of molecular processes. But its effect is behavioral: it enforces that coincidences must happen within specific time windows. The system does not check timing explicitly — timing is enforced by the competition between accumulation and decay. + +## NIGHT — The General Form + +``` +given: TAG // strength of DAY evidence for this component + STRUCTURE // current architectural state +if: TAG > threshold // evidence strong enough to justify investment +then: + Δstructure = min(expansion_cost, + MATERIAL, // slow structural resources available + ENERGY × fraction) // assembly ATP available + STRUCTURE += Δstructure × coherence_bonus + MATERIAL -= Δstructure // RECOVERABLE after LTD + ENERGY -= Δstructure × ATP_cost // NOT recoverable +``` + +The coherence bonus appears when pre, post, and astro tags are all SET simultaneously — the three components of the synapse have all independently gathered evidence for the same structural change, which amplifies the commit beyond what any single tag would produce alone. + +What is not potentiated passively decays: + +``` +STRUCTURE -= decay_rate × Δt_night +STRUCTURE += min(maintenance_allocation, maintenance_cost) +// if maintenance_allocation < decay_rate × Δt_night: +// structure drifts down — depotentiation by neglect +``` + +# More details + +## SOMA + +### The Abstract Pattern Applied to Soma Timing + +The abstract pattern says: a behavior deposits a trace, the trace decays, and the trace biases the next behavior. For the soma, the AP is the behavior, and **the refractory period and threshold elevation should both be consequences of a single trace deposited by the AP, decaying back toward baseline**. Neither should be a hardcoded duration — both should emerge from the return of the trace to resting conditions. + +--- + +Yes, this is much more consistent with the rest of the architecture. The soma should not compute an explicit rhythm estimate and predict the next input — that is top-down. Instead, the **mismatch itself leaves a trace**, and that trace adjusts the refractory dynamics. Let me think through this carefully. + +--- + +### The Bottom-Up Mechanism + +The key event is: **a dendritic input arrives strong enough to fire the soma, but the soma is still refractory.** This is a missed opportunity — the input wanted to fire the cell, but the cell was not ready. This mismatch is the signal. + +Each time this happens, it should leave a trace that biases the refractory dynamics toward recovering faster in that timing window — so that next time an input arrives at that phase, the soma is ready. This is potentiation of the refractory recovery, occurring within DAY, driven entirely by the local coincidence of "input wanted to fire" and "soma was not ready." + +``` +scope DAY | context NOT_AP (within refractory): + + // Detect the mismatch: suprathreshold input during refractory + if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold: + // Input arrived but soma could not fire — missed coincidence + refractory_alignment_trace += (branch_Vm - effective_threshold) + × soma_Na_inactivation + // graded: stronger input + deeper refractory → larger trace + // this is the "potentiation" signal for faster recovery +``` + +The `refractory_alignment_trace` then biases the recovery rate of the inactivation trace: + +``` + // Recovery rate biased by accumulated alignment trace + recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace) + soma_Na_inactivation *= decay(τ_Na / recovery_rate) + // more alignment trace → faster recovery → soma ready sooner next time +``` + +--- + +### Why This Is Bottom-Up + +There is no rhythm estimation, no prediction of the next input time, no computed inter-input interval. The soma does not model its input. It simply notices, locally and reactively, that an input arrived when it was not ready, and leaves a trace that makes it recover faster. Over many such mismatches at the same phase, the recovery speeds up at that phase specifically — and the soma ends up aligned with its input rhythm **without ever representing that rhythm**. + +The alignment is an emergent statistical consequence of many local mismatch events, exactly as a potentiated synapse becomes tuned to its input without representing what it is tuned to. The phase-coupling appears, but nothing in the soma computed it. + +--- + +### Depotentiation as Neglect — Not Explicit + +Now the crucial part you raised: the depotentiation of refractory alignment must occur as a **consequence of not potentiating**, not as an explicit opposing mechanism. + +The `refractory_alignment_trace` decays continuously. If mismatches keep happening at a particular phase, the trace is continuously replenished and the fast recovery is maintained. If mismatches stop happening — because the input rhythm changed, or because the alignment succeeded and inputs now arrive when the soma is ready — then the trace is no longer replenished and **decays back toward baseline on its own**. + +``` + // No explicit depotentiation — just decay when not reinforced + refractory_alignment_trace *= decay(τ_alignment) + // if mismatches continue → trace replenished → fast recovery maintained + // if mismatches stop → trace decays → recovery returns to baseline +``` + +This is exactly parallel to synaptic depotentiation by neglect. The soma does not actively slow its recovery when alignment is no longer needed. It simply stops receiving the mismatch signal that was keeping the recovery fast, and the recovery drifts back to baseline because the trace that accelerated it is no longer reinforced. + +There is an elegant self-limiting property here. Once the soma is well-aligned, inputs arrive when it is ready, so there are no more mismatches, so the alignment trace stops being replenished and begins to decay. This would slowly de-align the soma — until inputs start arriving during refractory again, regenerating the mismatch and re-potentiating the alignment. The system settles into a dynamic equilibrium where just enough mismatch occurs to maintain just enough alignment. The soma hovers at the edge of alignment, continuously corrected by the residual mismatches that its imperfect alignment produces. + +--- + +### The Full Bottom-Up Soma Timing + +``` +scope DAY | context AP: + + effective_threshold = soma_structure.baseline_threshold + × (1 + soma_adaptation) + × neuromod_factor(NE_level, ACh_level) + + can_fire = (soma_Na_inactivation < inactivation_threshold) + + if branch_Vm > effective_threshold and can_fire: + AP_fired = True + soma_budget -= AP_generation_cost + + // Deposit traces from the AP + soma_Na_inactivation += AP_amplitude // fast — refractory + soma_adaptation += AP_contribution // slow — spike train threshold + soma_fast_trace += nuclear_Ca_influx() // slow — plasticity tagging + +scope DAY | context NOT_AP: + + // MISMATCH DETECTION — bottom-up alignment signal + if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold: + // input wanted to fire but soma was refractory — missed coincidence + refractory_alignment_trace += (branch_Vm - effective_threshold) + × soma_Na_inactivation + // local potentiation of recovery — no prediction, no rhythm model + + // Recovery biased by alignment trace + recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace) + soma_Na_inactivation *= decay(τ_Na / recovery_rate) // faster if aligned + soma_adaptation *= decay(τ_adaptation) + soma_fast_trace *= decay(τ_nuclear) + + // Alignment trace decays — depotentiation by neglect, not explicit + refractory_alignment_trace *= decay(τ_alignment) + // maintained only while mismatches continue + // self-limiting: good alignment → fewer mismatches → trace decays → + // slight de-alignment → mismatches return → re-potentiation + + // ... budget replenishment, shipments, tagging as before ... +``` + +--- + +### The Conceptual Payoff + +This makes the soma's temporal alignment obey exactly the same principles as everything else in the system: + +A behavior leaves a trace — here the missed coincidence leaves the alignment trace. + +The trace biases future behavior — here it accelerates recovery so the next input at that phase succeeds. + +Potentiation is the active drive — the soma actively speeds up recovery in response to mismatch. + +Depotentiation is neglect — the alignment trace decays when mismatches stop, with no explicit opposing process. + +The system finds equilibrium through the residual of its own imperfection — just enough mismatch persists to maintain just enough alignment. + +And critically, the soma achieves temporal prediction — firing in phase with its input rhythm — **without ever representing the rhythm**. The prediction is implicit in the structure of the recovery dynamics, built up from purely local, reactive, bottom-up trace deposits. This is the same way a potentiated synapse "predicts" that its input will be significant without representing the prediction: the prediction is the physical bias left by past experience, not a computed expectation. The soma's phase-coupling is the temporal version of the synapse's weight — both are implicit predictions encoded as physical bias, both built bottom-up from local coincidence, both maintained by reinforcement and lost by neglect. + +## Energy depletion in Presynapse + +how does the budget and energy influence the model. If for example a presynapse has no more energy variuos times during day, what happens? + +Good question. Let me trace through exactly what happens when energy is repeatedly depleted, following the mechanics already in the pseudocode. + +--- + +### The Immediate Effect — Behavior Suppression + +When `pre_budget < AP_release_cost`, the pseudocode does: + +``` +if pre_budget < AP_release_cost: + suppress(NT_flux) + exit context +``` + +So the immediate consequence of an energy-depleted bouton is **silence** — it does not release neurotransmitter for that AP, regardless of how strong the incoming spike was. The AP arrives, but nothing comes out the other side. This is biologically real: ATP-depleted boutons fail to release because the VATPase cannot refill vesicles and the calcium pumps cannot maintain the gradients that drive release. + +--- + +### The Cascade of Consequences Within DAY + +A single depletion is recoverable — the bouton refuels from astrocyte lactate in the next NOT_AP context and resumes. But **repeated depletion during DAY** sets off a cascade that runs through the entire trace and tagging machinery. + +**No release means no glutamate means no downstream trace.** When the bouton is silent, no glutamate reaches the cleft. The postsynapse receives no AMPA current, its NMDA channels do not open, and `post_fast_trace` does not rise. The astrosynapse detects no spillover, so `astro_fast_trace` does not rise and no D-serine pulse is released. The entire synaptic event simply does not happen. A bouton that is energy-depleted at the moment a significant pattern arrives causes that pattern to be invisible to the postsynapse — the synapse fails to participate in whatever the network is doing. + +**No participation means no eligibility.** Because the bouton did not release, `pre_fast_trace` is not elevated by a release event (it still rises from calcium influx, but without the reinforcing facilitation of successful release). More importantly, the postsynapse, having received no input, accumulates no `post_possible_tagging`. When dopamine arrives to validate the moment, there is nothing to validate at this synapse — the eligibility window is empty. The synapse misses the tagging opportunity entirely. + +**Missing the tag means missing the NIGHT commit.** Since no tag was set during DAY, the synapse has nothing to draw structural resources with during NIGHT. It does not potentiate. And because the system's depotentiation is by neglect, **a synapse that fails to potentiate is automatically on the path to depotentiation** — it receives only maintenance allocation, and if other synapses potentiated and drew down the shared pool, even maintenance may be insufficient. + +--- + +### The Deeper Consequence — Energy Depletion Becomes Structural Depression + +Here is the important emergent property: **repeated energy depletion at a bouton during DAY leads to its structural depression during NIGHT, even though no depression signal was ever sent.** + +The chain is entirely passive: + +``` +repeated pre_budget depletion in DAY + → bouton silent during significant events + → no glutamate release + → no post_fast_trace, no post_possible_tagging + → no tag set (pre or post) + → no NIGHT structural commit at this synapse + → only maintenance allocation received + → if pool depleted by other synapses' potentiation: + maintenance insufficient + → pre_structure and post_structure decay + → DEPOTENTIATION +``` + +The energy-starved synapse is outcompeted not because it was marked for depression but because it could not generate the activity needed to claim resources. Energy availability during DAY therefore directly determines which synapses can even enter the competition for NIGHT potentiation. + +--- + +### The Feedback Loop — Depression Reduces Future Energy Demand + +There is a stabilizing feedback here. A depotentiated synapse has smaller `pre_structure` — a smaller active zone, fewer docking slots, lower release probability. This means it costs **less energy to operate**. So a synapse that was energy-starved and consequently depotentiated now has lower energy demands, making it less likely to be energy-starved in the future. + +``` +energy depletion → depotentiation → smaller structure → lower energy demand + → less likely to deplete → stabilizes at a low-activity equilibrium +``` + +The synapse settles into a low-energy, low-structure, low-activity state. It is not dead — it still operates at baseline — but it has been demoted from the pool of synapses competing for potentiation. Energy scarcity has selected it out. + +--- + +### Why This Is Functionally Important + +This is not a bug — it is a resource-allocation mechanism with real computational value. + +**Energy availability acts as a second gate on plasticity, parallel to the neuromodulatory gate.** Dopamine asks "was this worth saving?" Energy asks "can this synapse afford to participate?" A synapse must pass both gates to be potentiated. This means the system preferentially potentiates synapses that are both behaviorally significant AND metabolically sustainable. A synapse that cannot sustain its own activity is not a good candidate for strengthening, because strengthening it would only increase its energy demand and make it fail more often. + +**Local energy competition implements a form of spatial sparsification.** Boutons on the same axon share `axon_budget` and ultimately the same astrocytic lactate supply. When many boutons are active simultaneously, the shared energy is divided among them, and the weakest — those with the least efficient structure or the least reliable input — deplete first and fall silent. This automatically sparsifies activity: under energy pressure, only the most robust synapses keep firing, and they are the ones that get potentiated. The system concentrates its limited resources on its strongest connections. + +**The astrocyte's energy delivery becomes a control signal.** Because the astrocyte controls lactate distribution across its territory, it has indirect control over which synapses can sustain activity and therefore which can be potentiated. A region of the astrocyte territory that is well-perfused and well-fueled supports vigorous plasticity. A region that is metabolically stressed — perhaps because of high overall demand or reduced vascular supply — suppresses plasticity in its synapses regardless of their activity. This couples the metabolic state of the tissue directly to its capacity to learn. + +--- + +### What Repeated Depletion Looks Like Over Days + +If a bouton is chronically energy-starved across multiple DAY cycles — perhaps because it is in a metabolically compromised region, or because it is competing with many highly active neighbors — the trajectory is: + +``` +Day 1: depletes occasionally → misses some events → weak tag → partial commit +Day 2: smaller structure → still depletes under load → weaker tag → less commit +Day 3: structure decaying → maintenance insufficient → depotentiation accelerates +... +Equilibrium: minimal structure, minimal energy demand, minimal participation + synapse survives but is functionally silent + resources it would have consumed now available to neighbors +``` + +This is a reasonable model of what happens to synapses in metabolically stressed tissue — they do not die immediately, but they are progressively silenced and depotentiated, freeing their resources for synapses in healthier regions. It is also a model of how chronic metabolic limitation — aging, vascular disease, mitochondrial dysfunction — would manifest as a gradual loss of plasticity capacity: not through any depression signal, but through the simple inability of energy-starved synapses to participate in the activity that would let them claim resources. + +The energy budget is therefore not just a constraint that occasionally blocks behavior — it is a continuous selective pressure that shapes which synapses thrive and which fade, operating silently in parallel with the explicit activity-and-reward-driven plasticity, and ultimately determining the metabolic sustainability of whatever the system chooses to remember. + +## Three parallel competitive resource economies +The neuronal structural economy — soma produces material, distributed through dendrite to spines and through axon to boutons, competed for by tagged synapses during NIGHT. +The astrocytic energy economy — astrocyte cell body produces lactate, distributed to perisynaptic processes, competed for by active synapses during DAY in proportion to their clearance demand. +The soma's own energy economy — soma mitochondria fuel AP generation and shipping, competed for by the soma's own functions. +All three share the same logic: a central producer with a capped output, distribution to peripheral consumers, demand-weighted allocation, and a self-reinforcing coupling where stronger consumers both demand and receive more. And all three ultimately bottom out at the same vascular glucose ceiling — the astrocyte directly, the soma through its own glucose uptake. +The deep consequence is that a synapse must win on both economies to be potentiated. It must generate enough activity to pull lactate from the astrocyte (energy economy) AND accumulate enough tag to draw material during NIGHT (structural economy). A synapse that wins the structural competition but cannot pull energy will be unable to sustain the activity that justified its potentiation — it will be a large, expensive structure that keeps going silent. A synapse that pulls energy but never accumulates a tag stays metabolically supported but structurally weak. Only synapses that win both — active enough to be fueled, significant enough to be tagged — achieve and maintain full potentiation. The two economies together implement a stringent joint criterion: persistent significant activity that the metabolic infrastructure can sustain.