From 45b627e6c9508dba4b787b11224371645e7bff5b Mon Sep 17 00:00:00 2001 From: ocrampal Date: Sun, 7 Jun 2026 11:14:09 +0200 Subject: [PATCH] Update 2026-06-06-tripartite_synapse_v2.md --- .../2026-06-06-tripartite_synapse_v2.md | 833 +++++++----------- 1 file changed, 340 insertions(+), 493 deletions(-) diff --git a/elements/astrocyte/appunti/2026-06-06-tripartite_synapse_v2.md b/elements/astrocyte/appunti/2026-06-06-tripartite_synapse_v2.md index 75e6d06..225bca2 100644 --- a/elements/astrocyte/appunti/2026-06-06-tripartite_synapse_v2.md +++ b/elements/astrocyte/appunti/2026-06-06-tripartite_synapse_v2.md @@ -155,7 +155,7 @@ The budget conservation law closes the entire system: LTP draws from shared pool --- --- -# Pseudocode: Tripartite Synapse — Scope & Context Aware Pseudocode v2 +# Pseudocode: Tripartite Synapse v3 --- @@ -165,691 +165,538 @@ The budget conservation law closes the entire system: LTP draws from shared pool SCOPE = { DAY, NIGHT } CONTEXT = { AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS } -Compartments: - PRE = presynaptic bouton - POST = dendritic spine (postsynapse) - ASTRO = astrocyte - DEND = dendritic branch (segment between soma and spines) - SOMA = cell body / nucleus +Compartments: PRE · POST · DEND · SOMA · ASTRO -Budget pools: - BUD = shared resource pool (one per territory) +Variable types: + FIXED = imposed externally or by simulation setup — does not change during run + VAR = changes dynamically during the simulation + TRACE = a VAR that persists across contexts and biases future behavior + BUDGET = the single energy variable per compartment — all costs deducted here -Trace: - A variable modified by a behavior that persists beyond - the current context and biases future behaviors. +The core loop: + behavior occurs within a CONTEXT + behavior costs BUDGET + behavior deposits a TRACE + TRACE biases the next behavior and gates resource allocation + NIGHT scope commits TRACES into permanent structure and replenishes BUDGET ``` --- -## Shared Resource Pools +## Fixed Parameters — Imposed by Simulation Setup ``` -// ── Axonal arbor ────────────────────────────────────────────────────── -BUD axon_vesicle_protein_pool // RIM, Munc13, VGCC subunits for AZ expansion -BUD axon_mitochondria_capacity // ATP ceiling for vesicle release + refill -BUD axon_tagged_boutons // boutons in competition for drifting proteins +// These do not change during a run. They define the organism and environment. -// ── Dendritic branch ────────────────────────────────────────────────── -BUD dend_receptor_reserve // local endosomal AMPA pool per branch -BUD dend_actin_machinery // Rac1/RhoA + actin monomers per branch -BUD dend_protein_flux // plasticity proteins flowing from soma -BUD dend_tagged_spines // spines competing for protein flux -BUD dend_mitochondria_capacity // local ATP budget for branch-level operations -BUD dend_mRNA_pool // locally stored mRNAs for rapid translation - -// ── Astrocyte territory ─────────────────────────────────────────────── -BUD astro_serine_racemase_cap // enzyme ceiling for D-serine synthesis -BUD astro_EAAT_pool // transporter protein for glutamate clearance -BUD astro_ECM_protein_pool // Glypicans, Thrombospondins for sealing -BUD astro_process_extensions // finite perisynaptic processes -BUD astro_ATP_budget // total ATP: clearance + synthesis + motility -BUD astro_lactate_ceiling // hard cap from capillary glucose supply - -// ── Soma ────────────────────────────────────────────────────────────── -BUD soma_ATP_budget // mitochondrial capacity of cell body -BUD soma_protein_synthesis_rate // CREB-driven — peaks in NIGHT scope -BUD soma_receptor_synthesis_rate// new AMPA/NMDA subunits per hour -BUD soma_organelle_pool // mitochondria + ribosomes available for shipping -BUD soma_mRNA_transcription_rate// rate of new mRNA production (Arc, BDNF, etc.) +FIXED input_freq // Hz — driving frequency of incoming spike train +FIXED dopamine_level // neuromodulatory broadcast — set by reward circuit +FIXED NE_level // norepinephrine — set by locus coeruleus +FIXED ACh_level // acetylcholine — set by basal forebrain +FIXED vascular_glucose_supply // hard ceiling on astrocyte fuel intake +FIXED branch_geometry // dendritic tree topology — affects bAP decay +FIXED Ca_HIGH // threshold: LTP-triggering Ca²⁺ amplitude +FIXED Ca_LOW // threshold: LTD-triggering Ca²⁺ amplitude +FIXED Ca_TAG_threshold // threshold: sufficient Ca²⁺ to plant a tag +FIXED spillover_threshold // threshold: cleft saturation activates mGluRs +FIXED homeostatic_ceiling // max tolerable firing rate before global downscale +FIXED disuse_threshold // duration of silence before passive LTD runs +FIXED recycling_fraction // fraction of ECM proteins recovered after MMP cleavage ``` --- -## Global State Variables +## Unified Budget — One Variable per Compartment ``` -// ── PRE: presynaptic bouton ─────────────────────────────────────────── -PRE pre_Ca_residual // TRACE: leftover Ca²⁺ between spikes -PRE vesicle_release_prob // P(0.1–1.0) per docking slot -PRE RRP_pool // readily-releasable vesicle pool -PRE reserve_pool // chained vesicles in deep storage -PRE active_zone_size // SLOW TRACE: docking slot count -PRE RRP_pool_capacity // SLOW TRACE: max RRP -PRE VGCC_clustering // SLOW TRACE: Ca²⁺ channels beneath AZ +// Each compartment has ONE energy variable. +// All costs are deducted from it. All production adds to it. +// Comments show what biological pool the deduction represents. -// ── POST: dendritic spine ───────────────────────────────────────────── -POST membrane_potential // Vm — local depolarization state -POST NMDA_Mg_block // bool — mechanical clamp on/off -POST post_Ca_amplitude // TRACE: peak [Ca²⁺] rise in spine -POST post_Ca_rise_speed // TRACE: d(Ca)/dt — fast=LTP, slow=LTD -POST spine_tag // TRACE: bool — synaptic tag planted -POST AMPA_count // SLOW TRACE: surface receptors -POST spine_volume // SLOW TRACE: physical spine size +VAR pre_budget // axon bouton ATP — covers: VGCC opening, vesicle release, + // VATPase refill, active zone protein maintenance + // (simplifies: axon_mitochondria_capacity + axon_vesicle_protein_pool) -// ── DEND: dendritic branch ──────────────────────────────────────────── -DEND branch_voltage // local depolarization propagating from spines -DEND bAP_amplitude // strength of back-propagating AP at this branch -DEND branch_Ca // TRACE: Ca²⁺ in branch shaft (from bAP + spines) -DEND branch_tag // TRACE: bool — branch-level plasticity tag -DEND local_protein_translation // rate of mRNA→protein at branch ribosomes -DEND mitochondria_density // SLOW TRACE: local energy capacity -DEND branch_BDNF_level // TRACE: local BDNF secreted by active spines +VAR post_budget // spine ATP — covers: NMDA current, NaK pump reset, + // AMPA receptor trafficking, spine actin remodeling + // (simplifies: dendrite_actin_machinery + dendrite_receptor_reserve) -// ── SOMA: cell body ─────────────────────────────────────────────────── -SOMA membrane_potential // somatic Vm — integrates all dendritic input -SOMA AP_threshold // firing threshold — modulated by neuromodulators -SOMA CREB_phospho // TRACE: bool — transcription factor active -SOMA Arc_mRNA_level // TRACE: activity-regulated mRNA — ships to branches -SOMA BDNF_production_rate // TRACE: neurotrophin synthesis rate -SOMA nuclear_Ca // TRACE: Ca²⁺ in nucleus — gates CREB -SOMA organelle_shipping_queue // queue of mitochondria/ribosomes being sent out +VAR dend_budget // branch ATP — covers: bAP propagation, local mRNA translation, + // branch calcium handling, organelle operation + // (simplifies: dend_mitochondria_capacity + dend_protein_flux) -// ── ASTRO: astrocyte ────────────────────────────────────────────────── -ASTRO glutamate_cleft // [glu] in synaptic cleft -ASTRO glutamate_spillover // extrasynaptic [glu] — saturates mGluRs -ASTRO astro_Ca_local // TRACE: IP3-triggered local rise -ASTRO astro_Ca_global // TRACE: soma-wide wave — overload flag -ASTRO D_serine_release // gliotransmitter pulse — NMDA co-agonist -ASTRO D_serine_tonic_level // SLOW TRACE: baseline co-agonist supply -ASTRO perisynaptic_distance // SLOW TRACE: wall distance from synapse -ASTRO ECM_integrity // SLOW TRACE: extracellular matrix density -ASTRO glutamate_clearance_rate // SLOW TRACE: EAAT transporter density -ASTRO lactate_out // fuel export to pre + post + dend +VAR soma_budget // somatic ATP — covers: AP generation, CREB transcription, + // protein synthesis, organelle biogenesis, shipping + // (simplifies: soma_ATP_budget + soma_protein_synthesis_rate + // + soma_organelle_pool + soma_receptor_synthesis_rate) -// ── SIG: signaling intermediates ───────────────────────────────────── -SIG mGluR2_3_activation // presynaptic Gi — autoinhibitory brake -SIG mGluR5_activation // astrocytic Gq — IP3→Ca²⁺→D-serine -SIG cAMP_level // TRACE: set by dopamine/NE via Gs -SIG PKA_activity // downstream of cAMP -SIG GluA1_Ser845_primed // TRACE: bool — AMPA insertion primed -SIG DARPP32_phospho // TRACE: bool — LTD phosphatase silenced -SIG CREB_active // TRACE: bool — gene expression enabled -SIG dopamine_level // broadcast: "save" context signal -SIG NE_level // broadcast: arousal / gain signal -SIG ACh_level // broadcast: attention / threshold signal -SIG BDNF_TrkB_signaling // local: branch survival + growth signal +VAR astro_budget // astrocyte ATP — covers: glutamate clearance, D-serine synthesis, + // ECM secretion, process motility, lactate production + // (simplifies: astro_ATP_budget + astro_serine_racemase_cap + // + astro_ECM_protein_pool + astro_process_extensions + // + astro_EAAT_pool) + +// Budget replenishment rates — all ultimately capped by vascular_glucose_supply +VAR astro_lactate // fuel exported by astrocyte → feeds pre, post, dend budgets + // astro_budget += glycolysis(vascular_glucose_supply) × Δt + // pre_budget += astro_lactate × pre_fraction + // post_budget += astro_lactate × post_fraction + // dend_budget += astro_lactate × dend_fraction + // soma_budget += mitochondria_output() × Δt (soma fuels itself) ``` --- -## Budget Allocation Functions +## Unified Traces — One Trace Variable per Compartment ``` -function request_axon_resources(bouton_id, req_AZ): - available = axon_vesicle_protein_pool × tag_priority(bouton_id, axon_tagged_boutons) - granted = min(req_AZ, available) - axon_vesicle_protein_pool -= granted - if granted < req_AZ: - trigger(heterosynaptic_depression, neighbors(bouton_id)) - return granted +// Each compartment has ONE primary trace variable. +// It accumulates during DAY, decays if not reinforced, +// and is evaluated during NIGHT to gate structural commits. +// Comments show what molecular cascade the trace represents. -function request_dend_resources(spine_id, req_AMPA, req_actin): - priority = tag_priority(spine_id, dend_tagged_spines) - g_AMPA = min(req_AMPA, dend_receptor_reserve × priority) - g_actin = min(req_actin, dend_actin_machinery × priority) - dend_receptor_reserve -= g_AMPA - dend_actin_machinery -= g_actin - if g_AMPA < req_AMPA: - queue(spine_id, deficit, dend_protein_flux) // wait for soma delivery - trigger(heterosynaptic_depression, neighbors(spine_id)) - return (g_AMPA, g_actin) +TRACE pre_trace // presynaptic history variable + // += residual Ca²⁺ after each AP (pre_Ca_residual) + // += tag flag when neuromodulator save signal arrives (axon_tagged_boutons) + // represents: facilitation state + commitment candidacy + // decays: τ ≈ 100ms for Ca²⁺ component; tag persists until NIGHT -function request_astro_resources(syn_id, req_Ds, req_ECM, req_proc): - g_Ds = min(req_Ds, astro_serine_racemase_cap) - g_ECM = min(req_ECM, astro_ECM_protein_pool) - g_proc = min(req_proc, astro_process_extensions) - ATP_cost = compute_ATP(g_Ds, g_ECM, g_proc) - if ATP_cost > astro_ATP_budget: scale_down(g_Ds, g_ECM, g_proc) - astro_serine_racemase_cap -= g_Ds - astro_ECM_protein_pool -= g_ECM - astro_process_extensions -= g_proc - astro_ATP_budget -= ATP_cost - return (g_Ds, g_ECM, g_proc) +TRACE post_trace // postsynaptic history variable + // += Ca²⁺ amplitude × rise_speed after NMDA opens (post_Ca_amplitude × post_Ca_rise_speed) + // += tag flag when Ca²⁺ crosses Ca_TAG_threshold in NOT_bAP context + // represents: LTP/LTD instruction + commitment candidacy + // decays: Ca²⁺ component fades in minutes; tag persists until NIGHT -function request_soma_resources(req_proteins, req_receptors, req_organelles): - g_prot = min(req_proteins, soma_protein_synthesis_rate) - g_rec = min(req_receptors, soma_receptor_synthesis_rate) - g_org = min(req_organelles, soma_organelle_pool) - ATP_cost = compute_ATP(g_prot, g_rec, g_org) - if ATP_cost > soma_ATP_budget: scale_down(g_prot, g_rec, g_org) - soma_protein_synthesis_rate -= g_prot - soma_receptor_synthesis_rate -= g_rec - soma_organelle_pool -= g_org - soma_ATP_budget -= ATP_cost - return (g_prot, g_rec, g_org) +TRACE dend_trace // branch history variable + // += branch Ca²⁺ from bAP + spine spillover (branch_Ca) + // += branch tag when co-active spine count crosses threshold + // += BDNF signal from active spines (branch_BDNF_level) + // represents: branch recruitment strength + survival signal + // decays: branch Ca²⁺ τ ≈ 300ms; BDNF slower; tag persists until NIGHT -function replenish_budgets(Δt): - // Axon - axon_vesicle_protein_pool += protein_transport_rate(axon) × Δt - // Dendritic branch - dend_receptor_reserve += soma_receptor_synthesis_rate × delivery_fraction() × Δt - dend_actin_machinery += actin_recovery_rate() × Δt - dend_protein_flux = soma_protein_synthesis_rate - dend_mRNA_pool += soma_mRNA_transcription_rate × Δt - dend_mitochondria_capacity += organelle_delivery_rate() × Δt - // Astrocyte - astro_serine_racemase_cap += enzyme_synthesis_rate() × Δt - astro_ECM_protein_pool += ECM_synthesis_rate() × Δt - astro_process_extensions += process_recovery_rate() × Δt // slow: hours - astro_ATP_budget += glycolysis(astro_lactate_ceiling) × Δt - astro_lactate_ceiling = capillary_glucose_supply() // vascular ceiling - // Soma - soma_protein_synthesis_rate = CREB_driven_expression() // peaks in NIGHT - soma_receptor_synthesis_rate += ribosome_activity() × Δt - soma_organelle_pool += biogenesis_rate() × Δt - soma_ATP_budget += mitochondria_output() × Δt - soma_mRNA_transcription_rate = AP_history_driven(SOMA.AP_rate) // scales with use +TRACE soma_trace // somatic history variable + // += nuclear Ca²⁺ from AP-driven influx (nuclear_Ca) + // += CREB phosphorylation state when nuclear_Ca AND PKA align + // represents: firing history × neuromodulatory context = synthesis mandate + // decays: nuclear Ca²⁺ fades over seconds; CREB state persists until NIGHT + +TRACE astro_trace // astrocyte territory history variable + // += local Ca²⁺ from mGluR5 / IP3 cascade (astro_Ca_local) + // += global Ca²⁺ wave flag when local exceeds overload threshold + // represents: synaptic load in territory + overload alarm + // decays: local Ca²⁺ fades over seconds; global flag clears after lockdown +``` + +--- + +## Slow Structural Variables — Written Only in NIGHT Scope + +``` +// These are the permanent architecture. DAY behaviors READ them. NIGHT commits WRITE them. + +VAR pre_structure // active zone capacity: docking slots + VGCC clustering + RRP ceiling + // (simplifies: active_zone_size + VGCC_clustering + RRP_pool_capacity) + +VAR post_structure // spine sensitivity: AMPA receptor count + spine volume + // (simplifies: AMPA_count + spine_volume) + +VAR dend_structure // branch capacity: mitochondrial density + local protein flux ceiling + // (simplifies: mitochondria_density + dend_protein_flux) + +VAR soma_structure // somatic output capacity: synthesis rate + organelle pool + // (simplifies: soma_protein_synthesis_rate + soma_organelle_pool) + +VAR astro_structure // synaptic environment: perisynaptic distance + ECM integrity + // + D-serine tonic level + clearance rate + // (simplifies: perisynaptic_distance + ECM_integrity + // + D_serine_tonic_level + glutamate_clearance_rate) ``` --- --- # SCOPE: DAY -All fast and intermediate behaviors. Structural variables only READ, not written. +# Behaviors run. Budgets are consumed. Traces are deposited. +# Structural variables are READ only — never written. --- ## PRE — Presynaptic Bouton -### CONTEXT: AP (action potential arriving) +### CONTEXT: AP ``` scope DAY | context AP: - // Gate 1: energy budget - if axon_mitochondria_capacity < release_ATP_cost: - suppress(release) // silent bouton — budget exhausted - exit context + // Budget gate — all release behaviors require energy + if pre_budget < release_cost: + suppress(release) // silent bouton — pre_budget exhausted + exit context // (covers: ATP for VGCC + vesicle fusion) - // Ca²⁺ dynamics — primary fast trace - pre_Ca_residual += spike_influx(input_freq) - pre_Ca_residual *= decay(τ ≈ 100ms) // TRACE: fades unless spikes keep arriving + // Deposit Ca²⁺ component of trace + pre_trace += spike_Ca_influx(input_freq) + pre_trace *= decay(τ ≈ 100ms) // trace erodes between spikes - // Release — gated by residual trace from prior APs - vesicle_release_prob *= facilitation(pre_Ca_residual) - released = binomial(RRP_pool, vesicle_release_prob) - glutamate_cleft = released × quantal_content - RRP_pool -= released - axon_mitochondria_capacity -= release_ATP_cost + // Release — gated by pre_trace (residual Ca²⁺ from prior APs) + release_prob = base_prob × facilitation(pre_trace) + // pre_structure sets base_prob (READ) + released = binomial(RRP_pool, release_prob) + glutamate = released × quantal_content + pre_budget -= release_cost // (covers: VGCC opening + vesicle fusion + VATPase refill) - // Overflow sensing — activates mGluR brake (cross-compartment) - glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft) - if glutamate_spillover > spillover_threshold: - mGluR2_3_activation = True - cAMP_level -= Gi_inhibition(adenylyl_cyclase) - vesicle_release_prob -= VGCC_suppression() // autoinhibitory brake + // Overflow — activates autoinhibitory brake via mGluR2/3 (Gi) + if glutamate > spillover_threshold: + release_prob *= mGluR_brake_factor // Gi → cAMP ↓ → VGCC suppression + // simultaneously triggers ASTRO response (cross-compartment) - // Fuel consumed — refill gated by lactate supply - RRP_pool refilled by VATPase(astro.lactate_out) + // Refuel from astrocyte lactate + pre_budget += astro_lactate × pre_fraction ``` -### CONTEXT: NOT_AP (between spikes) +### CONTEXT: NOT_AP ``` scope DAY | context NOT_AP: - // Residual Ca²⁺ decays — trace erodes passively - pre_Ca_residual *= decay(τ ≈ 100ms) + // Trace decays passively + pre_trace *= decay(τ ≈ 100ms) - // Reserve pool mobilization — intermediate tuning, pool-limited - if input_freq_history > 20Hz: - mobilize(reserve_pool → RRP_pool) // only if reserve_pool > 0 - // TRACE: RRP_pool now larger - elif input_freq_history < 5Hz: - vesicle_release_prob *= 0.7 // TRACE: depression accumulates + // Intermediate tuning from trace history + if pre_trace > high_trace_threshold: + mobilize(reserve → RRP) // pool-limited: only if reserve non-empty + elif pre_trace < low_trace_threshold: + release_prob *= depression_factor - // Neuromodulator context gate — sets axonal tag if save signal present + // Neuromodulator context — deposits tag component of trace if dopamine_level > D1_threshold or NE_level > β_threshold: - cAMP_level += Gs_activation(adenylyl_cyclase) - PKA_activity = proportional_to(cAMP_level) - axon_tagged_boutons.add(bouton_id) // TRACE: tag — competes for axonal proteins + pre_trace += tag_weight // TAG PLANTED: marks bouton for NIGHT commit + // (covers: cAMP↑ → PKA → axon_tagged_boutons) ``` --- ## POST — Dendritic Spine -### CONTEXT: NOT_bAP (before back-propagating AP — Hebbian anticipation window) +### CONTEXT: NOT_bAP ``` scope DAY | context NOT_bAP: - // AMPA current from incoming glutamate - AMPA_current = glutamate_cleft × AMPA_count - membrane_potential += AMPA_current + // AMPA current — gated by post_structure (AMPA_count READ) + AMPA_current = glutamate × post_structure.sensitivity + Vm += AMPA_current - // NMDA gate: coincidence check with D-serine from astrocyte - if membrane_potential > -40mV and D_serine_release > threshold: - NMDA_Mg_block = False - post_Ca_amplitude += NMDA_influx(glutamate_cleft) - post_Ca_rise_speed = d(post_Ca_amplitude) / dt // TRACE: encodes LTP vs LTD + // NMDA gate: coincidence of depolarization + D-serine from astrocyte + if Vm > Mg_eject_threshold and astro_D_serine > D_serine_threshold: + Ca_influx = NMDA_influx(glutamate) + post_trace += Ca_influx × rise_speed(Ca_influx) + // TRACE: amplitude × speed encodes LTP vs LTD + // (covers: post_Ca_amplitude × post_Ca_rise_speed) + post_budget -= NMDA_cost // (covers: NMDA current + spine depolarization) - // TAG PLANTED HERE — before bAP confirms coincidence - // Condition: Ca²⁺ rising, NMDA open, ion channels activated - if post_Ca_amplitude > Ca_TAG_threshold and NMDA_Mg_block == False: - spine_tag = True // TRACE: tag planted in anticipation window - dend_tagged_spines.add(spine_id) // enters competition for drifting proteins + // Tag planted in anticipation window — before bAP confirms coincidence + if post_trace > Ca_TAG_threshold: + post_trace += tag_weight // TAG PLANTED: enters competition for dend resources + // (covers: dend_tagged_spines.add(spine_id)) - // PKA priming — if neuromodulator context already set - if GluA1_Ser845_primed: - AMPA_insertion_threshold *= 0.7 // easier to anchor receptors later + // PKA priming lowers commit threshold — if neuromodulator context already set + if dopamine_level > D1_threshold: + post_trace *= PKA_amplifier // (covers: GluA1_Ser845_primed → lower insertion threshold) ``` -### CONTEXT: bAP (back-propagating action potential arriving) +### CONTEXT: bAP ``` scope DAY | context bAP: - // bAP depolarizes spine — confirms or rejects the tag planted in NOT_bAP - membrane_potential += bAP_depolarization(dend.bAP_amplitude) + // bAP confirms or rejects the tag planted in NOT_bAP + Vm += bAP_depolarization // strength set by dend_structure (READ) - // Coincidence validation: was the tag planted just before bAP? - if spine_tag == True and post_Ca_amplitude > Ca_TAG_threshold: - // Confirmed Hebbian coincidence — escalate Ca²⁺ - post_Ca_amplitude += bAP_Ca_boost() // TRACE: amplitude now crosses LTP threshold - post_Ca_rise_speed = d(post_Ca_amplitude) / dt + if post_trace > Ca_TAG_threshold: + post_trace += bAP_Ca_boost // CONFIRMED COINCIDENCE: trace amplified above LTP threshold + // (covers: Hebbian bAP amplification of spine Ca²⁺) + // else: bAP passes without amplification — no coincidence, trace unchanged - elif spine_tag == False: - // bAP arrived but no prior glutamate signal — no coincidence - // membrane_potential rises transiently but no Ca²⁺ amplification - pass - - // Fuel: NaK pump resets membrane — gated by lactate from astrocyte - membrane_potential restored by NaK_ATPase(astro.lactate_out) - soma_ATP_budget -= bAP_propagation_cost + post_budget -= bAP_reset_cost // (covers: NaK pump membrane reset) + dend_budget -= bAP_prop_cost // (covers: bAP propagation energy in branch) ``` --- ## DEND — Dendritic Branch -### CONTEXT: CONTINUOUS (branch is always active as integrator) +### CONTEXT: CONTINUOUS ``` scope DAY | context CONTINUOUS: - // Branch integrates spine activity and propagates bAP - branch_voltage = integrate(POST.membrane_potential, all_spines_on_branch) - bAP_amplitude = propagate_bAP(SOMA.AP_fired, branch_geometry) - // TRACE: bAP_amplitude decays with distance from soma + // Integrate spine signals upward toward soma + branch_Vm = integrate(POST.Vm, all_spines_on_branch) - // Branch Ca²⁺ — driven by bAP and local NMDA spillover - branch_Ca += bAP_Ca_influx(bAP_amplitude) - branch_Ca *= decay(τ ≈ 300ms) // TRACE: slower than spine Ca²⁺ + // Propagate bAP downward — amplitude set by dend_structure (READ) + bAP_local = propagate_bAP(SOMA.AP_fired, dend_structure.geometry) - // Branch tag — planted when multiple co-active spines detected + // Deposit branch Ca²⁺ component of trace + dend_trace += bAP_Ca_influx(bAP_local) + dend_trace *= decay(τ ≈ 300ms) // slower than spine Ca²⁺ + + // Branch tag — planted when co-active spine count crosses threshold if co_active_spines(branch) > branch_tag_threshold: - branch_tag = True // TRACE: branch-level tag for coordinated plasticity - BDNF_TrkB_signaling += local_BDNF_release(branch_Ca) // TRACE: survival signal + dend_trace += tag_weight // TAG PLANTED: branch-level commitment candidacy + dend_trace += BDNF_signal // (covers: BDNF-TrkB survival signal from active spines) - // Local translation — mRNA → protein at branch ribosomes - // Only runs if branch_tag is set and mRNA pool available - if branch_tag and dend_mRNA_pool > 0: - local_protein_translation = translate(dend_mRNA_pool, dend_mitochondria_capacity) - dend_mRNA_pool -= local_protein_translation × cost - dend_protein_flux += local_protein_translation // TRACE: locally produced proteins + // Local translation — runs only if tag set and dend_budget allows + if dend_trace > tag_weight and dend_budget > translation_cost: + local_proteins = translate(mRNA_pool, dend_budget) + dend_structure.protein_flux += local_proteins // fast local supply, no soma wait + dend_budget -= translation_cost // (covers: ribosome ATP + mRNA consumption) - // Branch energy budget - dend_mitochondria_capacity -= branch_ATP_cost(branch_voltage, local_protein_translation) + // Global attention modulation + commit_threshold *= (1 / (1 + ACh_level × ACh_gain)) - // Intermediate tuning: ACh modulates branch excitability globally - LTP_threshold *= (1 / (1 + ACh_level × mAChR_gain)) + dend_budget -= branch_maintenance_cost // (covers: branch Ca²⁺ handling + voltage integration) + dend_budget += astro_lactate × dend_fraction ``` --- ## SOMA — Cell Body -### CONTEXT: AP (somatic action potential fired) +### CONTEXT: AP ``` scope DAY | context AP: - // Somatic AP triggered when branch_voltage integration crosses threshold - if SOMA.membrane_potential > AP_threshold: + // Soma fires when integrated branch_Vm crosses threshold + if branch_Vm > AP_threshold: AP_fired = True - // Nuclear Ca²⁺ — key trace for slow-scale gene expression - nuclear_Ca += Ca_influx_from_AP() // TRACE: accumulates with firing rate - nuclear_Ca *= decay(τ ≈ seconds) + // Deposit nuclear Ca²⁺ component of soma trace + soma_trace += nuclear_Ca_influx() // TRACE: accumulates with firing rate + soma_trace *= decay(τ ≈ seconds) - // CREB phosphorylation — gated by nuclear Ca²⁺ AND PKA - if nuclear_Ca > Ca_CREB_threshold and PKA_activity > PKA_threshold: - CREB_phospho = True // TRACE: enables gene expression in NIGHT scope - SOMA.Arc_mRNA_level += transcribe(Arc_gene) // TRACE: ships to active branches - SOMA.BDNF_production_rate += transcribe(BDNF_gene) + // CREB gate: nuclear Ca²⁺ AND PKA must coincide + if soma_trace > CREB_threshold and dopamine_level > D1_threshold: + soma_trace += CREB_weight // TAG PLANTED: gene expression mandate + // (covers: CREB_phospho + Arc_mRNA + BDNF_transcription) - soma_ATP_budget -= AP_generation_cost + soma_budget -= AP_generation_cost // (covers: AP ionic currents + Na/K reset) ``` -### CONTEXT: NOT_AP (between somatic spikes) +### CONTEXT: NOT_AP ``` scope DAY | context NOT_AP: - // Integrate dendritic input — build toward next AP or not - SOMA.membrane_potential = integrate(DEND.branch_voltage, all_branches) + // Integrate dendritic input + branch_Vm = integrate(DEND.branch_Vm, all_branches) - // Ship mRNA to active dendritic branches — tagged branches receive priority - for branch in dend_tagged_spines: - Arc_mRNA_level → ship_to(branch, priority_fraction) // TRACE: Arc arrives at branch - BDNF_production_rate → modulate(branch_BDNF_level) + // Ship resources to tagged branches — priority by dend_trace magnitude + for branch in branches_ranked_by(dend_trace): + dend_budget[branch] += soma_budget × shipping_fraction + dend_structure[branch].protein_flux += soma_structure.synthesis_rate × delivery_fraction + soma_budget -= shipping_cost + // (covers: mRNA + organelle transport to branch) - // Ship organelles to high-demand branches - if soma_organelle_pool > 0: - soma_organelle_queue.add(branches_ranked_by(branch_Ca)) - dend_mitochondria_capacity[top_branch] += deliver_organelle() - soma_organelle_pool -= delivery_cost - - // Neuromodulator context received — PKA gate set for all compartments + // Neuromodulator context propagated to all compartments if dopamine_level > D1_threshold or NE_level > β_threshold: - PKA_activity = proportional_to(cAMP_level) - GluA1_Ser845_primed = True // TRACE: primes all tagged spines - DARPP32_phospho = True // TRACE: silences LTD phosphatase - CREB_active = True // TRACE: gene expression gate open + post_trace *= PKA_amplifier // lowers insertion threshold at all tagged spines + pre_trace += tag_weight // confirms axonal tag + // (covers: DARPP32_phospho + GluA1_Ser845_primed + // + CREB_active broadcast) ``` --- ## ASTRO — Astrocyte -### CONTEXT: CONTINUOUS (astrocyte monitors territory at all times) +### CONTEXT: CONTINUOUS ``` scope DAY | context CONTINUOUS: - // Clearance — always running, rate limited by EAAT pool and ATP budget - glutamate_cleft -= glutamate_clearance_rate × Δt - astro_ATP_budget -= clearance_ATP_cost(glutamate_clearance_rate) + // Clearance — always running + glutamate -= clearance_rate × Δt // clearance_rate set by astro_structure (READ) + astro_budget -= clearance_cost // (covers: EAAT transporter ATP) - // Overflow detection — gated by spillover threshold (low-affinity mGluR5) - glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft) - if glutamate_spillover > spillover_threshold: - mGluR5_activation = True - astro_Ca_local += IP3_cascade(PLC) // TRACE: local Ca²⁺ rises - (g_Ds, _, _) = request_astro_resources(syn_id, proportional_to(astro_Ca_local), 0, 0) - D_serine_release += g_Ds // NMDA co-agonist — may be budget-limited - mGluR2_3_activation = True // simultaneously brakes PRE + // Overflow detection — gated by spillover_threshold (FIXED) + if glutamate > spillover_threshold: + astro_trace += mGluR5_Ca_influx() // TRACE: local Ca²⁺ rises with overflow + // (covers: IP3 → astro_Ca_local) + D_serine = min(proportional_to(astro_trace), astro_budget × Ds_fraction) + astro_budget -= D_serine_cost // (covers: serine racemase ATP) + // simultaneously: mGluR2/3 brakes PRE (cross-compartment, no budget cost on astro) - // Global overload check - astro_Ca_global = soma_wave(astro_Ca_local > OVERLOAD_threshold) - if astro_Ca_global: trigger(shockwave_lockdown) + // Global overload — trace exceeds ceiling + if astro_trace > OVERLOAD_threshold: + trigger(shockwave_lockdown) // (covers: astro_Ca_global wave) - // Fuel pipeline — hard-capped at vascular ceiling - lactate_out = min(glycolysis_rate(glutamate_clearance_rate), astro_lactate_ceiling) - deliver(lactate_out → PRE, POST, DEND) // all three compartments draw from this - astro_ATP_budget += glycolysis(lactate_out) × Δt + // Fuel pipeline — hard cap at vascular_glucose_supply (FIXED) + astro_lactate = min(glycolysis(vascular_glucose_supply), astro_budget × lactate_fraction) + astro_budget += glycolysis(vascular_glucose_supply) × Δt + deliver(astro_lactate → pre_budget, post_budget, dend_budget) ``` --- -## Special Case — Shockwave Lockdown (>100Hz, uncoordinated, any scope) +## Special Case — Shockwave Lockdown (any scope) ``` scope DAY or NIGHT | context OVERLOAD: - astro_Ca_global = GLOBAL_WAVE - release(GABA, ATP) // emergency — bypasses budget gate - rec_AMPA = POST.mass_internalization() - POST.AMPA_count -= rec_AMPA - dend_receptor_reserve += rec_AMPA // returned to branch reserve - POST.membrane_potential = HYPERPOLARIZED - cluster(PRE.VGCC → beneath_active_zone) // overdrive — signal preserved in chaos - astro_ATP_budget -= emergency_response_cost() + // Emergency override — bypasses all budget gates + D_serine = 0 // co-agonist cut + post_structure.AMPA_count *= mass_internalization_factor + // receptors returned to reserve, not destroyed + Vm = HYPERPOLARIZED + pre_structure.VGCC_clustering += overdrive_cluster() + // ensures signal penetrates chaos + astro_budget -= emergency_cost // large deduction — territory depleted afterward ``` --- --- # SCOPE: NIGHT -Structural commit, resource replenishment, consolidation. -All compartments are modulated. Slow variables now WRITTEN. +# Structural variables WRITTEN. Budgets replenished. Traces evaluated and cleared. --- -## ALL COMPARTMENTS — Structural Commit +## Step 1 — Replenish All Budgets ``` -scope NIGHT: +scope NIGHT | step 1: - // Step 1: replenish all budgets — soma protein synthesis peaks here - replenish_budgets(Δt_night) + // Astrocyte replenishes first — fuels everything else + astro_budget += overnight_synthesis_rate() × Δt_night + // (covers: enzyme pool + ECM pool + process extensions) - // Step 2: process somatic shipping queue — fulfill deferred organelle deliveries - for branch in soma_organelle_queue: - dend_mitochondria_capacity[branch] += deliver_organelle() - soma_organelle_pool -= delivery_cost + // Soma replenishes from its own mitochondria + soma_budget += overnight_mitochondria_output() × Δt_night - // Step 3: evaluate structural commit for each tagged synapse - for each (bouton_id, spine_id, syn_id) where spine_tag == True: - commit_to_structural_change(bouton_id, spine_id, syn_id) + // Soma budget funds downstream replenishment + dend_budget += soma_budget × dend_replenish_fraction + post_budget += soma_budget × post_replenish_fraction + pre_budget += soma_budget × pre_replenish_fraction - // Step 4: homeostatic downscaling — prune unvalidated potentiations - for each synapse where spine_tag == False and disuse_duration > disuse_threshold: - passive_LTD(synapse) - - // Step 5: clear all DAY-scope traces that were not committed - for each expired_tag in dend_tagged_spines + axon_tagged_boutons: - expire_tag(expired_tag) + // CREB-driven synthesis peaks here — rate set by soma_trace magnitude + soma_structure.synthesis_rate = CREB_driven_expression(soma_trace) + // (covers: soma_protein_synthesis_rate peak in sleep) ``` --- -## PRE — Structural Commit (NIGHT) +## Step 2 — Structural Commit for Each Tagged Compartment ``` -scope NIGHT | PRE: +scope NIGHT | step 2: - g_AZ = request_axon_resources(bouton_id, AZ_expansion_cost) + // Three-layer filter — all must be true to commit + event_strong = post_trace > Ca_HIGH // did something happen? + overflow_seen = astro_trace > astro_tag_threshold // was it excessive? + context_valid = dopamine_level > D1_threshold // was it worth saving? + or NE_level > β_threshold - // Commit proportional to granted budget - active_zone_size += g_AZ // SLOW TRACE: permanent AZ expansion - RRP_pool_capacity += pool_expansion(active_zone_size) - VGCC_clustering += cluster_beneath_AZ(g_AZ) - vesicle_release_prob += scale_with(g_AZ) + if event_strong and overflow_seen and context_valid: - // If partial grant: deficit queued for next NIGHT cycle - if g_AZ < AZ_expansion_cost: - queue(bouton_id, deficit, axon_vesicle_protein_pool) + // PRE structural commit — draws from pre_budget + ΔAZ = min(AZ_expansion, pre_budget × pre_structural_fraction) + pre_structure += ΔAZ // SLOW TRACE WRITTEN: bigger active zone + pre_budget -= ΔAZ × cost // (covers: RIM/Munc13 incorporation + VGCC clustering) + if ΔAZ < AZ_expansion: + queue(pre_deficit → next NIGHT) - axon_tagged_boutons.remove(bouton_id) + // POST structural commit — draws from post_budget + ΔAMPA = min(AMPA_insertion, post_budget × post_structural_fraction) + post_structure += ΔAMPA // SLOW TRACE WRITTEN: more receptors + larger spine + post_budget -= ΔAMPA × cost // (covers: CaMKII anchoring + actin remodeling) + if ΔAMPA < AMPA_insertion: + queue(post_deficit → next NIGHT) - // LTD branch: resources returned to pool - if LTD_signal: - rec_AZ = docking_slot_removal() - active_zone_size -= rec_AZ - axon_vesicle_protein_pool += rec_AZ // returned for reuse - RRP_pool_capacity -= pool_contraction() - VGCC_clustering -= scatter_VGCCs() - vesicle_release_prob *= 0.6 -``` + // DEND structural commit — draws from dend_budget + ΔDEND = min(branch_expansion, dend_budget × dend_structural_fraction) + dend_structure += ΔDEND // SLOW TRACE WRITTEN: denser mitochondria + higher protein flux + dend_budget -= ΔDEND × cost // (covers: organelle incorporation + mRNA pool expansion) ---- + // ASTRO structural commit — draws from astro_budget + ΔASTRO = min(process_retraction, astro_budget × astro_structural_fraction) + astro_structure -= ΔASTRO // SLOW TRACE WRITTEN: walls IN, ECM sealed, D-serine tonic ↑ + astro_budget -= ΔASTRO × cost // (covers: process motility + ECM secretion + racemase upregulation) -## POST — Structural Commit (NIGHT) + return "potentiated" -``` -scope NIGHT | POST: + elif event_strong and not context_valid: + // Ca²⁺ rose but no save signal — transient only, no structural write + return "temporary — no commit" - (g_AMPA, g_actin) = request_dend_resources(spine_id, AMPA_cost, actin_cost) + elif not event_strong and post_trace > Ca_LOW: + // LTD: resources returned to budgets + post_structure -= LTD_amount // SLOW TRACE WRITTEN: fewer receptors + smaller spine + post_budget += recovered_AMPA_cost // receptors recycled — budget partially restored + pre_structure -= LTD_pre_amount // SLOW TRACE WRITTEN: smaller active zone + pre_budget += recovered_AZ_cost // proteins recycled + astro_structure += LTD_astro_amount // SLOW TRACE WRITTEN: walls OUT, ECM dissolved + astro_budget += recovered_process_cost × recycling_fraction // partial recovery + return "depressed" - // Commit proportional to granted budget - activate(CaMKII) - AMPA_count += receptor_insertion(CaMKII, g_AMPA) // SLOW TRACE: permanent receptor gain - spine_volume *= (1 + spine_scale(g_actin)) // SLOW TRACE: spine head enlarged - - // Deficit queued for next NIGHT cycle - if g_AMPA < AMPA_cost: - queue(spine_id, deficit, dend_protein_flux) - - dend_tagged_spines.remove(spine_id) - spine_tag = False // tag cleared after commit - - // LTD branch: resources returned to branch pool - if LTD_signal: - activate(PP1) - rec_AMPA = receptor_internalization(PP1) - AMPA_count -= rec_AMPA - dend_receptor_reserve += rec_AMPA // returned to branch pool - spine_volume *= 0.7 - dend_actin_machinery += actin_depolymerization() -``` - ---- - -## DEND — Structural Commit (NIGHT) - -``` -scope NIGHT | DEND: - - // Branch receives organelles shipped from soma during NIGHT - dend_mitochondria_capacity += soma_organelle_delivery(branch_id) // SLOW TRACE - - // Arc mRNA translated into structural proteins at branch ribosomes - if dend_mRNA_pool > Arc_threshold: - new_proteins = translate(dend_mRNA_pool, dend_mitochondria_capacity) - dend_protein_flux += new_proteins // SLOW TRACE: local supply expanded - dend_mRNA_pool -= translation_cost - - // Branch BDNF consolidates active branch architecture - if branch_BDNF_level > BDNF_survival_threshold: - dend_mitochondria_density += BDNF_TrkB_signaling × Δt // SLOW TRACE: branch reinforced else: - dend_mitochondria_density -= pruning_rate() × Δt // SLOW TRACE: branch weakened - - // Branch tag cleared - branch_tag = False + return "baseline — no change" ``` --- -## SOMA — Structural Commit (NIGHT) +## Step 3 — Homeostatic Scaling ``` -scope NIGHT | SOMA: +scope NIGHT | step 3: - // CREB drives transcription — highest rate during NIGHT (slow-wave sleep replay) - if CREB_phospho: - soma_protein_synthesis_rate += CREB_driven_expression() // SLOW TRACE - soma_receptor_synthesis_rate += CREB_driven_expression() - soma_mRNA_transcription_rate += transcription_burst() - - // Replenish organelle pool — biogenesis peaks during rest - soma_organelle_pool += mitochondria_biogenesis() × Δt // SLOW TRACE - soma_ATP_budget += overnight_mitochondria_recovery() × Δt - - // Homeostatic scaling: if overall firing was too high, scale down all synapses - if soma_AP_rate_history > homeostatic_ceiling: + // If soma firing rate during DAY exceeded ceiling — global downscale + if soma_trace > homeostatic_ceiling: for each synapse: - AMPA_count[synapse] *= homeostatic_scale_down_factor - vesicle_release_prob[synapse] *= homeostatic_scale_down_factor + post_structure *= homeostatic_scale_down // all spines reduced proportionally + pre_structure *= homeostatic_scale_down // all boutons reduced proportionally + // Relative differences preserved — absolute excitability restored - // Clear CREB trace if no further consolidation needed - if soma_organelle_queue.empty() and dend_tagged_spines.empty(): - CREB_phospho = False - CREB_active = False + // Branches not recruited during DAY — passive structural decline + for each branch where dend_trace < disuse_threshold: + dend_structure -= pruning_rate × Δt_night // SLOW TRACE WRITTEN: branch weakens + dend_budget += recovered_branch_cost // resources freed ``` --- -## ASTRO — Structural Commit (NIGHT) +## Step 4 — Clear All DAY Traces ``` -scope NIGHT | ASTRO: +scope NIGHT | step 4: - // Perisynaptic process remodeling — most expensive astrocyte operation - // LTP: walls move IN — seals and insulates the channel - if LTP_signal: - (g_Ds, g_ECM, g_pr) = request_astro_resources(syn_id, Ds_cost, ECM_cost, proc_cost) - perisynaptic_distance -= g_pr // SLOW TRACE: tighter wrap - ECM_integrity += g_ECM // SLOW TRACE: matrix sealed - D_serine_tonic_level += g_Ds // SLOW TRACE: sustained co-agonist - glutamate_clearance_rate *= (1 - clearance_scale(g_pr)) // SLOW TRACE + // Traces either committed to structure (steps 2–3) or cleared here + pre_trace = 0 // Ca²⁺ residual and tag both cleared + post_trace = 0 // Ca²⁺ instruction and tag both cleared + dend_trace = 0 // branch Ca²⁺, BDNF signal, and tag cleared + soma_trace = 0 // nuclear Ca²⁺ and CREB state cleared + astro_trace = 0 // local Ca²⁺ and overload flag cleared - // LTD: walls move OUT — loosens diffusion barrier, dissolves matrix - if LTD_signal: - rec_ECM = secrete(MMPs) - ECM_integrity -= rec_ECM - astro_ECM_protein_pool += rec_ECM × recycling_fraction // partial recovery - D_serine_tonic_level = 0 // SLOW TRACE: starved - perisynaptic_distance += process_extension() - astro_process_extensions += freed_process // freed for reallocation - glutamate_clearance_rate *= 1.2 // SLOW TRACE - - // Replenish astrocyte pools overnight - replenish_budgets(Δt_night) + // System enters next DAY with clean trace slate + // Only structural variables (pre/post/dend/soma/astro_structure) carry history forward ``` --- -## Heterosynaptic Depression — Passive Resource Depletion (any scope) +## Key Asymmetry — Structural Variables Amplify Both Directions ``` -scope DAY or NIGHT | triggered by budget exhaustion: +// astro_structure controls diffusion geometry and D-serine tonic level simultaneously: +// LTP → walls IN → clearance slower + D_serine_tonic ↑ → future events easier to potentiate +// LTD → walls OUT → clearance faster + D_serine_tonic = 0 → future events easier to depress - function heterosynaptic_depression(neighbor_ids): - // No active signal — purely consequence of pool depletion - for n in neighbor_ids: - if n not in dend_tagged_spines and n not in axon_tagged_boutons: - POST.AMPA_count[n] -= passive_depletion_rate() - PRE.vesicle_release_prob[n] -= passive_depletion_rate() -``` - ---- - -## Energy Supply Chain — Metabolic Gating (DAY scope, CONTINUOUS) - -``` -scope DAY | context CONTINUOUS: - - function metabolic_loop(Δt): - glucose_uptake = blood_capillary_supply() // vascular hard ceiling - lactate_out = min(glycolysis(glucose_uptake, glutamate_clearance_rate), - astro_lactate_ceiling) - lactate_out *= load_factor(glutamate_clearance_rate) - - // Distribute fuel to all three consumer compartments - PRE.RRP_pool refilled by VATPase(lactate_out × pre_fraction) - POST.membrane_potential reset by NaK_ATPase(lactate_out × post_fraction) - DEND.branch_ops powered by lactate_out × dend_fraction - - astro_ATP_budget += glycolysis(lactate_out) × Δt -``` - ---- - -## Key Asymmetries and Closure Summary - -``` -// PERISYNAPTIC DISTANCE — amplifies both directions -// LTP: walls IN → clearance_rate ↓, D_serine_tonic ↑ → self-reinforcing -// LTD: walls OUT → clearance_rate ↑, D_serine_tonic = 0 → self-reinforcing -// Cost: astro_process_extensions budget — slow to recover (hours) - -// SYNAPTIC TAG — the bridge between DAY and NIGHT -// Planted in DAY (NOT_bAP context) when Ca²⁺ rises before bAP confirms coincidence -// Consumed in NIGHT when structural commit runs and budget is available -// Expires in NIGHT if no save signal arrived during DAY — no structural trace left - -// BUDGET CONSERVATION — the system is closed -// LTP draws from shared pools → neighbors passively depressed (heterosynaptic LTD) -// LTD returns resources to pools → neighbors passively enriched -// Net: one synapse's gain is its neighbors' loss, bounded by vascular glucose ceiling - -// SLEEP (NIGHT scope) — not passive recovery but active execution -// soma_protein_synthesis_rate peaks → queued deficits fulfilled -// CREB_driven_expression peaks → new structural proteins shipped to tagged branches -// Homeostatic downscaling runs → unvalidated potentiations pruned -// All DAY traces either committed to structure or cleared +// This is why commits are self-reinforcing: +// the slow structural variable written in NIGHT +// biases every fast behavior READ in the next DAY + +// Budget conservation law: +// LTP draws from shared budgets → neighbors passively impoverished +// LTD returns resources to budgets → neighbors passively enriched +// Total resources bounded by vascular_glucose_supply (FIXED) +// No behavior is free. No trace is permanent without NIGHT commit. +// No commit is possible without budget. ```