Endurance need is deposited only on interrupted success, not on bare depletion. Each component's DAY block now has a two-condition test: budget gated a behavior AND that behavior was on a successful trajectory (the local definition you specified — rising postsynaptic engagement for pre, climbing calcium for post, active distal spines for dend, and so on). Depletion during useless activity deposits nothing.
Endurance bypasses dopamine. The endurance_need trace gates the NIGHT budget-ceiling adaptation directly, with no neuromodulatory coincidence. This is the homeostatic-versus-associative distinction: strength requires significance, endurance only requires that fuel was the binding constraint on a forming success.
Budget capacity is now fully parallel to structure. Fast budget (occupancy, filled in DAY) versus slow budget_ceiling (capacity, built in NIGHT) mirrors exactly the occupancy-versus-structure distinction. The budget is clamped by its ceiling during DAY.
The two drives compete for one pool. Step 2b draws from the same material and energy as the structural commits in step 2, so building endurance somewhere prevents building strength elsewhere. A connection that is both significant and fuel-limited is the strongest competitor, drawing on both — which can force depotentiation of others.
Decay is by neglect, consistently. Budget ceilings decay when endurance need is not renewed (mitophagy removing idle mitochondria), exactly as structures decay when not maintained.
One thing worth your scrutiny: I kept the endurance need decaying over minutes (intermediate timescale) and cleared at NIGHT, while the budget_ceiling persists like structure. Check whether that split feels right, or whether endurance need should itself persist partially across nights for multi-night metabolic conditioning, the way tags can carry forward.
# Tripartite Synapse — Pseudocode v9
New in v9: BUDGET CAPACITY as an adaptive quantity (endurance), parallel to STRUCTURE (strength)
- budget_ceiling: slow capacity on the fast budget (like structure is on occupancy)
- endurance_need trace: deposited when depletion INTERRUPTS A SUCCESSFUL TRAJECTORY
(not mere depletion — depletion that cut short something on its way to success)
- NIGHT builds budget_ceiling where fuel was the binding constraint on a valuable outcome
NIGHT builds bigger slots (per-event power) bigger fuel cap (sustain duration)
competes for shared material + energy SAME shared material + energy
decays when unmaintained (neglect) unused / failures not costly (mitophagy)
JOINT LOGIC:
to be remembered AND sustainable, a connection must
- complete validated coincidences (→ strength), AND
- either not be fuel-limited, or earn endurance by failing-at-the-verge (→ endurance)
under scarcity the two drives compete:
building endurance somewhere spends material that can't strengthen elsewhere
the system invests endurance specifically where FUEL,
not structure or significance, was what stood between activity and success.
```
# 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)
A component operates within two ceilings set by the previous NIGHT: a **structure** that bounds how strongly each behavior can act, and a **budget capacity** that bounds how much fuel the component can hold. Both ceilings bound an active, competitive DAY process — structure bounds how far behavior strength can be filled toward its maximum, budget capacity bounds how far fuel can be replenished toward its maximum — and in both cases the filling competes against other components for a shared resource. During DAY, in each context, the component executes behaviors that draw on budget and deposit fast traces. Two kinds of evidence accumulate: a **tag**, when a local eligibility signal coincides with non-local validation, driving *strength*; and an **endurance need**, when budget depletion interrupts a behavior on a successful trajectory, driving *endurance*. At NIGHT, tags raise structure and endurance needs raise budget capacity, both proportional to available material and energy, both drawing from the same finite pool, so that strength and endurance compete. What is not committed decays for lack of maintenance, and the resources freed partially fund what was.
ENDURANCE_NEED += g(trajectory) // fuel interrupted a forming success
```
Two competitive DAY processes fill the two ceilings:
**Strength filling (bounded by STRUCTURE).** Behavior strength rises toward the structural ceiling by competing for local occupancy resources — receptors at the postsynapse, vesicles at the presynapse. A behavior cannot act more strongly than its structure permits, because the occupancy it draws on is itself bounded by the structure.
**Fuel replenishment (bounded by BUDGET_CEILING).** Fuel rises toward the budget ceiling by competing for shared upstream supply — astrocyte lactate, soma shipment. Each component's claim is the gap between its current budget and its ceiling; the shared supply is rationed by these claims:
```
// competitive replenishment — the ceiling bounds the process via the demand
c_demand = BUDGET_CEILING - BUDGET // gap below ceiling = claim on supply
total_demand = sum(c_demand for components on shared supply S)
allocation_factor = min(1, S / (total_demand + ε))
Neither ceiling is applied as a clamp. Each bounds its process from within: structure is the thing being filled with occupancy, budget_ceiling is the target the replenishment demand reaches toward. A high budget_ceiling is not free even during DAY — it makes a large standing claim on shared fuel, and the component reaches it only if the supply can satisfy that claim against competing claims.
The fast trace drives two parallel processes; depletion drives a third.
**Across contexts** — the fast trace accumulates into `possible_tagging` above the eligibility threshold. The bridge toward strength. Requires the trace to survive into a NOT/CONTINUOUS context.
**On depletion** — when budget gates a behavior that was succeeding, `endurance_need` accumulates. The bridge toward endurance. Requires the depletion to have interrupted something valuable, not merely to have occurred.
Strength is associative. The tag requires local eligibility plus non-local validation, the number of coincidences set by the component's spatial scale.
Endurance is homeostatic, not associative. It requires depletion plus a successful trajectory, the meaning of "successful" set by the component's local function. **No dopamine.**
Decay is not a separate behavior — it is the passive consequence of molecular processes. It enforces time windows without any clock: a coincidence must complete, and a depletion must interrupt a success, while the relevant trace is still elevated. Timing is the competition between accumulation and decay.
Coherence bonus when pre, post, and astro tags are all set together — the three synaptic components independently gathered evidence for the same change.
The two commits compete for the same material and energy: building endurance somewhere cannot strengthen elsewhere. A component both significant and fuel-limited demands both and is the strongest claimant, potentially forcing decay elsewhere.
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
// 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.
// ... 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.