diff --git a/README.md b/README.md index 532480d..8879edd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ C'e' una differenza se il cambio di fullness e' su un Tub di tipo floor (esempio Il context e' a RF piu' alto, che attiva la possibilita' di un episode a RF piu' basso. L'episode "dura" in un intervallo di context. Il context puo' integrare le ipotesi fatte durante l'episode. +A Context sets the conditions, an Episode is a named outcome within those conditions. + ### Condition, hypothesis ... diff --git a/neuron/BEH-AXO.md b/neuron/BEH-AXO.md index 32bf1a8..8e034c5 100644 --- a/neuron/BEH-AXO.md +++ b/neuron/BEH-AXO.md @@ -198,7 +198,7 @@ container: BEH-PRE ``` -### ms: behaviors +### ms: behaviors PRE #### AP-RRPConcentration: Context @@ -402,14 +402,14 @@ episode: CaTracesAccumulationSlow trace: None ``` -### sec: behaviors +### sec: behaviors PRE -#### SecContext: Context +#### CheckConditions: Context Contestualizziamo in maniera Fixed ogni mezzo secondo? ```Gen -context: SecContext +context: CheckConditions contained_by: BEH-PRE in_context: Fixed @@ -540,7 +540,7 @@ episode: RPShuttleMaximal trace: None ``` -### min: behaviors +### min: behaviors PRE #### Refill RP from Glutamine diff --git a/neuron/BEH-BD.md b/neuron/BEH-BD.md index b77ba55..02451a6 100644 --- a/neuron/BEH-BD.md +++ b/neuron/BEH-BD.md @@ -15,7 +15,7 @@ Qui BEH-DB espande solo i BEH-POST, e' un cavo di collegamento come l'assone Container: BEH-BD expansion: - - BEH-POST ( fullness: 50x, active: 20x, emptiness: 10x ) + - BEH-POST ( full: 50x, active: 20x, empty: 10x ) modulated_by: DEV-BD-BEH-POST-TUB from DEV-N.md ``` @@ -27,7 +27,7 @@ Like its presynaptic partner, the postsynapse is governed by three interlocking --- -### 1. The $V_{post}$ Loop: The Fast Gatekeeper (Milliseconds) +1.The $V_{post}$ Loop: The Fast Gatekeeper (Milliseconds) This is the primary electrophysiological response, where chemical signals are converted back into electricity. @@ -39,7 +39,7 @@ This is the primary electrophysiological response, where chemical signals are co --- -### 2. The $Ca^{2+}$ Loop: The Plasticity Controller (Seconds) +2.The $Ca^{2+}$ Loop: The Plasticity Controller (Seconds) This loop translates electrical timing into biological "memory." @@ -51,7 +51,7 @@ This loop translates electrical timing into biological "memory." --- -### 3. The ATP Loop: The Metabolic Backbone (Minutes) +3.The ATP Loop: The Metabolic Backbone (Minutes) This is the "Hidden Master" that determines if the other two loops are allowed to function. @@ -71,36 +71,46 @@ The system is beautifully asymmetric. While the presynapse is built to **supply* container: BEH-POST expansion: - - BEH-POST-AMPA ( fullness: 10x, active: 5x, emptiness: 2x ) + - BEH-POST-AMPA ( full: 10x, active: 5x, empty: 2x ) # modulated_by: TUN-POST-IC # possible/actual tub_local: - - Ca2+ ( fullness: 60x, active: 30x, emptiness: 0x ) + - Ca2+ ( full: 60x, active: 30x, empty: 0x ) # modulated_by: DEV-POST-???-FULL # Full - - Nox ( fullness: 100x, active: 20x, emptiness: 0x ) # Nitric Oxide (NO): A gas that diffuses freely. + - Nox ( full: 100x, active: 20x, empty: 0x ) # Nitric Oxide (NO): A gas that diffuses freely. - - Ecb ( fullness: 100x, active: 20x, emptiness: 0x ) # Endocannabinoids (e.g., 2-AG) + - Ecb ( full: 100x, active: 20x, empty: 0x ) # Endocannabinoids (e.g., 2-AG) tub_intricated: - Nt ( contained_by: BEH-SYN ) - bAp ( contained_by: BEH-SOMA ) ``` -### Context +### ms: behaviors POST + +#### CheckConditions:Context + +Contestualizziamo in maniera Fixed ogni mezzo secondo? ```Gen -context: captureNt - contained_by: BEH-POST +context: CheckConditions + contained_by: BEH-POST - in_context: Fixed - rf: ( active: 10x ) + in_context: Fixed + rf: ( active: 600x ) - condition: (Nt full) AND NOT (bAp) - out_context: NtCaptured + condition: NOT (RP empty) AND NOT (RRP full) + out_context: RPShuttle + + condition: NOT (CaTrace empty) + out_context: CaTracesNotEmpty + + condition: NOT (eCB empy) + out_context: eCBNotEmpty ``` -### Episode +#### :Episode ## BEH-POST-AMPA: Container @@ -114,7 +124,13 @@ container: BEH-POST-AMPA - bAp ( contained_by: BEH-SOMA ) ``` -### AmpaOpen: Episode +### sec: behaviors POST + +### min: behaviors POST + +### ms: behaviors AMPA + +#### AmpaOpen: Episode - Timing: < 1 ms - InContext: Glutamate > FULLNESS @@ -134,7 +150,7 @@ episode: AmpaOpen trace: None # Se Ca+FULLNESS, lascio tracce di overflow per modulazione DOWN, da capire UP ``` -### Depolarization by bAP +#### Depolarization by bAP Da ricordare i Dendritic VCGG che si aprono facendo entrare Ca2+ all'arrivo di bAP. In teoria abbiamo 3 Ion Channel. @@ -142,23 +158,23 @@ Da ricordare i Dendritic VCGG che si aprono facendo entrare Ca2+ all'arrivo di b - InContext: bAP backpropagating action potential - Consequence: addition to local depolarization (EPSP) from bAP -### Mg²⁺ NMDA unblock +#### Mg²⁺ NMDA unblock - Timing: > 1 ms - InContext: local depolarization (EPSP) > FULLNESS (requires depolarization > -40mV) - OutContext: NMDA Mg²⁺ unblock -### Full Ca+ influx by NDMA +#### Full Ca+ influx by NDMA - Timing: < 1 ms - InContext: NMDA Mg²⁺ unblock - Consequence: Na⁺ influx - Consequence: addition to local depolarization (EPSP) from Full NMDA activation -### Upregulation: Observable +#### Upregulation: Observable - Upregulation: Depolarization relieves NMDA Mg²⁺ block → Ca²⁺ influx amplification -### Downregulation: Observable +#### Downregulation: Observable - Downregulation: AMPA desensitization acts as low-pass filter diff --git a/neuron/appunti/2026-03-30-behavior-POST.md b/neuron/appunti/2026-03-30-behavior-POST.md index 10a0f13..8fe64fd 100644 --- a/neuron/appunti/2026-03-30-behavior-POST.md +++ b/neuron/appunti/2026-03-30-behavior-POST.md @@ -1,91 +1,299 @@ -## BEH-POST-UNIFIED: The Integrated Postsynaptic Model +--- -### **ms: behaviors (Fast Kinetics & Gate Logic)** +**What needs adjustment** -#### **Voltage-Context: Episode** +`Voltage-Context` is labelled as an Episode but contains sub-episodes — it should be a Context. Same for `NMDA-Coincidence` and `Ca-Dynamics & ATP-Drain`. You have used Episode and Context interchangeably in a few places; the distinction matters for the specification: a Context sets the conditions, an Episode is a named outcome within those conditions. -*Determines the total depolarization level (Vpost​) available to clear the NMDA Mg-block.* +`Vpost_Maximum` lists `V_bAP full OR (g_AMPA full AND V_bAP medium)` — this is correct Boolean logic and should be kept exactly as written. It captures the two ways the postsynapse can reach maximum depolarisation: the bAP alone if it is strong enough, or AMPA plus a partial bAP together. -- **Vpost_Maximum: Episode** - - — `V_bAP` full OR (`g_AMPA` full AND `V_bAP` medium) - - — Result: Vpost​ is high enough for complete Mg-block removal. -- **Vpost_Attenuated: Episode** - - — `g_AMPA` medium AND `V_bAP` empty/low - - — Result: Vpost​ is sub-threshold; Mg-block partially remains. -- **Vpost_Passive: Episode** - - — `g_AMPA` empty AND `V_bAP` empty - - — Result: Vpost​ at rest; Mg-block fully intact. +`AMPA_Population_Increase` correctly gates on `ATP_level_post NOT empty` — LTP requires ATP for CaMKII phosphorylation and receptor trafficking. LTD does not have the same gate in your spec. This is slightly asymmetric — LTD (receptor internalisation via endocytosis) is also ATP-dependent, though less so than LTP. Worth noting. -#### **NMDA-Coincidence: Context** +`Plasticity_LTD` covers `Ca_post_history medium` but does not cover the case where `Ca_post_history` is empty — a completely silent synapse also weakens over time (homeostatic depression). This can be left as a gap or named explicitly. -- **NMDA_Open: Episode** - - — `NT_cleft` full AND `V_post` maximum - - — Result: Capost​ surges; triggers high ATP demand for clearance. -- **NMDA_LogicBlocked: Episode** - - — `NT_cleft` full BUT `V_post` attenuated/passive - - — Result: Mg-block prevents Ca2+ influx despite NT presence. -- **NMDA_LigandBlocked: Episode** - - — `V_post` maximum BUT `NT_cleft` empty - - — Result: No glutamate to open the channel; Ca2+ entry zero. +`Astrocyte_Supply_Crises` has a typo (Crises → Crisis). -#### **Ca-Dynamics & ATP-Drain: Context** - -- **Clearance_Optimal: Episode** - - — `ATP_level_post` full - - — Result: Pumps flush Ca2+ rapidly; `ATP_demand_post` increases. -- **Clearance_Failing: Episode** - - — `ATP_level_post` low/empty - - — Result: Ca2+ remains elevated (residual floor); creates "False Trigger" conditions. +The bAP needs new parameters and state variables in the model before it can be expressed as a fully implemented behavior. I will add those inline as `[GAP — to implement]` markers so the spec is complete even where the code is not yet written. --- -### **sec: behaviors (Signal Integration & Fate)** +**Final restructured specification** -#### **Synaptic-Weight-Decision (Plasticity)** +``` +BEH-POST-UNIFIED: The Integrated Postsynaptic Model +===================================================== +Three loops, three timescales, one shared astrocyte supply. +Each loop feeds the next: V_post enables NMDA, NMDA drives +Ca_post, Ca_post determines plasticity and eCB, ATP sustains +all three. Failure of ATP does not silence the postsynapse +(unlike the presynapse) — it corrupts it, triggering false +retrograde signals and risking excitotoxic Ca2+ accumulation. -- **Plasticity_LTP: Episode** - - — `Ca_post_history` (recent 2s) is **Full** - - — Result: High-frequency/High-amplitude coincidence detected; tags synapse for AMPA increase. -- **Plasticity_LTD: Episode** - - — `Ca_post_history` is **Medium** - - — Result: Low-frequency or poorly timed coincidence; tags synapse for AMPA removal. +Variables: + V_bAP — back-propagating AP amplitude (0→1) + [GAP — requires bAP_train input, + analogous to presynaptic spike_train] + g_AMPA — AMPA receptor conductance (= receptor_conductance) + V_post — total postsynaptic membrane potential (0→1) + NT_cleft — glutamate in cleft (from presynapse) + Desensitization — fraction of AMPA receptors desensitized (0→1) + Ca_post — free Ca2+ in postsynaptic spine (0→...) + Ca_post_history — 2 s rolling mean of Ca_post + ATP_level_post — normalised postsynaptic ATP (0→1) + ATP_demand_post — accumulated ATP cost since last metabolic cycle + g_AMPA_baseline — long-term AMPA receptor density set by plasticity + [GAP — not yet in model; LTP/LTD would write this] + eCB_level — endocannabinoid retrograde signal (0→1) + written here, read by presynapse Loop 1 -#### **Retrograde-Feedback (eCB)** +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +ms: behaviors — Fast Kinetics and Gate Logic +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- **eCB_Synthesis_Active: Episode** - - — `Ca_post_history` > threshold (0.7) - - — **Logic A (Protection):** Response to genuine NMDA over-activity. - - — **Logic B (Error):** Response to pump failure (Ca2+ accumulation due to low ATP). -- **eCB_Synthesis_Idle: Episode** - - — `Ca_post_history` < threshold; eCB level decays. +Voltage-Context: Context + Determines the total depolarisation (V_post) available to + lift the NMDA Mg block. Two independent sources contribute: + AMPA-driven local depolarisation (g_AMPA) and the somatic + back-propagating AP (V_bAP). Either alone can partially + depolarise; both together reach maximum. ---- + Vpost_Maximum: Episode + — V_bAP full OR + — g_AMPA full AND V_bAP medium + — Result: V_post high enough for complete Mg block removal. + NMDA gate can open fully. + Both ATP costs charged at maximum rate. -### **min: behaviors (Bioenergetics & Structural Change)** + Vpost_Attenuated: Episode + — g_AMPA medium AND V_bAP empty/low OR + — g_AMPA low AND V_bAP medium + — Result: V_post sub-threshold. + Mg block partially remains. + NMDA gate opens partially or not at all. + This is the most common state during low-rate firing + without a coincident bAP. -#### **Metabolic-Recovery** + Vpost_Passive: Episode + — g_AMPA empty AND V_bAP empty + — Result: V_post at rest. + Mg block fully intact. + No Ca_post entry possible. + Na/K-ATPase cost minimal. -- **Astrocyte_Supply_Active: Episode** - - — `Glucose_level` full; `ATP_level_post` is replenished. -- **Astrocyte_Supply_Crises: Episode** - - — `Glucose_level` low; `ATP_level_post` remains empty; Ca2+ pumps fail. + Desensitization-Context: Context + Modulates g_AMPA independently of NT_cleft. + Sustained NT exposure drives receptors into a closed state + that persists even when NT remains present. -#### **Structural-Update** + DesensitizationRising: Episode + — NT_cleft sustained high (multiple consecutive ms) + — Desensitization rises each ms + — g_AMPA effectively reduced despite NT presence + — attenuates Vpost_Maximum toward Vpost_Attenuated -- **AMPA_Population_Increase: Episode** - - — Triggered by `Plasticity_LTP` AND `ATP_level_post` NOT empty. - - — Result: `g_AMPA_baseline` shifts higher for next cycle. -- **AMPA_Population_Decrease: Episode** - - — Triggered by `Plasticity_LTD`. - - — Result: `g_AMPA_baseline` shifts lower. + DesensitizationRecovering: Episode + — NT_cleft low or empty + — Desensitization decays with tau_desensitization = 500 ms + — g_AMPA ceiling restored gradually ---- +NMDA-Coincidence: Context + Strict AND gate: both NT (ligand) and V_post (voltage) must + be simultaneously non-zero for Ca_post to rise. + Unlike presynaptic VGCCs which open with any spike, NMDA + requires coincidence. This makes Ca_post a detector of + coordinated pre+post activity, not just input rate. -### **Key Structural Observations** + NMDA_Open: Episode + — NT_cleft full AND V_post maximum (Vpost_Maximum active) + — Mg block fully lifted + — Ca_post surges — LTP territory + — ATP_demand_post rises sharply (PMCA must clear Ca_post) + — if sustained → Ca_post_history crosses eCB threshold -1. **The Vpost Priority:** Vpost​ is now the "sum" of local input and global feedback. This allows the model to simulate both **Hebbian learning** (needs a bAP) and **Homeostatic Scaling** (where enough local AMPA activity can eventually trigger the NMDA gate alone). -2. **The ATP Bottleneck for LTP:** Note that in the `min` behaviors, I’ve added a constraint: LTP requires `ATP_level_post` to be healthy. Moving receptors into the membrane is a physical "work" process. If the synapse is energy-starved, it might "decide" to do LTP in the `sec` loop but fail to **execute** it in the `min` loop. -3. **The Coincidence Hierarchy:** - - **LTP** = Perfect Timing (NT + bAP). - - **LTD** = Misaligned Timing (Low NT or Out-of-sync bAP). - - **False eCB** = Metabolic Failure (No NT, No bAP, just Low ATP). \ No newline at end of file + NMDA_LogicBlocked: Episode + — NT_cleft full BUT V_post attenuated or passive + — Mg block partially or fully intact + — Ca_post does not rise despite NT presence + — Result: presynapse fired but postsynapse was not ready + No plasticity signal generated + This is the mechanism for input selectivity: + only synapses active during postsynaptic firing + produce a Ca_post signal + + NMDA_LigandBlocked: Episode + — V_post maximum BUT NT_cleft empty + — No glutamate to open the channel + — Ca_post entry zero despite full depolarisation + — Result: bAP arrived but presynapse was silent + Again no plasticity signal + The AND logic enforces true coincidence + +Ca-Dynamics-Context: Context + Ca_post clearance rate depends entirely on ATP_level_post. + This is the bridge from the ATP loop into the Ca2+ loop. + When ATP fails, Ca_post clearance fails, and the Ca2+ loop + becomes corrupted — Ca_post reflects pump state rather + than genuine coincidence events. + + Clearance_Optimal: Episode + — ATP_level_post full → pump_scale_post near 1 + — PMCA (ATP-gated) + NCX (always on) both clearing + — Ca_post returns to baseline between events + — Each coincidence event is temporally isolated + — ATP_demand_post increases proportionally to Ca_post load + + Clearance_Reduced: Episode + — ATP_level_post medium → pump_scale_post reduced + — Ca_post clears more slowly + — Residual elevation begins accumulating between events + — Ca_post_history starts drifting upward + — eCB threshold may be approached during heavy firing + + Clearance_Failing: Episode + — ATP_level_post low or empty → pump_scale_post near 0 + — Only NCX clearing (floor, not rescue) + — Ca_post accumulates regardless of coincidence activity + — False Trigger conditions: Ca_post_history crosses eCB + threshold without genuine NMDA overactivity + — Excitotoxicity risk if Ca_post elevation is sustained + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +sec: behaviors — Signal Integration and Fate +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Synaptic-Weight-Decision: Context + Ca_post_history (2 s rolling mean of Ca_post) determines + the plasticity signal. The threshold logic is graded: + the same variable produces opposite outcomes depending + on whether it is above or below the LTP/LTD boundary. + ATP_level_post gates LTP expression but not LTD — + strengthening requires energy, weakening does not. + + Plasticity_LTP: Episode + — Ca_post_history full (above Ca_post_LTP threshold) + — High-frequency or high-amplitude coincidence detected + — Tags synapse for AMPA receptor insertion + — Requires ATP_level_post NOT empty for expression + (CaMKII phosphorylation and receptor trafficking are + ATP-dependent — energy failure blocks LTP even if + the Ca_post signal is correct) + — [GAP] LTP expression writes g_AMPA_baseline upward + in the minutes loop + + Plasticity_Boundary: Episode + — Ca_post_history medium + — Poorly timed or low-frequency coincidence + — Neither LTP nor LTD threshold crossed + — Synapse weight unchanged this cycle + + Plasticity_LTD: Episode + — Ca_post_history low but non-zero + — Weak or mistimed coincidence — presynapse fired + but postsynapse was not sufficiently depolarised + — Tags synapse for AMPA receptor removal + — Less ATP-dependent than LTP; can proceed under + mild energy stress + — [GAP] LTD expression writes g_AMPA_baseline downward + in the minutes loop + + Plasticity_Silent: Episode + — Ca_post_history empty (prolonged absence of activity) + — Homeostatic depression: unused synapses weaken + — [GAP] not yet modelled; would require Ca_post_trace + integration over hours + +Retrograde-Feedback: Context + eCB synthesis is triggered by Ca_post_history, not V_post. + It is Ca2+ in the spine — not voltage — that activates the + enzymes (DAGL, PLC) that produce endocannabinoids. + The model cannot distinguish internally between the two + causes of elevated Ca_post_history (genuine vs pump failure) + but the consequences differ: one is communication, + the other is survival. + + eCB_Synthesis_Active: Episode + — Ca_post_history > eCB_threshold (0.7) + + — Logic A (Genuine Protection): + Cause : sustained NMDA_Open events — real overactivity + Effect : appropriate retrograde stop signal + Outcome : presynapse reduces NT → NT_cleft falls → + NMDA closes → Ca_post load drops → + Ca_post_history falls → eCB synthesis subsides + Loop closes correctly + + — Logic B (False Trigger — Excitotoxic Protection): + Cause : Clearance_Failing — Ca_post elevated by + pump failure, not genuine coincidence + Effect : presynapse silenced without real overactivity + Outcome : NT_cleft falls → NMDA closes → Ca_post + load drops → ATP_demand_post falls → + ATP_level_post recovers → pumps restart → + Ca_post clears → Ca_post_history falls → + eCB synthesis subsides + Desperate survival loop — buys time for + metabolic recovery + + eCB_Synthesis_Idle: Episode + — Ca_post_history < eCB_threshold + — eCB_level decays with tau_eCB_decay = 10000 ms + — Presynaptic suppression lifts gradually + — 10 s decay means suppression outlasts the trigger — + prevents immediate re-engagement before Ca_post + has stabilised + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +min: behaviors — Bioenergetics and Structural Change +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Metabolic-Recovery: Context + ATP_level_post is computed from Glucose_level (shared + supply) minus ATP_demand_post (postsynaptic-specific cost). + The shared supply creates the coupling: both pre and post + deplete the same astrocyte glucose budget simultaneously. + Presynaptic silence is therefore metabolically beneficial + to the postsynapse — less NT means less NMDA activation + means less Ca_post means less PMCA cost. + + Astrocyte_Supply_Active: Episode + — Glucose_level full + — ATP_demand_post within supply capacity + — ATP_level_post replenished each cycle + — All three loops operating normally + + Astrocyte_Supply_Stressed: Episode + — Glucose_level medium OR ATP_demand_post elevated + — ATP_level_post partially reduced + — Clearance_Reduced begins + — Plasticity_LTP at risk (ATP dependency) + + Astrocyte_Supply_Crisis: Episode + — Glucose_level low OR ATP_demand_post chronically high + — ATP_level_post near empty + — Clearance_Failing — only NCX clearing Ca_post + — False Trigger likely → eCB_Synthesis_Active (Logic B) + — Presynaptic silence indirectly reduces postsynaptic + ATP demand — the coupled protection mechanism + +Structural-Update: Context + Long-term changes to AMPA receptor density. + These are the physical substrate of learning and memory. + [GAP] g_AMPA_baseline not yet implemented in the model. + Would be written in Loop 3 and read by Loop 1 as the + ceiling of receptor_conductance. + + AMPA_Population_Increase: Episode + — Triggered by Plasticity_LTP + — AND ATP_level_post NOT empty + — g_AMPA_baseline shifts higher for next cycle + — More AMPA receptors → stronger Vpost_Maximum + — Easier to reach NMDA_Open in future events + — Positive feedback: LTP makes future LTP more likely + + AMPA_Population_Decrease: Episode + — Triggered by Plasticity_LTD or Plasticity_Silent + — g_AMPA_baseline shifts lower + — Fewer AMPA receptors → Vpost_Attenuated more common + — Harder to reach NMDA_Open → weakens synapse further + — Negative feedback: LTD stabilises by reducing + future coincidence probability +``` \ No newline at end of file