Compare commits

...

264 Commits

Author SHA1 Message Date
sergio 1b0be03567 Update elements/neuron/postsynapse.md 2026-07-11 17:00:45 +02:00
sergio 126fba68a1 Update elements/neuron/postsynapse.md 2026-07-11 16:59:47 +02:00
sergio ba68961933 Update elements/neuron/postsynapse.md 2026-07-11 16:54:00 +02:00
ocrampal 2bbec8e1ae Update 2026-06-29-tripartite-synapse_v17.md 2026-07-11 13:15:02 +02:00
ocrampal cbfe46ca04 Update 2026-07-08-the-unexpressed-objects.md 2026-07-11 11:13:26 +02:00
ocrampal 0770b6b27b Update presynapse.md 2026-07-10 15:01:00 +02:00
ocrampal 5094cabbb4 Update presynapse.md 2026-07-10 14:59:33 +02:00
ocrampal 554578343b Update 2026-06-29-tripartite-synapse_v17.md 2026-07-10 11:47:21 +02:00
ocrampal 5634bb8801 Update 2026-07-08-the-unexpressed-objects.md 2026-07-10 11:27:34 +02:00
ocrampal 890d27b6a0 Update 2026-07-08-the-unexpressed-objects.md 2026-07-08 17:49:41 +02:00
ocrampal 249a437776 Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 17:47:01 +02:00
ocrampal de513856cb varie 2026-07-08 16:36:41 +02:00
ocrampal 044c6fb875 Create 2026-06-19-abstract-pattern-expression.md 2026-07-08 16:35:04 +02:00
ocrampal dd8a55c4d5 Delete 2026-06-19-abstract-pattern-expression.md 2026-07-08 16:34:59 +02:00
ocrampal c2d514449f Create 2026-07-08-the-unexpressed-objects.md 2026-07-08 16:33:47 +02:00
ocrampal 1aa18d3f94 Delete 2026-07-08-verifable-behaviors.md 2026-07-08 16:33:41 +02:00
ocrampal 7998ad7d5c Create 2026-07-08-verifable-behaviors.md 2026-07-08 13:43:12 +02:00
ocrampal 0edce0ab9f Update 2026-06-29-tripartite-synapse_v17.md 2026-07-08 13:31:40 +02:00
ocrampal 45609ab922 Update 2026-07-08-traditional-approach-simulation.md 2026-07-08 11:46:15 +02:00
ocrampal f861fb87da Create 2026-07-08-traditional-approach-simulation.md 2026-07-08 11:44:44 +02:00
ocrampal 233b1058ea Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 11:35:06 +02:00
ocrampal 42313c801a Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 11:33:12 +02:00
ocrampal f9dfb2e542 Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 11:21:19 +02:00
ocrampal 8742439b99 varie 2026-07-08 10:46:40 +02:00
ocrampal b169084b2c Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 10:45:39 +02:00
ocrampal 421aae0095 Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-08 10:34:48 +02:00
ocrampal 4ea6ffa504 Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-07 23:53:43 +02:00
ocrampal be8b241395 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-07 23:21:35 +02:00
ocrampal cf9f4476f3 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-07 14:44:22 +02:00
ocrampal 7561652e2e Update 2026-07-06-logic-principles-of-the-expresion_v5.md 2026-07-07 14:25:37 +02:00
ocrampal e57f1b2f82 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-07 01:46:16 +02:00
ocrampal 9a3d75af04 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-06 23:14:28 +02:00
ocrampal 9d8ef10767 logic v5 2026-07-06 18:54:14 +02:00
ocrampal 46b2480dbe Delete 2026-06-30-logic-principles-of-the-expression_v4.md 2026-07-06 18:53:58 +02:00
ocrampal d10ec73310 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-06 18:34:26 +02:00
ocrampal 651f2847af Update 2026-06-29-tripartite-synapse_v17.md 2026-07-06 16:45:34 +02:00
ocrampal db08fb9770 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-06 11:35:10 +02:00
ocrampal 25c20d10ea Update 2026-06-29-tripartite-synapse_v17.md 2026-07-05 21:33:31 +02:00
ocrampal 49f0c48391 Update 2026-06-30-logic-principles-of-the-expression_v4.md 2026-07-05 20:46:48 +02:00
ocrampal ac97417beb varie 2026-07-05 20:37:59 +02:00
ocrampal 12eae6f662 Update presynapse.md 2026-07-04 23:02:21 +02:00
ocrampal 8b33560dff Update presynapse.md 2026-07-04 15:37:53 +02:00
ocrampal fe0147dda1 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-03 18:43:35 +02:00
ocrampal 3b94db3fdf Update presynapse.md 2026-07-03 17:17:47 +02:00
ocrampal ae167bc585 Update presynapse.md 2026-07-03 17:14:25 +02:00
ocrampal 76de56a8e4 Update presynapse.md 2026-07-03 17:13:02 +02:00
ocrampal 6213b1f3ca Update presynapse.md 2026-07-03 15:32:53 +02:00
ocrampal eb2e638d1e Update presynapse.md 2026-07-02 15:05:29 +02:00
ocrampal 4a2dea6e87 Update presynapse.md 2026-07-02 15:05:17 +02:00
ocrampal a562eb3292 Update 2026-06-29-tripartite-synapse_v17.md 2026-07-02 12:16:27 +02:00
ocrampal 8d8d2f74e7 Update 2026-06-30-logic-principles-of-the-expression_v4.md 2026-07-01 16:22:58 +02:00
ocrampal 1b9c716f19 Update 2026-06-30-logic-principles-of-the-expression_v4.md 2026-07-01 15:13:31 +02:00
ocrampal d80643425c Update 2026-06-29-tripartite-synapse_v17.md 2026-07-01 11:36:42 +02:00
ocrampal d523660db9 Update 2026-06-30-logic-principles-of-the-expression_v4.md 2026-07-01 11:28:16 +02:00
ocrampal 4027b9329b logic principles v4 2026-06-30 17:30:32 +02:00
ocrampal c1d2b862ad Create 2026-06-30-logic-principles-of-the-expression_v4.md 2026-06-30 17:29:55 +02:00
ocrampal 2f3f5b2b96 v17 2026-06-30 11:43:19 +02:00
ocrampal 9365d4f937 Update 2026-06-29-tripartite-synapse_v16.md 2026-06-30 10:53:42 +02:00
ocrampal 9e517eb122 Update 2026-06-29-biological-reference_v16.md 2026-06-30 10:53:28 +02:00
ocrampal a2c8be26d8 v16 2026-06-30 10:51:28 +02:00
ocrampal 6cb83dd856 Create 2026-06-26-tripartite-synapse_v14.md 2026-06-29 21:43:24 +02:00
ocrampal 025ad37116 Delete 2026-06-26-tripartite-synapse_v14.md 2026-06-29 21:43:16 +02:00
ocrampal 8a577b4fad Create 2026-06-29-biological-reference_v15.md 2026-06-29 21:32:16 +02:00
ocrampal 4c9bb9e48e Delete 2026-06-26-biological-reference_v14.md 2026-06-29 21:32:08 +02:00
ocrampal 9d0d80a873 Create 2026-06-29-tripartite-synapse_v15.md 2026-06-29 21:30:38 +02:00
ocrampal a5941a2262 varie 2026-06-29 17:41:10 +02:00
ocrampal 2082fc27c8 Update presynapse.md 2026-06-29 17:26:59 +02:00
ocrampal 90377380e8 Update 2026-06-26-tripartite-synapse_v14.md 2026-06-29 11:32:33 +02:00
ocrampal 66c8a6e8cb Update presynapse.md 2026-06-28 13:46:01 +02:00
ocrampal d9c55d0269 v14 2026-06-26 17:43:48 +02:00
ocrampal 844618db13 v14 2026-06-26 17:43:37 +02:00
ocrampal 09e0d9d984 Update 2026-06-22-tripartite-synapse_v13.md 2026-06-26 16:23:35 +02:00
ocrampal 7aacb5999c Update presynapse.md 2026-06-26 16:01:05 +02:00
ocrampal 09dacd9fd7 trace -> else 2026-06-26 15:52:16 +02:00
ocrampal a70039c597 Update presynapse.md 2026-06-26 12:47:41 +02:00
ocrampal de89772209 Update presynapse.md 2026-06-26 12:12:38 +02:00
ocrampal f8ef915a41 Create presynapse old.md 2026-06-26 12:11:29 +02:00
ocrampal 21b2c0600d Delete presynapse old.md 2026-06-26 12:11:23 +02:00
ocrampal 60d5af4625 Update presynapse.md 2026-06-26 12:10:08 +02:00
ocrampal e6f7573da8 Update presynapse.md 2026-06-26 12:09:24 +02:00
ocrampal 769d96a3b0 Update presynapse.md 2026-06-26 12:08:19 +02:00
ocrampal a227329798 Update presynapse.md 2026-06-26 12:07:35 +02:00
ocrampal 9ed42e20fa Update presynapse.md 2026-06-26 11:57:12 +02:00
ocrampal 90d4eceb86 Update presynapse.md 2026-06-26 11:54:28 +02:00
ocrampal 4a31aa0ba8 Update presynapse.md 2026-06-26 11:50:30 +02:00
ocrampal 260b37edd2 Update presynapse.md 2026-06-26 11:49:13 +02:00
ocrampal 7ab42a6c65 Update presynapse.md 2026-06-26 11:36:39 +02:00
ocrampal 1dc2c0248f Update presynapse.md 2026-06-26 10:44:44 +02:00
ocrampal 1770444589 Update presynapse.md 2026-06-25 19:07:06 +02:00
ocrampal f6152f3a2b Update presynapse.md 2026-06-25 19:01:59 +02:00
ocrampal 4298d2cd8d Update presynapse.md 2026-06-25 18:50:19 +02:00
ocrampal 4d12a6b107 Update presynapse.md 2026-06-25 18:42:45 +02:00
ocrampal 6bb183ffc7 Update presynapse.md 2026-06-25 17:18:06 +02:00
ocrampal 2a705a22f9 Update presynapse.md 2026-06-25 17:14:49 +02:00
ocrampal 4fd9d80e87 Update presynapse.md 2026-06-25 17:10:25 +02:00
ocrampal 5228d8b9a5 Update presynapse.md 2026-06-25 17:07:50 +02:00
ocrampal 96fb613ba0 Update presynapse.md 2026-06-25 17:00:45 +02:00
ocrampal e4e390bb90 Update presynapse.md 2026-06-25 16:23:05 +02:00
ocrampal 1b8a8104b4 Update presynapse.md 2026-06-25 14:58:32 +02:00
ocrampal da387663bd Update presynapse.md 2026-06-25 14:52:57 +02:00
ocrampal 34bdd58331 Update presynapse.md 2026-06-25 14:51:02 +02:00
ocrampal f89a270263 Update presynapse.md 2026-06-25 14:39:20 +02:00
ocrampal e58173af5a Update presynapse.md 2026-06-25 11:57:18 +02:00
ocrampal c8c953f68d Update presynapse.md 2026-06-25 11:56:15 +02:00
ocrampal 95b1d9bab0 void 2026-06-25 11:30:04 +02:00
ocrampal 605ecb83a2 Update presynapse.md 2026-06-25 10:45:21 +02:00
ocrampal 0f886f6896 Update presynapse.md 2026-06-25 10:19:38 +02:00
ocrampal fea9d3342f Update presynapse.md 2026-06-25 10:16:54 +02:00
ocrampal 953ea9f810 Update presynapse.md 2026-06-25 10:15:17 +02:00
ocrampal cfdc7da02a Update presynapse.md 2026-06-25 10:12:35 +02:00
ocrampal 9fbb62fbb4 Update presynapse.md 2026-06-25 10:11:43 +02:00
ocrampal 95c3971a02 varie 2026-06-25 09:59:27 +02:00
ocrampal a5ce3ca8c3 Update neuron.md 2026-06-24 17:17:07 +02:00
ocrampal b322eb1dfc varie 2026-06-24 17:13:41 +02:00
ocrampal 103936c25d Update presynapse.md 2026-06-24 17:08:20 +02:00
ocrampal 50d14970b8 Update presynapse.md 2026-06-24 17:07:35 +02:00
ocrampal 06047e6a69 Update winnertakeall.md 2026-06-24 16:46:25 +02:00
ocrampal 9c47bc7380 Update presynapse.md 2026-06-24 16:34:38 +02:00
ocrampal 588e850056 Update winnertakeall.md 2026-06-24 16:21:14 +02:00
ocrampal 17282a6cbd Update winnertakeall.md 2026-06-24 16:20:34 +02:00
ocrampal 995358e5a2 varie 2026-06-24 16:05:32 +02:00
ocrampal f0c0f0d8e3 Update presynapse.md 2026-06-24 12:00:30 +02:00
ocrampal 3e449ffa1b Update presynapse.md 2026-06-24 11:57:06 +02:00
ocrampal 5b4ed0a30c Update winnertakeall.md 2026-06-24 11:22:58 +02:00
ocrampal bfb7532d73 Update winnertakeall.md 2026-06-24 11:22:11 +02:00
ocrampal 38e12a7521 Update presynapse.md 2026-06-23 17:52:14 +02:00
ocrampal 2918659cee Update presynapse.md 2026-06-23 17:36:40 +02:00
ocrampal bb1cd202ba Update presynapse.md 2026-06-23 17:36:00 +02:00
ocrampal 4dc073d0fe Update presynapse.md 2026-06-23 16:20:06 +02:00
ocrampal cd4cdd043e Update presynapse.md 2026-06-23 16:19:17 +02:00
ocrampal 0fa8185a32 Update presynapse.md 2026-06-23 12:54:30 +02:00
ocrampal 1957d4ef85 Update 2026-06-19-abstract-pattern-expression.md 2026-06-22 21:17:17 +02:00
ocrampal d9059cfd9f v12 2026-06-22 16:37:36 +02:00
ocrampal 7a2e28b696 v13 2026-06-22 16:36:52 +02:00
ocrampal bec6e8f09d v13 2026-06-22 16:35:11 +02:00
ocrampal 955f572774 v12 2026-06-22 11:56:47 +02:00
ocrampal a74eedcbae v12 2026-06-22 11:56:33 +02:00
ocrampal 4191d61e80 v12 2026-06-22 11:48:55 +02:00
ocrampal d0f2cbab20 v12 2026-06-22 11:48:40 +02:00
ocrampal 49b9fa2830 v11 2026-06-21 20:10:03 +02:00
ocrampal cb7054113a v11 2026-06-21 20:09:48 +02:00
ocrampal 58a19df8e3 varie 2026-06-21 19:42:46 +02:00
ocrampal 3ff76fb9a5 Update presynapse.md 2026-06-21 15:10:48 +02:00
ocrampal 85d371d9cf Update presynapse.md 2026-06-21 15:06:17 +02:00
ocrampal 27e2f3df7b Create presynapse old.md 2026-06-21 13:51:27 +02:00
ocrampal 529bd64fba Merge branch 'master' of https://repo.splindex.net/ocrampal/organism 2026-06-21 10:16:50 +02:00
ocrampal 0df834108a no ecb messages 2026-06-21 10:16:34 +02:00
ocrampal d2554b18dd Update elements/neuron/appunti/2026-06-19-logic-principles-of-the-expression.md 2026-06-20 10:05:35 +02:00
ocrampal 1c20c24961 Update 2026-06-19-logic-principles-of-the-expression.md 2026-06-19 19:51:27 +02:00
ocrampal 4c6c956345 fill vs refill 2026-06-19 14:09:24 +02:00
ocrampal e807c77dad Create 2026-06-10-what-the-organism-does.md 2026-06-19 11:19:48 +02:00
ocrampal e4ef1dfb83 Delete 2026-06-10-what-the-organism-does.md 2026-06-19 11:19:42 +02:00
ocrampal ce46bf3c39 Create 2026-06-19-abstract-pattern-expression.md 2026-06-19 11:18:52 +02:00
ocrampal f60ab1a1da v10 2026-06-19 11:16:56 +02:00
ocrampal b031be0e4d Delete 2026-06-15-tripartite_synapse_v8.md 2026-06-19 11:16:47 +02:00
ocrampal 5bea36e50e Create 2026-06-18-tripartite_synapse_v9.md 2026-06-19 11:06:22 +02:00
ocrampal 99041885ec Delete 2026-06-18-tripartite_synapse_v9.md 2026-06-19 11:06:16 +02:00
ocrampal 5812fbc325 Update 2026-06-19-logic-principles-of-the-expression.md 2026-06-19 10:46:42 +02:00
ocrampal be99c347a3 varie 2026-06-19 10:45:28 +02:00
ocrampal 1ef79f8d68 logic principles 2026-06-19 10:45:17 +02:00
ocrampal 25211d062a Create 2026-06-15-tripartite_synapse_v8.md 2026-06-19 10:19:38 +02:00
ocrampal e5110c260b abstract pattern 2026-06-19 10:19:32 +02:00
ocrampal c5297fcf5d bis 2026-06-18 12:33:01 +02:00
ocrampal f5d23459ad v9 bis 2026-06-18 12:32:48 +02:00
ocrampal 98e6cb6500 v9 2026-06-18 12:29:56 +02:00
ocrampal b91f134845 varie 2026-06-15 12:32:57 +02:00
ocrampal c0070f98a7 Create 2026-06-11-tripartite_synapse_v7.md 2026-06-15 12:19:13 +02:00
ocrampal 05e2164a9d Delete 2026-06-11-tripartite_synapse_v7.md 2026-06-15 12:19:06 +02:00
ocrampal be51cf8548 Update 2026-06-11-general-guidelines-for-G-expression.md 2026-06-15 12:18:39 +02:00
ocrampal 40dd0db647 v8 2026-06-15 12:11:15 +02:00
ocrampal 3b19904f57 Update 2026-06-11-tripartite_synapse_v7.md 2026-06-15 11:04:30 +02:00
ocrampal e9527a0d07 Update 2026-06-11-tripartite_synapse_v7.md 2026-06-15 10:39:56 +02:00
ocrampal 6a58b77492 Update 2026-06-11-tripartite_synapse_v7.md 2026-06-14 12:55:52 +02:00
ocrampal 2639582b99 VTA 2026-06-13 16:55:31 +02:00
ocrampal 414ffc581e Update 2026-06-11-tripartite_synapse_v7.md 2026-06-11 19:01:36 +02:00
ocrampal 8b76abc54a old 2026-06-11 18:59:20 +02:00
ocrampal 1fe72a277b old 2026-06-11 18:59:09 +02:00
ocrampal debe070b3f old 2026-06-11 18:57:40 +02:00
ocrampal 289932a0e7 old 2026-06-11 18:57:29 +02:00
ocrampal 2aadec4d45 Create 2026-06-11-tripartite_synapse_v7.md 2026-06-11 18:56:44 +02:00
ocrampal 1a53d0c693 toc 2026-06-11 18:43:41 +02:00
ocrampal 89cf28928f Update 2026-06-11-tripartite_synapse_v6.md 2026-06-11 16:58:23 +02:00
ocrampal 755f558a17 v6 2026-06-11 15:37:33 +02:00
ocrampal c3a8231e84 Update 2026-06-11-tripartite_synapse_v5.md 2026-06-11 10:50:31 +02:00
ocrampal c86dd5f794 Create 2026-06-11-general-guidelines-for-G-expression.md 2026-06-11 10:48:45 +02:00
ocrampal 0523779740 old 2026-06-11 10:25:16 +02:00
ocrampal 19824cae69 old appunti 2026-06-11 10:25:00 +02:00
ocrampal a0b4a10b7b Create 2026-06-11-tripartite_synapse_v5.md 2026-06-11 10:02:36 +02:00
ocrampal 710c63b8e7 Create 2026-06-11-tripartite_synapse_v5 2026-06-11 09:57:46 +02:00
ocrampal 1291a1d271 Update 2026-06-10-what-the-organism-does.md 2026-06-11 09:22:58 +02:00
ocrampal 4089fcbb48 Update 2026-06-10-what-the-organism-does.md 2026-06-10 20:01:40 +02:00
ocrampal 86edf83f97 Create 2026-06-10-what-the-organism-does.md 2026-06-10 20:00:24 +02:00
ocrampal 6b61a57840 Delete 2026-06-06-tripartite_synapse_v2.md 2026-06-10 19:59:32 +02:00
ocrampal 107137ccb2 Update 2026-06-06-tripartite_synapse_v4.md 2026-06-10 19:59:07 +02:00
ocrampal ab47b0621a Create 2026-06-06-tripartite_synapse_v4.md 2026-06-10 11:06:12 +02:00
ocrampal f51a0e9589 Delete 2026-06-06-tripartite_synapse_v2.md 2026-06-10 00:26:42 +02:00
ocrampal e79f3714cf Create 2026-06-06-tripartite_synapse_v2.md 2026-06-09 18:43:35 +02:00
ocrampal a682fa5b56 Update presynapse.md 2026-06-09 17:40:19 +02:00
ocrampal e3fd155e45 Merge branch 'master' of https://repo.splindex.net/ocrampal/organism 2026-06-09 12:00:20 +02:00
ocrampal 9c2915e3d5 Update presynapse.md 2026-06-09 12:00:12 +02:00
sergio 11651aa7be Update elements/neuron/soma.md 2026-06-08 02:28:14 +02:00
sergio ca8b156612 Update elements/neuron/pre_vgcc.md 2026-06-08 01:43:13 +02:00
ocrampal 19f32b490d Delete elements/astrocyte/appunti/2026-06-06-tripartite_synapse_budget_pseudocode.md 2026-06-07 12:09:12 +02:00
ocrampal ceab38040f Delete elements/astrocyte/appunti/2026-06-04-modulation-of-future-behavior.md 2026-06-07 12:08:39 +02:00
ocrampal 9223715277 Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:50:56 +02:00
ocrampal 2d6938e145 Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:49:03 +02:00
ocrampal 766d944e39 Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:23:27 +02:00
ocrampal 19c1836d73 Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:20:34 +02:00
ocrampal 3f490dcaff Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:15:32 +02:00
ocrampal 45b627e6c9 Update 2026-06-06-tripartite_synapse_v2.md 2026-06-07 11:14:09 +02:00
ocrampal 545638780e Update 2026-06-06-tripartite_synapse_v2.md 2026-06-06 16:55:07 +02:00
ocrampal 567fb80d8b Create 2026-06-06-tripartite_synapse_v2.md 2026-06-06 16:49:29 +02:00
ocrampal 41d3916997 Delete tripartite_synapse_full_pseudocode.html 2026-06-06 14:39:27 +02:00
ocrampal 9f59b2906a Update 2026-06-06-tripartite_synapse_budget_pseudocode.md 2026-06-06 14:37:47 +02:00
ocrampal 984722538e Update 2026-06-06-tripartite_synapse_budget_pseudocode.md 2026-06-06 14:37:14 +02:00
ocrampal 2cad11b1c2 Delete tripartite_synapse_budget_pseudocode.md 2026-06-06 13:23:42 +02:00
ocrampal ffe3231eff varie 2026-06-06 13:23:40 +02:00
ocrampal b5fca33e32 Merge branch 'master' of https://repo.splindex.net/ocrampal/organism 2026-06-06 13:13:43 +02:00
ocrampal 22f6185115 Create tripartite_synapse_budget_pseudocode.md 2026-06-06 13:12:50 +02:00
ocrampal 2175a668fe Update elements/astrocyte/appunti/2026-06-04-modulation-of-future-behavior.md
Budget
2026-06-06 10:09:46 +02:00
ocrampal 91851fd2d4 Update elements/astrocyte/appunti/2026-06-04-modulation-of-future-behavior.md
Calcium
2026-06-06 09:58:24 +02:00
ocrampal ff2e0a9ee9 Update elements/astrocyte/appunti/2026-06-04-modulation-of-future-behavior.md
Simple organism
2026-06-06 09:50:10 +02:00
ocrampal 6dd501ce06 Update elements/astrocyte/appunti/2026-06-04-modulation-of-future-behavior.md
Timescales
2026-06-06 09:21:35 +02:00
ocrampal 84b07c9e39 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 16:38:11 +02:00
ocrampal 48979a3d31 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 16:29:52 +02:00
ocrampal c875fd975e Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:56:27 +02:00
ocrampal 2a96e285af Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:55:08 +02:00
ocrampal 53e0c7c863 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:52:19 +02:00
ocrampal 7149ca6850 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:42:53 +02:00
ocrampal 19b6662da9 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:41:57 +02:00
ocrampal 2f3cb4855a Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 13:08:48 +02:00
ocrampal 7df99e34ca Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:34:42 +02:00
ocrampal 63777f2f11 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:33:09 +02:00
ocrampal 0a9c9ba11a Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:32:18 +02:00
ocrampal 83f4239f38 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:31:11 +02:00
ocrampal 9d1b4b43fd Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:25:21 +02:00
ocrampal daab317e5f Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:04:13 +02:00
ocrampal cb1ff359b2 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:00:56 +02:00
ocrampal 9c520aae32 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 12:00:07 +02:00
ocrampal d79dccc48b Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 11:58:35 +02:00
ocrampal 3c11124b9e Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 11:57:43 +02:00
ocrampal a0b55b7851 Create tripartite_synapse_full_pseudocode.html 2026-06-05 11:57:23 +02:00
ocrampal 0e3548a284 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 11:56:51 +02:00
ocrampal 027713339c Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 11:44:09 +02:00
ocrampal 641a60debe Update 2026-06-04-modulation-of-future-behavior.md 2026-06-05 11:26:17 +02:00
ocrampal 9428ad0973 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-04 17:54:59 +02:00
ocrampal 140a52bb56 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-04 17:54:37 +02:00
ocrampal bb29dd3f00 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-04 17:53:15 +02:00
ocrampal 42bf8a2a35 Update 2026-06-04-modulation-of-future-behavior.md 2026-06-04 17:52:04 +02:00
ocrampal ec1010955a Update 2026-06-04-modulation-of-future-behavior.md 2026-06-04 10:33:02 +02:00
ocrampal 7e2b1fb607 Merge branch 'master' of https://repo.splindex.net/ocrampal/organism 2026-06-04 10:14:13 +02:00
ocrampal 45e7fafaa5 Create 2026-06-04-modulation-of-future-behavior.md 2026-06-04 10:13:58 +02:00
ocrampal cd374bd8b6 Update 2026-06-02-astrocyte-behaviors.md 2026-06-04 10:13:51 +02:00
ocrampal 6096202642 Update 2026-06-02-astrocyte-behaviors.md 2026-06-04 09:33:03 +02:00
sergio 106aaff6c1 Update elements/neuron/soma.md 2026-06-03 19:30:21 +02:00
sergio 1f120c3b9c Update elements/neuron/soma.md 2026-06-03 18:55:02 +02:00
ocrampal 059ff8b39f Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 12:04:46 +02:00
ocrampal 8eddd6657e Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 12:03:08 +02:00
ocrampal c7c8e27955 Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 12:01:42 +02:00
ocrampal 703f6c16a7 Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 11:59:32 +02:00
ocrampal dcfc77181c Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 11:32:59 +02:00
ocrampal 03ebcce29d Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 10:33:15 +02:00
ocrampal 9af08319b0 Merge branch 'master' of https://repo.splindex.net/ocrampal/organism 2026-06-03 10:27:36 +02:00
ocrampal a8536caf19 Update 2026-06-02-astrocyte-behaviors.md 2026-06-03 10:26:58 +02:00
63 changed files with 16297 additions and 3151 deletions
+5
View File
@@ -0,0 +1,5 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{}
@@ -1,6 +1,339 @@
# Specification Document: Multi-Scale Tripartite Synapse Model ---
include_toc: true
---
This document serves as the comprehensive blueprint for a multi-scale computational model of a glutamatergic (excitatory) tripartite synapse. It integrates the directional influences between the **presynapse**, **postsynapse**, and **astrocyte** across fast, intermediate, and slow time scales, detailing both standard and opposite plastic behaviors. # Architectural Blueprint: The Acoustic Wave Model of the Tripartite Synapse
This document compiles the complete, integrated framework of your tripartite synapse model. It translates the biological interactions of the **presynapse**, **postsynapse**, **astrocyte**, and **neuromodulators** into a singular, high-level metaphor of **wave propagation, resonance, and acoustic carving** across multiple time scales.
## Intro
The presynapse, postsynapse, and astrocyte each maintain a **default low-energy baseline** when input frequency is within normal range (~110 Hz): the presynapse releases vesicles at low probability, the postsynapse stays clamped by the Mg²⁺ block, and the astrocyte simply clears the cleft and ticks over its fuel pipeline. When current input deviates from this baseline — either upward into high-frequency bursts or downward into disuse — the system begins to adapt, but the *direction* of that adaptation depends on **past influence**: if the high-frequency drive is sustained and coincides with a neuromodulatory validation signal (dopamine), the deviation gets permanently encoded as structural expansion; if the drive is transient, only temporary facilitation occurs and the system rebounds; if the signal is chronically weak or mistimed, the astrocyte actively dissolves the existing structure and the synapse contracts back toward silence. In other words, current input sets the *alarm*, but accumulated history — stored in vesicle pool sizes, receptor counts, and ECM integrity — determines whether the response is ignored, temporarily buffered, permanently carved in, or actively erased.
---
## 1. The Cast of the Acoustic Chamber
### The Presynapse: "The Scalable Wave Generator"
* **The Core Business:** An oscillator whose sole job is to translate digital electrical events (Action Potentials) into analog chemical wavefronts.
* **The Physics:** It alters its physical launchpad (**the Active Zone**) to change the shape, volume, and reliability of the waves it outputs. It can scale from a muffled desktop speaker to a high-fidelity subwoofer array based on historical demand.
### The Postsynapse: "The Coincidence Resonator"
* **The Core Business:** A specialized tuning fork designed to capture incoming wavefronts and record them by adjusting its local vibration sensitivity (**AMPA receptors**).
* **The Physics:** It features a heavy, built-in mechanical clamp (**the Magnesium plug**) that prevents it from vibrating freely during routine background noise. It requires precise synchronization to unlock its recording software.
### The Astrocyte: "The Acoustic Medium, Gatekeeper & Fuel Plant"
* **The Core Business:** The dynamic fluid medium filling the entire chamber. It monitors traffic volume and actively reshapes the physical environment.
* **The Physics:** It changes its local density to vacuum up trailing echoes, injects direct pressure nudges, drops local tuning stabilizers, or deploys massive dampening gels to protect the chamber from shattering under high-volume shockwaves.
### Neuromodulators: "The Global Gain & Tension Controllers"
* **The Core Business:** A brain-wide broadcast system (**Norepinephrine, Dopamine, Acetylcholine**) that alters the context of the chamber.
* **The Physics:** They tighten or loosen the "strings" of the medium, shifting the operational thresholds of the entire system and dictating whether a wave pattern is important enough to permanently carve into the architecture.
---
## 2. Temporal Architecture of the System
* **The Fast Time Scale (Milliseconds to Seconds):** **Wave Propagation.** The immediate physics of a single wavefront launching from the Generator, traveling through the Medium, and striking the Resonator.
* **The Intermediate Time Scale (Seconds to Minutes):** **Temporary Tuning.** Dynamic adjustments where frequency patterns temporarily prime the launchpad or loosen the mechanical clamps to gate learning.
* **The Slow Time Scale (Hours to Days to Weeks):** **Structural Carving & Power Management.** The permanent physical rewriting of the chamber's architecture (building or destroying channels) and the management of the raw energy supply chain.
---
## 3. The Functional Operational Modes
### Mode 1: Baseline Cleaning (Low-Frequency Ripples)
* **The Input:** Slow, isolated, low-frequency electrical ripples ($\sim$ 110 Hz).
* **The Presynaptic State:** The Generator maintains its factory calibration. The launchpad is small, and only a tiny fraction of its wave packets (**vesicles**) sit at the edge. The rest are chained in a deep storage reserve.
* **The Postsynaptic State:** The wavefront strikes the Resonator, but because the heavy mechanical clamp is on, it barely registers. The baseline sensitivity remains unchanged.
* **The Astrocytic State:** The Astrocyte acts as an **Acoustic Buffer**. It rapidly vacuums up the trailing edges of the wavefront, preventing acoustic blur. This keeps the chamber silent and crisp before the next ripple arrives.
### Mode 2: Standard Plasticity (Targeted Resonance & Carving)
* **The Input:** An intense, rhythmic high-frequency wave cascade ($\sim$ 50100 Hz) restricted to a single pathway.
* **The Phased Interaction:**
1. **Intermediate Prep:** The **Generator** cuts the chains holding its wave packets in deep storage, rapidly packing its launchpad to maximum capacity. It is now primed to launch massive wavefronts.
2. **Unlocking the Gate:** The massive wave cascade forces the **Resonator** to heat up, electrostatically throwing off its heavy mechanical clamp ($Mg^{2+}$ plug). Simultaneously, the **Astrocyte** senses the high volume and drops a precise acoustic stabilizer (**D-Serine**) directly onto the Resonator.
3. **Resonance Phase:** The Resonator begins to hum at maximum amplitude, temporarily upscaling its capturing sensitivity (**Early-LTP**).
4. **Slow Structural Carving (Late-LTP):** If a validation signal like **Dopamine** (the "Save Button") arrives, the Astrocyte approves permanent storage. The Astrocyte physically moves its fluid walls closer around the Resonator to insulate it and secretes a solid molecular matrix (**Glypicans**). This permanently expands the Generator's launchpad and anchors new receptors into the Resonator—**permanently carving an acoustic channel** that funnels future waves effortlessly.
### Mode 3: Opposite Behavior (The Shockwave Lockdown)
* **The Input:** Massive, widespread, uncoordinated tidal waves ($> 100\text{ Hz}$) overloading multiple neighboring channels simultaneously.
* **The Phased Interaction:**
1. **The Global Alarm:** The individual local vibrations fuse into a massive, global shockwave ($Ca^{2+}_{\text{soma}}$ wave) sweeping across the entire **Astrocyte**.
2. **Presynaptic Overdrive:** To ensure critical data survives the chaos, the Astrocyte forces the **Generator** into an overdrive reconfiguration. The generator clusters its input valves directly beneath its launchpad, guaranteeing maximum signal penetration.
3. **Postsynaptic Shielding:** Simultaneously, the Astrocyte floods the **Resonator** with a heavy acoustic gel (**GABA/ATP field**). This gel hyperpolarizes the Resonator and internalizes its receptors, acting as a massive circuit-breaker to protect the delicate cellular hardware from shattering under the extreme volume.
### Mode 4: Active Forgetting (Acoustic Erosion)
* **The Input:** A consolidated channel falls into disuse or is subjected to a continuous, meaningless, out-of-sync drone ($\sim$ 1 Hz white noise).
* **The Phased Interaction:**
1. **Discordant Leakage:** The out-of-sync waves hit the Resonator, but because the timing is wrong, the mechanical clamp stays on. Only a tiny, discordant vibration leaks through.
2. **Astrocytic Teardown:** The **Astrocyte** recognizes this useless chatter, cuts off the tuning stabilizers, and deploys molecular scissors (**MMPs**).
3. **Dismantling the Launchpad:** The scissors actively dissolve the structural matrix. The **Generator** dismantles its launchpad docking slots, scatters its input valves, and pulls its wave packets back into deep storage. The custom acoustic channel crumbles, and the synapse returns to a muffled, low-energy baseline.
---
## 4. The Energy Supply Chain (Metabolic Gating)
Operating high-fidelity wave generators and vibrating resonators drains the system's physical batteries. Intact energy blocks cannot pass between cell membranes, so the Astrocyte runs a refined fuel pipeline:
```
[Blood Capillary] ──> Absorbed by Astrocyte ──> Refined into Lactate (Fluid Fuel)
┌─────────────────────────────────────────────────┴─────────────────────────────────────────────────┐
▼ ▼
[Absorbed by Generator] ──> Powers V-ATPase Pumps ──> Refills Waves [Absorbed by Resonator] ──> Powers Na+/K+ Pumps ──> Resets Membrane
```
* **The Trigger:** The harder the Astrocyte has to work to vacuum up rogue wavefronts, the faster its internal glycolysis engine pumps.
* **The Delivery:** It absorbs raw glucose from blood vessels, refines it into a easily digestible fluid fuel (**Lactate**), and pours it into the extracellular space.
* **The Consumption:** The Generator and Resonator vacuum up this fluid fuel to power their internal mitochondria. This energy recharges the Generator's wave-refilling pumps and the Resonator's reset pumps ($Na^+/K^+$ ATPase), keeping the acoustic highway fully powered and operational.
---
---
# Pseudocode, organized by variable, influence, and time
## global state variables
// ─── FAST (mss) ─── INTERMEDIATE (smin) ─── SLOW (hdays) ───
// Presynaptic
vesicle_release_prob // P(0.11.0) — baseline 0.2
active_zone_size // docking slots — scales launchpad
RRP_pool // readily-releasable pool (fast)
reserve_pool // chained vesicles in deep storage
presynaptic_Ca // [Ca²⁺] at active zone
// Postsynaptic
AMPA_count // surface receptors = sensitivity
NMDA_Mg_block // bool — mechanical clamp on/off
postsynaptic_Ca // [Ca²⁺] in spine — triggers LTP/LTD
membrane_potential // Vm — depolarization state
// Astrocyte
glutamate_clearance_rate // EAAT transporter speed
D_serine_release // gliotransmitter — NMDA co-agonist
astro_Ca // internal Ca²⁺ wave state
ECM_integrity // extracellular matrix density
lactate_output // fuel export rate to neurons
// Neuromodulators (global broadcast)
dopamine_level // "save button" — validates LTP
norepinephrine_level // arousal / signal-to-noise gain
acetylcholine_level // attention — lowers LTP threshold
## fast time scale — wave propagation (ms → s)
function fire_action_potential(input_freq):
// Presynapse: launch wavefront
presynaptic_Ca += spike_influx(input_freq)
released_vesicles = binomial(RRP_pool, vesicle_release_prob)
glutamate_cleft = released_vesicles × quantal_content
RRP_pool -= released_vesicles
// Postsynapse: wavefront strikes resonator
AMPA_current = glutamate_cleft × AMPA_count
membrane_potential += AMPA_current
// NMDA gate — needs coincidence (clamp check)
if membrane_potential > -40mV and D_serine_release > threshold:
NMDA_Mg_block = False // Mg²⁺ ejected — clamp unlocked
postsynaptic_Ca += NMDA_influx(glutamate_cleft)
// Astrocyte: vacuum up trailing echoes
glutamate_cleft -= glutamate_clearance_rate × Δt
lactate_output += glycolysis_rate(glutamate_clearance_rate)
// Fuel consumed by post + pre to reset
membrane_potential restored by NaK_ATPase(lactate_output)
RRP_pool refilled by VATPase_pump(lactate_output)
## intermediate time scale — temporary tuning (s → min)
function short_term_plasticity(input_freq):
// Presynapse: facilitate or depress based on Ca²⁺ history
if input_freq > 20Hz: // facilitation
vesicle_release_prob *= 1.3 // residual Ca²⁺ primes launchpad
mobilize(reserve_pool → RRP_pool) // break storage chains
elif input_freq < 5Hz: // depression
vesicle_release_prob *= 0.7 // RRP depleted faster than refill
// Postsynapse: NMDA gate primed if frequency sustained
if input_freq >= 50Hz and duration > 1s:
NMDA_Mg_block = False // sustained depolarization
postsynaptic_Ca accumulates // early-LTP signal rises
// Astrocyte: sense volume → deploy co-agonist
if glutamate_cleft > threshold_mid:
D_serine_release += gliotransmitter_pulse() // acoustic stabilizer
astro_Ca += IP3_wave()
// Neuromodulators: shift operational threshold globally
LTP_threshold *= gain(1 / (1 + acetylcholine_level))
signal_to_noise += norepinephrine_level × β_receptor_gain
## slow time scale — structural carving (h → weeks)
function late_LTP_consolidation():
// Gate: dopamine "save button" must arrive
if postsynaptic_Ca > Ca_LTP_threshold and dopamine_level > D1_threshold:
// Postsynapse: anchor new receptors
AMPA_count += receptor_insertion(CaMKII_signal)
spine_volume *= 1.5 // spine head enlarges
// Presynapse: expand active zone, fill launchpad
active_zone_size *= 1.4
vesicle_release_prob += 0.1 // VGCC clustering beneath AZ
// Astrocyte: seal the acoustic channel
ECM_integrity += secrete(Glypicans, Thrombospondins)
retract(perisynaptic_process) // astrocyte walls in closer → insulate
glutamate_clearance_rate *= 0.85 // tighter diffusion barrier
// Late-LTP endpoint: carved channel
return synapse_state = "potentiated"
function LTD_active_forgetting():
// Trigger: low-freq, out-of-sync — discordant leakage only
if input_freq ≈ 1Hz and timing == "uncorrelated":
// Postsynapse: small Ca²⁺ rise activates phosphatases
AMPA_count -= receptor_internalization(PP1_signal)
// Astrocyte: deploy molecular scissors → dissolve matrix
D_serine_release = 0 // cut co-agonist supply
ECM_integrity -= secrete(MMPs) // matrix metalloproteinases
// Presynapse: dismantle launchpad
active_zone_size -= docking_slot_removal()
vesicle_release_prob *= 0.6
sequester(RRP_pool → reserve_pool)
return synapse_state = "depressed"
function shockwave_lockdown(): // Mode 3 — >100Hz uncoordinated
// Astrocyte: global Ca²⁺ wave triggers circuit-breaker
astro_Ca = GLOBAL_WAVE // soma-level flood
release(GABA, ATP) // gel floods postsynapse
AMPA_count -= mass_internalization()
membrane_potential = HYPERPOLARIZED
// Presynapse: overdrive clustering to preserve signal
cluster(VGCC → beneath_active_zone) // ensures penetration
## energy supply chain — metabolic gating (continuous)
function metabolic_loop(Δt):
// Astrocyte: glucose → lactate pipeline
glucose_uptake = blood_capillary_supply()
lactate_output = glycolysis(glucose_uptake, glutamate_clearance_rate)
// Both neurons absorb lactate → power pumps
RRP_pool refill rate ∝ VATPase(lactate_output)
membrane_potential reset ∝ NaK_ATPase(lactate_output)
// Feedback: harder clearance work → faster fuel pump
lactate_output *= load_factor(glutamate_clearance_rate)
**State variables** at the top declare every quantity that gets modified — split by which cell "owns" it. These are the nodes that the rest of the code reads and writes.
**Three time-scale functions** then show how those variables evolve:
- `fire_action_potential` is pure fast physics — Ca²⁺ triggers vesicle release, AMPA opens, NMDA unlocks only under coincidence, astrocyte clears the cleft, fuel is consumed.
- `short_term_plasticity` runs on top of repeated firing — the presynapse facilitates or depresses based on Ca²⁺ history, the astrocyte drops D-serine when volume is high, and neuromodulators shift the gain coefficient globally.
- `late_LTP_consolidation` and `LTD_active_forgetting` are the permanent rewrite layer — they require the dopamine "save button" as an AND-gate, and they modify structural variables (`active_zone_size`, `ECM_integrity`, `AMPA_count`) that persist independently of individual spikes.
The `shockwave_lockdown` and `metabolic_loop` sit alongside as two special-case routines that override the normal flow — one a circuit-breaker, the other a continuous background process coupling astrocyte workload to fuel delivery.
---
---
# Core business of each component
## 1. The Core Businesses of Each Component
### The Presynapse: "The Scalable Signal Transmitter"
* **The Business:** Its sole job is to translate digital electrical events (Action Potentials) into analog chemical signals.
* **The Dynamics:** It does not treat every AP equally. It uses its immediate history to either amplify (facilitate) or dampen (depress) the strength and duration of the signal it sends out.
### The Postsynapse: "The Coincidence Detector & Recorder"
* **The Business:** Its job is to capture incoming signals and record them by adjusting its local sensitivity.
* **The Dynamics:** It acts as a strict verification gate. It ignores standard incoming signals unless they arrive in perfect sync with its own internal electrical activity. When that synchronization happens, it opens a window to rewrite its recording baseline (synaptic weight).
### The Astrocyte: "The Traffic Controller & Maintenance Plant"
* **The Business:** It monitors the total traffic volume of the synapse and acts as a localized director, an emergency circuit-breaker, and a power plant.
* **The Dynamics:** It switches between a local supervisor (helping a single synapse learn) and a macro-network manager (shutting down entire sectors for protection), while simultaneously managing the physical raw fuel supply chain.
---
## 2. The Behavioral Modes (The "What" is Happening)
### Mode 1: Baseline Cleaning (Low Traffic)
* **What happens:** Firing is slow and routine.
* **The Interaction:** The presynapse sends standard-strength signals. The postsynapse records them without changing its baseline. The astrocyte acts as a localized vacuum cleaner—rapidly sweeping up leftover signals and stabilizing the local electrical environment so the next transmission can be crisp and clear.
### Mode 2: Standard Plasticity (Targeted Learning)
* **What happens:** A single pathway undergoes intense, patterned activity.
* **The Interaction:** * **The Presynapse** floods the channel with signals.
* **The Astrocyte** notices this local surge and steps in as a gatekeeper: it temporarily applies a brake to the presynapse to prevent it from burning out, while simultaneously handing a "chemical key" to the postsynapse.
* **The Postsynapse** uses this key, combines it with its own synchronized internal spike, and successfully unlocks its recording software to temporarily upscale its weight (Early-LTP).
### Mode 3: Opposite Behavior (Emergency Network Defense)
* **What happens:** The entire local network suffers a massive, overwhelming surge of synchronous activity.
* **The Interaction:** * The local inputs overflow, forcing the **Astrocyte** to switch from "local supervisor" to "emergency network defense."
* It triggers an internal alarm wave that overrides the standard rules.
* It commands the **Presynapse** to boost its signal to the absolute maximum to ensure urgent messages get through.
* Simultaneously, it forces the **Postsynapse** into a temporary lockdown (depression), heavily dampening its sensitivity to act as a circuit-breaker and protect the system from a total meltdown.
---
## 3. The Long-Term Behaviors (The "What" of Storage & Survival)
### Structural Consolidation: "Freezing the Memory"
* **What happens:** A synapse has successfully completed targeted learning (Mode 2) repeatedly, and the broader brain network signals that this event was important.
* **The Interaction:** The **Postsynapse** sends out a strong request for permanent storage. The **Astrocyte** reviews the request alongside global "attention" signals. If approved, the astrocyte physically wraps around the synapse and builds a molecular scaffold. This scaffold locks the new, higher sensitivity of the postsynapse into permanent storage (Late-LTP).
### Depotentiation: "Active Forgetting"
* **What happens:** A previously strengthened synapse falls into disuse or experiences continuous, meaningless low-level chatter.
* **The Interaction:** The **Postsynapse** experiences a slow, continuous trickle of uncoordinated signals. The **Astrocyte** senses this decay in signal quality and deploys molecular scissors that chew up the physical scaffold. Without the astrocytic structure holding it together, the recording erases, and the synapse drops back to its weak baseline.
### Metabolic Gating: "The Energy Supply Chain"
* **What happens:** High-frequency activity drains the internal batteries of both the pre- and postsynapse.
* **The Interaction:** The **Astrocyte** monitors the workload by measuring how hard it has to work to clean up the synapse. It absorbs raw fuel from the bloodstream, refines it into an easily digestible intermediary fuel, and shuttles it directly into the pre- and postsynapse. The neuronal terminals absorb this refined fuel to recharge their internal engines, preventing total system fatigue and failure.
---
---
# Comprehensive Specification Document: Multi-Scale Tripartite Synapse Model with Metabolic Gating
This document serves as the unified blueprint for a multi-scale computational model of a glutamatergic (excitatory) tripartite synapse. It integrates the directional influences between the **presynapse**, **postsynapse**, and **astrocyte** across fast, intermediate, and slow time scales, explicitly detailing standard, opposite, and metabolic behaviors.
--- ---
@@ -8,21 +341,21 @@ This document serves as the comprehensive blueprint for a multi-scale computatio
### The Presynapse (The Sender) ### The Presynapse (The Sender)
* **Primary Role:** Converts electrical action potentials into chemical signals via vesicle exocytosis. * **Primary Role:** Converts electrical action potentials into chemical signals via vesicle exocytosis and manages local neurotransmitter replenishment.
* **Key Variables:** Vesicle release probability ($P_r$), available vesicle pool ($N$), firing frequency ($f$). * **Key Variables:** Vesicle release probability ($P_r$), available vesicle pool ($N$), firing frequency ($f$), internal metabolic ATP ($[\text{ATP}]_{\text{pre}}$).
* **Receptors/Targets:** Adenosine A1 receptors (inhibitory feedback), mGluRs/Kainate receptors (facilitatory feedback). * **Receptors/Targets:** Adenosine $A_1$ receptors (inhibitory feedback), Adenosine $A_{2A}$ receptors (facilitatory feedback), mGluRs/Kainate receptors (facilitatory feedback), MCT2 transporters (lactate uptake).
### The Postsynapse (The Receiver) ### The Postsynapse (The Receiver)
* **Primary Role:** Decodes chemical signals into electrical depolarization and downstream intracellular signaling cascades. * **Primary Role:** Decodes chemical signals into electrical depolarization, gates calcium influx, and converts patterns into permanent architectural changes.
* **Key Variables:** Membrane potential ($V_m$), AMPA conductance ($g_{AMPA}$), NMDA conductance ($g_{NMDA}$), intracellular calcium ($Ca^{2+}_{\text{post}}$). * **Key Variables:** Membrane potential ($V_m$), AMPA conductance ($g_{AMPA}$), NMDA conductance ($g_{NMDA}$), intracellular calcium ($Ca^{2+}_{\text{post}}$), internal metabolic ATP ($[\text{ATP}]_{\text{post}}$).
* **Receptors/Targets:** AMPA receptors (fast transmission), NMDA receptors (plasticity gating mechanism). * **Receptors/Targets:** AMPA receptors (fast transmission), NMDA receptors (dual-lock plasticity gate), $P2X$ receptors (ionotropic ATP channels), $P2Y$ receptors (metabotropic ATP channels), MCT2 transporters (lactate uptake).
### The Astrocyte (The Gatekeeper & Regulator) ### The Astrocyte (The Gatekeeper, Regulator & Fuel Plant)
* **Primary Role:** Dynamically senses synaptic activity through neurotransmitter clearance and responds by shaping the local chemical, ion, and structural environment. * **Primary Role:** Senses synaptic activity through neurotransmitter clearance, acts as a directional signaling gateway, and structurally and metabolically sustains the synapse.
* **Key Variables:** Microdomain calcium ($Ca^{2+}_{\text{micro}}$), Whole-cell somatic calcium ($Ca^{2+}_{\text{soma}}$), Extracellular D-Serine ($[D\text{-}Ser]$), Extracellular Adenosine ($[Ado]$). * **Key Variables:** Microdomain calcium ($Ca^{2+}_{\text{micro}}$), Whole-cell somatic calcium ($Ca^{2+}_{\text{soma}}$), Extracellular ATP ($[\text{ATP}]_{\text{ext}}$), Extracellular Adenosine ($[\text{Ado}]$), Extracellular D-Serine ($[D\text{-}Ser]$), Internal Lactate production ($[\text{Lac}]_{\text{astro}}$).
* **Structural Components:** Perisynaptic Astrocytic Processes (PAPs) wrapping individual clefts. * **Structural Components:** Perisynaptic Astrocytic Processes (PAPs) wrapping individual clefts; vascular end-feet wrapping blood capillaries.
--- ---
@@ -45,29 +378,40 @@ This document serves as the comprehensive blueprint for a multi-scale computatio
### 2.1 Fast Time Scale (Milliseconds to Seconds) ### 2.1 Fast Time Scale (Milliseconds to Seconds)
*Focuses on immediate ion/neurotransmitter clearance and maintaining baseline system equilibrium.* *Focuses on ion/neurotransmitter clearance, direct purinergic current injection, and maintaining baseline equilibrium.*
#### Mode 1: Low-to-Moderate Baseline Firing ($\sim$ 110 Hz) #### Mode 1: Low-to-Moderate Baseline Firing ($\sim$ 110 Hz)
* **Presynapse $\rightarrow$ Astrocyte:** Releases glutamate via single vesicles, signaling routine, low-demand baseline activity. * **Presynapse $\rightarrow$ Astrocyte:** Releases single vesicles of glutamate, signaling routine baseline activity.
* **Astrocyte $\rightarrow$ Presynapse:** Clears glutamate rapidly from the cleft via GLT-1/EAAT2 transporters. **Influence:** *Homeostatic/Permissive.* Prevents glutamate receptor desensitization, clearing the slate for successive pulses. * **Astrocyte $\rightarrow$ Presynapse:** Rapidly clears glutamate from the cleft via GLT-1/EAAT2 transporters. **Influence:** Prevents glutamate receptor desensitization, clearing the slate for successive pulses.
* **Postsynapse $\rightarrow$ Astrocyte:** Depolarizes briefly via AMPA receptors, resulting in an efflux of potassium ($K^+$) into the extracellular space. * **Postsynapse $\rightarrow$ Astrocyte:** Depolarizes briefly via AMPA receptors, resulting in a localized efflux of potassium ($K^+$) into the extracellular space.
* **Astrocyte $\rightarrow$ Postsynapse:** Siphons excess extracellular $K^+$ through Kir4.1 channels. **Influence:** *Inhibitory stabilizer.* Prevents unwanted, continuous postsynaptic depolarization (hyperexcitability). * **Astrocyte $\rightarrow$ Postsynapse:** Siphons excess extracellular $K^+$ through Kir4.1 channels. **Influence:** Inhibitory stabilizer that prevents unwanted, continuous postsynaptic depolarization.
#### Fast Purinergic Currents (ATP Injection)
* **Astrocyte $\rightarrow$ Postsynapse:** Upon localized activation, the astrocyte exocytoses **ATP** packets into the cleft.
* **Influence:** Extracellular ATP binds directly to postsynaptic ionotropic **$P2X$ receptors**, opening a non-selective cation channel. This creates an immediate, fast excitatory postsynaptic current ($I_{P2X}$) that depolarizes the postsynapse independently of glutamate.
--- ---
### 2.2 Intermediate Time Scale (Seconds to Minutes) ### 2.2 Intermediate Time Scale (Seconds to Minutes)
*Focuses on Short-Term Plasticity (STP/STD) and the induction phase of Long-Term Plasticity.* *Focuses on Short-Term Plasticity (STP/STD), the Kinetic Delay Relay of ATP degradation, and the induction phase of Long-Term Plasticity.*
#### Mode 2: High-Frequency Burst Firing (Standard Plasticity Mode) #### Mode 2: High-Frequency Burst Firing (Standard Plasticity Mode)
Activated by pattern-specific high-frequency bursts (e.g., 50100 Hz) restricted to a single synaptic pathway. Activated by pattern-specific high-frequency bursts (e.g., 50100 Hz) restricted to a single synaptic pathway.
* **Presynapse $\rightarrow$ Astrocyte:** Excess glutamate spills out of the cleft, binding to astrocytic **mGluR5** receptors. **Influence:** Triggers a localized, nanoscale calcium surge ($Ca^{2+}_{\text{micro}}$). * **Presynapse $\rightarrow$ Astrocyte:** Spillover glutamate binds to astrocytic **mGluR5** receptors, triggering a localized, nanoscale calcium surge ($Ca^{2+}_{\text{micro}}$).
* **Astrocyte $\rightarrow$ Presynapse:** In response to $Ca^{2+}_{\text{micro}}$, the astrocyte exocytoses **ATP**, which rapidly converts to **Adenosine** extracellularly. Adenosine binds to presynaptic A1 receptors, blocking voltage-gated calcium channels. **Influence:** *Short-Term Depression (STD).* Acts as a brake to lower $P_r$, preventing vesicle depletion. * **Astrocyte $\rightarrow$ Presynapse (The Kinetic Relay):** In response to $Ca^{2+}_{\text{micro}}$, the astrocyte releases signaling **ATP**.
* Over hundreds of milliseconds, surface enzymes (ecto-nucleotidases) degrade this ATP into **Adenosine**.
* At moderate concentrations, Adenosine binds to presynaptic **$A_1$ receptors**, blocking voltage-gated calcium channels. **Influence:** *Short-Term Depression (STD)* that acts as a brake to lower $P_r$, preventing vesicle depletion.
* If the burst is intense, highly concentrated Adenosine recruits presynaptic **$A_{2A}$ receptors**, which actively inhibit the $A_1$ pathways. **Influence:** Disinhibits the terminal, switching the presynapse back into a facilitated state.
* **Postsynapse $\rightarrow$ Astrocyte:** Strong localized depolarization triggers retrograde synthesis of endocannabinoids (eCBs) that bind to astrocytic CB1 receptors, amplifying the local $Ca^{2+}_{\text{micro}}$ signal. * **Postsynapse $\rightarrow$ Astrocyte:** Strong localized depolarization triggers retrograde synthesis of endocannabinoids (eCBs) that bind to astrocytic CB1 receptors, amplifying the local $Ca^{2+}_{\text{micro}}$ signal.
* **Astrocyte $\rightarrow$ Postsynapse:** The astrocyte releases **D-Serine** into the active cleft. D-serine binds to the mandatory co-agonist site of NMDA receptors. Simultaneously, strong postsynaptic AMPA depolarization expels the channel's electrical magnesium ($Mg^{2+}$) plug. **Influence:** *LTP Induction Gating.* With $Mg^{2+}$ expelled, glutamate bound, and astrocytic D-serine present, the NMDA channel opens wide, driving a massive postsynaptic calcium spike ($Ca^{2+}_{\text{post}}$) that triggers potentiation cascades. * **Astrocyte $\rightarrow$ Postsynapse (Unlocking the NMDA Gate):** The astrocyte releases **D-Serine** into the active cleft, opening the NMDA receptor's chemical lock. Simultaneously, intense postsynaptic AMPA depolarization expels the channel's electrical magnesium ($Mg^{2+}$) plug.
* **Influence:** *LTP Induction Gating.* With $Mg^{2+}$ expelled, glutamate bound, and astrocytic D-serine present, the NMDA channel opens wide, driving a massive postsynaptic calcium spike ($Ca^{2+}_{\text{post}}$) required for potentiation cascades.
#### Mode 3: Massive Synchronous / Multi-Pathway Firing (Opposite Behavior Mode) #### Mode 3: Massive Synchronous / Multi-Pathway Firing (Opposite Behavior Mode)
@@ -82,231 +426,159 @@ Activated by intense, widespread network hyper-activation or high-frequency stre
### 2.3 Slow Time Scale (Hours to Days to Weeks) ### 2.3 Slow Time Scale (Hours to Days to Weeks)
*Focuses on the consolidation or erasure of Long-Term Potentiation (LTP) and Long-Term Depression (LTD).* *Focuses on metabolic energy replenishment via the lactate shuttle, and the consolidation or erasure of Long-Term Potentiation (LTP) and Long-Term Depression (LTD).*
```
[BLOOD CAPILLARY]
▼ (Glucose)
┌────────────────────────────────────────────────────────┐
│ ASTROCYTE END-FOOT │
│ Glucose ──> [Glycolysis] ──> Net ATP (Astrocytic Fuel)│
│ │ │
│ ▼ │
│ L-Lactate │
└──────────────────────────────────┬─────────────────────┘
▼ (MCT1/4 Transporters)
[EXTRACELLULAR SPACE]
▼ (MCT2 Transporters)
┌────────────────────────────────────────────────────────┐
│ NEURONAL TERMINALS (Pre / Post) │
│ L-Lactate ──> Pyruvate ──> [Mitochondria] ──> Vast ATP│
└────────────────────────────────────────────────────────┘
```
#### The Astrocyte-Neuron Lactate Shuttle (ANLS / Metabolic Gating)
Intact metabolic ATP ($[\text{ATP}]_{\text{int}}$) cannot pass between cell membranes. To power the heavy energy demands of synaptic recovery, the astrocyte feeds the neurons via a metabolic relay:
1. **Sensing Demand:** As the astrocyte clears glutamate via sodium-dependent transporters (GLT-1), the surge of internal sodium ($Na^+$) activates the astrocyte's internal glycolysis engine.
2. **Lactate Export:** The astrocyte breaks down glucose into **L-Lactate** and exports it into the extracellular space via **MCT1/4** transporters.
3. **Neuronal Absorption:** The pre- and postsynapse vacuum up this lactate via **MCT2** transporters, convert it to pyruvate, and feed it into their mitochondria.
4. **Energy Generation:** This generates the high volume of internal metabolic ATP ($[\text{ATP}]_{\text{pre}}$ and $[\text{ATP}]_{\text{post}}$) needed to power the $Na^+/K^+$ ATPase pumps and the vesicle refilling pumps.
* **Model Implication:** If this shuttle fails, internal neuronal ATP drops, the $Na^+/K^+$ pumps fail, gradients collapse, and vesicle replenishment rates drop to zero, forcing an absolute synaptic fatigue shutdown.
#### Potentiation Consolidation (Late-LTP) #### Potentiation Consolidation (Late-LTP)
* **Postsynapse $\rightarrow$ Astrocyte:** Following successful induction, repeated postsynaptic calcium spikes force the synthesis and prolonged secretion of **BDNF** (Brain-Derived Neurotrophic Factor) and Nitric Oxide (NO). * **Postsynapse $\rightarrow$ Astrocyte:** Following successful induction, repeated postsynaptic calcium spikes force the secretion of **BDNF** (Brain-Derived Neurotrophic Factor) and Nitric Oxide (NO).
* **Astrocyte Structural Action:** If local BDNF concentrations cross a threshold, and are paired with a global alert signal (neuromodulators like **Norepinephrine** or **Dopamine** activating astrocytic GPCRs), the astrocyte initiates structural remodeling. * **Astrocyte Structural Action:** If local BDNF concentrations cross a threshold, and are paired with a global alert signal (neuromodulators like **Norepinephrine** or **Dopamine** activating astrocytic GPCRs), the astrocyte initiates structural remodeling.
* **Astrocyte $\rightarrow$ Postsynapse:** The perisynaptic astrocytic process (PAP) physical wraps tighter around the spine to insulate it. The astrocyte secretes matrix proteins (**Glypicans** and **Thrombospondins**). **Influence:** *Permanent Potentiation Enactment.* These proteins form a physical scaffold in the cleft that anchors newly inserted AMPA receptors into the post-synaptic density, permanently locking in an increased synaptic weight ($W$). * **Astrocyte $\rightarrow$ Postsynapse:** The PAP physically wraps tighter around the spine to insulate it. The astrocyte secretes matrix proteins (**Glypicans** and **Thrombospondins**). **Influence:** *Permanent Potentiation Enactment.* These proteins form a physical scaffold in the cleft that anchors newly inserted AMPA receptors into the post-synaptic density, permanently locking in an increased synaptic weight ($W$).
#### Depotentiation / Weakening (LTD & Erasure) #### Depotentiation / Weakening (LTD & Erasure)
* **Presynapse $\rightarrow$ Astrocyte:** Prolonged, low-frequency stimulation (LFS, $\sim$ 1 Hz) leaks a steady, low level of glutamate into the astrocyte over minutes. * **Presynapse $\rightarrow$ Astrocyte:** Prolonged, low-frequency stimulation (LFS, $\sim$ 1 Hz) leaks a steady, low level of glutamate into the astrocyte over minutes.
* **Astrocyte $\rightarrow$ Postsynapse:** This drives slow, rhythmic astrocytic calcium oscillations, releasing D-serine without causing significant postsynaptic depolarization. Because the postsynapse stays near resting potential, the $Mg^{2+}$ plug remains largely intact inside the NMDA channel. **Influence:** *LTD Induction.* The locked channel permits only a tiny, prolonged trickle of calcium into the postsynapse, activating protein phosphatases that internalize AMPA receptors, lowering the maximum conductance ($g_{AMPA}$). * **Astrocyte $\rightarrow$ Postsynapse:** This drives slow, rhythmic astrocytic calcium oscillations, releasing D-serine without causing significant postsynaptic depolarization. Because the postsynapse stays near resting potential, the $Mg^{2+}$ plug remains largely intact inside the NMDA channel.
* **Influence:** *LTD Induction.* The locked channel permits only a tiny, prolonged trickle of calcium into the postsynapse, activating protein phosphatases that internalize AMPA receptors, lowering maximum conductance ($g_{AMPA}$).
* **Network $\rightarrow$ Astrocyte:** If a consolidated synapse falls into disuse, or during active pruning, extracellular proteases like **MMPs (Matrix Metalloproteinases)** are up-regulated. **Influence:** *Structural Depotentiation.* MMPs act as molecular scissors, cleaving the astrocytic glypican/thrombospondin matrix. Without the astrocytic scaffold, clustered AMPA receptors drift out of the post-synaptic density and dissolve, erasing the stored memory weight. * **Network $\rightarrow$ Astrocyte:** If a consolidated synapse falls into disuse, or during active pruning, extracellular proteases like **MMPs (Matrix Metalloproteinases)** are up-regulated. **Influence:** *Structural Depotentiation.* MMPs act as molecular scissors, cleaving the astrocytic glypican/thrombospondin matrix. Without the astrocytic scaffold, clustered AMPA receptors drift out of the post-synaptic density and dissolve, erasing the stored memory weight.
--- ---
## 3. Mathematical Modeling Core Logic Gates ## 3. Mathematical Gating Logic for Model Implementation
To translate this specification document into differential equations or object-oriented code, use the following logical control blocks: ### 3.1 Postsynaptic Current Gating Vector
### 1. NMDA Current Equation Matrix The total postsynaptic current equation must include the parallel purinergic current channel:
$$I_{NMDA} = g_{NMDA} \cdot [Glu] \cdot [D\text{-}Ser]_{astro} \cdot \text{MgBlock}(V_m) \cdot (V_m - E_{rev})$$ $$I_{\text{total}} = I_{\text{AMPA}} + I_{\text{NMDA}} + I_{P2X} + I_{\text{leak}}$$
* **Standard Plasticity Mode (Mode 2):** $[D\text{-}Ser]_{astro} \to 1$, $\text{MgBlock}(V_m) \to 1 \implies$ **High $I_{NMDA}$ Influx $\to$ LTP.** Where the NMDA current relies on the triple-product gate:
* **Depotentiation Mode (LFS):** $[D\text{-}Ser]_{astro} \to 1$, $\text{MgBlock}(V_m) \to 0.05 \implies$ **Low, Prolonged $I_{NMDA}$ Influx $\to$ LTD.**
* **Heterosynaptic Mismatch (Neighboring Noise):** $[D\text{-}Ser]_{astro} \to 0$, $\text{MgBlock}(V_m) \to 1 \implies$ **Zero Current. Synapse Shielded.**
### 2. Astrocytic State Switch Gating $$I_{NMDA} = g_{NMDA} \cdot [Glu] \cdot [D\text{-}Ser]_{astro} \cdot \left( \frac{1}{1 + \eta [Mg^{2+}] e^{-\gamma V_m}} \right) \cdot (V_m - E_{rev})$$
### 3.2 Extracellular ATP $\rightarrow$ Adenosine Kinetic Decay Relay
Track the degradation cascade explicitly to manage the short-term plasticity time-lag and the heterosynaptic contrast shield:
$$\frac{d[\text{ATP}]_{\text{ext}}}{dt} = \text{Exocytosis}(Ca^{2+}_{\text{micro}}) - k_{\text{deg}}[\text{ATP}]_{\text{ext}} - \text{Diffusion}_{\text{hetero}}$$
$$\frac{d[\text{Ado}]_{\text{ext}}}{dt} = k_{\text{deg}}[\text{ATP}]_{\text{ext}} - k_{\text{clear}}[\text{Ado}]_{\text{ext}}$$
### 3.3 Astrocytic Conditional Logic Block
```python ```python
# Compute Astrocytic Calcium Compartments # Evaluate spatial calcium scales and metabolic states
Ca_micro = update_local_microdomain(glutamate_input, eCB_retrograde) Ca_micro = update_local_microdomain(glutamate_input, eCB_retrograde)
Ca_soma = update_global_soma(sum(Ca_micro_array), neuromodulator_presence) Ca_soma = update_global_soma(sum(Ca_micro_array), neuromodulator_presence)
if Ca_soma > global_threshold: if Ca_soma > global_threshold:
# MODE 3: Engage Opposite Behavior Mode (Network Protection) # MODE 3: Engage Opposite Behavior Mode (Network Protection)
presynaptic_Pr *= glutamate_facilitation_factor(Ca_soma) presynaptic_Pr *= glutamate_facilitation_factor(Ca_soma) # Boost Pre
postsynaptic_gAMPA *= gaba_tonic_depression_factor(Ca_soma) postsynaptic_gAMPA *= gaba_tonic_depression_factor(Ca_soma) # Crush Post
elif Ca_micro > local_threshold: elif Ca_micro > local_threshold:
# MODE 2: Engage Standard Plasticity Mode (Hebbian Learning Gate) # MODE 2: Engage Standard Plasticity Mode (Hebbian Learning Gate)
presynaptic_Pr *= adenosine_depression_factor(Ca_micro) # Brake # Compute receptor affinity balance based on kinetic relay
extracellular_D_Serine = 1.0 # Open NMDA Gate A1_activation = function_of(extracellular_Adenosine)
A2A_activation = function_of_high_concentration(extracellular_Adenosine)
presynaptic_Pr *= (A2A_activation - A1_activation)
extracellular_D_Serine = 1.0 # Open NMDA Chemical Lock
else: else:
# MODE 1: Baseline Housekeeping # MODE 1: Baseline Housekeeping
extracellular_D_Serine = 0.0 extracellular_D_Serine = 0.0
maintain_ion_homeostasis() execute_ion_siphoning_and_clearance()
``` ```
### 3. Structural Consolidation Equation ($\alpha_{\text{matrix}}$) ### 3.4 Structural Consolidation Equation ($\alpha_{\text{matrix}}$)
$$\frac{d\alpha_{\text{matrix}}}{dt} = \left( k_1 \cdot [\text{BDNF}]_{\text{post}} + k_2 \cdot [\text{Neuromodulator}] \right) \cdot \mathbb{H}(Ca^{2+}_{\text{soma}} - \theta) - k_3 \cdot [\text{MMPs}]$$ $$\frac{d\alpha_{\text{matrix}}}{dt} = \left( k_1 \cdot [\text{BDNF}]_{\text{post}} + k_2 \cdot [\text{Neuromodulator}] \right) \cdot \mathbb{H}(Ca^{2+}_{\text{soma}} - \theta) \cdot [\text{ATP}]_{\text{pre/post}} - k_3 \cdot [\text{MMPs}]$$
* **Enact LTP:** If $\frac{d\alpha_{\text{matrix}}}{dt} > \text{Threshold}$, freeze the current baseline synaptic weight value ($W$). * If $\alpha_{\text{matrix}} > \text{Consolidation\_Threshold}$, the synaptic weight ($W$) is frozen into a permanent state variable ($W_{\text{late}}$).
* **Depotentiation:** If $[\text{MMPs}]$ dominates, decay $\alpha_{\text{matrix}} \to 0$, causing $W$ to return to its original baseline state. * If metabolic $[\text{ATP}]$ falls or active degradation $[\text{MMPs}]$ dominates, $\alpha_{\text{matrix}} \to 0$, causing $W$ to undergo structural depotentiation and return to baseline.
--- ---
--- ---
Here is how **Neuromodulators (Norepinephrine, Dopamine, Acetylcholine)** fit into this high-level algorithmic model.
To clear things up completely, I have actually highlighted **three distinct operational modes** driven by synaptic activity. In terms of the "what," neuromodulators act as the **"Priority & Context Filter."** They do not carry the raw data; instead, they broadcast a brain-wide broadcast message that dictates whether the current data stream is important, surprising, or rewarding.
They are categorized by the **intensity and pattern** of the firing, which dictates whether the astrocytic response stays localized or goes global.
Here is the explicit breakdown of all three modes so you can map them clearly in your code.
--- ---
## Mode 1: Low-to-Moderate Baseline Firing (Local / Housekeeping) # Neuromodulatory influence
* **The Trigger:** Standard, low-frequency background neuronal activity ($\sim$ 110 Hz). ## 1. The Neuromodulatory Core Business: "The State & Priority Filter"
* **Spatial Scale:** Strictly **Local Microdomains** (the tiny leaf-like processes wrapping the individual synapse).
* **The Behavior:** The astrocyte acts as a localized cleaner and stabilizer. It vacuums up glutamate (preventing signal blur) and siphons away excess potassium ($K^+$). * **The Business:** Their job is to dynamically shift the operational thresholds of the entire tripartite synapse based on the organism's behavioral state (e.g., fear, focus, reward, or sleep).
* **Model State:** Synaptic weights ($W$) remain stable; the system is maintaining its baseline equilibrium. * **The Dynamics:** They act as a global override switch. Without them, the synapse operates purely on local physics (Mode 1 or Mode 2). With them, the synapse is told *how to interpret* those local physics.
--- ---
## Mode 2: High-Frequency / Burst Firing (Local / Learning Gate) ## 2. Specific Modulators: What They Code in Your Model
* **The Trigger:** High-frequency, pattern-specific bursts (e.g., 50100 Hz bursts used in learning protocols). ### Norepinephrine (The "Urgency/Danger" Switch)
* **Spatial Scale:** Still **Local Microdomains**, but with a much higher concentration of calcium ($Ca^{2+}_{\text{micro}}$) restricted to that specific active synapse.
* **The Behavior:** This is the **Standard Plasticity Mode**. The localized calcium surge triggers the release of **D-serine** into that specific cleft, unlocking postsynaptic NMDA receptors. * **What it means to the system:** "Pay attention immediately; something critical is changing in the environment."
* **Model State:** This triggers **Short-Term Facilitation (STP)** or gates the induction of **Long-Term Potentiation (LTP)** for that single, specific synapse. * **The Functional Action:** It drastically lowers the activation threshold for the **Astrocyte**. It primes the astrocyte to trigger its global alarm wave (Mode 3) much faster and ensures that any temporary learning occurring at the **Postsynapse** is immediately marked for permanent storage.
### Dopamine (The "Save Button" / Validation Signal)
* **What it means to the system:** "The action just performed led to a successful or better-than-expected outcome."
* **The Functional Action:** It acts as a delayed validation signal. If the **Presynapse** and **Postsynapse** just engaged in targeted learning (Mode 2), a wave of dopamine acts as an explicit instruction to the **Astrocyte** to deploy its structural scaffold. If dopamine is missing, the system assumes the computation was useless and lets the memory decay.
### Acetylcholine (The "Focus & Sharpening" Filter)
* **What it means to the system:** "Focus deeply on this specific sensory stream; ignore background noise."
* **The Functional Action:** It enhances the signal-to-noise ratio. It forces the **Astrocyte** to become an aggressive vacuum cleaner for weak synapses (Mode 1 baseline cleaning), while making active synapses (Mode 2) incredibly sensitive. It essentially widens the gap between active data and background noise.
--- ---
## Mode 3: Massive Synchronous / Network-Wide Firing (Global / Emergency Alert) ## 3. Updated Behavioral Modes with Neuromodulators
* **The Trigger:** Intense, multi-synapse, or hyper-synchronous firing (e.g., epileptic-like activity, severe sensory overload, or intense stress). ### The Modified Baseline (Mode 1 + Acetylcholine)
* **Spatial Scale:** **Astrocyte-Wide / Global**. The individual local calcium signals spill over, cross-talk, and trigger a full **Global Calcium Wave ($Ca^{2+}_{\text{soma}}$)** across the entire cell.
* **The Behavior:** This flips the system into the **Opposite Mode**. To manage the crisis, the whole astrocyte dumps **Glutamate** to facilitate the presynapse (ensuring the urgent signal cuts through) while simultaneously dumping **GABA or ATP** to depress the postsynapse (acting as a circuit-breaker to protect the neurons from melting down).
* **Model State:** This drives network-wide **Short-Term Depression (STD)** at the postsynapse to force a temporary system reset.
--- * **What happens:** The brain enters a state of intense focus.
* **The Interaction:** Acetylcholine commands the **Astrocyte** to pump up its cleanup efficiency. The astrocyte aggressively suppresses any random, weak signals from the **Presynapse**. This ensures that the **Postsynapse** only hears the absolute cleanest, most synchronized data stream possible.
## Mode 4 (The Slow Appendix): Chronic Over- or Under-Excitation (Global / Homeostatic Scaling) ### The Modified Learning Gate (Mode 2 + Dopamine)
*This is the slow-acting extension of the states above, operating over hours or days rather than seconds.* * **What happens:** Targeted learning occurs, and it is deemed rewarding.
* **The Interaction:** The **Presynapse** and **Postsynapse** successfully collaborate to open the learning window. Usually, this change is highly unstable. However, the arrival of Dopamine binds to the **Astrocyte**, authorizing it to immediately begin building the physical structural scaffold. Dopamine transforms a fleeting electrical coincidence into a permanent physical structure.
* **The Trigger:** If Mode 1 or Mode 3 persists uninterrupted for hours or days (e.g., a limb is immobilized, causing chronic under-excitation, or a brain region suffers chronic stroke/epilepsy, causing chronic over-excitation). ### The Emergency/Stress State (Mode 3 + Norepinephrine)
* **Spatial Scale:** **Astrocyte-Wide / Global**.
* **The Behavior:** The astrocyte physically remodels the tissue. It secretes structural factors (like **TNF-$\alpha$** or **Thrombospondins**) to either systematically strip away or globally add AMPA receptors across thousands of synapses.
* **Model State:** **Homeostatic Synaptic Scaling (LTP/LTD consolidation)**. It multiplies *all* local synaptic weights by a global scaling factor to pull the entire network's baseline firing rate back into a safe, functional zone.
--- * **What happens:** High-frequency activity combined with a high-stress or high-alert state.
* **The Interaction:** Norepinephrine floods the system, instantly binding to the **Astrocyte**. The astrocyte immediately bypasses normal local routing and fires its global wave. It forces the **Presynapse** into a hyper-transmitter state (boosting transmission probability) while throwing the **Postsynapse** into a protected, tonically depressed state. This allows the network to process massive emergency inputs without suffering hardware damage.
## The Input Gating Architecture for Your Model
When building your simulation, your input variable (Neuronal Activity) feeds into a nested logic structure:
IF Activity == Low-to-Moderate (1-10 Hz)
──> Engage MODE 1 (Local Housekeeping)
IF Activity == High-Frequency Bursts (50-100 Hz, single pathway)
──> Engage MODE 2 (Standard Plasticity: Local D-Serine / LTP Gate)
IF Activity == Massive/Synchronous (>100 Hz, multi-pathway)
──> Engage MODE 3 (Opposite Behavior: Global Wave / Pre-Boost / Post-Drop)
└─► IF MODE 1 or MODE 3 persists for hours/days
──> Engage MODE 4 (Global Structural Homeostatic Scaling)
---
---
Yes. Dissoridating the two locks—displacing magnesium without D-serine, or providing D-serine without displacing magnesium—happens naturally in several physiological scenarios.
These mismatches are highly useful for your model because they represent states where the network is trying to perform a computation but the astrocyte or the post-synapse acts as a gatekeeper to alter the outcome.
---
## Situation A: Magnesium Displaced, but NO Astrocytic D-Serine
In this scenario, the electrical lock is open, but the chemical lock is closed.
* **When this happens:** **Low-Frequency Backpropagation or Artificial Depolarization.**
* Imagine the postsynaptic neuron fires an action potential from its cell body that travels *backward* up its own dendrites (a backpropagating action potential), or an experimenter forces the postsynaptic cell to depolarize using a patch-pipette, **while the presynapse is completely silent**.
* **The Biophysics:** The strong voltage shift changes the electrical charge inside the postsynaptic membrane, repelling and **displacing the $Mg^{2+}$ plug**. However, because the presynapse didn't fire, there is no glutamate to trigger the astrocytes microdomain calcium surge. Consequently, **no D-serine is released**.
* **The Functional Outcome:** **Silent Displacements / No Plasticity.** Even though the physical channel is technically unblocked, the NMDA receptor cannot pass calcium current because its co-agonist site is empty. The induction of LTP is blocked.
---
## Situation B: Astrocytic D-Serine Released, but Magnesium NOT Displaced
In this scenario, the chemical lock is open, but the electrical lock is closed.
* **When this happens:** **Low-Frequency Stimulation (LFS) / Long-Term Depression (LTD).**
* This happens when a presynaptic pathway fires slowly and persistently (e.g., $\sim$ 1 Hz for several minutes).
* **The Biophysics:** The slow trickle of glutamate is not strong enough to cause the summation needed to highly activate AMPA receptors. The postsynapse remains near its resting potential (around $-70\text{ mV}$), meaning **the $Mg^{2+}$ plug stays firmly inside the channel**. However, over minutes, this steady ambient glutamate leaks out of the cleft and steadily climbs into the astrocyte process, triggering slow, rhythmic calcium oscillations that cause the astrocyte to **release D-serine**.
* **The Functional Outcome:** **Long-Term Depression (LTD).** Because the $Mg^{2+}$ plug is still present, it blocks 95% of the channel. However, because D-serine is bound, whenever a tiny fluctuation in voltage slightly loosens the magnesium plug, a *minute* trickle of calcium escapes into the postsynapse.
* In neuroscience, a **massive, fast** calcium influx triggers **LTP** (learning).
* A **tiny, prolonged** calcium influx triggers **LTD** (unlearning/weakening).
* Therefore, having D-serine present *without* fully displacing magnesium is the exact biophysical state required to downscale or weaken a synapse.
---
## Summary for Your System Coding
You can think of these combinations as a matrix of states that determine the direction of your weight update rule ($\Delta W$):
| $Mg^{2+}$ Status | Astrocytic D-Serine Status | Resulting Synaptic State | Computational Result |
| --- | --- | --- | --- |
| **Blocked** (Resting V) | **Absent** (No Astro Ca) | Baseline Transmission | Stable Synapse ($W$ unchanged) |
| **Unblocked** (Depolarized) | **Absent** (No Astro Ca) | Non-Functional Opening | Gated Block ($W$ unchanged) |
| **Blocked** (Resting V) | **Present** (Slow Astro Ca) | Minimal $Ca^{2+}$ Leak | **LTD Induction** ($W$ decreases) |
| **Unblocked** (Depolarized) | **Present** (Burst Astro Ca) | Massive $Ca^{2+}$ Influx | **LTP Induction** ($W$ increases) |
By implementing these conditions, your model will accurately replicate how the timing between the neuron's electrical state and the astrocyte's chemical state determines whether a memory is created, deleted, or ignored.
---
---
The transition from temporary synaptic strengthening to permanent, astrocytically consolidated structural change (**Late-LTP**) acts as a critical filter in the brain. It ensures the brain only burns energy to store information that is deemed genuinely important.
In your computational model, whether an astrocyte decides to structurally consolidate a synapse or let it decay back to baseline is influenced by four distinct physiological factors.
---
## 1. Volume and Duration of Postsynaptic Signals (The Local Threshold)
The astrocyte does not automatically know that a synapse has opened its NMDA receptors. It relies on the postsynapse to send an active "request for consolidation" via retrograde chemical factors.
* **The Signals:** **BDNF** (Brain-Derived Neurotrophic Factor) and **Nitric Oxide (NO)**.
* **How it influences consolidation:** * **Lack of Consolidation:** If the NMDA receptors open briefly (e.g., during a single, short burst of activity), the postsynapse inserts a few temporary AMPA receptors but releases very little BDNF. The neighboring astrocyte process never detects enough BDNF to trigger its internal protein-synthesis machinery. The structural lock remains open, and the synapse decays back to baseline within an hour.
* **Successful Consolidation:** If the synapse experiences repeated, spaced bursts of high-frequency activity, the sustained calcium influx forces the postsynapse to secrete a massive wave of BDNF. This high concentration overpowers the astrocyte's receptor thresholds, initiating structural consolidation.
---
## 2. Global Astrocytic Calcium Scale (The Cooperativity Factor)
As we established in the multi-compartment architecture, the spatial scale of calcium ($Ca^{2+}$) within the astrocyte plays a massive role in dictating its long-term structural behavior.
* **How it influences consolidation:**
* **Lack of Consolidation (Single Synapse Isolation):** If only one single, isolated synapse on a dendritic branch is active, the calcium rise is confined to a tiny nanoscale microdomain ($Ca^{2+}_{\text{micro}}$). While this is enough to release D-serine for *induction*, a single microdomain often lacks the metabolic clout to trigger whole-cell protein synthesis.
* **Successful Consolidation (Synaptic Cooperativity):** If multiple neighboring synapses on the same dendritic branch fire together, their individual signals summate. This triggers a localized, high-amplitude **calcium hotspot** or a branch-specific calcium wave. This larger spatial signal activates astrocytic calcineurin and transcription factors (like NFAT), prompting the astrocyte to synthesize and secrete the structural matrix proteins (**Glypicans** and **Thrombospondins**) needed to anchor those new AMPA receptors long-term.
---
## 3. Neuromodulatory Input (The "Attention" or "Value" Switch)
The brain uses neuromodulators to stamp an event as "important." Astrocytes are highly sensitive to these chemicals because they possess vast arrays of metabotropic receptors for them.
* **The Signals:** **Norepinephrine** (released during stress/alertness), **Dopamine** (released during reward), and **Acetylcholine** (released during intense focus).
* **How it influences consolidation:**
* Even if a neuronal pathway fires perfectly to open the NMDA gate, the absence of neuromodulators often results in a failure of late-stage consolidation.
* Conversely, when you are highly alert or rewarded, a flood of norepinephrine or dopamine binds to astrocytic GPCRs (like $\alpha_1$-adrenergic or $D_1$-dopamine receptors). This triggers a massive release of calcium from the astrocyte's internal endoplasmic reticulum stores. This neuromodulator-enforced calcium surge forces the astrocyte to rapidly consolidate whatever local synapses happen to be active at that moment, transforming weak early-LTP into permanent late-LTP.
---
## 4. Extracellular Protease Activity (The Structural Eraser)
Even after the astrocyte releases matrix proteins to stabilize a synapse, consolidation can be actively undone or blocked by enzymatic degradation.
* **The Signals:** **MMPs (Matrix Metalloproteinases)** and **tPA (tissue Plasminogen Activator)**.
* **How it influences consolidation:**
* Astrocytes and neurons co-secrete these proteases into the extracellular space. MMPs act like molecular scissors that chew up the extracellular matrix and the structural anchors (like Glypicans) provided by the astrocyte.
* If a synapse is not continuously reinforced, or if a competing pathway nearby becomes highly active, local MMP activity spikes. This degrades the astrocytic scaffold, causing the clustered AMPA receptors to lose their anchor points and diffuse away. This results in a failure of consolidation or an active reversal of LTP (de-potentiation).
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,634 @@
# The Logic of the Tripartite Synapse Model — v5
*A synthesis of the principles the pseudocode enacts. The document is ordered why → what → how: it
opens with why this is a different kind of object than an ordinary model (Part I), states the single
principle its content obeys (Part II), then descends through seven categories that specialize that
principle (Part III). The why comes first because it is the reason everything else matters — without
it, a reader could take the categories for a description of a synapse and miss that they describe a
physics that writes itself.*
*What changed in v5. The old "evaluation" phase is retired — it was always preparation aimed at
the other scope. The ring is recut into three categories: ACTION, RECOVERY, PREPARATION. The
obsolete subject-mapping (lateral/local/vertical) is dropped. New findings are folded in: the
rhythm is (ACTION ⇄ RECOVERY) × many, then PREPARATION; every category spans all timescales; night
PREPARATION replays the day ACTION with the same machinery; build and release compete within a
component while material competes between components; there are two independent forgettings;
collaboration by day versus competition by night follows from the rivalry of each scope's currency;
behavior is legible and meaning is assigned by the reader not the signal; and the three categories
are the three modulable dimensions of behavior. Nine categories are consolidated to six, a seventh
is added (the four operations), and — new in this revision — the "why" (formerly a closing note) is
corrected and promoted to the front as Part I.*
---
# PART I — Why This Is Not a Model but a Way of Making Models
Before the principles, one question: *what kind of object is this?* The answer is unusual, and it
governs everything that follows. This is not a model you can write down and run. It is a **generator
of models** — a rule that turns each history into a different fixed model, and only once that history
has been lived. History is not a variable inside the model; history *is* the model. This part earns
that claim, because stated cold it sounds like mysticism, and it is not — it is a checkable fact
about what the coupled components do.
**The pseudocode is a physics written in the grammar of an algorithm.** The companion pseudocode
reads like a program — assignments, conditionals, loops — but every line leans on something code
cannot supply. Its primitives — the calcium influxes, the fluctuations, the clearances — name
*physical processes*, not computations; `mini_Ca()` is a placeholder for "whatever the matter does
here." Every `·Δt` is a differential equation in disguise: the discrete step is our notation, the
thing itself is continuous. And every coincidence — the three-way gate, the tag, the build — assumes
its inputs are *present at the same instant at the same place*, which the physical cleft supplies for
free by diffusion but which an `if` can only presuppose. The imperative grammar is a transcription;
the content is a dynamical system. The pseudocode is faithful to the model exactly where it is
unfaithful to computation.
**The natural objection: surely it can still be simulated.** Nothing here is non-computable in
principle. The dynamics are differential equations with thresholds, which computers integrate
routinely. If "implement" means "numerically approximate a trajectory," computation suffices. This
objection is correct as far as it goes — so the question is what happens when you try to act on it.
**A first answer that is true but philosophical: the simulator occupies the vantage the model
denies.** The model's content is that there is no global state — no component reads another's
interior, no place holds the whole, holism is enacted and never encoded. But to compute the system
you must hold every component's state in one memory and step them in one loop: the simulator *is* the
forbidden global observer. To order the updates it needs a scheduler (a central order-giver) or a
synchronous clock ticking all components together — the "command from above" that "causation
circulates, command nowhere" denies. And it must *count* time as a variable, where the model insists
time is *suffered* — read off the decay of stores, kept by forgetting. So a computed simulation gets
the trajectory right and the ontology backwards. This is real, but on its own it can be waved away as
metaphysics. The decisive answer is concrete.
**The decisive answer: there is no one model to simulate — only a way of making models.** Compare two
cases.
Where simulation *works* — pricing a financial option. You have **one fixed model**: a stochastic
equation with fixed parameters, the same rule on day 1 and day 200. You run 100,000 random price
paths through that same equation. Each path differs, but all are **samples of one stationary object**
— the fixed distribution the equation defines. Average the payoff over them and it **converges**:
100,000 paths give a good estimate, 200,000 barely move it. It works because the paths are variations
on a single system — noise around a stable structure. History matters *within* a path but never
changes *the model*; every path runs the same equation. The model is one object; the paths are its
samples.
Where the same recipe breaks — this model. Take the four steps in turn. **(1) There is no one fixed
model.** The equation is not the same on day 1 and day 200: night 1 rewrites it into a new equation,
night 2 rewrites that. Each path runs a *different, self-modified* equation by day 10 — there is no
fixed rule to sample from. **(2) The paths are not variations on one system; they are different
systems.** In option pricing, two paths are the same stock behaving differently. Here, the path where
synapse X won an early material competition and grew, and the path where its neighbour Y won instead,
have *physically different structures* — different synapses exist. They are not two runs of one model
but two different models a shared early history produced. **(3) There is no center to converge to.**
The average final price is a real thing; the "average" of *X exists, Y pruned* and *Y exists, X
pruned* is not a valid configuration — it is a blend of two incompatible circuits, corresponding to
no possible state. **(4) More samples stabilize nothing.** More option paths tighten the estimate;
more runs here yield *more distinct circuits*, never a better estimate of one, because there is
nothing for them to estimate.
In one line: in Monte Carlo, history varies *within* a fixed model, so samples estimate the model;
here history *is* the model — each history builds a different system — so there is nothing the
samples jointly estimate. That is the precise content of "there is no one model, only a way of making
models." The pseudocode is not a model you sample; it is a *generator* of models, one per history,
knowable only once the history is complete.
**And Monte Carlo is not the only rescue that fails — every acceleration method fails, for the same
reason.** Each general way to compute a system faster than living it out relies on some *stable
invariant* to exploit, and this model, by construction, holds none.
- *Closed-form solution* needs the future to be a computable function of **time**; here it is a
function of the whole **history** — no formula takes a path as input and skips it.
- *Coarse-graining / renormalization* (physics' strongest tool, and tempting given the fast-day /
slow-night split) needs the fast variables to settle, at fixed slow parameters, to a **stationary
average** the slow dynamics can see. But the day's dynamics never settle history-independently —
*which patterns can fire* depends on structure built by every prior night — and the coupling is
bidirectional and same-order: the slow change *is made of* specific fast events (which pattern
replayed), not their average. Coarse-graining discards exactly the individuating detail the model
consolidates. The micro-detail here is the signal, not the noise.
- *Dynamic programming / memoization* needs **state recurrence** to cache and reuse; irreversible
ratcheting (energy spent, structure pruned) means no configuration is ever revisited —
nothing repeats, so nothing can be cached.
- *Surrogate / learned models* need **cross-history regularity** to generalize; the histories are
incommensurable individuals with no shared structure, so there is nothing to learn that is cheaper
than running the history.
Every method needs one of: time-parametrizability, scale separation with stationary fast statistics,
state recurrence, or cross-history regularity. This model has none — it is history-parametrized, its
fast and slow are same-order coupled, it never recurs (irreversible ratchet), and its histories are
incommensurable. The methods do not fail by bad luck; each needs the stable, reusable structure that
"the specification is continuously rewritten by its own running" abolishes.
**And here the exponential appears — not as the obstruction, but as its price.** Suppose you refuse
all of the above and insist on simulating anyway. To simulate *is* to fix a structure: a simulation
is a set of variables updated by fixed rules, and you cannot write the loop without committing to
what the variables are. But the real structure changes every night. So you face a forced choice.
Freeze *one* structure and you have committed to a single branch — one accidental history, a
measure-zero sample of a thing that is not a distribution. Stay faithful while keeping a fixed
substrate and you must instead carry *every* structure the system might occupy as an enumerated set —
and that set multiplies each night, growing exponentially in the number of nights, of changing
dimension, non-factorable. This exponential is not a property of the model; the model never
enumerates, it simply becomes one structure. The exponential is the shadow the fluid, self-rewriting
model casts on a fixed substrate — it arises *if and only if* you demand the stable structure that
simulation requires. The need for stable structure is what converts self-rewriting into
exponential enumeration; drop the demand and the exponential vanishes, leaving only a physics living
one history.
**Three concrete faces of the obstruction.** *The foreclosed synapse:* a synapse pruned on night 3
is gone; a pattern that would have used it on night 50 breaks at that link and cannot replay, so its
downstream components lose participation and drift toward pruning too — one cheap early pruning
deterministically forecloses a family of patterns fifty nights later, and you cannot know night 50's
structure without having run nights 349 in order. *The two histories that never reconcile:* run from
the same start twice; because material is conserved and structure capped, X-growing starves Y, and by
night 20 the runs have disjoint sets of synapses — not noisy versions of one answer but two
incompatible circuits with no meaningful average. *No shortcut:* because each night's structural
change feeds the next day's dynamics feeds the next night's change, with no scale separation to
exploit and no recurrence to cache, the one honest trajectory must be computed night by night, in
order, in full — it is its own shortest description. The only way to know the state at night N is to
run all N nights.
**Why this is one insight, not several.** The deep cause is that the model **abolishes the separation
between program and data.** Structure (the equations) is built from the accumulated traces of
behavior; behavior runs on structure. Night turns data into program; day turns program into data.
There is no stable specification anywhere, because the specification is continuously rewritten by its
own running — which is just "holism enacted, not encoded" and "no global state," seen over time. A
computation *requires* the split: the program is, by definition, the stable part. A thing with no
stable program cannot be captured by one.
**What the physics does instead — and why the synapse is its own faithful implementation.** The
physical synapse escapes all of this not by being non-computable but by never needing an invariant.
It does not compute which structure obtains tomorrow; it *becomes* it, by undergoing its night. It
realizes exactly one history in real time — the *real* one, not a sampled one — needing no global
memory (each component holds only its own state), no scheduler (time sequences everything at once,
everywhere, for free), no counted clock (its stores keep time by decaying). So the faithful
implementation of this model is not a program but a *material*: something that, by its own
constitution, undergoes these dynamics with locality, simultaneity, continuity, and suffered time,
without a controller. You can compute *a* life — one honest history, in full, in order,
incompressibly — but never *the* model, because there is no "the model": there is a rule that makes
one model from each history, and the synapse is the matter that runs that rule by being it.
*Two honest limits. This says faithful **acceleration** is impossible, not that useful
**approximation** is — a coarse model can teach you things, it just would not be this model. And it
holds for the model as specified (irreversible, non-recurring, individuating); whether real neural
tissue is secretly more regular, with statistics one could exploit, is an open empirical question,
not something these principles can foreclose.*
**The same no-privileged-vantage principle has a second face, in description rather than simulation.**
The first face is simulative: there is no fixed model, only histories. The second is descriptive:
there is no privileged object, only *cuts*. Nothing in the system is a bounded, persisting object one
could isolate and make the whole story — the synapse is part of a neuron, the neuron of an assembly,
the assembly of an organ, with no top and no bottom, only nested aligning projects. To describe it at
all, an observer must *choose a cut*: a boundary, a timescale, and a scope, treating what is inside as
the object and everything larger and smaller as context appearing at the boundary. Every cut is
partial by necessity; none is the whole, for the same reason no computation is the model — there is no
privileged, bounded, stable thing to be the whole. This is orthogonal to the reductive default of
classical physics, which cuts at *static object-boundaries* and explains by *cause and effect between
persisting objects*. Here the objects are active alignments continuously re-achieved, not persisting
substances; the cut is a chosen boundary × timescale × scope, not a given; and the relations that
matter are *constitution across cuts* (parts constitute an object; a level constrains the one below,
emerges into the one above), not efficient causation between objects at one level. Within a single cut
at a single timescale, ordinary cause and effect still works (this release causes that response); it
is the *objects of interest* — synapse, alignment, assembly — that live at the intersection of cuts,
where between-object causation is not the operative relation. There are affinities here with the
scale-relative parts of modern physics — the renormalization group, non-equilibrium thermodynamics,
effective field theory, all of which make descriptions depend on the scale of the cut — but those do
not *solve* this system (see the acceleration survey: they lack the invariants it refuses to hold);
they only point in the right *direction*, toward descriptions that are cut-relative rather than
absolute. The descriptive consequence — that each real object is an object-under-a-cut, partial by
construction — is developed in the companion document on the unexpressed objects.
Everything below is what this self-writing physics *is* (Part II) and how it works, category by
category (Part III).
---
# PART II — The Unifying Principle
Watch one presynaptic bouton for a day and a night. By day it releases neurotransmitter, restocks
its vesicles so it can release again, and — in the quiet after a burst — stocks a trace that records
how much this release mattered. By night it does the same three things at a slower tempo: it changes
its structure, restocks the material to change again, and replays the release as a probe to measure
whether the change is still warranted. Nothing supervises it. It reads only its own state and the
signals that reach it. What we call the synapse, the neuron, the memory, the organism is nowhere
inside the bouton — it is only the name we give to many such boutons, coupled.
That is the whole model in one instance. Stated generally:
> **There is only the local component and its one repeating act. Everything we call a system — the
> synapse, the neuron, the assembly, the organism — is that act, multiplied and coupled, and
> described from outside. The act has one shape (act, recover, prepare) run in two directions
> (outward by day, inward by night), and the relations between components are set by what is scarce.
> Holism is real, but it is enacted by the coupling, never encoded in any part.**
This is why the model is a generator rather than a fixed object (Part I): because the specification
is never encoded in any part but enacted by the running, it is rewritten by that running, so no fixed
model exists — only the rule and the history.
Every category in Part III is this principle, turned to face one question: *What is a component?*
(locality), *What is its act?* (the ring), *What are its two directions?* (the two turnings), *At
what speeds does it act?* (the ladder), *How do components relate?* (scarcity), *Who is in charge?*
(causation — no one), and *By what operations is the local multiplied and coupled into a describable
whole?* (the four operations). None adds a new assumption; each specializes the one above.
A note on language. This document does not say "the system." There is no system — only local
components, contextualized by their neighbors. Where the phrase appears, it is inside quotation
marks, naming the thing we are denying: an actor that stands above the parts, holds the whole, and
acts on it. No such actor exists here.
---
# PART III — What the Physics Is, and How It Works
---
## 1. Locality — The Only Thing That Exists Is a Local Component
Everything the model contains is a local component: the bouton, the spine, the astrocytic process,
the dendrite, the soma, the axon. The actors we call higher — neuron, astrocyte, organism — are not
additional things. They are descriptions of many components' coupled activity, spoken from outside.
This is the direct reading of the unifying principle, and the rest of the category is its mechanics.
**A component reads only its own state and the signals that arrive.** It cannot read another
component's interior, and it cannot read "the whole." When the bouton needs to know whether its
release reached a responsive target, it does not inspect the spine; it waits for a retrograde signal
the spine emitted. Coordination is never achieved by a component consulting a global state, because
there is no global state to consult. It is achieved by signals crossing between components, each
read locally and made to mean something by the local context that receives it.
**Everything emits; nothing is a pure sink.** A component that only consumed would be invisible to
the rest and could not participate in coordination. Even the leaves of the daytime chain — the
bouton, the spine — emit: by day they emit fatigue upward and retrograde messages laterally; by
night they emit freed material into the shared pool and demand upward. To exist in the model is to
be readable, and to be readable is to emit.
**Behavior is legible: acting leaves a readable mark, sent or not.** What a component emits is not
always an intended message. Some emissions are *signals* — sent to be read (glutamate, the
retrograde messages, D-serine). Others are *traces* — the physical residue of acting, read by
others though never "sent": spillover glutamate is the consequence of a bouton releasing more than
the cleft can clear, and that overrun is itself information about the bouton's power. There are no
silent acts. Acting and informing are inseparable, because behavior displaces the shared medium and
the displacement is readable. This is why coordination needs no broadcast of intent: a component
that simply behaves is already legible to whoever shares its medium.
**Meaning is assigned by the reader, not carried by the signal.** A signal is a physical fact — a
molecule, a voltage, an overrun. It has no intrinsic meaning; its meaning is fixed by the local
context that reads it. The same endocannabinoid is a *brake* to the bouton (reduce release) and a
report of *postsynaptic excess* to the astrocytic process (a pressure cue for its own structural
control). The same nitric oxide is *confirmation to strengthen* for the bouton and *this coincidence
was real, keep the capacity* for the astrocyte. The same spillover is *lost transmitter* to no one
and *my presynapse has outgrown my volume* to the astrocyte. One emission, many readers, many
meanings — and none of the readers consults the others to agree on the meaning. This is the locality
principle at the level of semantics: because no component can read another's interior, all it ever
has is the shared physical facts, which it must interpret unilaterally. Coordination is achieved
without shared meaning — each component reads the common medium and assigns its own.
**Coupling is openness, and openness is bounded.** A component is open — it takes in signals and
supply, gives out signals and product — but its openness is bounded by what it can physically
reach: its own cleft, its own supply lines, the neighbors it is wired to. It is neither sealed (that
would make coordination impossible) nor unbounded (that would make it the whole). The bounded
openness is what lets many local components compose into something we can describe as a whole
without any of them being that whole.
**Holism is real but only described.** The re-evoked pattern at night, the neuron's total activity,
the memory a synapse carries — these are real. But they are not stored anywhere. The pattern is not
in any component; it is what happens when many primed components ignite each other. The neuron's
"excitability" is not computed by anyone; it is the coincidence of many components' own lowered
thresholds. Holism is enacted by the coupling and read off by us as observers — it is never encoded
in a part, because if it were, that part would be the system, and there is no system.
---
## 2. The Ring — One Act in Three Phases
The local component's act has one shape, and it is the same shape everywhere: **ACTION, RECOVERY,
PREPARATION.** This is the specialization of the principle to the question *what is the act?*
**The three phases.**
- **ACTION** is the component's defining deed — the thing that makes it the component it is. The
bouton releases; the soma fires; the spine responds; the axon and dendrite propagate. Action is
the only phase that spends irreversibly and reaches outside the component.
- **RECOVERY** is the fast alter-ego of action: it restores the capacity to act again. Vesicles
refill, sodium channels de-inactivate, calcium clears. Recovery undoes the local depletion the
action caused, so a next action is possible. It looks backward — it repairs what was just spent.
- **PREPARATION** shapes what comes next. It faces two futures at once: the next action in this same
scope, and the action of the *other* scope. Setting the release machinery for the next spike is
preparation for this scope; stocking the tag that the night will spend is preparation for the
other. Preparation is provisioning, not judging — which is why the old "evaluation" phase was a
misnomer and has been retired. Depositing a trace does not render a verdict; it lays down a
provision that a later phase may or may not draw on. What we once called evaluation was always
preparation aimed at the other scope.
**The rhythm is (ACTION ⇄ RECOVERY) × many, then PREPARATION — then again.** The act is not one pass
through three phases. Action and recovery alternate rapidly — a tight inner loop, release-and-restock
many times over — and only when that alternation subsides does preparation run, punctuating the
bout and setting up the next. A spike train is exactly this: release ⇄ refill, release ⇄ refill,
then, in the sustained quiet, the preparation that stocks the tag and tunes the next train. The
inner loop is fast; preparation is the slower punctuation.
**Every category spans all three timescales.** The three phases are not three speeds. Each phase is
a kind of work — deed, restore-capacity, provision — and each kind happens fast, medium, and slow.
Preparation especially is multi-timescale: it contains a fast loop (probe and restock), a medium
adjustment (tuning the release machinery from the tag), and a slow settling. A category names *what
kind* of work, never *how fast*.
**Action is always local; recovery and preparation may be contextual.** A component necessarily has
its own action — the deed just is the local event occurring in it, and it cannot be performed on
another's behalf (that would be signalling, not acting). But the recovery and preparation of an
action can live in other components. A calcium channel's action is letting calcium in; its
recovery-and-preparation live in the presynapse and above. So the ring is a property of *coupled
components*, not of the individual: **the ring must close — every action recovered from and prepared
for — but no single component need run all three phases itself.** What is necessary is the closing
of the ring, not its co-location.
**The three categories are the three modulable dimensions of behavior — which is why the synapse has
three parts.** Ask what about a behavior can be changed, and there are exactly three answers: *how
hard* (intensity), *how soon again* (timing), and *where* (spatial extent — which connections exist,
how isolated they are). These are not an arbitrary list; they are the three categories seen from
outside. Intensity is the magnitude of the ACTION — a bigger release is a bigger deed. Timing is set
by RECOVERY — how fast the capacity to act is restored *is* the temporal window and the readiness
for the next deed. Space is set by PREPARATION — which structure is built or pruned is the
configuration future action will run on. To modulate a dimension is to modulate the corresponding
phase; there is nothing to change about a behavior except its three phases, so there are exactly
three dimensions, in one-to-one correspondence.
This is why the synapse is tripartite and not bipartite. Three separable dimensions want three
independent controllers, and the parties divide them: the presynapse owns the clean intensity knob
(how much it releases), the postsynapse owns sensitivity (how strongly it responds), and the
astrocytic process owns timing and space (its clearance sets how fast transmitter is cleared —
shorter dwell, sharper temporal window — and its coverage sets spillover and isolation). A
two-party synapse could set intensity but could not independently sharpen timing or bound space;
the third party exists precisely to control the dimensions the two coinciding parties cannot. In the
category language, the astrocytic process is the *recovery-and-preparation* specialist of the synapse
— it owns how-soon and where — while the pre and post are *action* specialists — they own how-hard.
The tripartite structure and the three-phase act are therefore two expressions of one three-way
partition: three phases of the deed, three dimensions of what can be changed, three parties to
change them.
The correspondence is not perfectly symmetric, and the asymmetry is instructive. Intensity and
timing each have a *live* mode — they are modulated moment to moment by the action and the recovery —
and also a *provisioned* mode, the persistent ceiling on them, set slowly. Space has no live mode: a
connection cannot be added mid-behavior; spatial structure is inherently slow. So preparation owns
space outright and also sets the ceilings for intensity and timing, while action and recovery hold
the live knobs. This is why "evaluation" was never a fourth category — there is no fourth dimension
for it to modulate. Behavior has three modulable dimensions; the act has three phases; a would-be
fourth phase would have nothing to change, which is exactly why it collapsed into preparation.
---
## 3. The Two Turnings — Day and Night
The one ring is turned in two directions. This specializes the principle to *what are the
component's two scopes?* — and it is where the model's deepest duality lives.
**Two contextualizations, two currencies.** By day the component faces outward, against the world
(the cleft); its currency is information — cheap, gathered passively, and non-rival (see category 5).
By night it faces inward, against the economy; its currency is material and energy — scarce,
conserved, and rival. The component does not know it is in "day" or "night" as a global state; each
turning simply runs against whatever environment is present, and the environment differs.
**The rotation: the same physical event is a different phase in each scope.** This is the sharpest
form of the duality. Neurotransmitter release is the day's ACTION — the outward deed. The *same
release*, run at night, is PREPARATION: the component releases not to transmit but as a probe, to
replay a behavior and measure how much it participates in the re-evoked pattern. And the structural
change, which the day can only *mark* (the tag is an inert claim pointing at a restructuring that
never happens by day), is the night's ACTION — its irreversible defining deed. So the defining act
of one scope is the measuring-instrument of the other: release is day-action / night-preparation;
restructuring is night-action / day-inert-mark. The scopes do not merely run the ring in two
directions — they swap which event is the deed and which is the provisioning. Because it is a ring,
each scope simply enters at a different phase.
**Night PREPARATION replays the day ACTION — the same machinery.** Because preparation-at-night is a
*replay* of the behavior, it runs the very code the day action runs: the same release, the same
capacity and vesicle checks, the same endurance deposit into the *same* trace. Endurance discovered
in replay is as real as endurance discovered in behaving. Only two things differ: there is no
dopamine (significance is already settled), and the released transmitter is a probe — it carries the
pattern onward to the next component and its own trace is read as participation. The action machinery
is written once and serves as the deed by day and the measurement by night.
**The tag is the payload that crosses between the turnings; the fatigue loop is the switch.** Each
scope's PREPARATION mints what the other scope will consume. Day-preparation mints the tag — a
token of confirmed significance — which the night spends on structure. Night-preparation measures
participation, which gates that spending. The tag is one token with three roles: by day it is the
significance bridge; at night it lowers the component's own threshold so its pattern can re-ignite,
and it funds the build, a slice at a time. Distinct from this payload handoff is the *switch* — the
fatigue loop that decides *when* a component crosses between scopes. Activity accrues fatigue; a
single continuous integrator (the one actor that never sleeps) reads the aggregate fatigue and emits
a pressure; when a component's own activity falls and pressure is high, it crosses into night; when
pressure discharges, it crosses back. No scheduler; no clock. The switch says *when* to turn; the
tag says *what* crosses when it turns. One ring, two turnings, stitched by the tag and switched by
fatigue.
**Two independent forgettings.** Because night ACTION is build ⇄ release (category 5), two distinct
things can be lost, by two distinct mechanisms. *Structural pruning* sheds built structure a
component no longer uses — driven by low participation, regardless of any tag it holds. *Intention
decay* is the tag itself decaying unspent — a planned strengthening that never found the
participation to license it. The tag is patient: it is sliced by building and never touched by
releasing, so it survives across non-participating cycles and cashes in when its pattern finally
re-evokes. Disuse prunes structure; unspent intention fades on its own slow clock. The two are
independent, and both are forgetting.
---
## 4. The Timescale Ladder
Orthogonal to the ring is the ladder of timescales. This specializes the principle to *at what
speeds does the component act?* The ring says *what kind* of work; the ladder says *how fast*; they
compose — every phase of the ring occurs at every rung of the ladder.
**The rungs.** FAST (milliseconds to seconds): the immediate trace a single action leaves. MEDIUM
(seconds to minutes): occupancy and evidence — the running average of fast traces, and the
eligibility climbing toward a tag. SLOW (hours): the tag, the consolidation bridge. PERSISTENT
(written only at night): the structural ceilings, and the two conserved stocks — energy, which does
not return, and material, which does.
**A tier's timescale is set by both its creation and its decay.** A fast trace is deposited as a
point event and relaxes in milliseconds. A medium trace ramps while a condition holds and settles
over minutes. The timescale is not a label attached to a variable; it is the joint consequence of
how the variable is written and how it fades. This is why the same climb appears in every component:
each action leaves a fast trace; the average of fast traces over seconds fills occupancy (short-term
strength); the average of that average over minutes, gated by dopamine, raises the tag. Occupancy is
the fast-and-medium memory of participation; the tag is its slow, validated distillate.
**Evidence ascends the ladder; capacity descends it.** By day, information climbs from fast trace to
tag — evidence accumulating upward. By night, capacity is written downward from the tag into
persistent structure. Each rung also has its own failure meaning, set by its timescale: a fast pool
running dry is transient depression; a medium pool constrained is a standing endurance need; a
persistent ceiling reached is a structural limit. Depletion and recovery at each rung mirror the
creation and decay of its trace — the same timescale governs both the evidence and the capacity at
that level.
---
## 5. Scarcity Decides — Collaboration by Day, Competition by Night
How components relate to one another is not an independent fact; it follows from what is scarce.
This specializes the principle to *how do components relate?* — and it unifies conservation,
selection, and the collaboration/competition character of the two scopes into one causal chain.
**Two conserved currencies, two rules of flow.** Energy ratchets: it is spent irreversibly, the
arrow of time in the model — a component that burns energy into structure cannot get it back.
Material circulates: it is freed by one component and reclaimed by another, conserved as it moves.
Scarcity of both forces choice — two ceilings (structure and endurance) compete for one finite
night pool, and what is not maintained drifts back down.
**Rivalry of the currency sets the relation.** By day the currency is information, which is
*non-rival*: a bouton releasing glutamate does not use up the spine's ability to receive it; a trace
here does not deplete a trace there. When producing for others costs nothing, the natural relation
is **collaboration** — and the day is exactly that: each component acts so the next can act, releasing,
integrating, clearing, passing activity along the chain, co-producing the pattern and the tags. By
night the currency is material and energy, which are *rival and conserved*: every unit one component
builds into its structure is a unit another cannot have, and the total is capped. When what one takes
another loses, the natural relation is **competition** — and the night is exactly that: components
contend for the shared pool, build what they win, and free what they shed back into contention.
**But night's competition is adjudicated by collaboration.** The relation is subtler than "day
collaborate, night compete." The replay that arbitrates the night's competition is itself a
collaborative act: a pattern re-evokes only if every component along its loop is primed and ignites
the next — mechanical coherence, a collaboration all the way around, one un-primed link breaking it.
Participation — the measure that gates who gets to build — *is* a measure of successful collaboration
in that re-enactment. So a component earns its share of the scarce material in proportion to how well
it collaborated in replaying the pattern. Collaboration is primary in both scopes: by day it
*produces* the shared, non-rival good; by night it *adjudicates* the competition for the rival one.
The register is economic, not martial — components do not fight; they contend for a conserved
resource, and the contention is settled fairly by a collaborative criterion.
**Two competitions at two loci.** Within the night, competition appears twice, cleanly separated.
*Within* a component, build and release contend over its own structure, arbitrated by participation:
high participation builds (funded by the tag, a slice per cycle), low participation releases (freeing
material, the tag untouched), and in between the component holds. *Between* components, this one and
its peers contend for the shared material and energy during recovery. The internal tension (grow or
shrink?) is settled by the replayed pattern; the external tension (can I get material?) is settled by
contention with neighbors. Selection under scarcity is the sum of these: what survives a night has
both earned its tag by day and won its material by night, and what neither participates nor is
maintained returns to the pool. Selection is not a judge's verdict; it is what scarcity leaves
standing.
---
## 6. Causation Circulates — Emergence Up, Constraint Down, Command Nowhere
The final category specializes the principle to *who is in charge?* — and the answer is no one.
Causation moves in two directions across the coupling, and neither is command.
**Emergence ascends; constraint descends.** By day, evidence and activity emerge upward: components
act locally, and their emitted activity is what a higher description (the neuron, the assembly) is
*made of*. Nothing reaches down to make them act. By night, constraint descends: a higher actor
broadcasts a bound — a renormalization target, a downscale factor — but it does not reach in. It
emits a signal; each component reads that signal and scales *itself*. The neuron never edits a
synapse; it announces a total, and the synapses each renormalize their own structure against it.
**No actor authorizes its own restructuring.** A component cannot open its own night. It is *put in
position* by the actor above — which holds an aggregate the component cannot see and opens a window
the component cannot open — and then, within that window, the component acts locally on its own
state. The soma cannot decide within the soma which of its synapses matter; the synapses decide that
locally, by their own thresholds. And the synapses cannot ignite their pattern alone; the soma's
firing does that. Each is put in position by the other; neither reads the other's interior. This is
the recursive grant: act locally, be enabled hierarchically.
**Command is nowhere.** There is no actor that both holds the whole and acts on it — that would be
the system, and there is no system. What looks like top-down control is always a broadcast constraint
scaled locally; what looks like bottom-up assembly is always local emission summed from outside. The
neuron that "renormalizes" only announces a number. The assembly that "replays" is only coincident
local thresholds propagating through coupling. Causation circulates — up as emergence, down as
constraint — but it never concentrates into command. This is the unifying principle in its final
form: because there is only the local component and its one act, there is no one to be in charge, and
the whole is enacted by the parts, never encoded above them.
---
## 7. The Four Operations — How the Local Is Multiplied Into a Whole
The six categories describe what a component is and does. This one is a different cut: it asks by
what *operations* the local is coupled into something we can describe as a whole. There are four —
integrate, coincide, broadcast, inject — and together they are the entire vocabulary by which scale
is crossed. The previous category named the two *directions* of causation; this one names the
*mechanisms*, and adds the two the directional view misses.
**Integrate — make the distributed present.** A quantity spread over time or space has no
instantaneous local existence. Flow is nowhere emitted; it is the accumulation of many releases
across a duration. Frequency is not present at any instant — a single spike has no rate; rate lives
only in the relation between events separated in time. Total activity is not held by any component;
it is the sum over many. The system reads none of these directly — it *cannot*, because they are not
anywhere. It reads them by **transducing the distributed into a store whose instantaneous level is
the quantity's present shadow.** The fast trace is the device: each event deposits a quantum, the
store leaks, and its standing level encodes recent frequency — high when deposits outran decay, low
when they did not. Spatial integration does the same across space: the dendrite summing its spines,
the soma summing its dendrites, the astrocyte summing its processes each make a spatially-distributed
quantity locally present at one site. This is how a distributed system verifies what is expressed
nowhere and by no one: it never reads the quantity, it reads the store the quantity filled. And it is
how the whole "knows" what no part knows — not by computing, but by *being the place where the parts
accumulate*.
Time itself is read this way. The system has no clock; it does not count duration. Time enters only
as the *decay* of stores — "how long ago" is how far a trace has fallen, "how fast" is how high it
stands against its leak. Time is not represented; it is suffered, and the store's level is the
readout. Every leaky store is a little clock that keeps time by forgetting rather than by counting.
**Coincide — read several present-made stores at one site, and get an event.** Integration produces
quantities; coincidence produces *events* — the meaningful happenings the components act on. And nothing
significant is caused by a single signal: significance is always the co-occurrence of several. The
postsynaptic calcium event requires glutamate and depolarization and the astrocytic gain together;
the tag requires accumulated eligibility and validation together; the night's build requires a
standing tag and confirmed participation together; the astrocytic spike requires many processes'
calcium together. A coincidence is *two or more stores being high at the same instant* — which can
only be read where all of them are present. So every coincidence needs a **meeting-site that owns
none of the signals it compares**: the site where the transduced-present stores overlap. This is why
the synapse is tripartite (the coincidence detector needs a third input neither coinciding party
owns), and the pattern recurs at every level — each has its coincidence and its meeting-site.
Integration makes the distributed present; coincidence reads several presences together. They are one
mechanism in two steps: transduce, then compare.
**Broadcast — distribute one state to many, without addresses.** The third operation sends a single
state outward to a whole population at once: the back-propagating spike to all a soma's spines, the
action potential to all its boutons, the renormalization to all a neuron's synapses, the priming
field and the calcium spike to all an astrocyte's processes. Broadcast is the descending partner of
integration, and like integration it is *addressless* — integration destroys location by summing
(the sum does not say which input), broadcast destroys it by spraying (the signal does not select
which target). Neither is a message from one component to another specific component; there is no
addressed communication across scale, only summation up and spraying down. Crucially, almost every
broadcast is **endogenous and reflective**: it carries a quantity integrated from the components' own
locals and sends back down. The back-propagating spike carries "the soma fired," which is the
integral of dendritic input, reflected to the spines. The renormalization carries the integrated
total weight. These are top-down in delivery but bottom-up in origin — the components talking to themselves
across scales, closing the loop that integration opened.
**Inject — import the one thing that cannot be built from within.** Reward is different, and the
difference is not its direction. It, too, descends as a broadcast, like the spike and the
renormalization — so top-down delivery is not what sets it apart. What sets it apart is its *origin*:
every other broadcast reflects a quantity assembled from the components' own activity, but no amount
of integrating the components' own activity can produce whether the behavior was *good for the organism in
its world*. That fact is exogenous — it comes from outside the components' own self-talk, from the
organism's encounter with its environment. Reward is the single channel by which information that
could not have been integrated from below enters the coupling at all. This is the precise sense in
which it is the opposite of integration: not top-down versus bottom-up, but **exogenous versus
endogenous** — a global that is *irreducible to* the locals, against a global that is *made of* them.
And it is necessary, because significance is defined at the organism's scale: locality can compute
what happened (activity, load, coincidence) but never whether it mattered, so that verdict must be
injected. The tag is exactly the meeting-site where endogenous evidence (eligibility, built from
local activity) coincides with this exogenous value — consolidation is the marriage of the components'
self-knowledge to the world's verdict, and it is the one place the model reaches outside itself.
So four operations, and they divide cleanly: integration makes *quantities* (by transducing the
distributed into present stores, time included, as decay); coincidence makes *events* (by reading
several such stores at a site that owns none of them); broadcast *distributes* (mostly the components'
own integrated state, reflected back down, addresslessly); injection *imports* the one global —
organism-in-world value — that no integration could produce. The first two build meaning from the
inside; the third circulates it; the fourth admits the one thing meaning cannot be built from within.
---
## Coda — The Seven as One, and the Why Beneath Them
Read downward, the seven categories are one principle refracted seven ways. A component is local
(1); its act has one shape, the ring (2); the ring turns in two directions, day and night (3), at
every rung of the timescale ladder (4); the relations between components are set by what is scarce,
collaborative where the currency is free and competitive where it is conserved (5); causation
circulates between components without ever concentrating into command (6); and the local is
multiplied into a describable whole by four operations — integrate, coincide, broadcast, inject —
none of which is a component reading another's interior (7). Remove any one and the principle loses a
facet; none stands apart from it.
And all seven serve the why of Part I. Each is a way the specification refuses to sit still in any
part: locality forbids a global copy; the ring builds structure from behavior and behavior from
structure; the two turnings make the night rewrite what the day runs; scarcity makes the rewriting
irreversible and history-locked; causation-without-command leaves no controller to hold a fixed
program; the four operations cross scale only by summing and spraying, never by encoding the whole
anywhere. Together they are why there is no fixed model to run — only the rule and the history. There
is only the local component and its one repeating act; everything else is that act, multiplied,
coupled, and described from outside — and because it is only ever *enacted*, never *encoded*, it must
be lived to be known.
@@ -0,0 +1,55 @@
## First, name what you actually need
The obstruction was specific: no global state, no scheduler, no counted time, and — the decisive one — *the structure rewrites itself, so there's no fixed program*. So a helpful physical framework must give you a substrate where (a) dynamics run without a central updater, (b) the parameters of the dynamics are themselves physical variables that evolve, and (c) time and simultaneity come for free. That's the spec. Now let's see what physics has.
## 1. Analog / continuous-time physical computation (the most direct help, and real)
The cleanest fit is the oldest idea: **don't simulate the dynamics, build a device whose native physics *is* the dynamics.** This is analog computation, and it's not a metaphor — it's a tradition.
- **Neuromorphic hardware** (memristor crossbars, analog VLSI) is built exactly for this. A memristor's conductance *is* a physical synaptic weight that changes as a continuous function of the current through it — the structure variable is a material property, updated by the physics of the device, not by a CPU writing to memory. No scheduler: every device updates simultaneously and continuously because they're all just obeying their I-V physics at once. No counted clock: the dynamics evolve in real physical time. This directly answers (a) and (c), and *partially* (b) — the weights evolve physically.
Where it helps: this genuinely removes the global state, the scheduler, and the counted clock. A memristor crossbar undergoing your day-dynamics is doing coincidence-detection and integration *as physics*, for free, in parallel, in real time. This is not speculative — it exists.
Where it stops: standard neuromorphic hardware changes *weights*, but your model changes *structure* — it prunes and grows synapses, changing the *dimension* and *connectivity*, not just the values. Memristor arrays have fixed topology. So analog hardware solves the "no scheduler / no clock / continuous" problem but not yet the "self-rewriting dimension" problem. That's the frontier — and there is work on structurally reconfigurable and self-organizing neuromorphic substrates, but it's much less mature. So: real help, incomplete.
## 2. Self-organizing / dissipative systems (help for the self-rewriting part)
The part physics helps *most* with conceptually is the thing you found hardest: a system whose own structure is built by its own running. This is the domain of **non-equilibrium thermodynamics and dissipative structures** (Prigogine), and more broadly self-organization.
The key idea you can borrow: **structure that is maintained by dissipation.** A dissipative structure (a convection cell, a chemical pattern, a flame) is not a fixed object — it is a *pattern held in place by a continuous flow of energy through the system*. Cut the flow and it vanishes. This is *exactly* your model's structure: coverage, active-zone capacity, receptor slots are all maintained by ongoing metabolic flow (energy that ratchets, material that circulates), and decay without maintenance. Your "structure builds where flow sustains it, releases where it doesn't" is a dissipative-structure principle almost verbatim.
Why this helps: it tells you the self-rewriting isn't mysterious or unphysical — physics has a whole theory of *systems whose organization is a dynamic steady state of matter/energy flow, not a fixed configuration.* The equations of your model are the local rules; the structure is the emergent dissipative pattern. You don't implement the structure directly — you implement the *flows and the local rules*, and let the structure be what the flows sustain. That reframes your implementation problem: **don't try to represent the changing program; implement the flows whose sustained patterns *are* the program.** The structure stops being something you update and becomes something that persists only while used — which is what the model already says.
Where it stops: dissipative-structure theory is strong on *pattern formation and maintenance* but weak on *the specific, addressed, memory-like structures* your model builds (this synapse, not that one). Convection cells are generic; your synapses are individuated by history. Bridging generic self-organization to individuated, history-dependent memory is not solved. So it gives you the right *category* of physics but not a ready equation.
## 3. Field theory / continuum descriptions (help for "no global state, yet coordinated")
Your worry about simultaneity and no-global-state is, in physics, the ordinary situation of a **field**. A field has no global controller — each point evolves by local rules (the field equations) reading only its immediate neighborhood, yet the whole exhibits coordinated, coherent behavior (waves, coherence, propagation) with no scheduler. Simultaneity is not imposed; it's what "the field at time t" means, and locality is built in (nothing propagates faster than the field's characteristic speed).
Why this helps: it's a proof-of-concept that *"purely local rules, no global state, no controller, yet globally coordinated behavior"* is not only possible but is how most of physics already works. Your replay-coherence (a pattern carries only where every link is primed) is a *propagation* phenomenon — it's a field/excitable-medium concept. **Excitable media** (the theory behind waves in heart tissue, the Belousov-Zhabotinsky reaction, forest-fire models) are the precise physics of "a disturbance propagates only where the medium is primed, and dies at unprimed gaps." That is your night replay, exactly. So excitable-media math (reaction-diffusion, wave propagation in heterogeneous media) is a directly applicable tool for the coherence-is-mechanical claim.
Where it stops: fields are usually *fixed-parameter* (the medium's properties don't change as the wave passes). Your medium rewrites itself. So you'd need an excitable medium *with plastic parameters* — reaction-diffusion where the diffusion constants and reaction rates are themselves slow dynamical variables driven by the fast activity. This exists in pockets (adaptive reaction-diffusion, self-modifying excitable media) but is not standard. Again: the right tool, needing an extension.
## 4. The honest synthesis — what I think your implementation actually is
Putting these together, here's the shape of an answer, and it's neither "just simulate it" nor "impossible":
**Your model is a plastic excitable medium maintained as a dissipative structure, and its faithful implementation is a physical (analog) substrate with three coupled timescales of its own material dynamics.** Concretely, the implementation you're looking for is not a program but a specification of:
- a **fast** excitable dynamics (the day: propagation, coincidence, integration) running on a medium,
- whose **parameters are slow physical variables** (the structure) that evolve by their own dynamics (the night: build/release as a dissipative steady state of material flow),
- **coupled** so that the fast activity drives the slow parameter change and vice versa,
- realized on a substrate (analog/neuromorphic) where all of this is *material behavior in continuous time*, not represented state updated by a clock.
The mathematics for this is **slow-fast coupled dynamical systems** (singular perturbation theory, adiabatic elimination) — the branch of dynamical-systems theory built precisely for "fast variables running on a landscape that slow variables reshape." That's the formal home of your day/night structure. It won't let you *escape* the exponential-branching intractability of *simulating* it — but it's the right language to *specify* it, and analog substrates are how you'd *instantiate* it without simulating.
## The one caveat I owe you
I want to be straight about the limit. None of this makes the *simulation* tractable — the exponential-branching argument stands. What physics offers is a different move: **stop trying to simulate, and instead specify-and-instantiate.** Slow-fast dynamical systems + excitable media + dissipative structures give you the *language to specify* the model as a physics; analog/neuromorphic substrates give you a way to *instantiate* it as matter that runs itself. The gap that remains — the genuinely unsolved part — is *structural* self-modification (changing dimension/topology, not just parameters) in a physical substrate. That's a real research frontier, not a solved problem. So you're not stuck, but the path is "build/specify a self-modifying analog dynamics," and the last mile (physical substrates that grow and prune their own topology) is open.
Two directions to pursue depending on what you want:
- If you want to **understand and specify**: slow-fast dynamical systems and excitable-media/reaction-diffusion are the math to write your model in — they'll turn the pseudocode into actual (continuous, local, controller-free) equations.
- If you want to **instantiate**: neuromorphic/memristive analog computing is the substrate tradition, with structural plasticity as the open extension.
Would it be useful if I took *one* component — say the astrosynapse, since it's the cleanest controller (spillover-error → coverage) — and tried to rewrite its day/night pseudocode as an actual slow-fast dynamical system (fast clearance dynamics, slow coverage as the drifting parameter, coupled)? That would be a concrete test of whether the "specify as physics" path actually works on this model, or whether something resists — and it's the honest way to find out if physics really helps here or just sounds like it should.
@@ -0,0 +1,209 @@
# The Unexpressed Objects — v1
*The objects the mechanism implies but never expresses. The pseudocode has PRE, POST,
ASTROSYNAPSE — three components, each running its own local loop. It has no `synapse`: no variable
holds one, no line makes one act. Yet we speak of the synapse constantly. This document is about what
kind of thing "the synapse" is, given that it is nowhere in the mechanism — and the answer, worked
out below, is that an object is a name we lay over an aggregation of behaviours, each behaviour read
at a chosen cut.*
## The machinery — expression, cut, behaviours, and the name
Three things, in a fixed relation:
**The expression is possibility.** The components express the *possibility* of verifying behaviours
in time, space, and quantity. Nowhere is a frequency, a flow, a duration expressed directly — only
the latent possibility of reading them. Time, space, and quantity are never *in* the expression; they
become readable only when we cut.
**A cut is a choice of level.** To read anything, we choose a level on each axis — time (ms · sec ·
min · hr), space (channel · synapse · branch · cell · territory), quantity (single quantum · occupancy
· total) — plus a scope (day · night). The cut is the grain at which we verify; nothing more. It is
what makes behaviours *actually* verifiable, out of the possibility the expression laid down.
**Behaviours are what a cut lets us read.** Put the expression through a cut and you get behaviours —
just behaviours, read at that level. This is the whole verification act:
```
expression → cut → behaviours
```
and it runs once per cut. The same expression, through a different cut, yields different behaviours.
**An object is a name over a set of these results.** "The synapse" is not a step in the chain, not an
input, not an output. It is the name we lay over a *collection* of chains —
```
the synapse = name over { expression→cut₁→behaviours A,
expression→cut₂→behaviours B,
expression→cut₃→behaviours C, ... }
```
— a grouping we perform across many cuts and label with one stable word. The object contributes
nothing to what is read; behaviours are all there is on the mechanism's side. "Synapse" adds no
behaviour and no verification — it adds only a grouping in our account. This is the cleanest form of
*verified but not expressed*: the object is not even verified; **behaviours** are verified, at cuts,
and the object is just the name over a chosen set of them. An object is therefore *not constituted by
components* — it is not built out of parts. It is a name over behaviours. Dopamine, the retrograde
messengers, the astrocytic spike, the shipment lines all enter the behaviours we call "the synapse";
listing three "constituents" would draw a false boundary and reimport the classical picture (object =
sum of parts) we are leaving behind.
**Components are objects too — there is no privileged level.** It is tempting to think the *components*
(PRE, POST, ASTROSYNAPSE) are the real objects and the synapse an emergent name over them. They are
not. A component is itself only a name over the behaviours readable at the **finest grain** — "PRE" is
the name over the ms-emission cut, the recovery cut, the tag cut, and so on, all read at the
single-component space level. So "PRE" and "the synapse" and "the assembly" are the *same kind of
thing* — names over collections of cut-behaviours — differing only in which cuts they gather (finer or
coarser). None is the bedrock the others are built from. The only bedrock is the expression as
possibility; everything above it, component included, is a name over cuts. The pseudocode's `pre_*`
variables are not "PRE the object" — they are the possibility of cutting behaviours at the finest
grain, which we name "PRE" for convenience.
**The name is one; the cuts are many.** Because "synapse" names the collection, it stays fixed
whichever cuts the collection gathers — synapse at ms, synapse at night, synapse as third party to
pre and post. These are not different objects; they are the same name, read at different cuts. It is
*always the synapse* — but always the synapse *at a cut*. The name gives stability (we can speak of
one thing across contexts); the cut gives specificity (we know which of its behaviours are in view).
Neither alone suffices: a name with no cut is vague (which behaviours?), a cut with no name is
unanchored (behaviours of what?).
## Orthogonal to classical reduction
This runs perpendicular to the habit classical physics trained into us. The reductive default
isolates a system at a **static object-boundary** — this mass, that charge, this cell — treats the
object as a persisting thing with fixed identity, and explains behaviour by **cause and effect
between such objects**: A strikes B, B moves. The object comes first and is real; behaviours are its
properties; causation runs between objects.
Here the order is inverted. **Behaviours come first** — read at cuts — and the object comes last, as
a name over some of them. There is no privileged object, not because we must choose among many
objects, but because objects were never on the mechanism's side at all: only behaviours are, and
"object" is our bookkeeping. Ask "what is the neuron trying to achieve," and any answer is partial —
the neuron is part of an assembly it cannot see, part of an organ, part of an organism, with no top
where the question closes, and made of synapses and channels, with no bottom either. The question
presumes a privileged object; there is none. This is the descriptive face of the model's founding
principle (logic_principles, Part I): as there is no global state and no privileged actor *inside*
the system, there is no privileged *object* from which to *describe* it. A name-over-cuts is to
description what one history is to simulation — the only tractable thing, necessarily partial,
honestly chosen.
Two riders. First, ordinary cause and effect still holds *within a single cut* (at the ms synapse
cut, this release causes that response); what has no clean analogue is cause/effect *between the
named objects* — the synapse does not cause anything and is caused by nothing, because it is not a
thing in the mechanism; it is a name over behaviours. Second,
the useful cuts are not arbitrary: they fall at the **joints**, where the system's own coupling is
denser inside than across (the behaviours we gather as one synapse couple more tightly to each other
than to those of the next synapse). We prefer these because they carve where the coupling already is
— but they remain cuts, still level-choices, still partial. There are affinities here with the
scale-relative frontier of physics — the renormalization group, non-equilibrium thermodynamics —
which also make description depend on the scale of the cut; but as the simulation argument showed,
those point in the direction without solving this system. They tell us cut-relative description is
legitimate physics; they do not hand us the object.
*The pseudocode is itself the finest cut* — it reads behaviours at the single-component level and
treats every larger whole as context arriving at the boundary (dopamine, the day/night context, the
renormalization are the organism and the hypothalamus reduced to inputs). This document lays names
over *coarser* collections of cuts in the same web.
## How each object is written
Given the machinery, each object below has one shape: **the name, then a series of `cut → behaviours`
entries, then the note that the name is simply the collection.** The compound observables — a
**frequency** (events per time), a **flow** (quantity per time), an **elapsed interval**, an **amount
at a moment**, a **spatial extent**, a **coincidence** — are just behaviours read along one or more
axes at a stated cut. Each entry names its cut (the levels on time, space, quantity, and the scope)
and reads the behaviours that cut makes verifiable. The object is nothing over and above the set.
---
## Object 1 — The Synapse
"The synapse" is a name over the behaviours read across the cuts below. Each cut names its levels —
time, space, quantity, scope — and reads what becomes verifiable there. None of these is more "the
synapse" than another; the word is the collection. Note in passing how much *one* observable, say
frequency, fractures across cuts: frequency of what, at what grain, in which scope — each a different
behaviour, all called "the synapse's."
**Cut — ms · single-component space · per-quantum · day.** At the finest time grain, cutting the
space at one component and the quantity at single events, the readable behaviours are the raw rates:
the **frequency of NT emission** (PRE's release events, read as PRE's fast-trace level), the
**frequency of channel opening** in POST (its fast trace), the **elapsed interval** since the last
release (how far a trace has decayed), the **quantity** of a single release (occupancy × drive). Each
is one component's behaviour; nothing joint yet.
**Cut — ms · cleft space · concentration · day.** Widen the spatial level from one component to the
cleft, keep time at ms. Now the readable behaviour is the **flow of NT out of the cleft** and its
**persistence** — the dwell time, set by the astrosynapse's clearance. This is a behaviour no single
component has; it lives at the cleft level, and the astrosynapse is where its shadow is held. "How
long transmitter stays" is a synapse behaviour only at *this* cut.
**Cut — ms · three-component space · joint · day (the third-party cut).** Cut the space to include
all three components at once and read their *joint* behaviour. Now a new behaviour is verifiable that
none of the previous cuts could reach: the **coincidence** — glutamate and depolarisation and
D-serine present together — read at POST's NMDA, which holds none of the three inputs but is where
their shadows overlap. At this cut the three axes have three owners (PRE: quantity; astrosynapse:
timing and space; POST: recombination), so the coincidence reads as *how much, how sharply timed, how
contained*. This is the cut at which "the synapse detects coincidence" is true — and it is true only
here, because coincidence is a joint behaviour and only a three-component space cut makes it
verifiable. (This is the tripartite decomposition of logic_principles §2, now located as one cut
among the synapse's many.)
**Cut — tens-to-hundreds of ms · three-component space · burst · day.** Coarsen the time level from
single spikes to bursts. The readable behaviour is now **train-to-train alignment** — does PRE's
*burst* fall in POST's depolarised *window* — and the **frequency of pre-post coincidence over a
train**, not spike by spike. Short-term plasticity is the synapse's behaviour at this cut: the gain
adjusting so the next burst lands better. Synchronisation here is over multiples of spikes; the
single-spike cut could not see it.
**Cut — minutes · three-component space · running average · day.** Coarsen time further. The
behaviour is **participation** — is this synapse consistently in the co-active set — read as the
occupancy and tag trajectories accumulating. "Is this synapse reliably aligned" is verifiable only at
the minutes cut; below it there are only instantaneous events, no reliability.
**Cut — overnight · three-component space · structural · night.** Switch scope to night and the time
level to the consolidation cycle. The behaviours are **build ⇄ release of structure** — PRE's active
zone, POST's receptor field, the astrosynapse's coverage — read against the tag and the replayed
participation. "The synapse consolidates" or "is pruned" is a behaviour of this cut alone: the same
name, now naming an overnight restructuring rather than a millisecond coincidence.
**One cut worth dwelling on — the alignment reading (any of the day cuts, read as motion).** Read the
day cuts not as snapshots but as a process, and a single compound behaviour appears across them: the
synapse **aligning along three axes** — PRE and POST tuning the quantity match, the astrosynapse
tuning the timing and space match — and doing so never bilaterally, since each party belongs to a
larger whole (PRE's neuron, POST's neuron, the astrocyte's territory). At this reading the synapse
verifies the *discovered compatibility of three larger rhythms* in when, how much, and where. And
because alignment costs fuel, it carries two success-conditions at once — **precision** (did the
alignment land: the strength tag) and **stamina** (could it be held: the endurance need) — the two
consolidation pathways seen as the two dimensions of one project: be good at coincidence, for as long
as it takes. This is not a different object; it is the day cuts read as a sustained project rather
than a series of instants.
**The name is the collection.** Synapse-at-ms, synapse-at-the-cleft, synapse-as-third-party,
synapse-over-a-train, synapse-at-participation, synapse-at-night, synapse-as-alignment — these are
not different objects, and none is the real one. They are one name laid over behaviours read at
different cuts. It is always the synapse; it is always the synapse *at a cut*. What the word buys us
is the ability to move between these cuts without losing the thread — to say "the synapse" and then
choose, by the cut, which of its behaviours we mean.
---
## The queue — objects still to build
- **The dendritic branch** (the name over cuts read at the branch's spatial grain, DEND). The
clearest spatial integrator: how behaviours read at branch-level space — the summed spine input —
become verifiable there; how attention (ACh) reweights that spatial read; what is readable at the
branch grain that no finer cut reaches.
- **The neuron's decision** (the name over cuts read at the whole-cell grain, SOMA). Where the
neuron's own **frequency** (its firing rate) and **flow** (summed input) become verifiable; the
cut at which continuous integration reads out as a discrete event.
- **The astrocytic territory** (the name over cuts read at the territory grain, ASTROCYTE).
Coincidence one scale up — synapse-synapse-synapse co-activity, not pre-post — readable at the
territory grain where the regenerative spike integrates local calcium and broadcasts it back.
- **The pathway loop / assembly** (PRE→POST→DEND→SOMA→AXON→PRE). The largest unexpressed object: how
a recurrent loop verifies flow and timing around itself, and how the night's replay reads the whole
loop's coherence as mechanical all-or-nothing (every link primed or the pattern breaks). The
assembly is the object most purely unexpressed — it is nothing but the coincidence of many primed
thresholds.
- **The rhythm** (cross-cutting). Frequency and phase as objects in their own right — what it means
for the system to verify and align to a rhythm (alpha, the day/night switch) that no component holds.
@@ -0,0 +1,792 @@
---
include_toc: true
---
# Neuron, budget, traces and behaviours
---
## Conventions: The Language of the System
The system operates across two scopes and multiple contexts. The **DAY scope** is the organism's active period — all fast and intermediate behaviors run here, structural variables are read but never permanently written, and every action leaves a trace that may or may not survive to the NIGHT. The **NIGHT scope** is when structural commits execute, budgets replenish, and all DAY traces are either converted into permanent architecture or cleared. Within each scope, each compartment operates in a specific **context** — AP or NOT_AP for the presynapse, bAP or NOT_bAP for the postsynapse, and CONTINUOUS for the astrocyte and dendritic branch — that determines which behaviors are permitted to run.
Every variable in the system is either a **state variable**, a **trace**, or a **budget**. State variables describe the current condition of a compartment. Traces are modifications deposited by a behavior that persist beyond the moment and bias future behaviors — they are the system's memory between contexts. Budgets are shared resource pools that constrain how much of any behavior can actually execute, and they ensure that nothing in the system is free.
---
## Shared Resource Pools: The Economy Before Any Behavior Runs
Before any spike fires or any receptor moves, the system's capacity for change is already determined by the state of its shared resource pools. These pools exist at four nested territorial levels, and they are the reason that what happens at one synapse has consequences for all its neighbors.
The axonal arbor maintains a shared pool of vesicle scaffold proteins — RIM, Munc13, and VGCC subunits — that every bouton on that axon must draw from when it wants to expand its active zone. It also maintains a mitochondrial ATP capacity that sets the ceiling on how many release events can occur before the energy supply is exhausted and boutons begin going silent. A set of tagged boutons tracks which sites are currently in competition for proteins drifting along the axon.
The dendritic branch maintains its own receptor reserve — a local endosomal pool of AMPA receptors held near the spines that can be rapidly inserted without waiting for the soma — alongside actin machinery for spine enlargement, a protein flux arriving from the soma, a local pool of stored mRNAs that branch ribosomes can translate immediately, and its own mitochondrial ATP budget. The set of tagged spines on the branch tracks which sites are competing for these local resources.
The astrocyte territory — which in humans wraps hundreds of thousands of synapses — maintains pools of serine racemase enzyme for D-serine synthesis, glutamate transporter proteins for clearance, extracellular matrix proteins for structural sealing, and a finite number of perisynaptic process extensions that it can selectively allocate to different synapses. All of these draw from a single ATP budget that is itself ultimately capped by the glucose supply from the nearest blood capillary — a hard vascular ceiling that cannot be exceeded regardless of demand.
The soma maintains its own pools of synthesis capacity, receptor production rate, organelles for shipping to branches, and mRNA transcription rate. These are the upstream sources that replenish the branch-level pools, and their rate is set by the CREB transcription state left over from DAY activity — meaning the soma's production capacity during NIGHT is determined by how the DAY went.
---
## Budget Allocation: Constraint Before Commitment
When any compartment wants to draw structural resources, it does not simply take them. It calls a budget allocation function that checks what is available, applies a priority weighting based on whether that site has planted a synaptic tag, grants only what can be afforded, and decrements the pool accordingly. If the grant is smaller than the request — because the pool is partially depleted by competing synapses — the deficit is queued for the next NIGHT cycle and heterosynaptic depression is triggered in untagged neighbors. The neighbors lose resources not because any signal told them to weaken, but because the pool was exhausted before reaching them.
The astrocyte allocation has an additional layer: all three of its resource draws — D-serine, ECM proteins, and process extensions — are individually capped by their specific pools, and then the combined ATP cost of all three is checked against the total ATP budget. If the ATP cost would exceed the budget, all three grants are scaled down proportionally. This means a heavily loaded astrocyte serving many simultaneously active synapses delivers partial support to each rather than full support to a few.
Budget replenishment runs continuously but peaks during the NIGHT scope. The soma's protein synthesis rate, driven by CREB activation accumulated during DAY, determines how fast the dendritic branch pools refill. The astrocyte's pools recover at rates set by enzyme synthesis and ECM production machinery, with process extensions recovering the slowest — on a timescale of hours — which is why a fully deployed astrocyte cannot immediately reallocate its walls to a new synapse. The vascular glucose ceiling is the one parameter in the entire system that cannot be increased by any molecular mechanism — it is set by blood flow and capillary density, and it sets the absolute limit on how much simultaneous structural change the system can support.
---
## DAY Scope — Presynaptic Bouton
### Context: AP
When an action potential arrives, the first check is not biological but economic: does this bouton's local mitochondrial capacity have enough ATP to afford the release? If not, the bouton goes silent regardless of the electrical input. This is the energy gate that prevents a depleted axon from continuing to operate at full output — it is not a regulatory decision but a resource constraint.
If the budget permits, calcium floods in through voltage-gated channels. The key quantity is not the peak calcium but the residual: the calcium left over from previous spikes that has not yet decayed. This residual is the presynaptic memory of recent activity — a trace that accumulates with repeated firing and fades with silence on a timescale of roughly 100 milliseconds. The current release probability is biased by this residual, meaning a bouton that has been firing recently is primed to release more than one that has been silent. Vesicles are released probabilistically from the readily-releasable pool, glutamate fills the cleft, and the pool shrinks by exactly the number released. The mitochondrial budget decrements.
If enough glutamate escapes the cleft to reach the low-affinity mGluR2/3 receptors on the presynaptic membrane, an autoinhibitory brake engages. The Gi-coupled cascade suppresses adenylyl cyclase, reducing cAMP and directly dampening voltage-gated calcium channel opening. This is a negative feedback loop entirely within the presynaptic compartment: excess output detected, output probability reduced, without any postsynaptic input. The RRP is then partially refilled by the astrocyte's lactate supply, but only to the extent that lactate is available — another resource gate.
### Context: NOT_AP
Between spikes, the presynapse is not idle. The residual calcium trace continues to decay passively — if spikes do not keep arriving, the facilitation advantage erodes. If recent firing history has been consistently above 20 Hz, the reserve pool is mobilized toward the readily-releasable pool, making more vesicles available for the next burst — but only if the reserve is non-empty, meaning this mobilization is itself budgeted by whatever was stored during prior quiescence. If firing history has been sparse, release probability drifts downward.
The more important event in the NOT_AP context is the neuromodulatory broadcast. When dopamine or norepinephrine arrives above threshold, PKA activity rises and a synaptic tag is planted — the bouton is added to the set of axon-tagged boutons competing for drifting structural proteins. This tag is a trace of the neuromodulatory context that will persist into the NIGHT scope: if a structural commit runs before the tag expires, this bouton gets priority access to the axonal protein pool.
---
## DAY Scope — Dendritic Spine
### Context: NOT_bAP
The NOT_bAP context is where the Hebbian anticipation window opens. Glutamate arriving from the presynapse activates AMPA receptors, depolarizing the spine membrane. If this depolarization is sufficient — and crucially if D-serine supplied by the astrocyte is present as a co-agonist — the NMDA receptor's magnesium block is ejected and calcium begins to enter. The amplitude and speed of this calcium rise are recorded as traces: amplitude encodes whether the event was strong enough for LTP, speed distinguishes LTP-driving fast rises from LTD-driving slow ones.
The synaptic tag is planted here, in this context, before the back-propagating AP arrives to confirm coincidence. The trigger for tag planting is the calcium rise combined with NMDA opening — the system is tagging the moment it detects an incoming signal strong enough to potentially be worth encoding, before it knows whether the postsynaptic cell actually fired. This is the Hebbian anticipation: the forward glutamate signal is the candidate event, and the tag is the molecular record of that candidacy. The spine is simultaneously added to the dendritic branch's pool of tagged spines, entering competition for local protein resources. If the neuromodulator context gate has already been set by PKA, the AMPA insertion threshold is lowered, making the eventual structural commit easier.
### Context: bAP
When the back-propagating action potential arrives from the soma down the dendritic tree, it depolarizes the spine further. This is the confirmation signal. If a tag was planted just before the bAP — meaning the forward glutamate signal and the retrograde AP signal coincide in time — the calcium rise is amplified beyond the LTP threshold, confirming genuine Hebbian coincidence. The bAP did not cause the calcium rise; it amplified one that was already in progress, retroactively validating the tag that was planted in anticipation.
If no tag was present — if the bAP arrives at a spine that received no glutamate signal — the membrane depolarizes transiently but no calcium amplification occurs and no trace is deposited. The spine passes through the bAP context without consequence. This asymmetry is the core of spike-timing-dependent plasticity: the order matters, and the tag mechanism enforces the order by requiring the forward signal to precede the backward one by enough time to plant the tag before the bAP confirms it. At the end of the bAP context, the sodium-potassium pump resets the membrane, drawing on the astrocyte's lactate supply, and the soma ATP budget decrements to pay for the propagation cost of the bAP itself.
---
## DAY Scope — Dendritic Branch
### Context: CONTINUOUS
The dendritic branch runs continuously as an integrator and distributor, operating in both directions simultaneously. Upward, it integrates the membrane potentials of all spines on its length into a branch voltage that propagates toward the soma and contributes to whether a somatic action potential fires. It also propagates the back-propagating AP downward from the soma toward the spines, but its geometry matters: bAP amplitude decays with distance from the soma, meaning spines at the distal end of a long branch receive a weaker confirmation signal than proximal spines. This geometry is itself a slow structural trace — branches that have grown longer or lost mitochondrial density will propagate bAPs less faithfully.
The branch accumulates its own calcium signal driven by the bAP and by spillover from active spines, but this calcium decays more slowly than spine calcium — it integrates across multiple spines and persists for hundreds of milliseconds. When enough spines on the same branch are co-active, a branch-level tag is planted. This is the branch's version of the synaptic tag: a marker that this branch as a whole has been meaningfully recruited, which triggers local BDNF release — a trace that signals branch-level survival and growth pressure to the soma.
When a branch tag is set and the local mRNA pool is non-empty, the branch ribosomes begin translating stored mRNAs into structural proteins locally, without waiting for the soma. This local translation provides a fast protein supply that can support early structural changes within minutes rather than hours. The translation itself draws from the branch mitochondrial budget, so a branch that is energetically depleted cannot translate even if its mRNA pool is full. The acetylcholine broadcast modulates the global LTP threshold continuously in this context — during periods of high attentional drive, the threshold lowers across all branches simultaneously.
---
## DAY Scope — Soma
### Context: AP
The soma fires an action potential when integrated dendritic input crosses the firing threshold — itself a variable that is modulated by the neuromodulatory state. When it fires, calcium enters the nucleus — a trace that accumulates with firing rate and decays over seconds. This nuclear calcium is the signal that gates CREB phosphorylation in the soma, and CREB phosphorylation is the trace that determines how much protein synthesis runs during the subsequent NIGHT scope. But CREB phosphorylation requires both nuclear calcium above threshold AND PKA activity above threshold — it is a coincidence gate at the somatic level, just as NMDA opening is a coincidence gate at the spine level. Both the activity pattern (nuclear calcium) and the neuromodulatory context (PKA) must align for the gene expression program to activate. When they do, Arc mRNA and BDNF production begin — both traces that will be shipped to active dendritic branches during the NOT_AP context.
### Context: NOT_AP
Between somatic spikes, the soma integrates dendritic inputs and manages the distribution of resources to branches. It ships Arc mRNA preferentially to tagged branches, whose tags were planted during the DAY based on spine-level calcium events. It queues organelle deliveries to branches ranked by their branch calcium levels — the most active branches receive mitochondria first. This shipping process is itself budgeted: the organelle pool is finite, and a soma that has been heavily depleting its pool during a period of high activity will have fewer organelles to ship until NIGHT replenishment runs.
The neuromodulatory broadcast in the NOT_AP context sets the PKA gate simultaneously across all compartments: GluA1-Ser845 priming lowers the AMPA insertion threshold at all tagged spines, DARPP-32 phosphorylation silences the LTD phosphatase globally, and CREB activation opens the gene expression gate. None of these actions write any structural variable — they are traces that bias what the NIGHT scope will commit.
---
## DAY Scope — Astrocyte
### Context: CONTINUOUS
The astrocyte operates without discrete contexts — it monitors its entire territory continuously. Glutamate clearance runs at all times at a rate set by the density of transporter proteins currently deployed, drawing from the ATP budget with every cycle. When spillover crosses the low-affinity mGluR5 threshold — signaling that the cleft is genuinely saturated rather than merely active — the astrocyte's internal calcium rises proportionally to the spillover level. This local calcium rise drives D-serine secretion, but the amount secreted is capped by the current serine racemase enzyme capacity, which may be partially depleted if many neighboring synapses are simultaneously demanding co-agonist support. A busy astrocyte territory delivers partial D-serine to many synapses rather than full D-serine to a few — the support is rationed automatically by the enzyme pool.
The same spillover simultaneously activates the presynaptic mGluR2/3 brake through a completely different receptor arm, reducing vesicle release probability at the source of the overflow. This push-pull is not coordinated by any signal — it is a structural consequence of the two receptor types sitting on different cells with different G-protein couplings, activated by the same diffusing ligand at the same moment.
The astrocyte checks continuously whether its local calcium has exceeded the global overload threshold. If it has, a soma-wide calcium wave fires and the shockwave lockdown executes — a circuit-breaker that mass-internalizes postsynaptic AMPA receptors, hyperpolarizes the membrane, and clusters presynaptic calcium channels for maximum signal preservation, all while rapidly depleting the astrocyte's ATP budget. The lactate pipeline runs in parallel at all times, converting glucose to lactate up to the vascular ceiling and distributing it in fractions to the presynapse, postsynapse, and dendritic branch — the fractionation determining which compartment gets refueled first under high demand.
---
## Special Case: Shockwave Lockdown
The shockwave lockdown can trigger in either scope. It bypasses all budget gates — it is an emergency override that executes regardless of resource availability — but it pays a large ATP cost that leaves the astrocyte depleted and slower to support normal plasticity events for some time afterward. AMPA receptors are mass-internalized and returned to the dendritic reserve pool rather than destroyed, meaning they are recoverable when the emergency passes.
---
## NIGHT Scope — All Compartments
The NIGHT scope opens with budget replenishment. Soma protein synthesis rate, which peaked because CREB was activated during DAY, now drives the highest protein production of the cycle. Branch-level pools refill from this production — receptor reserves, actin machinery, mRNA pools, and mitochondrial capacity all recover at rates proportional to how much CREB-driven expression ran. The astrocyte's pools replenish on their own schedules, with process extensions recovering the most slowly.
The soma then processes its shipping queue: organelles deferred during DAY are delivered to the branches that ranked highest by calcium activity. Once the queues are resolved, the structural commit function runs for every synapse that carries a tag.
### PRE — Structural Commit
The presynapse draws from the axonal protein pool to expand its active zone. What it receives is proportional to how much remains in the pool after competing tagged boutons have drawn their shares. The expansion commits permanently: the active zone grows, more docking slots are installed, calcium channels cluster more tightly beneath the zone, and baseline release probability rises. These are slow traces that will read by every AP context in every subsequent DAY scope. If the pool was insufficient for the full requested expansion, the deficit is queued for the next NIGHT and the partial expansion is committed immediately. In the LTD branch, the process runs in reverse and the proteins dismantled from the active zone are returned to the shared pool, where they become available to other boutons.
### POST — Structural Commit
The postsynapse draws from the branch receptor reserve and actin machinery. CaMKII, activated by the calcium trace deposited during DAY, anchors new AMPA receptors into the membrane surface — the number anchored determined by how many receptors the budget granted. The spine head physically enlarges in proportion to the actin machinery available. Both changes are slow traces that will be read by every NOT_bAP context in every subsequent DAY. Deficits are queued. In the LTD branch, phosphatase PP1 drives receptor internalization, and the internalized receptors are returned to the branch reserve pool — again conserving the total receptor count across the segment rather than destroying it.
### DEND — Structural Commit
The dendritic branch receives the organelles shipped from the soma, permanently increasing its local mitochondrial density — a slow trace that will improve bAP propagation fidelity and local translation capacity in future DAY scopes. Arc mRNA stored in the branch pool is translated into structural proteins that expand the local protein flux, making the branch more self-sufficient for future plasticity demands. If BDNF-TrkB signaling crossed its survival threshold during DAY — meaning the branch was genuinely and collectively active — mitochondrial density is further reinforced, stabilizing the branch architecture. If it did not cross the threshold, mitochondrial density declines slightly, making the branch progressively less capable of supporting future plasticity. This is the branch-level version of the use-it-or-lose-it logic: not a binary decision but a continuous drift in one direction or the other depending on whether BDNF traces accumulated during DAY.
### SOMA — Structural Commit
The soma's NIGHT work is primarily generative rather than structural in the local sense. CREB-driven transcription produces new proteins, receptors, and mRNAs at the highest rate of the cycle, replenishing all downstream pools. Organelle biogenesis runs — new mitochondria are produced and added to the organelle pool for shipping in future NIGHT cycles. If the overall somatic firing rate during DAY exceeded the homeostatic ceiling — meaning the entire neuron was over-recruited — a global downscaling factor is applied to all synapses simultaneously, reducing AMPA counts and release probabilities network-wide. This homeostatic correction is not targeted to any specific synapse; it is a blanket adjustment that restores the neuron's mean excitability without erasing the relative differences between strong and weak synapses. When all queues are empty and all tags are cleared, CREB phosphorylation and CREB activation are reset to false, closing the gene expression program until the next DAY's activity reactivates it.
### ASTRO — Structural Commit
The astrocyte's NIGHT work centers on remodeling its physical relationship to each synapse it wraps. For synapses that were validated for LTP during DAY, the astrocyte draws from its ECM protein pool to secrete Glypicans and Thrombospondins, sealing and structurally reinforcing the synaptic environment. It draws from its process extension budget to retract its walls inward — physically tightening the wrap around the synapse. This tightening is itself a slow trace with two consequences: it reduces the rate at which glutamate diffuses away from the cleft, and it raises the tonic D-serine level available to the NMDA receptor. Both changes make the synapse more sensitive to future events, making LTP self-reinforcing. For synapses committed to LTD, the reverse occurs: MMP enzymes dissolve the ECM, D-serine supply is cut to zero, and the astrocyte's process walls extend outward, loosening the diffusion geometry and making future signals less concentrated and less likely to trigger NMDA opening. The freed process extensions are returned to the pool and become available for reallocation to LTP synapses.
---
## Key Asymmetries and the Closure Summary
The perisynaptic distance variable is the one slow trace that amplifies rather than merely reflects the outcome. Because it controls both glutamate diffusion geometry and tonic D-serine availability simultaneously, a synapse that has been potentiated becomes progressively easier to potentiate further, and one that has been depressed becomes progressively harder to rescue — not because of any new signal but because the physical environment was remodeled to favor the existing direction.
The synaptic tag is the bridge that closes the loop between DAY and NIGHT. It is planted in the NOT_bAP context of DAY when a calcium event meets the tagging threshold, and it is consumed in the NIGHT scope when structural resources are available to fulfill the commit. If the neuromodulatory save signal never arrived during DAY — if dopamine or norepinephrine never validated the event as worth storing — the tag expires at the end of NIGHT without triggering a commit, and the DAY's traces are cleared without structural consequence.
The budget conservation law closes the entire system: LTP draws from shared pools and passively impoverishes untagged neighbors; LTD returns resources to shared pools and passively enriches them. The total resources in the system do not grow through activity — they are redistributed. The only way to increase total capacity is through NIGHT-scope CREB-driven synthesis and organelle biogenesis, and even that is bounded by the vascular glucose ceiling that the astrocyte cannot exceed regardless of demand. Every behavior in the system therefore occurs within a context that permits it, consumes from a budget that constrains it, and leaves a trace that shifts the probability of the next behavior — and the entire architecture is designed so that no single event, however strong, can permanently commit the system without the conjunction of the right context, the right energy state, and the right neuromodulatory validation.
---
---
# Tripartite Synapse — Pseudocode v4
---
## Conventions
```
SCOPE = { DAY, NIGHT }
CONTEXT = { AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS }
Variable types:
FIXED = imposed externally — does not change during simulation
VAR = changes dynamically
FAST_TRACE = accumulates and decays within DAY scope only
lifetime: ms to minutes
role: biases the next behavior within the same context
cleared: automatically by decay, never persists to NIGHT
TAG = set during DAY, persists into NIGHT scope
lifetime: hours — survives the full DAY scope
role: gates structural commit in NIGHT
cleared: explicitly at end of NIGHT after commit or expiry
requires: explicit SET and CLEAR operations
BUDGET = single energy variable per compartment
all costs deducted here regardless of molecular source
STRUCTURE = slow architectural variable
READ during DAY, WRITTEN only during NIGHT
```
---
## Fixed Parameters
```
FIXED input_freq // driving spike frequency
FIXED dopamine_level // reward/save signal from VTA
FIXED NE_level // arousal signal from locus coeruleus
FIXED ACh_level // attention signal from basal forebrain
FIXED vascular_glucose_supply // hard energy ceiling
FIXED branch_geometry // dendritic topology — affects bAP decay
FIXED Ca_HIGH // LTP-triggering Ca²⁺ threshold
FIXED Ca_LOW // LTD-triggering Ca²⁺ threshold
FIXED Ca_TAG_threshold // Ca²⁺ level sufficient to set a tag
FIXED spillover_threshold // cleft saturation threshold for mGluR activation
FIXED homeostatic_ceiling // max firing rate before global downscale
FIXED disuse_threshold // silence duration before passive LTD
FIXED recycling_fraction // fraction of ECM proteins recovered after MMP cleavage
FIXED tag_expiry_threshold // minimum tag strength to survive to NIGHT commit
```
---
## Budgets — One Per Compartment
```
VAR pre_budget // bouton ATP
// costs: VGCC opening, vesicle fusion, VATPase refill, AZ maintenance
// (simplifies: axon_mitochondria_capacity + vesicle_protein_pool)
VAR post_budget // spine ATP
// costs: NMDA current, NaK reset, AMPA trafficking, actin remodeling
// (simplifies: spine_actin_machinery + receptor_reserve)
VAR dend_budget // branch ATP
// costs: bAP propagation, local translation, branch Ca²⁺ handling
// (simplifies: dend_mitochondria_capacity + local_protein_flux)
VAR soma_budget // somatic ATP
// costs: AP generation, CREB transcription, protein synthesis, shipping
// (simplifies: soma_ATP + synthesis_rate + organelle_pool)
VAR astro_budget // astrocyte ATP
// costs: glutamate clearance, D-serine synthesis, ECM secretion,
// process motility, lactate production
// (simplifies: astro_ATP + racemase_cap + ECM_pool + process_extensions)
VAR astro_lactate // fuel exported to pre, post, dend budgets
// hard cap: vascular_glucose_supply (FIXED)
```
---
## Traces — Split Into FAST_TRACE and TAG Per Compartment
```
// ── PRE ───────────────────────────────────────────────────────────────
FAST_TRACE pre_fast_trace // residual Ca²⁺ in bouton
// SET: += spike_Ca_influx() on each AP
// DECAY: *= exp(-Δt / 100ms) continuously
// ROLE: biases vesicle_release_prob in next AP context
// CLEAR: decays automatically — never reaches NIGHT
// (covers: pre_Ca_residual, short-term facilitation)
TAG pre_tag // commitment candidacy of this bouton
// SET: when dopamine_level > D1_threshold in NOT_AP context
// ROLE: grants priority access to axonal protein pool in NIGHT
// marks bouton as validated for structural expansion
// CLEAR: explicitly at end of NIGHT after commit or expiry
// (covers: axon_tagged_boutons, PKA-driven bouton marking)
// ── POST ──────────────────────────────────────────────────────────────
FAST_TRACE post_fast_trace // Ca²⁺ dynamics in spine
// SET: += NMDA_Ca_influx × rise_speed() in NOT_bAP context
// SET: += bAP_Ca_boost() if pre_tag confirmed in bAP context
// DECAY: *= exp(-Δt / τ_Ca) — faster for LTP, slower for LTD
// ROLE: encodes LTP vs LTD instruction via amplitude + speed
// gates whether post_tag is set
// CLEAR: decays automatically — never reaches NIGHT
// (covers: post_Ca_amplitude, post_Ca_rise_speed, CaMKII vs PP1)
TAG post_tag // commitment candidacy of this spine
// SET: when post_fast_trace > Ca_TAG_threshold in NOT_bAP
// AND confirmed by bAP in bAP context
// ROLE: grants priority access to dend receptor reserve in NIGHT
// gates structural commit of AMPA insertion + spine growth
// CLEAR: explicitly at end of NIGHT after commit or expiry
// (covers: dend_tagged_spines, synaptic tag-and-capture)
// ── DEND ──────────────────────────────────────────────────────────────
FAST_TRACE dend_fast_trace // branch Ca²⁺ integration
// SET: += bAP_Ca_influx() + spine_spillover_Ca()
// DECAY: *= exp(-Δt / 300ms) — slower than spine Ca²⁺
// ROLE: integrates co-active spine count
// gates whether dend_tag is set
// CLEAR: decays automatically — never reaches NIGHT
// (covers: branch_Ca, local NMDA spillover integration)
TAG dend_tag // commitment candidacy of this branch
// SET: when co_active_spines > branch_tag_threshold
// AND dend_fast_trace > dend_tag_threshold
// ROLE: activates local mRNA translation during DAY
// gates branch structural expansion in NIGHT
// triggers BDNF release to soma
// CLEAR: explicitly at end of NIGHT after commit or expiry
// (covers: branch_tag, BDNF-TrkB branch survival signal)
// ── SOMA ──────────────────────────────────────────────────────────────
FAST_TRACE soma_fast_trace // nuclear Ca²⁺ accumulation
// SET: += nuclear_Ca_influx() on each somatic AP
// DECAY: *= exp(-Δt / τ_nuclear) — seconds timescale
// ROLE: gates CREB phosphorylation when combined with PKA
// gates soma_tag when threshold crossed
// CLEAR: decays automatically — never reaches NIGHT
// (covers: nuclear_Ca, AP-driven Ca²⁺ accumulation)
TAG soma_tag // gene expression mandate
// SET: when soma_fast_trace > CREB_threshold
// AND dopamine_level > D1_threshold (PKA coincidence)
// ROLE: drives protein synthesis rate in NIGHT scope
// determines how much structural protein is available
// for all compartment commits
// CLEAR: explicitly at end of NIGHT after synthesis executed
// (covers: CREB_phospho, Arc_mRNA, BDNF_production mandate)
// ── ASTRO ─────────────────────────────────────────────────────────────
FAST_TRACE astro_fast_trace // local Ca²⁺ in perisynaptic process
// SET: += mGluR5_Ca_influx() when glutamate > spillover_threshold
// DECAY: *= exp(-Δt / τ_astro_Ca) — seconds timescale
// ROLE: drives D-serine release proportional to magnitude
// gates astro_tag when overload threshold crossed
// CLEAR: decays automatically — never reaches NIGHT
// (covers: astro_Ca_local, IP3-driven Ca²⁺)
TAG astro_tag // territory-level activity record
// SET: when astro_fast_trace > astro_tag_threshold
// integrates overflow events across territory
// ROLE: confirms overflow_sensed condition in NIGHT commit
// gates ECM sealing and process remodeling in NIGHT
// CLEAR: explicitly at end of NIGHT after structural commit
// (covers: mGluR5_activation record, overflow validation)
```
---
## Structural Variables — Written Only in NIGHT
```
VAR pre_structure // active zone capacity
// (covers: active_zone_size + VGCC_clustering + RRP_pool_capacity)
VAR post_structure // spine sensitivity
// (covers: AMPA_count + spine_volume)
VAR dend_structure // branch capacity
// (covers: mitochondria_density + local_protein_flux_ceiling)
VAR soma_structure // somatic output capacity
// (covers: protein_synthesis_rate + organelle_pool)
VAR astro_structure // synaptic environment geometry
// (covers: perisynaptic_distance + ECM_integrity
// + D_serine_tonic_level + glutamate_clearance_rate)
```
---
---
# SCOPE: DAY
# FAST_TRACEs written and decay. TAGs set but not cleared. STRUCTUREs read only.
---
## PRE | CONTEXT: AP
```
scope DAY | context AP:
if pre_budget < release_cost:
suppress(release)
exit context
// Fast trace: deposit and decay
pre_fast_trace += spike_Ca_influx(input_freq)
pre_fast_trace *= decay(τ = 100ms) // FAST_TRACE — will not reach NIGHT
// Release gated by fast trace (residual Ca²⁺ from recent APs)
release_prob = pre_structure.base_prob × facilitation(pre_fast_trace)
released = binomial(RRP_pool, release_prob)
glutamate = released × quantal_content
pre_budget -= release_cost
// Overflow: autoinhibitory brake + astro notification
if glutamate > spillover_threshold:
release_prob *= mGluR_brake_factor // Gi arm — no budget cost on PRE
// Refuel
pre_budget += astro_lactate × pre_fraction
```
## PRE | CONTEXT: NOT_AP
```
scope DAY | context NOT_AP:
// Fast trace decays passively
pre_fast_trace *= decay(τ = 100ms)
// Intermediate tuning from fast trace history
if pre_fast_trace > high_threshold:
mobilize(reserve → RRP) // pool-limited
elif pre_fast_trace < low_threshold:
release_prob *= depression_factor
// Tag: set when neuromodulator context validates this bouton
if dopamine_level > D1_threshold or NE_level > β_threshold:
pre_tag = SET // TAG — persists to NIGHT
// pre_fast_trace NOT modified
// two variables, two lifetimes
```
---
## POST | CONTEXT: NOT_bAP
```
scope DAY | context NOT_bAP:
// AMPA current — gated by post_structure (READ)
Vm += glutamate × post_structure.sensitivity
post_budget -= AMPA_cost
// NMDA gate: depolarization + D-serine coincidence
if Vm > Mg_eject_threshold and astro_D_serine > D_serine_threshold:
Ca_influx = NMDA_influx(glutamate)
post_fast_trace += Ca_influx × rise_speed(Ca_influx) // FAST_TRACE — will not reach NIGHT
post_budget -= NMDA_cost
// Tag: set when fast trace crosses tagging threshold
// This is the Hebbian anticipation window — before bAP confirms
if post_fast_trace > Ca_TAG_threshold:
post_tag = SET // TAG — persists to NIGHT
// post_fast_trace NOT modified
// tag is a separate variable, separate lifetime
```
## POST | CONTEXT: bAP
```
scope DAY | context bAP:
// bAP arrives — confirms or rejects the tag set in NOT_bAP
Vm += bAP_depolarization(dend_structure.geometry)
if post_tag == SET and post_fast_trace > Ca_TAG_threshold:
post_fast_trace += bAP_Ca_boost() // FAST_TRACE amplified — confirms coincidence
// post_tag remains SET — bAP confirms but does not set the tag
// else: bAP without prior tag — no amplification, no tag set
post_budget -= bAP_reset_cost
dend_budget -= bAP_prop_cost
```
---
## DEND | CONTEXT: CONTINUOUS
```
scope DAY | context CONTINUOUS:
// Integrate and propagate
branch_Vm = integrate(POST.Vm, all_spines)
bAP_local = propagate_bAP(SOMA.AP_fired, dend_structure.geometry)
// Fast trace: branch Ca²⁺
dend_fast_trace += bAP_Ca_influx(bAP_local)
dend_fast_trace *= decay(τ = 300ms) // FAST_TRACE — will not reach NIGHT
// Tag: set when branch co-activity crosses threshold
if co_active_spines(branch) > branch_tag_threshold:
dend_tag = SET // TAG — persists to NIGHT
BDNF_signal → soma // signals branch recruitment to soma
// Local translation: only runs if tag set and budget allows
// Uses dend_fast_trace magnitude to scale translation rate
if dend_tag == SET and dend_budget > translation_cost:
local_proteins = translate(mRNA_pool, dend_fast_trace)
dend_structure.protein_flux += local_proteins // immediate local supply
dend_budget -= translation_cost
dend_budget -= branch_maintenance_cost
dend_budget += astro_lactate × dend_fraction
```
---
## SOMA | CONTEXT: AP
```
scope DAY | context AP:
if branch_Vm > AP_threshold:
AP_fired = True
// Fast trace: nuclear Ca²⁺
soma_fast_trace += nuclear_Ca_influx() // FAST_TRACE — will not reach NIGHT
soma_fast_trace *= decay(τ = seconds)
// Tag: set when fast trace AND neuromodulator context coincide
if soma_fast_trace > CREB_threshold and dopamine_level > D1_threshold:
soma_tag = SET // TAG — persists to NIGHT
// soma_fast_trace NOT modified
// two variables, two lifetimes
soma_budget -= AP_generation_cost
```
## SOMA | CONTEXT: NOT_AP
```
scope DAY | context NOT_AP:
branch_Vm = integrate(DEND.branch_Vm, all_branches)
// Ship resources to tagged branches — tag status determines priority
for branch in branches_ranked_by(dend_tag == SET):
dend_budget[branch] += soma_budget × shipping_fraction
soma_budget -= shipping_cost
// Neuromodulator broadcast: amplifies post_fast_trace at tagged spines
// Does NOT set tags — that requires the Ca²⁺ coincidence in POST
if dopamine_level > D1_threshold or NE_level > β_threshold:
for spine where post_tag == SET:
post_fast_trace *= PKA_amplifier // FAST_TRACE boosted — lowers commit threshold
```
---
## ASTRO | CONTEXT: CONTINUOUS
```
scope DAY | context CONTINUOUS:
// Clearance — rate set by astro_structure (READ)
glutamate -= astro_structure.clearance_rate × Δt
astro_budget -= clearance_cost
// Fast trace: local Ca²⁺ from overflow
if glutamate > spillover_threshold:
astro_fast_trace += mGluR5_Ca_influx() // FAST_TRACE — will not reach NIGHT
astro_fast_trace *= decay(τ = astro_Ca_τ)
// D-serine proportional to fast trace — budget-limited
D_serine = min(proportional_to(astro_fast_trace), astro_budget × Ds_fraction)
astro_budget -= D_serine_cost
// Tag: set when overflow is sustained above territory threshold
if astro_fast_trace > astro_tag_threshold:
astro_tag = SET // TAG — persists to NIGHT
// astro_fast_trace NOT modified
// Global overload: fast trace spike triggers lockdown
if astro_fast_trace > OVERLOAD_threshold:
trigger(shockwave_lockdown) // uses astro_fast_trace, not astro_tag
// Fuel pipeline — capped 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)
```
---
---
# SCOPE: NIGHT
# TAGs evaluated. STRUCTUREs written. Budgets replenished. All traces cleared.
---
## Step 1 — Replenish Budgets
```
scope NIGHT | step 1:
// soma_tag magnitude determines how much synthesis runs
soma_structure.synthesis_rate = CREB_expression(soma_tag) // TAG READ here
astro_budget += overnight_synthesis() × Δt_night
soma_budget += overnight_mitochondria() × Δt_night
dend_budget += soma_budget × dend_replenish_fraction
post_budget += soma_budget × post_replenish_fraction
pre_budget += soma_budget × pre_replenish_fraction
```
---
## Step 2 — Structural Commit
```
scope NIGHT | step 2:
// Three-layer filter — uses TAGs, not FAST_TRACEs
event_strong = post_tag == SET // TAG evaluated
overflow_seen = astro_tag == SET // TAG evaluated
context_valid = pre_tag == SET // TAG evaluated
and soma_tag == SET // TAG evaluated
if event_strong and overflow_seen and context_valid:
// All four compartments commit simultaneously — budget-gated
ΔAZ = min(AZ_cost, pre_budget × pre_structural_fraction)
ΔAMPA = min(AMPA_cost, post_budget × post_structural_fraction)
ΔDEND = min(dend_cost, dend_budget × dend_structural_fraction)
ΔASTRO = min(astro_cost, astro_budget × astro_structural_fraction)
pre_structure += ΔAZ // STRUCTURE WRITTEN — larger active zone
post_structure += ΔAMPA // STRUCTURE WRITTEN — more receptors, larger spine
dend_structure += ΔDEND // STRUCTURE WRITTEN — denser mitochondria, more flux
astro_structure -= ΔASTRO // STRUCTURE WRITTEN — walls IN, ECM sealed, D-serine tonic ↑
pre_budget -= ΔAZ × structural_cost
post_budget -= ΔAMPA × structural_cost
dend_budget -= ΔDEND × structural_cost
astro_budget -= ΔASTRO × structural_cost
// Partial grants: deficit queued for next NIGHT
if ΔAZ < AZ_cost: queue(pre_deficit → next NIGHT)
if ΔAMPA < AMPA_cost: queue(post_deficit → next NIGHT)
return "potentiated"
elif event_strong and not context_valid:
return "temporary — no commit" // tags expire without structural write
elif post_tag == SET and post_fast_trace < Ca_LOW:
// LTD: resources returned to budgets
pre_structure -= LTD_pre_amount
post_structure -= LTD_post_amount
astro_structure += LTD_astro_amount // walls OUT, ECM dissolved
pre_budget += recovered_AZ_cost
post_budget += recovered_AMPA_cost
astro_budget += recovered_process_cost × recycling_fraction
return "depressed"
else:
return "baseline — no change"
```
---
## Step 3 — Homeostatic Scaling
```
scope NIGHT | step 3:
if soma_tag.magnitude > homeostatic_ceiling:
for each synapse:
post_structure *= homeostatic_scale_down // STRUCTURE WRITTEN
pre_structure *= homeostatic_scale_down // STRUCTURE WRITTEN
for each branch where dend_tag == CLEAR and disuse_duration > disuse_threshold:
dend_structure -= pruning_rate × Δt_night // STRUCTURE WRITTEN
dend_budget += recovered_branch_cost
```
---
## Step 4 — Clear All Traces
```
scope NIGHT | step 4:
// FAST_TRACEs: already decayed during DAY — confirm zero
pre_fast_trace = 0
post_fast_trace = 0
dend_fast_trace = 0
soma_fast_trace = 0
astro_fast_trace = 0
// TAGs: explicitly cleared after commit or expiry
if pre_tag < tag_expiry_threshold: pre_tag = CLEAR
if post_tag < tag_expiry_threshold: post_tag = CLEAR
if dend_tag < tag_expiry_threshold: dend_tag = CLEAR
if soma_tag < tag_expiry_threshold: soma_tag = CLEAR
if astro_tag < tag_expiry_threshold: astro_tag = CLEAR
// Tags above threshold: persist to next NIGHT (multi-night consolidation)
```
---
## Key Structural Asymmetry
```
// astro_structure controls both diffusion geometry and D-serine tonic simultaneously:
// LTP commit → astro_structure decreases (walls IN)
// → clearance_rate ↓ + D_serine_tonic ↑
// → every future DAY event easier to potentiate
// LTD commit → astro_structure increases (walls OUT)
// → clearance_rate ↑ + D_serine_tonic = 0
// → every future DAY event easier to depress
// Self-reinforcing in both directions.
// Budget conservation:
// LTP draws from shared budgets → neighbors passively impoverished
// LTD returns resources to budgets → neighbors passively enriched
// Hard ceiling: vascular_glucose_supply (FIXED) — cannot be exceeded
// The FAST_TRACE / TAG split enforces the core loop precisely:
// FAST_TRACE: behavior leaves a trace that biases the next behavior (within DAY)
// TAG: behavior leaves a trace that gates resource allocation (DAY → NIGHT)
// STRUCTURE: resource allocation produces permanent change (written in NIGHT)
// BUDGET: all of the above is constrained by available energy
```
---
---
# Additions
## Neuromodulators
These are produced by small, anatomically concentrated nuclei that broadcast widely across the brain:
- dopamine_level // "save button" — validates LTP
- norepinephrine_level // arousal / signal-to-noise gain
- acetylcholine_level // attention — lowers LTP threshold
### Dopamine
Dopamine is produced primarily by neurons in the Substantia Nigra pars compacta (projecting to the striatum, relevant for motor learning and habit formation) and the Ventral Tegmental Area (VTA) (projecting to the prefrontal cortex and limbic system via the mesolimbic and mesocortical pathways, relevant for reward, motivation, and the "save button" function in your model).
### Norepinephrine
Norepinephrine is produced almost exclusively by the Locus Coeruleus, a tiny nucleus in the brainstem pons. Despite its small size it projects diffusely across virtually the entire brain — cortex, hippocampus, cerebellum, spinal cord. It's essentially the brain's arousal and signal-to-noise broadcaster, firing tonically at low rates during calm wakefulness and phasically during novel or stressful events.
### Acetylcholine
Acetylcholine has two main sources: the basal forebrain nuclei (including the nucleus basalis of Meynert) projecting to the cortex and hippocampus — relevant for attention and learning gating — and the medial septum projecting specifically to the hippocampus, where it strongly modulates theta rhythms and memory encoding.
What's striking in the context of your model is that all three systems share the same architectural logic: a tiny, localized cell population broadcasts a global contextual signal that shifts the operational threshold of millions of synapses simultaneously — none of them carrying specific content, all of them modulating how content gets written.
### Simple organisms
Excellent point. The hippocampal replay model is a vertebrate solution to a specific problem — how to consolidate many parallel experiences quickly without catastrophic interference. But the underlying molecular logic of the commit function is far more ancient and appears in organisms that have no hippocampus, no sleep architecture in the vertebrate sense, and sometimes no centralized nervous system at all.
**In invertebrates with simple ganglia***Aplysia*, *C. elegans*, *Drosophila* — the slow-scale consolidation still requires protein synthesis and still uses CREB as the nuclear transcription factor. The same PKA→CREB axis that validates LTP in the mammalian hippocampus was actually first characterized in *Aplysia* gill-withdrawal reflex studies by Kandel. What differs is the trigger and the timing. Without a hippocampus to compress and replay experiences during a rest phase, consolidation in these organisms appears to depend simply on **repetition and spacing of the stimulus itself**. A single strong shock to the siphon produces short-term sensitization lasting minutes — the intermediate scale running without commitment. Four or five spaced shocks over hours produce long-term sensitization lasting days — the slow-scale commit running because repeated PKA activation eventually crosses the threshold needed to drive CREB-dependent gene expression. The spacing matters because cAMP degrades between stimuli, and spaced repetition keeps re-elevating it above the threshold for nuclear translocation, whereas massed repetition saturates and desensitizes the cascade.
**In *C. elegans***, which has exactly 302 neurons and no sleep in any recognizable sense, consolidation-like phenomena still occur through the same molecular logic. What substitutes for the validation signal is less clear, but there is evidence that **neuromodulatory interneurons releasing serotonin and dopamine** gate whether a repeated experience gets written into long-term behavioral change — functionally identical to the save button role, just implemented in a three-neuron circuit rather than a diffuse broadcast system.
**In organisms without a nervous system at all***Physarum polycephalum*, the slime mould — something that looks functionally like consolidation occurs through purely biochemical means. Repeated exposure to a stimulus that causes contraction leaves a persistent change in the cytoskeletal and biochemical state of the organism that biases future responses. There is no synapse, no calcium influx through NMDA receptors, no PKA — but the logic of the three-layer filter is still present in a stripped-down form: the organism detects that something happened, detects that it was significant enough to exceed a threshold, and commits a physical change to its internal architecture that persists. The molecular substrate is different but the computational structure is the same.
**What this suggests about consolidation in general** is that the slow-scale commit function does not require sleep or replay — those are vertebrate optimizations on top of a more primitive mechanism. The core requirements appear to be just three things that evolution has solved repeatedly with different molecular tools:
The first is a **threshold mechanism** that prevents every transient event from being written permanently — in neurons this is the calcium amplitude and rise-speed filter, in slime moulds it is a chemical concentration threshold, but the logic is the same.
The second is a **context validation signal** that asks whether the event was behaviorally meaningful — in vertebrates this is the neuromodulatory broadcast from VTA and locus coeruleus, in *Aplysia* it is facilitatory interneurons releasing serotonin, in slime moulds it may simply be the magnitude of the perturbation itself serving as its own validation.
The third is a **protein synthesis requirement** that enforces a time cost on permanent storage — in all organisms where long-term behavioral change has been studied, blocking protein synthesis blocks consolidation, suggesting that the metabolic cost of building new structural proteins is a universal gate that prevents trivial events from consuming permanent resources.
Sleep and hippocampal replay are therefore best understood not as the mechanism of consolidation but as a **vertebrate solution to the scaling problem** — how to consolidate thousands of experiences per day across billions of synapses without running the protein synthesis machinery continuously at full cost during waking. Simpler organisms consolidate fewer experiences, face less interference, and can afford to let repetition and spacing do the work that sleep does in more complex nervous systems.
## Calcium in pre, post, astro
**In the postsynapse**, the calcium amplitude and rise-speed filter works because CaMKII and the phosphatases PP1/PP2B have different sensitivities to calcium-bound calmodulin, and calmodulin itself has different binding kinetics depending on how fast calcium rises.
Calmodulin has four calcium binding sites and its activation is highly cooperative — it does not activate linearly with calcium concentration but switches sharply above a threshold. When calcium rises fast and high, as during a strong high-frequency burst, calmodulin saturates quickly and activates CaMKII. CaMKII then autophosphorylates at Thr286, which is the critical step — once autophosphorylated it remains active even after calcium falls back to baseline, effectively converting a transient calcium event into a sustained kinase signal that outlasts the trigger. This persistence is what gives CaMKII its memory-like property and is what drives AMPA receptor insertion.
When calcium rises slowly and to a lower amplitude, as during weak low-frequency input, calmodulin activates preferentially the phosphatases PP2B (calcineurin) and downstream PP1 instead, because these enzymes have higher affinity for calcium-calmodulin complexes at lower occupancy. PP1 then dephosphorylates AMPA receptors, triggering their internalization and driving LTD.
So the filter is not a simple threshold — it is a **kinetic competition** between two enzyme systems with different calcium-calmodulin affinities. Fast large rise activates the low-affinity high-gain system (CaMKII). Slow small rise activates the high-affinity low-gain system (PP2B/PP1). The same calcium messenger routes to opposite outcomes depending purely on its dynamics.
**In the presynapse**, the calcium filter is structurally simpler but operates on a different principle — **proximity and timing** rather than kinetic competition. Calcium enters through VGCCs clustered directly beneath the active zone, and the vesicles docked at that zone sit within nanometers of the channel mouth. The local calcium concentration at the release site reaches extremely high values — estimated at hundreds of micromolar — for a very brief window of microseconds before diffusing away. Synaptotagmin, the calcium sensor on the vesicle membrane, has a low affinity but fast on-rate, meaning it only fires in response to this extremely high local transient, not to the diffuse residual calcium that lingers afterward.
The residual calcium that accumulates with repeated spikes — the pre_Ca_residual in the pseudocode — acts on a completely different target: Munc13 and RIM proteins at the active zone, which have higher affinity for calcium but slower kinetics. These proteins respond to the sustained low-level residual and increase the size of the readily-releasable pool and the probability of release — this is facilitation. So the presynaptic filter distinguishes between the sharp local transient (triggers release via synaptotagmin) and the slow diffuse residual (modulates future release probability via Munc13/RIM). Two calcium signals, two sensors, two time scales, within the same compartment.
**In the astrocyte**, the calcium filter is the least understood of the three but operates through IP3 receptor gating. IP3 receptors on the endoplasmic reticulum have a bell-shaped calcium dependence — they open in response to rising calcium but are inhibited at very high calcium concentrations. This means the astrocyte's internal calcium release is self-limiting: a moderate IP3 signal produces a local calcium rise that drives D-serine release, but an excessive signal triggers the global soma wave that activates the circuit-breaker response instead.
The key filter here is therefore the **spatial containment of the IP3 signal**. Under normal high-frequency activity, IP3 production is local to the perisynaptic process and the calcium rise stays local — driving D-serine release proportionally. Only when multiple neighboring synapses fire simultaneously does IP3 accumulate enough to propagate as a regenerative wave across the entire astrocyte via gap junctions to adjacent astrocytes, triggering the global alarm. The astrocyte is therefore filtering not just amplitude but **spatial coherence** — a single strong synapse produces a local response, but coordinated overactivity across a territory produces a qualitatively different global response.
The common thread across all three compartments is that none of them use a simple concentration threshold. Each uses a molecular mechanism that is sensitive to the **dynamics** of the calcium signal — its speed, its spatial spread, its duration, or its subcellular location — rather than just its peak value. This is what allows the same ion to encode fundamentally different instructions depending on the context in which it arrives.
## Resource budget
Exactly right. This is a resource allocation problem, and it is one of the most important constraints the system operates under. Each compartment has a finite physical budget, and potentiation at one synapse necessarily draws from a shared pool that serves many others.
**In the presynapse**, the axon has many en passant boutons — synaptic release sites distributed along its length, sometimes hundreds of them. The total vesicle pool, the mitochondrial capacity to run the VATPase pumps that refill vesicles, and the cytoskeletal machinery that mobilizes reserve pools are all shared across the entire axonal arbor. When one bouton undergoes LTP and expands its active zone and increases its RRP capacity, it is drawing on the same pool of synaptic proteins — RIM, Munc13, VGCC subunits — that all other boutons on that axon compete for. There is evidence for a **synaptic tagging and capture** mechanism here: a potentiated bouton plants a molecular tag that allows it to capture plasticity-related proteins drifting along the axon, effectively pulling resources away from untagged boutons. This means strong potentiation at one site can passively deplete neighboring sites — a form of competitive resource allocation baked into the axonal architecture.
**In the postsynapse**, the dendrite hosts thousands of spines, and the situation is even more constrained. The soma produces plasticity-related proteins — new AMPA receptor subunits, CaMKII, scaffolding proteins like PSD-95 — at a rate determined by CREB-driven gene expression, and these proteins must be shipped out along the dendritic arbor to wherever they are needed. The same synaptic tagging logic applies on the postsynaptic side: a spine that has been tagged by early LTP can capture these drifting proteins when they pass, but the total production rate is finite. There is also a **spine morphology budget** — actin polymerization drives spine head enlargement, but the actin machinery and the small GTPases (Rac1, RhoA) that regulate it are shared across the dendritic segment. Potentiating many spines simultaneously on the same dendritic branch would require more actin remodeling machinery than is locally available, meaning strong potentiation at a cluster of nearby spines may physically constrain how much each individual spine can grow.
Additionally, the postsynapse has a **receptor recycling pool** — a finite intracellular reserve of AMPA receptors held in endosomes near the spine that can be rapidly inserted during early LTP. This pool is local to a dendritic segment and is not immediately replenished. If multiple nearby spines are potentiated in rapid succession, they compete for the same local receptor reserve before new receptors synthesized in the soma can arrive.
**In the astrocyte**, the budget constraint is the most spatially explicit of the three because a single astrocyte wraps somewhere between 100,000 and 2,000,000 synapses in humans — an enormous territory. Its finite resources include the total EAAT transporter protein available for glutamate clearance, the D-serine synthesis capacity which depends on serine racemase enzyme levels, the ECM protein production capacity for Glypicans and Thrombospondins, and critically the ATP budget for running all of these simultaneously. When many synapses in its territory are active simultaneously, the astrocyte faces a genuine allocation problem: it cannot maximally support all of them at once. There is evidence that the perisynaptic process — the fine astrocytic extension that wraps individual synapses — is itself a dynamic structure that the astrocyte extends and retracts selectively, suggesting it physically prioritizes which synapses receive close wrapping and therefore which ones benefit from tighter D-serine delivery and glutamate containment.
**The deeper implication** is that potentiation is not just a local bilateral negotiation between one presynapse and one postsynapse. It is a **network-level resource competition** in which:
A strongly potentiated synapse draws proteins and structural resources away from its neighbors on the same axon and dendrite. The astrocyte must allocate its clearance, co-agonist, and structural support capacity across its entire territory. The metabolic pipeline — glucose from blood vessels, lactate to neurons — has a ceiling determined by capillary supply, meaning a highly active region of the astrocyte territory can become fuel-limited if demand outpaces vascular supply.
This is probably why **heterosynaptic LTD** exists — the observation that strong LTP at one synapse is often accompanied by spontaneous depression at neighboring synapses on the same dendrite even without those synapses being directly stimulated. It may be less a deliberate regulatory mechanism and more a direct consequence of resource depletion: the potentiated synapse captured the available receptors, actin machinery, and astrocytic support, leaving neighboring synapses passively impoverished.
The pseudocode should therefore include a budget layer that sits above the individual synapse functions — something like a shared resource pool per axonal arbor, per dendritic segment, and per astrocyte territory, from which each commit function draws and against which each structural expansion is checked. Potentiation that would exceed the available budget either fails to consolidate fully, triggers compensatory depression at neighboring synapses, or waits for new protein synthesis to replenish the pool before completing.
@@ -0,0 +1,252 @@
---
include_toc: true
---
# What the Organism Is Trying to Achieve
The organism exists in a world that is partially predictable and partially surprising. Its fundamental challenge is to become progressively better at navigating that world — to recognize patterns that matter, respond to them effectively, and build on past experience to improve future behavior. This requires the organism to continuously update its internal structure based on what it encounters, while remaining stable enough that not every transient experience rewrites everything it has learned.
The organism is therefore solving a **selective memory problem**: out of the continuous flood of experience, identify what is genuinely significant, strengthen the neural pathways that processed it, and let everything less significant fade — all within the constraints of finite energy and finite biological material.
---
## How the Organism Achieves This — The Spatial Hierarchy
The organism solves this problem through a hierarchy of structures operating at different spatial scales, each sensitive to different aspects of experience.
**At the organismic level**, dedicated organs monitor the overall state of the organism and its relationship to the world. The **VTA** tracks reward and surprise — whether outcomes were better or worse than predicted. The **locus coeruleus** tracks novelty and arousal — whether the current situation demands heightened attention. The **basal forebrain** tracks attentional state — whether the organism is in a mode where new patterns should be encoded. These organs integrate across the entire organism's experience — sensory input, motor output, internal state, social context — and translate their assessment into **neuromodulatory broadcasts**: dopamine, norepinephrine, and acetylcholine signals that diffuse widely across the brain and simultaneously shift the operating state of millions of synapses. These broadcasts are the organism's way of saying to its own neural tissue: what is happening right now is worth remembering, or is not.
**At the neural circuit level**, populations of neurons integrate signals across sensory, motor, and associative areas, building representations of the current situation and generating behavioral responses. The circuit level is where the content of experience is processed — what was seen, what was done, what happened as a result. This is the level at which patterns are recognized and predictions are formed.
**At the cellular level**, individual neurons and their associated astrocytes are the elementary units of pattern storage. Each neuron integrates inputs from thousands of synapses, each synapse reflecting a different aspect of the patterns the neuron participates in representing. The neuron's job is to detect coincidences — to fire when a particular combination of inputs arrives — and to strengthen the connections that reliably contribute to its firing.
**At the synaptic level**, the individual synapse — composed of presynapse, postsynapse, and astrosynapse — is where the actual structural change happens. This is the elementary unit of memory: a physical modification of the connection between two neurons that makes future transmission across that connection more or less effective.
---
## The Neuron and Its Compartments
A neuron is not a simple input-output device. It is a spatially extended system whose different parts perform different computations and operate on different timescales.
The **soma** is the neuron's integrating and decision-making center. It sums all the inputs arriving from its dendritic tree, decides whether the combined input crosses the threshold for firing an action potential, and manages the production of structural proteins that all other compartments depend on. It is also the point where the organism-level validation signal — dopamine arriving via neuromodulatory broadcast — coincides with the neuron-level activity signal — nuclear calcium accumulating from recent firing — to produce the gene expression mandate that drives structural change during the night.
The **axon** is the neuron's output channel. It carries the action potential from the soma to every presynaptic bouton, reliably and rapidly. It is also the supply line that transports vesicle proteins, mitochondria, and scaffold components from the soma to the boutons. Its structural integrity determines both how reliably APs reach their destination and how quickly boutons can be resupplied after structural remodeling.
The **dendritic tree** is the neuron's input collection system. It receives signals from thousands of synapses and propagates them toward the soma. But it is not a passive cable — it actively integrates, amplifies, and filters. Individual dendritic branches perform local computations, summing inputs from their spines and deciding whether the local pattern is strong enough to propagate. The branch also carries the back-propagating action potential from soma to spines, providing each spine with the retrograde confirmation signal needed for coincidence detection. The branch is the resource distribution channel between soma and spines, delivering proteins, mRNA, and energy to wherever demand is highest.
The **presynaptic bouton** is the neuron's output terminal at each individual synapse. It converts the electrical action potential into a chemical signal by releasing neurotransmitter into the synaptic cleft. Its release capacity — how much NT it can release per AP — is determined by the size of its active zone, the density of its vesicle docking slots, and the proximity of its calcium channels to those slots. All of these are structural properties that are remodeled during the night based on the bouton's recent activity history and its validation by the organism-level reward signal.
The **postsynaptic spine** is the neuron's input terminal at each individual synapse. It detects the neurotransmitter released by the presynapse and converts it back into an electrical signal. Its sensitivity — how strongly it responds to a given NT release — is determined by the number of AMPA receptors anchored in its postsynaptic density and the physical size of the spine head. These structural properties are also remodeled during the night. The spine is also the primary site of coincidence detection: it requires both the forward glutamate signal from the presynapse and the retrograde bAP signal from the soma to arrive within a precise time window in order to trigger the cascade that leads to potentiation.
---
## The Astrocyte and the Astrosynapse
The astrocyte is not a supporting cell. It is a full partner in synaptic function, and its perisynaptic process — the **astrosynapse** — is the third component of every synapse alongside pre and post.
The astrosynapse controls two things that neither the presynapse nor the postsynapse can control for themselves. First, it determines how long glutamate remains in the cleft by clearing it through transporter proteins — setting the effective duration and concentration of the presynaptic signal. Second, it determines whether the postsynapse is permitted to open its NMDA receptors by supplying D-serine as the obligatory co-agonist — acting as a permissive gate on coincidence detection and therefore on the entire LTP induction cascade.
By physically moving closer to or further from the synaptic cleft — retracting its walls inward during potentiation and extending them outward during depotentiation — the astrosynapse amplifies the direction of structural change that the synapse has already committed to. A tightly wrapped astrosynapse makes every future glutamate signal more concentrated and the NMDA gate more reliably open, making the synapse easier to potentiate further. A loosely wrapped astrosynapse dilutes the signal and starves the NMDA gate, making the synapse progressively harder to rescue. This self-reinforcing property makes the astrosynapse the most powerful single determinant of the long-term trajectory of a synapse.
The astrocyte cell body integrates signals across its entire territory — which wraps hundreds of thousands of synapses — and provides the astrosynapse with the raw materials it needs: D-serine precursors, ECM proteins, process extension machinery, and energy in the form of lactate. The astrocyte is also the primary energy supplier to the entire synapse: it absorbs glucose from the blood vasculature, converts it to lactate, and delivers it to presynapse, postsynapse, and dendritic branch alike. The vascular glucose supply is the hard energy ceiling of the entire system — the one constraint that no molecular mechanism can overcome.
---
## The Temporal Hierarchy — DAY and NIGHT
The system operates across two temporal scopes that correspond to the organism's activity cycle.
During the **DAY**, the organism is acting in the world and the neural system is processing experience. At the fastest timescale — milliseconds — individual synapses are transmitting signals, calcium is flowing, vesicles are releasing. At the intermediate timescale — seconds to minutes — patterns of activity are building up traces within each compartment: residual calcium encoding recent firing history, possible tagging variables accumulating evidence of sustained recruitment, dopamine transients arriving and intersecting with local eligibility windows. All of these traces are graded, decaying, and reversible. No permanent structural change occurs during DAY. The architecture is fixed but tunable and the system operates within these constraints.
The key DAY event is **tagging**: the coincidence of local eligibility — the component was recently and significantly active — and global validation — the organism-level neuromodulatory signal says this activity was worth preserving. When both coincide within the decay window of the local trace, a tag is set. The tag is the DAY scope's record of what the organism found significant. It is not binary — it is graded by how strong the activity was and how strong the validation was — and it decays slowly, surviving the full DAY scope to reach NIGHT.
During the **NIGHT**, the organism is at rest and the neural system shifts into a structural rewriting mode. Budgets are replenished from the soma's protein synthesis machinery, which peaks during slow-wave sleep driven by the CREB gene expression program activated during DAY. Tagged synapses draw from these replenished pools to commit structural changes: larger active zones, more anchored receptors, tighter astrosynaptic wrapping. The magnitude of each structural change is proportional to the tag strength and bounded by the available budget. Untagged synapses receive only what remains after potentiation has drawn its share — and since structural maintenance requires a continuous resource allocation, synapses that receive less than their maintenance cost drift passively toward lower structural states. Depotentiation is not an active process. It is the shadow of potentiation — the inevitable consequence of finite resources being redirected toward what the organism found significant.
---
## The Integration That Makes It Work
The entire system is fundamentally an **integration machine** operating across space and time simultaneously.
In space, it integrates from the molecular level — calcium ions, receptor phosphorylation states, vesicle docking — through the synaptic level — pre, post, and astrosynapse cooperating — through the cellular level — soma integrating thousands of synaptic inputs — through the circuit level — populations of neurons collectively representing experience — to the organismic level — the VTA and locus coeruleus assessing the global significance of what is happening. Each level integrates experiences that the level below cannot generate from within itself. The organism's assessment of significance — dopamine — is not computable from the synapse's local activity. The synapse's coincidence detection — the bAP meeting the NMDA calcium signal — is not visible at the organismic level. Both are necessary. Neither is sufficient alone.
In time, it integrates from the millisecond scale — individual spikes and calcium transients — through the second-to-minute scale — spike trains and trace accumulation — through the hour scale — tag persistence and protein synthesis — through the day-night cycle — structural commit and budget replenishment — through the multi-day scale — queued deficits resolved across consecutive nights and structural consolidation completed. Each timescale feeds forward into the next: what happens in milliseconds determines what the traces look like over minutes, which determines what gets tagged over hours, which determines what gets structurally committed over nights, which determines how the system responds to experience over weeks.
The result is a system that is simultaneously **sensitive and stable**: sensitive because it continuously updates its structure based on recent significant experience, stable because the update process is slow, gated, resource-limited, and requires validation from the organism level before anything permanent is written. Fast enough to learn from today's experience. Slow enough that yesterday's learning is not erased by today's noise.
# High level description of the components
## Presynaptic Bouton
### What Does the Presynaptic Bouton Actually Do?
The presynaptic bouton has three distinct functions:
**Neurotransmitter release** — it converts the arriving action potential into a chemical signal by releasing neurotransmitter into the synaptic cleft. The release is driven by calcium influx through voltage-gated calcium channels, which triggers vesicle fusion at the active zone. The rate of NT release — the NT flux — is determined by how much calcium arrives and how much NT is currently available in the readily-releasable pool. This is the bouton's primary fast function and its sole output to the synapse.
**Release probability modulation** — it adjusts how effectively each AP drives NT release based on its own recent history. Residual calcium left from prior spikes accumulates in the bouton and biases the release machinery toward higher output — this is short-term facilitation. Depletion of the readily-releasable pool under sustained high-frequency firing reduces output regardless of calcium drive — this is short-term depression. Both are entirely local to the bouton and require no signal from outside.
**Active zone maintenance** — it maintains the physical docking infrastructure at the active zone: the scaffold proteins that hold vesicles in position, the calcium channels clustered beneath the docking slots, and the reserve pool of vesicles ready to replenish the readily-releasable pool. The integrity of this infrastructure determines the ceiling on what the bouton can do moment to moment.
### Occupancy vs Capacity for the Presynaptic Bouton
**DAY occupancy** — how effectively the bouton is currently releasing NT, driven by `pre_fast_trace`:
- Current NT flux — the rate of neurotransmitter entering the cleft right now, driven by calcium and RRP level
- Current RRP level — how full the readily-releasable pool is at this moment, fluctuating with release and refill rates
- Current release probability — biased upward by residual calcium from recent spikes, downward by RRP depletion
All three fluctuate continuously during DAY and reverse automatically when activity ceases. No structural variable is written.
**NIGHT capacity** — the ceiling on DAY occupancy, set by `pre_structure`:
- Active zone size — the number of docking slots available, determining the RRP ceiling
- VGCC clustering — the proximity of calcium channels to docking slots, determining the efficiency of calcium-triggered release
- RRP refill ceiling — the maximum rate at which the reserve pool can replenish the readily-releasable pool, determined by transport machinery and VATPase pump density
---
## Postsynaptic Spine
### What Does the Postsynaptic Spine Actually Do?
The postsynaptic spine has three distinct functions:
**Glutamate detection** — it detects the NT released by the presynapse through AMPA receptors on its surface, converting the chemical signal back into an electrical current that depolarizes the spine membrane. The magnitude of this current is determined by how many AMPA receptors are currently anchored at the postsynaptic density. This is the spine's primary fast function and its direct response to presynaptic output.
**Coincidence detection** — it determines whether the incoming glutamate signal coincides with a retrograde signal from the soma. The NMDA receptor acts as the molecular coincidence detector: it requires both glutamate binding and sufficient membrane depolarization to eject its magnesium block, AND D-serine from the astrosynapse as a co-agonist. When all three conditions are met simultaneously, calcium enters through the NMDA channel and encodes the coincidence as a graded calcium signal whose amplitude and rise speed carry the instruction for future structural change.
**Synaptic tagging** — it records the occurrence of a significant coincidence event by accumulating a graded tag variable that survives to the NIGHT scope. The tag is built in two stages: a candidate phase set by the local calcium event, which is then stabilized if dopamine arrives within the stabilization window. Only spines that were genuinely active during the day AND received organismic validation accumulate a stable tag strong enough to draw structural resources during NIGHT.
### Occupancy vs Capacity for the Postsynaptic Spine
**DAY occupancy** — how effectively the spine is currently detecting and encoding signals, driven by `post_fast_trace`:
- Current AMPA current — the immediate electrical response to glutamate, fluctuating with moment-to-moment receptor surface availability via lateral diffusion and rapid recycling
- Current calcium amplitude and rise speed — the coincidence signal encoding the LTP versus LTD instruction, driven by NMDA opening
- Current possible tagging level — the graded accumulation of participation evidence building toward a stable tag
All three fluctuate during DAY. The transient receptor insertions and internalizations that drive AMPA current fluctuation are reversible — they reflect occupancy of existing anchoring slots, not creation of new ones.
**NIGHT capacity** — the ceiling on DAY occupancy, set by `post_structure`:
- Anchoring slot count — the number of positions in the PSD scaffold that can hold AMPA receptors, determining the ceiling on effective surface receptor count
- Spine volume — the physical size of the spine head, determining the local endosomal receptor reserve and actin machinery available for rapid DAY trafficking
- Local receptor reserve — the endosomal pool of AMPA receptors held near the spine, available for rapid insertion without waiting for somatic synthesis
---
## Dendritic Branch
### What Does the Dendritic Branch Actually Do?
The dendritic branch has three distinct functions:
**Bidirectional signal propagation** — it carries the summed electrical activity of its spines toward the soma, contributing to the somatic integration that determines whether an AP fires. It simultaneously propagates the back-propagating action potential from the soma toward the spines, providing each spine with the retrograde confirmation signal required for coincidence detection. The fidelity of bAP propagation decreases with distance from the soma, meaning distal spines receive a weaker confirmation signal than proximal ones — a spatial gradient that makes distal spines inherently harder to potentiate.
**Local resource distribution** — it is the logistics channel between the soma and its spines, carrying proteins, mRNA, receptors, and mitochondria from the soma's production machinery to wherever spine-level demand is highest. Tagged spines receive priority allocation of these resources. The branch is not a passive pipe — it actively gates and directs the flow based on local demand signals.
**Local protein synthesis** — it has its own ribosomes and stored mRNA pool that can produce structural proteins locally and rapidly, without waiting for somatic delivery. This local translation is activated when the branch itself is sufficiently recruited — when enough of its spines are co-active — providing a fast protein supply that supports early structural changes within minutes rather than hours.
### Occupancy vs Capacity for the Dendritic Branch
**DAY occupancy** — how effectively the branch is currently performing its three functions, driven by `dend_fast_trace`:
- Current bAP propagation strength — how faithfully the bAP reaches distal spines right now, fluctuating with recent activity and local energy availability
- Current protein flux rate — how much resource is flowing through the branch toward spines at this moment
- Current local translation rate — how actively branch ribosomes are running, gated by branch tag status and local budget
All three fluctuate during DAY and recover when activity and budget allow. No structural variable is written.
**NIGHT capacity** — the ceiling on DAY occupancy, set by `dend_structure`:
- Mitochondrial density — determines the local ATP ceiling, which sets both bAP propagation strength and local translation rate
- Cytoskeletal integrity — determines transport speed from soma to spines and the physical geometry of bAP propagation
- mRNA pool ceiling — the maximum stored mRNA available for local translation, set by how much Arc and plasticity-related mRNA was shipped from the soma during prior NIGHT cycles
---
## Soma
### What Does the Soma Actually Do?
The soma has three distinct functions:
**Input integration and AP generation** — it continuously sums the electrical signals arriving from all its dendritic branches and decides whether the combined input crosses the firing threshold. When it does, it generates an action potential that propagates simultaneously down the axon to all presynaptic boutons and back up the dendritic tree as the bAP. The firing threshold is not fixed — it rises with recent firing history through spike-frequency adaptation, falls with strong neuromodulatory drive, and is subject to a hard absolute refractory period immediately after each AP.
**Organism-level signal integration** — it is the point where the neuron-level activity signal — nuclear calcium accumulating from recent firing — meets the organism-level validation signal — dopamine arriving via the VTA broadcast. Only when both are present simultaneously is the gene expression program activated. The soma is therefore the coincidence detector at the cellular scale, just as the NMDA receptor is the coincidence detector at the synaptic scale.
**Structural protein production** — it is the upstream source of all structural proteins, receptors, organelles, and mRNA that the downstream compartments — dendritic branches, spines, and axonal boutons — depend on for their NIGHT structural commits. The rate of production during NIGHT is set by the CREB gene expression program activated during DAY. This makes the soma the production bottleneck for the entire system: the magnitude of structural change possible across all compartments during any given NIGHT is bounded above by what the soma synthesized.
### Occupancy vs Capacity for the Soma
**DAY occupancy** — how effectively the soma is currently performing its three functions, driven by `soma_fast_trace`:
- Current firing threshold — rises above baseline with each AP via spike-frequency adaptation driven by slow potassium channels, falls with neuromodulatory drive, and is temporarily infinite during the absolute refractory period
- Current integration gain — how effectively dendritic inputs sum toward threshold, modulated continuously by norepinephrine and acetylcholine levels
- Current nuclear calcium level — the fast trace that accumulates with each AP and gates the coincidence with dopamine needed to activate gene expression
All three fluctuate during DAY. The threshold adjustments and nuclear calcium accumulation are reversible on a timescale of seconds.
**NIGHT capacity** — the ceiling on DAY occupancy, set by `soma_structure`:
- Baseline firing threshold — the resting threshold before any DAY modulation, set by ion channel density at the axon initial segment
- AP generation capacity — determined by sodium channel density and distribution, setting the reliability and amplitude of generated APs
- Protein synthesis ceiling — ribosome density and CREB machinery capacity, determining the maximum rate of structural protein production available to all downstream compartments during NIGHT
---
## Axon
### What Does the Axon Actually Do?
The axon has three distinct functions:
**AP propagation** — it carries the somatic action potential reliably and rapidly from the axon initial segment to every presynaptic bouton along its length. Reliability is not guaranteed under all conditions — at very high firing frequencies, propagation can fail at axonal branch points because sodium channels need a brief recovery period after each AP. This frequency-dependent propagation failure is the axon's only form of short-term depression and is entirely local to the axon.
**Anterograde resource transport** — it carries vesicle scaffold proteins, mitochondria, calcium channel subunits, and other structural components from the soma to the presynaptic boutons via motor proteins moving along microtubule tracks. The transport rate determines how quickly boutons can be resupplied after structural remodeling during NIGHT and therefore sets the timescale over which presynaptic structural commits are fulfilled.
**Bouton maintenance supply** — it continuously delivers the molecular components that each bouton needs to maintain its active zone integrity, replenish its vesicle pools, and sustain its release capacity. A bouton that is not adequately supplied drifts toward lower structural states regardless of its tagging history, because maintenance requires a continuous resource allocation just as spine maintenance does.
### Occupancy vs Capacity for the Axon
**DAY occupancy** — how effectively the axon is currently performing its three functions, driven by `axon_fast_trace`:
- Current propagation reliability — the fraction of APs that successfully reach all boutons, degrading under high-frequency firing as sodium channels at branch points enter relative refractoriness
- Current transport rate — how fast structural components are being delivered to boutons right now, fluctuating with local ATP availability and motor protein engagement
- Current bouton supply level — whether individual boutons have sufficient molecular components for sustained release at this moment
**NIGHT capacity** — the ceiling on DAY occupancy, set by `axon_structure`:
- Myelination density — determines AP propagation speed and the frequency at which propagation failure begins to occur
- Transport machinery capacity — motor protein density and microtubule integrity, determining the maximum rate of anterograde delivery to boutons
- Axonal mitochondrial density — local ATP supply for both propagation and transport along the axon shaft, determining the energy ceiling on axonal function independent of astrocytic lactate delivery
---
## Astrosynapse
### What Does the Astrosynapse Actually Do?
The astrosynapse has three distinct functions:
**Glutamate clearance** — it removes glutamate from the cleft via EAAT transporters, terminating the signal and preventing spillover to neighboring synapses. This is the astrosynapse's primary fast function.
**D-serine supply** — it releases D-serine as the NMDA co-agonist, gating whether the postsynapse can open its NMDA channels. Without D-serine, NMDA cannot open regardless of depolarization. The astrosynapse is therefore a permissive gate on postsynaptic LTP induction.
**Diffusion geometry control** — by physically moving closer to or further from the cleft, it controls how concentrated glutamate remains in the cleft and how quickly it escapes to the extrasynaptic space. This is the perisynaptic distance variable — the structural variable that amplifies both LTP and LTD directions.
### Occupancy vs Capacity for the Astrosynapse
**DAY occupancy** — how the astrosynapse is currently performing its three functions, driven by `astro_fast_trace`:
- Current clearance rate — how fast glutamate is being removed right now, fluctuates with transporter availability and local ATP
- Current D-serine release rate — how much co-agonist is being supplied right now, proportional to astro_fast_trace magnitude
- Current diffusion geometry — the instantaneous physical position of the process relative to the cleft
**NIGHT capacity** — the ceiling on DAY functions, set by `astro_structure`:
- EAAT transporter density — determines maximum clearance rate
- Serine racemase enzyme density — determines maximum D-serine synthesis rate
- Perisynaptic distance — the resting position of the process walls around the cleft
- ECM integrity — the extracellular matrix scaffold that stabilizes the process position
@@ -0,0 +1,157 @@
---
include_toc: true
---
# Logic principles
Here are the logic principles that have guided the construction, organized from the most fundamental to the most specific.
---
## I. Principles of Resource and Conservation
**Nothing is free.** Every behavior consumes a budget. There is no operation in the system that does not draw down some resource. This is not a constraint added on top of the logic — it is the foundation of the logic. Selectivity, competition, and forgetting all emerge from the fact that resources are finite.
**Resources are redistributed, not created.** The total resource pool is bounded by an external ceiling (the vascular glucose supply). Within that ceiling, the system moves resources around — from one synapse to another, from structure back to pool when structures are dismantled. No internal process can manufacture new capacity; it can only reallocate existing capacity. Learning is therefore always at the expense of something else.
**Every economy has a single capped root.** Each resource type traces back to one producer with a hard output ceiling — the astrocyte cell body for synaptic energy, the soma for neuronal structural material. Everything downstream competes for shares of that capped production. The ceiling is the ultimate arbiter of how much the system can do.
**Conservation makes one synapse's gain another's loss.** Because resources are shared and finite, potentiation at one site necessarily reduces what is available elsewhere. This coupling is not designed — it is the automatic consequence of drawing from a common pool.
---
## II. Principles of Time and Scope
**Behavior and structural change occupy separate scopes.** Fast behavior happens in DAY; permanent structural change happens in NIGHT. This separation prevents transient activity from directly rewriting architecture — every noise spike would otherwise remodel the system. The scope boundary is the mechanism that makes the system both responsive and stable.
**DAY accumulates evidence; NIGHT acts on it.** No decision about permanent change is made during DAY. DAY only gathers traces. NIGHT reads the accumulated evidence and commits. The system never commits in the moment — it always defers commitment to a consolidation phase that operates on aggregated evidence.
**Every quantity has a characteristic timescale, and timescale is meaning.** Fast traces decay in milliseconds, tags in hours, structures over days. The decay constant of a variable is not a parameter — it is what the variable means. A variable that decays fast is a momentary signal; one that decays slowly is a commitment. Putting two different timescales in one variable destroys both meanings.
**Time windows are enforced by chemistry, not by clocks.** The system never checks a timer. Coincidence windows emerge from the competition between accumulation and decay. A signal must arrive while a trace is still elevated. The window opens when the trace crosses a threshold and closes when it decays below it. Timing is a consequence of dynamics, not an explicit rule.
---
## III. Principles of Capacity and Occupancy
**NIGHT builds containers; DAY fills them.** Structural variables are capacities — ceilings on what behavior can achieve. NIGHT changes the ceiling. DAY operates within it. The two never do each other's job: NIGHT never places a receptor, DAY never builds a slot.
**Short-term change is occupancy; long-term change is capacity.** Filling a container more or less is fast and reversible. Changing the size of the container is slow and persistent. The same physical quantity — receptor count, vesicle count — has a fast component (how full) and a slow component (how big), and these are governed by entirely different processes.
**Structure is simultaneously memory and prior.** The architecture left by the last NIGHT is both a record of past significant experience and a bias on how the next DAY will respond. A potentiated synapse is more likely to respond strongly and therefore more likely to be potentiated again. Structure encodes what mattered and predicts what will matter.
---
## IV. Principles of Locality and Non-Locality
**Short-term change is local; long-term change is non-local.** A component can transiently potentiate from its own activity alone. But to permanently change, it requires validation from beyond itself — from other compartments, from the soma, from the organism. Cheap reversible change is autonomous; expensive permanent change requires external authorization.
**Permanent change requires coincidence across spatial scales.** A tag forms only when a local eligibility signal meets one or more non-local confirmation signals. The number of required coincidences reflects where the component sits in the hierarchy — the postsynapse, as the primary memory locus, requires the most. Each scale confirms something the previous scale cannot know about itself.
**The whole validates the part; the part cannot validate itself.** A synapse cannot know whether its activity was behaviorally significant — that information exists only at the organism level. The neuromodulatory broadcast carries organism-level significance down to the synapse. This is why the system is open: the highest validation comes from outside any component that is being modified.
---
## V. Principles of Selection and Asymmetry
**Potentiation is the active drive; depotentiation is its shadow.** The entire machinery is oriented toward strengthening what is significant. There is no symmetric machinery for weakening. Weakening happens to whatever potentiation did not select, as a consequence of the resources potentiation consumed. The system is built to learn, and forgetting is the cost of learning.
**Depression is never explicit — it is what happens when potentiation does not.** No signal says "weaken this." Structures decay continuously and are held up only by maintenance resources. When potentiation consumes those resources, unmaintained structures drift down. Depression is the absence of maintenance, not the presence of a depression signal.
**Selection requires winning on multiple independent criteria.** To be permanently strengthened, a synapse must be both active enough to be fueled and significant enough to be validated. These are independent gates. Activity without significance is not saved; significance without sustainable activity cannot be maintained. The conjunction is what filters for genuinely valuable connections.
**The system finds equilibrium through the residual of its own imperfection.** Where alignment or balance is achieved, the very success removes the signal that drove it, allowing slow drift back toward imbalance, which regenerates the driving signal. The system hovers near optimum, continuously corrected by the small errors its own imperfect state produces. Equilibrium is dynamic, maintained by residual error, never static.
---
## VI. Principles of Bottom-Up Emergence
**Complex temporal behavior emerges from local reactive traces, not from explicit computation.** The soma aligns with its input rhythm without representing the rhythm. It simply leaves a trace when an input arrives during refractoriness and lets that trace speed future recovery. Prediction, anticipation, and rhythm-tracking emerge from purely local, reactive deposits — never from a model of the future.
**The system never represents what it is becoming tuned to.** A potentiated synapse does not contain a representation of the pattern it responds to — it is physically biased toward that pattern. The tuning is the structure, not a description of the structure. Prediction is implicit physical bias, not explicit expectation.
**Global organization arises from local competition.** Sparsification, normalization, and winner-take-more dynamics are nowhere computed centrally. They emerge automatically from many local units drawing from shared pools. The astrocyte does not decide which synapses to fuel — the synapses' own demands, competing for capped production, produce the allocation.
---
## VII. Principles of Coupling and Self-Reinforcement
**Couplings create trajectories, not just states.** Some variables, once moved in a direction, make further movement in that direction easier — the astrosynapse wrapping tighter after potentiation, which makes future potentiation easier. These self-reinforcing couplings mean the system has momentum: it does not just occupy states, it follows trajectories, deepening whatever direction it has begun.
**The same signal can serve opposite functions through different receptors.** Glutamate spillover brakes the presynapse while exciting the astrocyte — one ligand, two receptor types, opposite cascades, simultaneous opposite effects. Function is determined by the receiver, not the signal. This lets one event coordinate multiple responses without any coordinating mechanism.
**Energy availability is itself a selective pressure, parallel to validation.** Beyond the explicit activity-and-reward gating, the simple availability of energy continuously selects which synapses can participate. A synapse that cannot be fueled cannot generate the activity that would let it be tagged. Metabolism silently shapes what can be learned, in parallel with and independent of the explicit plasticity machinery.
---
## VIII. Principles of Openness and Boundedness
**The system is finite and open, not infinite and closed.** It has bounded components and a bounded state space, and it receives inputs it cannot generate from within — sensory drive, neuromodulatory validation, metabolic supply. Because it is finite, its self-modification does not generate infinite regress. Because it is open, its highest validation comes from outside itself.
**The fixed points are made explicit, not hidden.** The parameters the system cannot modify from within — thresholds, the vascular ceiling, the neuromodulatory signals — are declared as fixed. These are the system's boundary with what it did not set and cannot inspect. Making them explicit is the honest acknowledgment that every self-modifying system operates within constraints it did not choose.
**Validation comes from embedding, not from internal consistency.** The system does not certify its own changes as correct. Whether a structural change was good is answered by the organism's subsequent experience in the world, fed back through the neuromodulatory system. Correctness is determined by the coupling between system and environment, not by any internal criterion. This is what it means for the fixed point to lie outside the system: the system acts, the world responds, and the response — not any internal check — determines what was worth keeping.
---
---
---
# Complete set of general guidelines (old)
## DAY — Behavior
**Behavior is determined by structure modulated by NIGHT.**
Every DAY behavior operates within the ceiling set by the previous NIGHT's structural commit. The neuron does not decide how sensitive its spines are, how large its active zones are, or how tightly its astrosynapse wraps the cleft — it simply operates within whatever architecture NIGHT left behind. Structure is the memory of past validated experience, and it silently shapes every moment of current processing.
**Behavior has an energy cost.**
Every behavior draws from the local budget. No behavior is free. The budget has a hard ceiling set by the vascular glucose supply through the astrocyte, and by the soma's own mitochondrial capacity. When the budget is exhausted, behavior is suppressed regardless of the input — the bouton goes silent, the spine cannot reset, the branch cannot propagate the bAP. Energy scarcity is not a failure mode — it is a regulatory mechanism that prevents runaway activity from destabilizing the system.
**Behavior has a material cost.**
Fast behaviors consume biological materials — D-serine precursors, vesicle membrane proteins, actin monomers for transient spine changes. These are distinct from energy: a behavior can be energetically affordable but materially limited. D-serine release depletes the astrocyte's serine pool. Sustained vesicle release depletes the readily-releasable pool faster than it can be refilled. Material costs impose a second independent constraint on behavior that energy alone does not capture.
**Behavior leaves traces.**
Every behavior deposits a graded, decaying record of its occurrence in the local fast trace variable. The trace is not a passive record — it actively biases the next behavior in the same context. Residual calcium in the bouton makes the next release more probable. Calcium in the spine encodes the instruction for future structural change. The trace is the system's short-term memory of what just happened, and it decays automatically so that only sustained or repeated behaviors accumulate enough trace to reach the tagging threshold.
**Behavior happens in a specialized fashion determined by structure modulated by NIGHT.**
The form of the behavior — not just its ceiling but its quality — is shaped by structure. A bouton with high pre_structure has tightly clustered calcium channels beneath its docking slots, making each AP more reliably coupled to vesicle fusion. A spine with high post_structure has more anchoring slots, making each glutamate pulse more faithfully converted into AMPA current. The astrosynapse with high astro_structure delivers D-serine tonically, keeping the NMDA gate chronically primed. Structure does not just set the maximum — it shapes the transfer function between input and output at every moment.
**Behavior happens in a time window determined by accumulation and elimination of traces.**
The eligibility window for tagging is not externally imposed — it emerges from the decay dynamics of the fast trace. A bouton is taggable only while its residual calcium is still elevated. A spine is in its Hebbian anticipation window only while its NMDA calcium is still above the tagging threshold. The window opens when the fast trace crosses the eligibility threshold and closes when it decays below it. Dopamine or the bAP must arrive within this window or find nothing to validate. Timing is enforced by chemistry, not by a clock.
**Behavior happens in a context determined by local and global circumstances.**
Local context is the current state of the compartment itself — whether an AP just arrived, whether the membrane is depolarized, whether the RRP has content. Global context is the state of the organism — whether dopamine is elevated, whether norepinephrine is driving arousal, whether acetylcholine is signaling attention. Neither alone determines behavior. The local context determines what the compartment can do. The global context determines whether what it does gets validated. Both must align for a behavior to leave a lasting trace.
---
## NIGHT — Structural Rewriting
**Based on traces from DAY there is competition to restructure.**
The NIGHT scope is not passive recovery — it is an active competition for finite structural resources. Tags accumulated during DAY represent the claims that different synapses are making on the shared material and energy pools. Tagged synapses draw first, in proportion to their tag magnitude. The strongest tags — those that accumulated the most coincident local activity and global validation — draw the most resources and achieve the largest structural expansion. Weaker tags draw proportionally less. The competition is not adjudicated by any central mechanism — it emerges automatically from the shared pool dynamics.
**What is not potentiated decays for lack of resources.**
After potentiation has drawn its share, what remains is distributed as maintenance to all synapses. Structural maintenance requires a continuous material and energy allocation just to resist the baseline decay of molecular components. When the maintenance allocation falls below the decay rate — because potentiation has consumed too much — untagged synapses drift toward lower structural states. They are not told to weaken. They simply do not receive enough to stay where they are. Depotentiation is the shadow of potentiation, enforced by conservation of resources rather than by an active depression signal.
---
## Additional General Points
**The system has one primary drive and one emergent consequence.**
The entire machinery — fast traces, possible tagging, tag stabilization, NIGHT commits — is oriented toward potentiation. There is no symmetric machinery oriented toward depression. Depression is what happens to everything that the potentiation machinery did not select. This asymmetry is not accidental — it reflects the organism's fundamental orientation toward learning from significant experience, with forgetting as the natural cost of that selectivity.
**Validation requires signals from progressively larger spatial scales.**
A behavior at the synapse leaves a local fast trace. The fast trace creates local eligibility. Eligibility alone is not sufficient — the bAP from the soma must confirm coincidence at the spine level. The soma's own firing must coincide with nuclear calcium for the gene expression mandate. And the organism's dopamine broadcast must coincide with local eligibility at every level for the tag to stabilize. Each spatial scale adds a confirmation that the previous scale cannot provide for itself. The synapse cannot know whether the soma fired. The soma cannot know whether the organism's outcome was rewarding. Both are required. Neither is redundant.
**The system integrates across time through a hierarchy of decay timescales.**
The fast trace decays in milliseconds to seconds. Possible tagging decays in seconds to minutes. The tag decays in hours. The structural variable decays over days to weeks unless maintained. Each timescale feeds the next: a single spike leaves a trace that can accumulate into possible tagging if spikes keep arriving, which can accumulate into a stable tag if dopamine validates the pattern, which can accumulate into structural change if NIGHT commits are fulfilled. The system does not decide at any single moment what to remember — it integrates continuously across all timescales simultaneously.
**The system is conservative — resources are redistributed, not created.**
Every structural gain at one synapse is paid for by material and energy drawn from pools that all synapses share. LTD at one synapse returns material to those pools, partially funding LTP at another. The total structural capacity of the system is bounded above by the vascular glucose supply and the soma's protein synthesis ceiling. No activity can increase those ceilings — only sleep-driven CREB expression and vascular adaptation can. Within those ceilings, the system continuously redistributes its fixed resources toward whatever the organism has most recently found significant.
**Structure is both the memory and the prior.**
The structural variables written in each NIGHT become the starting conditions for the next DAY. A potentiated synapse enters the next DAY with a larger active zone, more receptors, tighter astrosynaptic wrapping — making it more likely to respond strongly to the same pattern and more likely to reach the tagging threshold again. A depotentiated synapse enters the next DAY with reduced capacity, making it less likely to respond and less likely to be tagged. Structure is not just a record of past experience — it is a prediction about what patterns are likely to matter in the future, continuously updated by what the organism actually encounters. This is the system's implementation of a prior: a bias toward re-experiencing what has proven significant, encoded in the physical architecture of the synapse itself.
**The astrosynapse is the gain control of the entire system.**
Unlike pre and post, whose structural variables set a ceiling on occupancy, astro_structure reshapes the input itself — controlling how much glutamate reaches effective concentration and whether the NMDA gate is chronically open or chronically closed. This makes the astrosynapse the only component whose structural change directly modifies the operating point of the other two components rather than just their range. And because its structural variable is self-reinforcing in both directions, it amplifies whatever trajectory the synapse is already on — making potentiated synapses progressively easier to potentiate and depressed synapses progressively harder to rescue. The astrosynapse is not just a third component of the synapse — it is the component that determines whether the synapse as a whole is in a learning-permissive or learning-resistant state.
**The organism's rest period is the execution window for structural memory.**
The DAY scope fills the system with evidence — traces, tags, eligibility records — but commits nothing permanently. The NIGHT scope executes on that evidence — writing structure, replenishing budgets, clearing traces. A day without sleep would leave the tags decaying without being committed and the structural decay proceeding without being compensated. The system is architecturally dependent on the alternation between DAY and NIGHT: neither scope alone can accomplish what both together achieve. DAY without NIGHT produces learning that cannot consolidate. NIGHT without DAY produces structural replenishment without new content to consolidate.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,867 @@
# Commenti
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
- structure (strength) ← validated coincidence ; budget_ceiling (endurance) ← interrupted success
---
## Two NIGHT-built capacities, two different drives
```
STRENGTH = structure ceiling
driven by: coincidence (2 or 3, per component) + dopamine validation
answers: "did a valuable coincidence COMPLETE and get validated?"
builds: bigger containers (more slots) → stronger per-event behavior
ENDURANCE = budget ceiling
driven by: depletion that INTERRUPTED a successful trajectory
answers: "did fuel run out exactly when a valuable outcome was forming?"
builds: bigger fuel capacity → longer-sustainable behavior
NO dopamine required — this is metabolic/homeostatic, not associative
Diagnostic combinations:
high structure tag, low endurance need → significant + sustainable → strengthen
low structure tag, high endurance need → fuel-limited at verge → fund endurance
high both → significant + fuel-limited → strengthen + fund
low both → idle, or failing for non-fuel reasons → let decay
```
---
## Part 1 — Conventions (additions to v8)
```
NEW VARIABLE TYPES:
ENDURANCE_TRACE = deposited when budget depletion interrupts a SUCCESSFUL trajectory
decays over minutes
NO dopamine gate (metabolic, not associative)
gates NIGHT budget_ceiling adaptation
BUDGET_CEILING = slow capacity on the fast budget
READ in DAY (clamps how high budget can be / how long behavior sustains)
WRITTEN in NIGHT (raised by endurance need, decays when unused)
KEY DISTINCTION:
budget = fast occupancy (current fuel level) — consumed/refilled in DAY
budget_ceiling = slow capacity (max fuel / endurance) — adapted in NIGHT
(exactly parallel to: occupancy filled in DAY vs structure ceiling built in NIGHT)
```
---
## Part 2 — New Trace and Capacity Variables (per component)
```
// Endurance traces — deposited only on INTERRUPTED SUCCESS
ENDURANCE_TRACE pre_endurance_need
ENDURANCE_TRACE post_endurance_need
ENDURANCE_TRACE dend_endurance_need
ENDURANCE_TRACE soma_endurance_need
ENDURANCE_TRACE axon_endurance_need
ENDURANCE_TRACE astro_endurance_need
// Budget ceilings — slow endurance capacity, WRITTEN in NIGHT
BUDGET_CEILING pre_budget_ceiling
BUDGET_CEILING post_budget_ceiling
BUDGET_CEILING dend_budget_ceiling
BUDGET_CEILING soma_budget_ceiling
BUDGET_CEILING axon_budget_ceiling
BUDGET_CEILING astro_budget_ceiling
// Each DAY budget is now clamped by its ceiling:
// {c}_budget = clamp({c}_budget, 0, {c}_budget_ceiling)
// New fixed params
FIXED endurance_threshold // min endurance_need to trigger ceiling growth
FIXED capacity_decay_rate // budget_ceiling decay when unused
FIXED trajectory_threshold // min "success trajectory" to count an interruption as costly
```
---
## Part 3 — How Each Component Detects "Interrupted Success"
```
// The endurance signal requires TWO things at the moment of depletion:
// 1. budget gated a behavior (depletion occurred)
// 2. that behavior was on a SUCCESSFUL TRAJECTORY (local definition per component)
// Only their conjunction deposits endurance_need.
PRE success trajectory = postsynaptic engagement was RISING
(release was building a coincidence)
POST success trajectory = post_fast_trace was APPROACHING Ca_TAG_threshold
(calcium was building toward a tag)
DEND success trajectory = active spines existed DISTAL to the propagation failure point
(bAP was needed downstream and got cut off)
SOMA success trajectory = nuclear Ca was APPROACHING CREB threshold, or
firing was successfully recruiting downstream
AXON success trajectory = propagation failed to ENGAGED boutons (driving active synapses)
ASTRO success trajectory = postsynapse was DEPOLARIZED and WAITING for D-serine
(gate needed exactly when synthesis ran out)
```
---
---
# SCOPE: DAY
Additions shown per component. Existing v8 behavior assumed unless noted.
Budget is now clamped by budget_ceiling. Endurance need deposited on interrupted success.
---
## PRE | CONTEXT: AP (additions)
```
scope DAY | context AP:
// Budget now clamped by its ceiling
pre_budget = clamp(pre_budget, 0, pre_budget_ceiling)
// Depletion gate — now also tests success trajectory
if pre_budget < AP_release_cost:
suppress(NT_flux)
// INTERRUPTED SUCCESS? was release building a coincidence downstream?
if postsynaptic_engagement_rising: // e.g. post_fast_trace was climbing
pre_endurance_need += postsynaptic_engagement // graded by how close to success
// fuel was the binding constraint on a forming coincidence
// else: depletion during ineffective firing → NO endurance need (let it fail)
exit context
// ... rest of v8 PRE AP behavior unchanged ...
pre_fast_trace += spike_Ca_influx(input_freq); pre_fast_trace *= decay(τ=100ms)
Ca_drive = pre_fast_trace / (K_Ca_release + pre_fast_trace)
if RRP_level > 0:
NT_flux = RRP_level × Ca_drive
glutamate += NT_flux × Δt; RRP_level -= NT_flux × Δt
pre_budget -= NT_flux × fusion_cost
// ... refill, brake ...
```
## PRE | CONTEXT: NOT_AP (additions)
```
scope DAY | context NOT_AP:
// endurance trace decays like other intermediate traces
pre_endurance_need *= decay(τ=minutes)
// ... rest of v8 PRE NOT_AP unchanged: budget replenish, refill, tagging ...
pre_budget += astro_lactate[syn] × pre_fraction + axon_shipment_to_pre
pre_budget = clamp(pre_budget, 0, pre_budget_ceiling)
// ... possible_tagging, tag ...
```
---
## POST | CONTEXT: NOT_bAP (additions)
```
scope DAY | context NOT_bAP:
post_budget = clamp(post_budget, 0, post_budget_ceiling)
// Depletion during receptor trafficking or membrane reset
if post_budget < required_cost:
// INTERRUPTED SUCCESS? was calcium climbing toward a tag?
if post_fast_trace > trajectory_threshold and post_fast_trace_rising:
post_endurance_need += post_fast_trace // collapse of a building tag-trajectory
// fuel (trafficking/reset) was the limit on completing a coincidence
// truncate the behavior
// else: depletion during low-calcium activity → no endurance need
post_endurance_need *= decay(τ=minutes)
// ... rest of v8 POST NOT_bAP: AMPA, NMDA, STP slot-fill, tagging ...
```
---
## DEND | CONTEXT: bAP (additions)
```
scope DAY | context bAP:
dend_budget = clamp(dend_budget, 0, dend_budget_ceiling)
// bAP propagation may fail partway if budget insufficient
bAP_local, propagation_reached = propagate_bAP(SOMA.AP_fired, dend_structure, dend_budget)
dend_budget -= bAP_propagation_cost × propagation_reached
// INTERRUPTED SUCCESS? were there active spines BEYOND where propagation died?
if propagation_failed_early and active_spines_distal_to(propagation_reached) > 0:
dend_endurance_need += active_spines_distal_to(propagation_reached)
// distal active spines were cut off from the retrograde signal by lack of fuel
// else: propagation failure with no distal active spines → no endurance need
// ... rest of v8 DEND bAP: branch Ca trace, integration ...
```
## DEND | CONTEXT: NOT_bAP (additions)
```
scope DAY | context NOT_bAP:
dend_endurance_need *= decay(τ=minutes)
// ... v8 replenish, ship to post, tagging, local translation ...
```
---
## SOMA | CONTEXT: AP (additions)
```
scope DAY | context AP:
soma_budget = clamp(soma_budget, 0, soma_budget_ceiling)
// If budget can't sustain firing during a recruiting train
if soma_budget < AP_generation_cost:
// INTERRUPTED SUCCESS? was nuclear Ca climbing toward CREB,
// or was firing recruiting downstream activity?
if soma_fast_trace > trajectory_threshold and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
// fuel cut a firing pattern that was achieving integration/CREB approach
// suppress firing this step
else:
// ... normal v8 SOMA AP: fire, deposit 3 traces, tagging ...
soma_endurance_need *= decay(τ=minutes)
```
---
## AXON | CONTEXT: AP (additions)
```
scope DAY | context AP:
axon_budget = clamp(axon_budget, 0, axon_budget_ceiling)
propagation_reliability = axon_structure.propagation × (1 - failure_rate(axon_fast_trace))
// budget can further reduce reliability if depleted
if axon_budget < AP_propagation_cost:
propagation_reliability *= budget_limited_factor
// INTERRUPTED SUCCESS? did failure hit ENGAGED boutons (driving active synapses)?
if failed_boutons_engaged > 0:
axon_endurance_need += failed_boutons_engaged
// fuel cut propagation to terminals that were successfully driving synapses
// else: failure to idle boutons → no endurance need
axon_endurance_need *= decay(τ=minutes)
// ... rest of v8 AXON AP ...
```
---
## ASTRO | CONTEXT: CONTINUOUS (additions)
```
scope DAY | context CONTINUOUS:
astro_central_budget = clamp(astro_central_budget, 0, astro_budget_ceiling)
// D-serine release is budget-limited (v8). Now detect interrupted success:
if glutamate[i] > spillover_threshold:
Ds_drive = astro_fast_trace[i] / (K_Ca_Dserine + astro_fast_trace[i])
Ds_wanted = Ds_drive × Ds_max
Ds_supplied = min(Ds_wanted, astro_central_budget × Ds_fraction)
if Ds_supplied < Ds_wanted:
// INTERRUPTED SUCCESS? was postsynapse DEPOLARIZED and waiting for the gate?
if post_depolarized[i] and post_fast_trace[i] approaching Ca_TAG_threshold:
astro_endurance_need[i] += (Ds_wanted - Ds_supplied)
// ran out of synthesis capacity exactly when the gate was needed
// else: insufficient D-serine but no waiting coincidence → no endurance need
astro_D_serine[i] += Ds_supplied
// ... rest of v8 astro overflow handling, tagging ...
astro_endurance_need[i] *= decay(τ=minutes)
```
---
---
# SCOPE: NIGHT
v8 steps unchanged EXCEPT: add Step 2b (budget capacity adaptation).
Budget capacity competes for the SAME material + energy as structure.
---
## Step 1 — Replenish & Distribute (unchanged from v8)
```
// energy economy: astrocyte → astrosynapses
// material economy: soma → branches/axon → spines/boutons
// next-DAY budgets pre-loaded
```
## Step 2 — Structural Commits (strength) (unchanged from v8)
```
// each commit raises a STRUCTURE ceiling, gated by tag + material + energy
// driven by COMPLETED VALIDATED COINCIDENCE
```
## Step 2b — Budget Capacity Adaptation (endurance) ★ NEW
```
scope NIGHT | step 2b:
// Driven by endurance_need (interrupted success), NOT by tags, NOT by dopamine.
// Competes for the SAME material + energy pools as structural commits (step 2).
// → endurance and strength trade off under scarcity.
for each component c:
if c_endurance_need > endurance_threshold:
// fuel was the binding constraint on a valuable outcome → build endurance
Δcap = min(capacity_expansion_cost,
c_material × cap_material_fraction, // mitochondria need proteins
c_energy × cap_energy_fraction) // biogenesis needs ATP
c_budget_ceiling += Δcap
c_material -= Δcap
c_energy -= Δcap × biogenesis_cost
if Δcap < capacity_expansion_cost:
queue(c_endurance_deficit → next NIGHT)
// biological basis: activity-driven mitochondrial biogenesis,
// local fuel-storage expansion
else:
// endurance exceeded demand (or failures weren't costly) → let ceiling decay
c_budget_ceiling -= capacity_decay_rate × Δt_night
c_material += released_mitochondria(c) × recycling_fraction
// biological basis: mitophagy — unused metabolic capacity removed,
// proteins returned to pool for components that need them
// NOTE on competition with strength (step 2):
// material/energy spent here cannot fund structural growth there.
// a component that is significant (high tag) AND fuel-limited (high endurance_need)
// demands both → highest total resource draw → strongest competitor for the pool
// → may force heterosynaptic depression / depotentiation elsewhere
```
## Step 3 — Passive Depotentiation (extended)
```
scope NIGHT | step 3:
// structures decay unless maintained (v8) ...
// ALSO: budget_ceilings decay if not reinforced by endurance_need (handled in 2b else-branch)
// maintenance now must cover BOTH structure and budget_ceiling:
// a component maintains its endurance only while it keeps earning endurance_need
// unused endurance capacity is the first thing sacrificed under scarcity
// (mitochondria are expensive to keep — mitophagy removes idle ones)
```
## Step 4 — Homeostatic Scaling (unchanged from v8)
## Step 5 — Clear Traces (extended)
```
scope NIGHT | step 5:
// v8 clears: fast_traces, possible_tagging, soma timing traces, tags
// ALSO clear endurance traces (they have served their purpose this cycle):
all endurance_need = 0
// budget_ceilings PERSIST (they are slow capacity, like structure)
```
---
## Summary — Two Capacities, Two Drives, One Resource Pool
```
STRENGTH (structure) ENDURANCE (budget_ceiling)
DAY signal coincidence completed + depletion INTERRUPTED a
validated (tag set) successful trajectory (endurance_need)
gate dopamine required NO dopamine (homeostatic)
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)
→ dend_budget top-up (organelle delivery)
→ axon_budget top-up (transport machinery)
```
## Material flow
```
SOMA
protein synthesis (CREB-driven, peaks in NIGHT)
→ soma_material (receptors, scaffold proteins, organelles, mRNA)
→ dend_material (branch receives proteins + mRNA from soma)
→ post_material (spine receives receptors + actin from branch)
→ axon_material (boutons receive AZ proteins + VGCCs from soma via axon)
→ pre_material (bouton active zone proteins)
ASTROSYNAPSE
ECM proteins synthesized in astrocyte cell body
→ astro_material (Glypicans, Thrombospondins, serine for D-serine)
→ cleft environment (ECM sealing, D-serine availability)
```
Yes, exactly. This is the essential abstract pattern. Let me state it precisely.
Here is the revised abstract pattern, integrating the endurance/budget dimension throughout.
---
Here is the updated abstract pattern, with both ceilings now correctly bounding competitive DAY processes.
---
# The Abstract Pattern
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.
---
## DAY — The General Form
Every DAY behavior runs within two ceilings and competes for two shared resources.
```
given: STRUCTURE // bounds behavior strength (ceiling from NIGHT)
BUDGET_CEILING // bounds fuel capacity (ceiling from NIGHT)
in: CONTEXT // local or global triggering condition
if: BUDGET >= cost // operational fuel available
then: behavior executes, strength bounded by STRUCTURE
BUDGET -= cost
FAST_TRACE += f(behavior) // local record deposited
else: behavior suppressed // fuel was the limit
if behavior was ON A SUCCESSFUL TRAJECTORY:
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 + ε))
replenishment = c_demand × allocation_factor // rationed share
BUDGET += replenishment // never exceeds ceiling (demand was the gap)
S -= replenishment
```
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.
**Within the same context** — the fast trace biases the next execution of the same behavior. Short-term modulation. Local, no external signal.
**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.
---
### Tag Formation — Non-Local Coincidence (drives STRENGTH)
Strength is associative. The tag requires local eligibility plus non-local validation, the number of coincidences set by the component's spatial scale.
**PRE, DEND, SOMA, AXON, ASTRO — one non-local coincidence:**
```
if FAST_TRACE > eligibility and dopamine > threshold:
TAG += dopamine × possible_tagging
```
**POST — three coincidences (astrosynapse, soma, organism):**
```
// 1. NOT_bAP: local Ca²⁺ + astrosynapse D-serine → CANDIDATE
if FAST_TRACE > Ca_TAG_threshold and D-serine > threshold:
post_possible_tagging += FAST_TRACE
// 2. bAP: CANDIDATE + soma fired → amplified above Ca_HIGH
if post_possible_tagging > threshold and bAP arrives:
FAST_TRACE += bAP_boost
// 3. any context: CANDIDATE + dopamine → STABLE
if post_possible_tagging > threshold and dopamine > threshold:
TAG += dopamine × post_possible_tagging
```
---
### Endurance Formation — Interrupted Success (drives ENDURANCE)
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.**
```
if BUDGET < cost and trajectory_was_succeeding:
ENDURANCE_NEED += g(trajectory) // graded by closeness to success
```
Per-component definition of *succeeding*:
- **PRE** — release was driving rising postsynaptic engagement
- **POST** — calcium was climbing toward the tagging threshold
- **DEND** — active spines existed distal to where propagation died
- **SOMA** — nuclear calcium was approaching CREB, or firing was recruiting downstream
- **AXON** — propagation failed to engaged boutons, not idle ones
- **ASTRO** — the postsynapse was depolarized and waiting for D-serine when synthesis ran out
The signal shape is identical everywhere — fuel ran out at the verge of a valuable outcome — only the local definition of "verge" varies.
---
### Trace Recession — The Temporal Behavior
In every NOT/CONTINUOUS context, all traces decay:
```
FAST_TRACE *= decay(τ_fast) // mss — closes eligibility window
possible_tagging *= decay(τ_mid) // smin — closes tagging window
ENDURANCE_NEED *= decay(τ_mid) // smin — closes endurance window
TAG *= decay(τ_slow) // hours — closes commitment window
```
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.
---
## NIGHT — The General Form
NIGHT raises two ceilings from two kinds of evidence, both drawing on the same finite material and energy.
**Strength commit — driven by tag (validated coincidence):**
```
if TAG > threshold:
Δstructure = min(expansion_cost, MATERIAL, ENERGY × fraction)
STRUCTURE += Δstructure × coherence_bonus // raises the strength ceiling
MATERIAL -= Δstructure // RECOVERABLE
ENERGY -= Δstructure × ATP_cost // NOT recoverable
```
Coherence bonus when pre, post, and astro tags are all set together — the three synaptic components independently gathered evidence for the same change.
**Endurance commit — driven by endurance need (interrupted success):**
```
if ENDURANCE_NEED > threshold:
Δcap = min(capacity_cost, MATERIAL, ENERGY × fraction)
BUDGET_CEILING += Δcap // raises the endurance ceiling
MATERIAL -= Δcap // RECOVERABLE (mitochondria recyclable)
ENERGY -= Δcap × biogenesis_cost // NOT recoverable
// no coherence bonus, no dopamine — endurance is per-component homeostatic
```
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.
**What is not committed decays — by neglect, for both ceilings:**
```
STRUCTURE -= decay_rate × Δt_night
STRUCTURE += min(structure_maintenance, maintenance_cost)
BUDGET_CEILING -= capacity_decay_rate × Δt_night
BUDGET_CEILING += min(capacity_maintenance, capacity_cost)
// if maintenance < decay: the ceiling drifts down
// structure → depotentiation by neglect
// budget_ceiling → loss of endurance (mitophagy of idle capacity)
// recovered material partially funds the commits above
```
---
## The Pattern in One View
```
TWO CEILINGS, each bounding a competitive DAY process and raised by NIGHT evidence:
STRUCTURE (strength) bounds behavior strength;
filled in DAY by competing for occupancy;
raised in NIGHT by TAG (validated coincidence)
BUDGET_CEILING (endurance) bounds fuel capacity;
filled in DAY by competing for shared supply;
raised in NIGHT by ENDURANCE_NEED (interrupted success)
DAY behavior runs within both ceilings, both filled competitively
consumes budget, deposits fast trace
fast trace + non-local coincidence → TAG (evidence for strength)
depletion + interrupted success → ENDURANCE_NEED (evidence for endurance)
traces decay in NOT/CONTINUOUS contexts — windows close
NIGHT TAG → raise STRUCTURE (per-event power)
ENDURANCE_NEED → raise BUDGET_CEILING (sustainable duration)
both draw the SAME material + energy → strength and endurance compete
unmaintained ceilings of either kind decay → freed material funds the rest
A high ceiling of either kind is never free: structure must be filled by winning
occupancy, budget capacity must be filled by winning shared fuel — both against
competing components, every DAY. The system invests STRENGTH where a valuable
coincidence completed and was validated, and ENDURANCE where fuel — not structure,
not significance — was what stood between activity and success. To be both effective
and sustainable, a connection must win on both, at both timescales, against all
others drawing from the same finite pools.
```
# More details
## SOMA
### The Abstract Pattern Applied to Soma Timing
The abstract pattern says: a behavior deposits a trace, the trace decays, and the trace biases the next behavior. For the soma, the AP is the behavior, and **the refractory period and threshold elevation should both be consequences of a single trace deposited by the AP, decaying back toward baseline**. Neither should be a hardcoded duration — both should emerge from the return of the trace to resting conditions.
---
Yes, this is much more consistent with the rest of the architecture. The soma should not compute an explicit rhythm estimate and predict the next input — that is top-down. Instead, the **mismatch itself leaves a trace**, and that trace adjusts the refractory dynamics. Let me think through this carefully.
---
### The Bottom-Up Mechanism
The key event is: **a dendritic input arrives strong enough to fire the soma, but the soma is still refractory.** This is a missed opportunity — the input wanted to fire the cell, but the cell was not ready. This mismatch is the signal.
Each time this happens, it should leave a trace that biases the refractory dynamics toward recovering faster in that timing window — so that next time an input arrives at that phase, the soma is ready. This is potentiation of the refractory recovery, occurring within DAY, driven entirely by the local coincidence of "input wanted to fire" and "soma was not ready."
```
scope DAY | context NOT_AP (within refractory):
// Detect the mismatch: suprathreshold input during refractory
if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold:
// Input arrived but soma could not fire — missed coincidence
refractory_alignment_trace += (branch_Vm - effective_threshold)
× soma_Na_inactivation
// graded: stronger input + deeper refractory → larger trace
// this is the "potentiation" signal for faster recovery
```
The `refractory_alignment_trace` then biases the recovery rate of the inactivation trace:
```
// Recovery rate biased by accumulated alignment trace
recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace)
soma_Na_inactivation *= decay(τ_Na / recovery_rate)
// more alignment trace → faster recovery → soma ready sooner next time
```
---
### Why This Is Bottom-Up
There is no rhythm estimation, no prediction of the next input time, no computed inter-input interval. The soma does not model its input. It simply notices, locally and reactively, that an input arrived when it was not ready, and leaves a trace that makes it recover faster. Over many such mismatches at the same phase, the recovery speeds up at that phase specifically — and the soma ends up aligned with its input rhythm **without ever representing that rhythm**.
The alignment is an emergent statistical consequence of many local mismatch events, exactly as a potentiated synapse becomes tuned to its input without representing what it is tuned to. The phase-coupling appears, but nothing in the soma computed it.
---
### Depotentiation as Neglect — Not Explicit
Now the crucial part you raised: the depotentiation of refractory alignment must occur as a **consequence of not potentiating**, not as an explicit opposing mechanism.
The `refractory_alignment_trace` decays continuously. If mismatches keep happening at a particular phase, the trace is continuously replenished and the fast recovery is maintained. If mismatches stop happening — because the input rhythm changed, or because the alignment succeeded and inputs now arrive when the soma is ready — then the trace is no longer replenished and **decays back toward baseline on its own**.
```
// No explicit depotentiation — just decay when not reinforced
refractory_alignment_trace *= decay(τ_alignment)
// if mismatches continue → trace replenished → fast recovery maintained
// if mismatches stop → trace decays → recovery returns to baseline
```
This is exactly parallel to synaptic depotentiation by neglect. The soma does not actively slow its recovery when alignment is no longer needed. It simply stops receiving the mismatch signal that was keeping the recovery fast, and the recovery drifts back to baseline because the trace that accelerated it is no longer reinforced.
There is an elegant self-limiting property here. Once the soma is well-aligned, inputs arrive when it is ready, so there are no more mismatches, so the alignment trace stops being replenished and begins to decay. This would slowly de-align the soma — until inputs start arriving during refractory again, regenerating the mismatch and re-potentiating the alignment. The system settles into a dynamic equilibrium where just enough mismatch occurs to maintain just enough alignment. The soma hovers at the edge of alignment, continuously corrected by the residual mismatches that its imperfect alignment produces.
---
### The Full Bottom-Up Soma Timing
```
scope DAY | context AP:
effective_threshold = soma_structure.baseline_threshold
× (1 + soma_adaptation)
× neuromod_factor(NE_level, ACh_level)
can_fire = (soma_Na_inactivation < inactivation_threshold)
if branch_Vm > effective_threshold and can_fire:
AP_fired = True
soma_budget -= AP_generation_cost
// Deposit traces from the AP
soma_Na_inactivation += AP_amplitude // fast — refractory
soma_adaptation += AP_contribution // slow — spike train threshold
soma_fast_trace += nuclear_Ca_influx() // slow — plasticity tagging
scope DAY | context NOT_AP:
// MISMATCH DETECTION — bottom-up alignment signal
if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold:
// input wanted to fire but soma was refractory — missed coincidence
refractory_alignment_trace += (branch_Vm - effective_threshold)
× soma_Na_inactivation
// local potentiation of recovery — no prediction, no rhythm model
// Recovery biased by alignment trace
recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace)
soma_Na_inactivation *= decay(τ_Na / recovery_rate) // faster if aligned
soma_adaptation *= decay(τ_adaptation)
soma_fast_trace *= decay(τ_nuclear)
// Alignment trace decays — depotentiation by neglect, not explicit
refractory_alignment_trace *= decay(τ_alignment)
// maintained only while mismatches continue
// self-limiting: good alignment → fewer mismatches → trace decays →
// slight de-alignment → mismatches return → re-potentiation
// ... budget replenishment, shipments, tagging as before ...
```
---
### The Conceptual Payoff
This makes the soma's temporal alignment obey exactly the same principles as everything else in the system:
A behavior leaves a trace — here the missed coincidence leaves the alignment trace.
The trace biases future behavior — here it accelerates recovery so the next input at that phase succeeds.
Potentiation is the active drive — the soma actively speeds up recovery in response to mismatch.
Depotentiation is neglect — the alignment trace decays when mismatches stop, with no explicit opposing process.
The system finds equilibrium through the residual of its own imperfection — just enough mismatch persists to maintain just enough alignment.
And critically, the soma achieves temporal prediction — firing in phase with its input rhythm — **without ever representing the rhythm**. The prediction is implicit in the structure of the recovery dynamics, built up from purely local, reactive, bottom-up trace deposits. This is the same way a potentiated synapse "predicts" that its input will be significant without representing the prediction: the prediction is the physical bias left by past experience, not a computed expectation. The soma's phase-coupling is the temporal version of the synapse's weight — both are implicit predictions encoded as physical bias, both built bottom-up from local coincidence, both maintained by reinforcement and lost by neglect.
## Energy depletion in Presynapse
how does the budget and energy influence the model. If for example a presynapse has no more energy variuos times during day, what happens?
Good question. Let me trace through exactly what happens when energy is repeatedly depleted, following the mechanics already in the pseudocode.
---
### The Immediate Effect — Behavior Suppression
When `pre_budget < AP_release_cost`, the pseudocode does:
```
if pre_budget < AP_release_cost:
suppress(NT_flux)
exit context
```
So the immediate consequence of an energy-depleted bouton is **silence** — it does not release neurotransmitter for that AP, regardless of how strong the incoming spike was. The AP arrives, but nothing comes out the other side. This is biologically real: ATP-depleted boutons fail to release because the VATPase cannot refill vesicles and the calcium pumps cannot maintain the gradients that drive release.
---
### The Cascade of Consequences Within DAY
A single depletion is recoverable — the bouton refuels from astrocyte lactate in the next NOT_AP context and resumes. But **repeated depletion during DAY** sets off a cascade that runs through the entire trace and tagging machinery.
**No release means no glutamate means no downstream trace.** When the bouton is silent, no glutamate reaches the cleft. The postsynapse receives no AMPA current, its NMDA channels do not open, and `post_fast_trace` does not rise. The astrosynapse detects no spillover, so `astro_fast_trace` does not rise and no D-serine pulse is released. The entire synaptic event simply does not happen. A bouton that is energy-depleted at the moment a significant pattern arrives causes that pattern to be invisible to the postsynapse — the synapse fails to participate in whatever the network is doing.
**No participation means no eligibility.** Because the bouton did not release, `pre_fast_trace` is not elevated by a release event (it still rises from calcium influx, but without the reinforcing facilitation of successful release). More importantly, the postsynapse, having received no input, accumulates no `post_possible_tagging`. When dopamine arrives to validate the moment, there is nothing to validate at this synapse — the eligibility window is empty. The synapse misses the tagging opportunity entirely.
**Missing the tag means missing the NIGHT commit.** Since no tag was set during DAY, the synapse has nothing to draw structural resources with during NIGHT. It does not potentiate. And because the system's depotentiation is by neglect, **a synapse that fails to potentiate is automatically on the path to depotentiation** — it receives only maintenance allocation, and if other synapses potentiated and drew down the shared pool, even maintenance may be insufficient.
---
### The Deeper Consequence — Energy Depletion Becomes Structural Depression
Here is the important emergent property: **repeated energy depletion at a bouton during DAY leads to its structural depression during NIGHT, even though no depression signal was ever sent.**
The chain is entirely passive:
```
repeated pre_budget depletion in DAY
→ bouton silent during significant events
→ no glutamate release
→ no post_fast_trace, no post_possible_tagging
→ no tag set (pre or post)
→ no NIGHT structural commit at this synapse
→ only maintenance allocation received
→ if pool depleted by other synapses' potentiation:
maintenance insufficient
→ pre_structure and post_structure decay
→ DEPOTENTIATION
```
The energy-starved synapse is outcompeted not because it was marked for depression but because it could not generate the activity needed to claim resources. Energy availability during DAY therefore directly determines which synapses can even enter the competition for NIGHT potentiation.
---
### The Feedback Loop — Depression Reduces Future Energy Demand
There is a stabilizing feedback here. A depotentiated synapse has smaller `pre_structure` — a smaller active zone, fewer docking slots, lower release probability. This means it costs **less energy to operate**. So a synapse that was energy-starved and consequently depotentiated now has lower energy demands, making it less likely to be energy-starved in the future.
```
energy depletion → depotentiation → smaller structure → lower energy demand
→ less likely to deplete → stabilizes at a low-activity equilibrium
```
The synapse settles into a low-energy, low-structure, low-activity state. It is not dead — it still operates at baseline — but it has been demoted from the pool of synapses competing for potentiation. Energy scarcity has selected it out.
---
### Why This Is Functionally Important
This is not a bug — it is a resource-allocation mechanism with real computational value.
**Energy availability acts as a second gate on plasticity, parallel to the neuromodulatory gate.** Dopamine asks "was this worth saving?" Energy asks "can this synapse afford to participate?" A synapse must pass both gates to be potentiated. This means the system preferentially potentiates synapses that are both behaviorally significant AND metabolically sustainable. A synapse that cannot sustain its own activity is not a good candidate for strengthening, because strengthening it would only increase its energy demand and make it fail more often.
**Local energy competition implements a form of spatial sparsification.** Boutons on the same axon share `axon_budget` and ultimately the same astrocytic lactate supply. When many boutons are active simultaneously, the shared energy is divided among them, and the weakest — those with the least efficient structure or the least reliable input — deplete first and fall silent. This automatically sparsifies activity: under energy pressure, only the most robust synapses keep firing, and they are the ones that get potentiated. The system concentrates its limited resources on its strongest connections.
**The astrocyte's energy delivery becomes a control signal.** Because the astrocyte controls lactate distribution across its territory, it has indirect control over which synapses can sustain activity and therefore which can be potentiated. A region of the astrocyte territory that is well-perfused and well-fueled supports vigorous plasticity. A region that is metabolically stressed — perhaps because of high overall demand or reduced vascular supply — suppresses plasticity in its synapses regardless of their activity. This couples the metabolic state of the tissue directly to its capacity to learn.
---
### What Repeated Depletion Looks Like Over Days
If a bouton is chronically energy-starved across multiple DAY cycles — perhaps because it is in a metabolically compromised region, or because it is competing with many highly active neighbors — the trajectory is:
```
Day 1: depletes occasionally → misses some events → weak tag → partial commit
Day 2: smaller structure → still depletes under load → weaker tag → less commit
Day 3: structure decaying → maintenance insufficient → depotentiation accelerates
...
Equilibrium: minimal structure, minimal energy demand, minimal participation
synapse survives but is functionally silent
resources it would have consumed now available to neighbors
```
This is a reasonable model of what happens to synapses in metabolically stressed tissue — they do not die immediately, but they are progressively silenced and depotentiated, freeing their resources for synapses in healthier regions. It is also a model of how chronic metabolic limitation — aging, vascular disease, mitochondrial dysfunction — would manifest as a gradual loss of plasticity capacity: not through any depression signal, but through the simple inability of energy-starved synapses to participate in the activity that would let them claim resources.
The energy budget is therefore not just a constraint that occasionally blocks behavior — it is a continuous selective pressure that shapes which synapses thrive and which fade, operating silently in parallel with the explicit activity-and-reward-driven plasticity, and ultimately determining the metabolic sustainability of whatever the system chooses to remember.
## Three parallel competitive resource economies
The neuronal structural economy — soma produces material, distributed through dendrite to spines and through axon to boutons, competed for by tagged synapses during NIGHT.
The astrocytic energy economy — astrocyte cell body produces lactate, distributed to perisynaptic processes, competed for by active synapses during DAY in proportion to their clearance demand.
The soma's own energy economy — soma mitochondria fuel AP generation and shipping, competed for by the soma's own functions.
All three share the same logic: a central producer with a capped output, distribution to peripheral consumers, demand-weighted allocation, and a self-reinforcing coupling where stronger consumers both demand and receive more. And all three ultimately bottom out at the same vascular glucose ceiling — the astrocyte directly, the soma through its own glucose uptake.
The deep consequence is that a synapse must win on both economies to be potentiated. It must generate enough activity to pull lactate from the astrocyte (energy economy) AND accumulate enough tag to draw material during NIGHT (structural economy). A synapse that wins the structural competition but cannot pull energy will be unable to sustain the activity that justified its potentiation — it will be a large, expensive structure that keeps going silent. A synapse that pulls energy but never accumulates a tag stays metabolically supported but structurally weak. Only synapses that win both — active enough to be fueled, significant enough to be tagged — achieve and maintain full potentiation. The two economies together implement a stringent joint criterion: persistent significant activity that the metabolic infrastructure can sustain.
@@ -0,0 +1,514 @@
# The Abstract Pattern
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
it can hold. Both ceilings bound an active, competitive DAY process and are raised at NIGHT by
two kinds of evidence — a **tag** (local eligibility coinciding with non-local validation,
driving strength) and an **endurance need** (a *fuel* shortfall interrupting a locally
successful trajectory, driving endurance). Strength and endurance draw on the same finite
material and energy, so they compete; what is not committed decays for lack of maintenance,
and the freed material partially funds what was.
Everything a component does — in DAY and in NIGHT alike — is an instance of one grammar of
seven functional groups. This is the common template. Components differ only in how they fill
the groups, never in their structure.
---
## The Grammar
```
RECEIVE take in resources + signals that arrived from outside (boundary: in)
TRACE maintain the trace hierarchy — deposit fast trace; accumulate
possible_tag + endurance_need; stabilize tag on coincidence
ADJUST compute local operating parameters from structure + traces + modulators
BEHAVE the component's defining action, within both ceilings
EMIT send out — signals (messages) + resources (shipments) (boundary: out)
RECOVER refill own private pools consumed by behaving
DECAY let traces recede, closing their windows
```
**TRACE absorbs evaluation.** Judging a behavior is always maintaining a trace — whether or
not a trace is written — so the two evidence streams (strength, endurance) live inside TRACE
alongside the fast-trace deposit. TRACE spans all timescales: the soma's inactivation,
adaptation, and nuclear-calcium deposits are all TRACE, three records of one firing.
**BEHAVE and EMIT stay separate.** EMIT is the output half of the locality interface. RECEIVE
and EMIT are the *only* boundary crossings; every other group is strictly local. Keeping EMIT
named makes the boundary auditable — sometimes EMIT coincides with the behavior (presynaptic
release, somatic firing), often it is a separable consequence (postsynaptic retrograde
messages) or a different operation entirely (resource shipments).
The grammar runs at two timescales. In **DAY** it operates on occupancy *within* the ceilings
(fast traces, budgets, behaviors). In **NIGHT** it operates on the *ceilings themselves*
(material, energy, structure, budget capacity). Same seven groups, two scopes — the
capacity-versus-occupancy principle written into the shape of the process.
**Every flow has a timescale.** Decay relaxes a quantity toward 0 over τ; creation and arrival
relax it toward a target over τ — the same first-order operator, differing only in the target.
A within-step write is the special case τ ≪ Δt. Rate-limited inflows (private refill, contested
replenishment, flux × Δt) carry their τ implicitly; shipment carries an explicit transit delay,
so distal targets receive later and more spread out than near ones.
**Strict locality.** Every group uses only the component's own state and signals that have
physically arrived. No component reads another's interior. All cross-compartment influence
enters through RECEIVE and leaves through EMIT.
---
## DAY — The Grammar on Occupancy
### RECEIVE — what arrived becomes local
Resources arrive by three disciplines, each bounded by a ceiling through the *gap* it leaves,
never by a post-hoc clamp:
```
// CONTESTED supply (astrocyte lactate, arrived shipments) — rationed by competing demands
demand = BUDGET_CEILING - BUDGET // the gap is the claim
factor = min(1, S / (Σ demand on S + ε))
BUDGET += demand × factor; S -= demand × factor // never exceeds the ceiling
// PRIVATE reserve (own vesicle pool, own mitochondria) — uncontested, rate-limited
POOL += min(rate, CEILING - POOL) × Δt
// TRANSIT (shipment arriving from upstream) — delivered over a transport time
BUDGET += transit(shipment_channel, τ_transport) // fraction of in-flight cargo lands
```
Signals arrive as channel reads — forward transmitter, the co-agonist gate, retrograde
messengers, neuromodulatory broadcast — latched into a local copy while the channel decays. A
high budget ceiling is not free even in DAY: it makes a large standing claim on contested
supply, satisfiable only by out-competing neighbours.
### TRACE — maintain the record hierarchy (and the two evidence streams)
One group deposits and updates every trace, on every timescale.
**Deposit** the fast trace from the behavior (and, for components with multi-timescale
dynamics, the slower records too — soma inactivation and adaptation alongside nuclear calcium).
Where a fast trace both *drives* and *records* a behavior (residual calcium at the presynapse),
the deposit precedes ADJUST; elsewhere it follows BEHAVE.
**Strength evidence (associative, needs dopamine).** A tag forms when local eligibility
coincides with non-local validation; the number of coincidences set by the component's spatial
scale.
```
// most components — one non-local coincidence
if FAST_TRACE > elig and dopamine > dop_thr:
TAG += dopamine × possible_tag
// POST — three coincidences (astrosynapse gate, soma bAP, organism dopamine)
if FAST_TRACE > Ca_TAG and astro_Dserine > thr: possible_tag += FAST_TRACE // CANDIDATE
if possible_tag > thr and bAP arrives: FAST_TRACE += bAP_boost // confirm
if possible_tag > thr and dopamine > dop_thr: TAG += dopamine × possible_tag // STABLE
```
**Endurance evidence (homeostatic, no dopamine).** A need forms only when a **fuel** shortfall
interrupts a *locally* successful trajectory. The success proxy is the component's own state,
amplified by a retrograde signal *only where one actually arrives*.
```
if BUDGET < cost and LOCAL_SUCCESS_PROXY > traj_thr:
ENDURANCE_NEED += LOCAL_SUCCESS_PROXY × (1 + arrived_feedback) // feedback only if it arrived
```
Local proxies (own-state): PRE — own strong release (amplified by retrograde NO that POST
emitted, the one component with arrived feedback); POST — own calcium climbing toward the tag;
DEND — own branch strongly active when propagation fell short; SOMA — own nuclear calcium
approaching CREB; AXON — own strong propagation load; ASTRO — own high clearance demand when
synthesis ran short of budget. Same shape everywhere — fuel ran out at the verge of the
component's *own* success — only the proxy differs.
### ADJUST — set the operating parameters
From structure (the ceiling), the current traces, and arrived modulators, compute the
parameters that govern this step's behavior:
```
parameter = f(STRUCTURE, FAST_TRACE, modulators, arrived_signals)
```
PRE — release drive from residual calcium and the received DSE brake; POST — AMPA drive from
arrived glutamate; SOMA — firing threshold from baseline × adaptation × neuromodulators, plus
the refractory gate; AXON — propagation reliability from structure minus load-driven failure;
ASTRO — lactate-allocation weights across the territory. ADJUST is where the NIGHT-built ceiling
silently shapes the moment: the same structure that bounds the maximum also tunes the transfer
function.
### BEHAVE — the defining action, within both ceilings, with two failure modes
```
if BUDGET < cost:
suppress behavior
// FUEL shortfall → endurance evidence (handled in TRACE, if the trajectory was succeeding)
else if OCCUPANCY/STRUCTURE exhausted: // pool empty, surface already at ceiling, refractory
suppress behavior
// → short-term depression, or a structural/timing limit — NOT endurance (more fuel wouldn't help)
else:
behavior executes, strength bounded by STRUCTURE; BUDGET -= cost
```
The two failure modes are kept distinct because they point to two different ceilings. A *fuel*
shortfall is endurance evidence — more budget capacity would have let the behavior proceed. An
*occupancy* shortfall (empty vesicle pool, surface saturated, refractory soma) is short-term
depression or a structural limit — endurance cannot fix it; it is a consequence to be allowed.
Conflating them would build the wrong capacity. Behavior fills occupancy toward the structural
ceiling; when the driving trace decays, occupancy passively drifts back — short-term depression
is the *absence* of drive, never a signalled act.
### EMIT — send signals and resources outward
The component writes its outputs into shared channels: the forward transmitter into the cleft,
retrograde messages back, integrated voltage onward, and shipments into transit toward
downstream pools (rationed by the downstream component's propagated demand, delivered over
τ_transport). EMIT and RECEIVE are the only boundary crossings; together they make
locally-computing components into a communicating whole.
### RECOVER — refill private pools
Pools consumed by behaving are refilled from the component's own reserve toward their ceiling,
rate-limited and budget-costed (the presynaptic RRP from the reserve vesicle pool; the soma's
budget from its own mitochondria). Private recovery grants a component autonomy that contested
supply does not.
### DECAY — let the windows close
```
FAST_TRACE *= decay(τ_fast) // mss — closes the eligibility window
possible_tag *= decay(τ_mid) // smin — closes the tagging window
ENDURANCE_NEED *= decay(τ_mid) // smin — closes the endurance window
TAG *= decay(τ_slow) // hours — closes the commitment window
arrived channels *= decay // received signals fade
```
Decay is the passive relaxation that enforces every time window without a clock: a coincidence
must complete, and a fuel shortfall must interrupt a success, while the relevant trace is still
elevated. Timing is the competition between accumulation and decay.
---
## NIGHT — The Same Grammar on Ceilings
NIGHT runs once per cycle and applies the identical grammar to the slow variables.
**RECEIVE** — overnight production at the roots (astrocyte glycolysis, soma CREB synthesis,
soma mitochondria), capped externally by the vascular supply and gated by `soma_tag`.
**TRACE + ADJUST** — read the accumulated tags and endurance needs; compute the commit weights
(the coherence bonus when pre, post and astro tags align; the tag-weighted shares for
distributing material and energy to competing astrosynapses, spines, and boutons).
**EMIT** — distribute produced material and energy down the supply chains, into transit
(soma → branch/axon → spine/bouton; astrocyte body → astrosynapses).
**BEHAVE** — the two commits, drawing on the same finite pool so they compete:
```
// STRENGTH — driven by tag (validated coincidence)
if TAG > tag_expiry:
Δ = min(slot_cost, MATERIAL, ENERGY × f)
STRUCTURE += Δ × coherence; MATERIAL -= Δ; ENERGY -= Δ × assembly_cost
// ENDURANCE — driven by endurance need (interrupted success); no dopamine, no coherence
if ENDURANCE_NEED > endur_thr:
Δ = min(cap_cost, MATERIAL × f, ENERGY × f)
BUDGET_CEILING += Δ; MATERIAL -= Δ; ENERGY -= Δ × biogenesis_cost
```
A component both significant and fuel-limited demands both commits and is the strongest
claimant on the pool, potentially forcing decay elsewhere.
**RECOVER + DECAY** — both ceilings decay by neglect; maintenance from the remaining pool
resists decay only where sufficient. What shrinks returns its **material** (not its energy) to
the pool, partially funding the commits above:
```
STRUCTURE -= decay_rate × Δt; STRUCTURE += min(maint, maint_cost)
BUDGET_CEILING -= capacity_decay_rate × Δt; BUDGET_CEILING += min(cap_maint, cap_cost)
// shortfall → depotentiation by neglect (structure) / mitophagy of idle capacity (budget)
MATERIAL += shrinkage × recycle // energy is gone — not recoverable
```
**DECAY (clear)** — fast traces, possible tags, endurance needs, and the soma timing traces
reset; tags below expiry clear, above-expiry tags carry forward for multi-night consolidation;
structure and budget capacity persist as the ceilings the next DAY will operate within.
---
## The Pattern in One View
```
ONE GRAMMAR, SEVEN GROUPS, TWO TIMESCALES
RECEIVE · TRACE · ADJUST · BEHAVE · EMIT · RECOVER · DECAY
DAY runs the grammar on OCCUPANCY within two ceilings:
STRUCTURE (strength) filled by competing for occupancy
BUDGET_CEILING (endurance) filled by competing for shared fuel
TRACE yields two evidence streams from local state + arrived signals:
fast_trace + dopamine coincidence → TAG (strength)
FUEL shortfall + interrupted LOCAL success → ENDURANCE_NEED (endurance)
OCCUPANCY/structure/timing shortfalls → short-term depression (NOT endurance)
NIGHT runs the SAME grammar on the CEILINGS:
TAG → raise STRUCTURE (per-event power)
ENDURANCE_NEED → raise BUDGET_CEILING (sustainable duration)
both draw the SAME material + energy → strength and endurance compete
unmaintained ceilings decay → recovered material funds the rest
FLOWS every flow has a timescale: decay → 0 over τ, arrival → target over τ;
shipment is transit-delayed; rate-limited inflows carry τ implicitly.
LOCAL every group uses only own state + arrived signals;
RECEIVE and EMIT are the only boundary crossings.
A high ceiling of either kind is never free: structure must be filled by winning occupancy,
budget capacity by winning shared fuel — both against competing components, every DAY. The
system invests STRENGTH where a validated coincidence completed, and ENDURANCE where fuel —
not structure, not significance — was what stood between a component's own activity and its
own success. To be both effective and sustainable, a connection must win on both, at both
timescales, against all others drawing from the same finite pools.
```
# More details
## SOMA
### The Abstract Pattern Applied to Soma Timing
The abstract pattern says: a behavior deposits a trace, the trace decays, and the trace biases the next behavior. For the soma, the AP is the behavior, and **the refractory period and threshold elevation should both be consequences of a single trace deposited by the AP, decaying back toward baseline**. Neither should be a hardcoded duration — both should emerge from the return of the trace to resting conditions.
---
Yes, this is much more consistent with the rest of the architecture. The soma should not compute an explicit rhythm estimate and predict the next input — that is top-down. Instead, the **mismatch itself leaves a trace**, and that trace adjusts the refractory dynamics. Let me think through this carefully.
---
### The Bottom-Up Mechanism
The key event is: **a dendritic input arrives strong enough to fire the soma, but the soma is still refractory.** This is a missed opportunity — the input wanted to fire the cell, but the cell was not ready. This mismatch is the signal.
Each time this happens, it should leave a trace that biases the refractory dynamics toward recovering faster in that timing window — so that next time an input arrives at that phase, the soma is ready. This is potentiation of the refractory recovery, occurring within DAY, driven entirely by the local coincidence of "input wanted to fire" and "soma was not ready."
```
scope DAY | context NOT_AP (within refractory):
// Detect the mismatch: suprathreshold input during refractory
if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold:
// Input arrived but soma could not fire — missed coincidence
refractory_alignment_trace += (branch_Vm - effective_threshold)
× soma_Na_inactivation
// graded: stronger input + deeper refractory → larger trace
// this is the "potentiation" signal for faster recovery
```
The `refractory_alignment_trace` then biases the recovery rate of the inactivation trace:
```
// Recovery rate biased by accumulated alignment trace
recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace)
soma_Na_inactivation *= decay(τ_Na / recovery_rate)
// more alignment trace → faster recovery → soma ready sooner next time
```
---
### Why This Is Bottom-Up
There is no rhythm estimation, no prediction of the next input time, no computed inter-input interval. The soma does not model its input. It simply notices, locally and reactively, that an input arrived when it was not ready, and leaves a trace that makes it recover faster. Over many such mismatches at the same phase, the recovery speeds up at that phase specifically — and the soma ends up aligned with its input rhythm **without ever representing that rhythm**.
The alignment is an emergent statistical consequence of many local mismatch events, exactly as a potentiated synapse becomes tuned to its input without representing what it is tuned to. The phase-coupling appears, but nothing in the soma computed it.
---
### Depotentiation as Neglect — Not Explicit
Now the crucial part you raised: the depotentiation of refractory alignment must occur as a **consequence of not potentiating**, not as an explicit opposing mechanism.
The `refractory_alignment_trace` decays continuously. If mismatches keep happening at a particular phase, the trace is continuously replenished and the fast recovery is maintained. If mismatches stop happening — because the input rhythm changed, or because the alignment succeeded and inputs now arrive when the soma is ready — then the trace is no longer replenished and **decays back toward baseline on its own**.
```
// No explicit depotentiation — just decay when not reinforced
refractory_alignment_trace *= decay(τ_alignment)
// if mismatches continue → trace replenished → fast recovery maintained
// if mismatches stop → trace decays → recovery returns to baseline
```
This is exactly parallel to synaptic depotentiation by neglect. The soma does not actively slow its recovery when alignment is no longer needed. It simply stops receiving the mismatch signal that was keeping the recovery fast, and the recovery drifts back to baseline because the trace that accelerated it is no longer reinforced.
There is an elegant self-limiting property here. Once the soma is well-aligned, inputs arrive when it is ready, so there are no more mismatches, so the alignment trace stops being replenished and begins to decay. This would slowly de-align the soma — until inputs start arriving during refractory again, regenerating the mismatch and re-potentiating the alignment. The system settles into a dynamic equilibrium where just enough mismatch occurs to maintain just enough alignment. The soma hovers at the edge of alignment, continuously corrected by the residual mismatches that its imperfect alignment produces.
---
### The Full Bottom-Up Soma Timing
```
scope DAY | context AP:
effective_threshold = soma_structure.baseline_threshold
× (1 + soma_adaptation)
× neuromod_factor(NE_level, ACh_level)
can_fire = (soma_Na_inactivation < inactivation_threshold)
if branch_Vm > effective_threshold and can_fire:
AP_fired = True
soma_budget -= AP_generation_cost
// Deposit traces from the AP
soma_Na_inactivation += AP_amplitude // fast — refractory
soma_adaptation += AP_contribution // slow — spike train threshold
soma_fast_trace += nuclear_Ca_influx() // slow — plasticity tagging
scope DAY | context NOT_AP:
// MISMATCH DETECTION — bottom-up alignment signal
if branch_Vm > effective_threshold and soma_Na_inactivation > inactivation_threshold:
// input wanted to fire but soma was refractory — missed coincidence
refractory_alignment_trace += (branch_Vm - effective_threshold)
× soma_Na_inactivation
// local potentiation of recovery — no prediction, no rhythm model
// Recovery biased by alignment trace
recovery_rate = base_recovery_rate × (1 + refractory_alignment_trace)
soma_Na_inactivation *= decay(τ_Na / recovery_rate) // faster if aligned
soma_adaptation *= decay(τ_adaptation)
soma_fast_trace *= decay(τ_nuclear)
// Alignment trace decays — depotentiation by neglect, not explicit
refractory_alignment_trace *= decay(τ_alignment)
// maintained only while mismatches continue
// self-limiting: good alignment → fewer mismatches → trace decays →
// slight de-alignment → mismatches return → re-potentiation
// ... budget replenishment, shipments, tagging as before ...
```
---
### The Conceptual Payoff
This makes the soma's temporal alignment obey exactly the same principles as everything else in the system:
A behavior leaves a trace — here the missed coincidence leaves the alignment trace.
The trace biases future behavior — here it accelerates recovery so the next input at that phase succeeds.
Potentiation is the active drive — the soma actively speeds up recovery in response to mismatch.
Depotentiation is neglect — the alignment trace decays when mismatches stop, with no explicit opposing process.
The system finds equilibrium through the residual of its own imperfection — just enough mismatch persists to maintain just enough alignment.
And critically, the soma achieves temporal prediction — firing in phase with its input rhythm — **without ever representing the rhythm**. The prediction is implicit in the structure of the recovery dynamics, built up from purely local, reactive, bottom-up trace deposits. This is the same way a potentiated synapse "predicts" that its input will be significant without representing the prediction: the prediction is the physical bias left by past experience, not a computed expectation. The soma's phase-coupling is the temporal version of the synapse's weight — both are implicit predictions encoded as physical bias, both built bottom-up from local coincidence, both maintained by reinforcement and lost by neglect.
## Energy depletion in Presynapse
how does the budget and energy influence the model. If for example a presynapse has no more energy variuos times during day, what happens?
Good question. Let me trace through exactly what happens when energy is repeatedly depleted, following the mechanics already in the pseudocode.
---
### The Immediate Effect — Behavior Suppression
When `pre_budget < AP_release_cost`, the pseudocode does:
```
if pre_budget < AP_release_cost:
suppress(NT_flux)
exit context
```
So the immediate consequence of an energy-depleted bouton is **silence** — it does not release neurotransmitter for that AP, regardless of how strong the incoming spike was. The AP arrives, but nothing comes out the other side. This is biologically real: ATP-depleted boutons fail to release because the VATPase cannot refill vesicles and the calcium pumps cannot maintain the gradients that drive release.
---
### The Cascade of Consequences Within DAY
A single depletion is recoverable — the bouton refuels from astrocyte lactate in the next NOT_AP context and resumes. But **repeated depletion during DAY** sets off a cascade that runs through the entire trace and tagging machinery.
**No release means no glutamate means no downstream trace.** When the bouton is silent, no glutamate reaches the cleft. The postsynapse receives no AMPA current, its NMDA channels do not open, and `post_fast_trace` does not rise. The astrosynapse detects no spillover, so `astro_fast_trace` does not rise and no D-serine pulse is released. The entire synaptic event simply does not happen. A bouton that is energy-depleted at the moment a significant pattern arrives causes that pattern to be invisible to the postsynapse — the synapse fails to participate in whatever the network is doing.
**No participation means no eligibility.** Because the bouton did not release, `pre_fast_trace` is not elevated by a release event (it still rises from calcium influx, but without the reinforcing facilitation of successful release). More importantly, the postsynapse, having received no input, accumulates no `post_possible_tagging`. When dopamine arrives to validate the moment, there is nothing to validate at this synapse — the eligibility window is empty. The synapse misses the tagging opportunity entirely.
**Missing the tag means missing the NIGHT commit.** Since no tag was set during DAY, the synapse has nothing to draw structural resources with during NIGHT. It does not potentiate. And because the system's depotentiation is by neglect, **a synapse that fails to potentiate is automatically on the path to depotentiation** — it receives only maintenance allocation, and if other synapses potentiated and drew down the shared pool, even maintenance may be insufficient.
---
### The Deeper Consequence — Energy Depletion Becomes Structural Depression
Here is the important emergent property: **repeated energy depletion at a bouton during DAY leads to its structural depression during NIGHT, even though no depression signal was ever sent.**
The chain is entirely passive:
```
repeated pre_budget depletion in DAY
→ bouton silent during significant events
→ no glutamate release
→ no post_fast_trace, no post_possible_tagging
→ no tag set (pre or post)
→ no NIGHT structural commit at this synapse
→ only maintenance allocation received
→ if pool depleted by other synapses' potentiation:
maintenance insufficient
→ pre_structure and post_structure decay
→ DEPOTENTIATION
```
The energy-starved synapse is outcompeted not because it was marked for depression but because it could not generate the activity needed to claim resources. Energy availability during DAY therefore directly determines which synapses can even enter the competition for NIGHT potentiation.
---
### The Feedback Loop — Depression Reduces Future Energy Demand
There is a stabilizing feedback here. A depotentiated synapse has smaller `pre_structure` — a smaller active zone, fewer docking slots, lower release probability. This means it costs **less energy to operate**. So a synapse that was energy-starved and consequently depotentiated now has lower energy demands, making it less likely to be energy-starved in the future.
```
energy depletion → depotentiation → smaller structure → lower energy demand
→ less likely to deplete → stabilizes at a low-activity equilibrium
```
The synapse settles into a low-energy, low-structure, low-activity state. It is not dead — it still operates at baseline — but it has been demoted from the pool of synapses competing for potentiation. Energy scarcity has selected it out.
---
### Why This Is Functionally Important
This is not a bug — it is a resource-allocation mechanism with real computational value.
**Energy availability acts as a second gate on plasticity, parallel to the neuromodulatory gate.** Dopamine asks "was this worth saving?" Energy asks "can this synapse afford to participate?" A synapse must pass both gates to be potentiated. This means the system preferentially potentiates synapses that are both behaviorally significant AND metabolically sustainable. A synapse that cannot sustain its own activity is not a good candidate for strengthening, because strengthening it would only increase its energy demand and make it fail more often.
**Local energy competition implements a form of spatial sparsification.** Boutons on the same axon share `axon_budget` and ultimately the same astrocytic lactate supply. When many boutons are active simultaneously, the shared energy is divided among them, and the weakest — those with the least efficient structure or the least reliable input — deplete first and fall silent. This automatically sparsifies activity: under energy pressure, only the most robust synapses keep firing, and they are the ones that get potentiated. The system concentrates its limited resources on its strongest connections.
**The astrocyte's energy delivery becomes a control signal.** Because the astrocyte controls lactate distribution across its territory, it has indirect control over which synapses can sustain activity and therefore which can be potentiated. A region of the astrocyte territory that is well-perfused and well-fueled supports vigorous plasticity. A region that is metabolically stressed — perhaps because of high overall demand or reduced vascular supply — suppresses plasticity in its synapses regardless of their activity. This couples the metabolic state of the tissue directly to its capacity to learn.
---
### What Repeated Depletion Looks Like Over Days
If a bouton is chronically energy-starved across multiple DAY cycles — perhaps because it is in a metabolically compromised region, or because it is competing with many highly active neighbors — the trajectory is:
```
Day 1: depletes occasionally → misses some events → weak tag → partial commit
Day 2: smaller structure → still depletes under load → weaker tag → less commit
Day 3: structure decaying → maintenance insufficient → depotentiation accelerates
...
Equilibrium: minimal structure, minimal energy demand, minimal participation
synapse survives but is functionally silent
resources it would have consumed now available to neighbors
```
This is a reasonable model of what happens to synapses in metabolically stressed tissue — they do not die immediately, but they are progressively silenced and depotentiated, freeing their resources for synapses in healthier regions. It is also a model of how chronic metabolic limitation — aging, vascular disease, mitochondrial dysfunction — would manifest as a gradual loss of plasticity capacity: not through any depression signal, but through the simple inability of energy-starved synapses to participate in the activity that would let them claim resources.
The energy budget is therefore not just a constraint that occasionally blocks behavior — it is a continuous selective pressure that shapes which synapses thrive and which fade, operating silently in parallel with the explicit activity-and-reward-driven plasticity, and ultimately determining the metabolic sustainability of whatever the system chooses to remember.
## Three parallel competitive resource economies
The neuronal structural economy — soma produces material, distributed through dendrite to spines and through axon to boutons, competed for by tagged synapses during NIGHT.
The astrocytic energy economy — astrocyte cell body produces lactate, distributed to perisynaptic processes, competed for by active synapses during DAY in proportion to their clearance demand.
The soma's own energy economy — soma mitochondria fuel AP generation and shipping, competed for by the soma's own functions.
All three share the same logic: a central producer with a capped output, distribution to peripheral consumers, demand-weighted allocation, and a self-reinforcing coupling where stronger consumers both demand and receive more. And all three ultimately bottom out at the same vascular glucose ceiling — the astrocyte directly, the soma through its own glucose uptake.
The deep consequence is that a synapse must win on both economies to be potentiated. It must generate enough activity to pull lactate from the astrocyte (energy economy) AND accumulate enough tag to draw material during NIGHT (structural economy). A synapse that wins the structural competition but cannot pull energy will be unable to sustain the activity that justified its potentiation — it will be a large, expensive structure that keeps going silent. A synapse that pulls energy but never accumulates a tag stays metabolically supported but structurally weak. Only synapses that win both — active enough to be fueled, significant enough to be tagged — achieve and maintain full potentiation. The two economies together implement a stringent joint criterion: persistent significant activity that the metabolic infrastructure can sustain.
@@ -0,0 +1,333 @@
# Tripartite Synapse — Biological Reference (companion to v10 pseudocode)
> This document explains what each variable and behavior in `tripartite_synapse_v10_pseudocode.md`
> conflates biologically. The pseudocode aggregates many molecular details into single
> variables for clarity; here each aggregation is unpacked. Read the pseudocode for the
> logic; read this when you need to know what a variable physically represents.
---
## The three synaptic components and their support structures
A SYNAPSE is composed of three first-class components:
- **PRE** — presynaptic bouton (the axon's terminal at this synapse)
- **POST** — postsynaptic spine (the dendrite's terminal at this synapse)
- **ASTRO** — astrosynapse, the perisynaptic astrocytic process (the astrocyte's terminal)
Each has an upstream support structure that supplies it:
- **AXON** supplies PRE (transmission + transport from soma)
- **DEND** supplies POST (integration + transport from soma)
- the **astrocyte cell body** supplies ASTRO (energy + ECM material)
- **SOMA** is the integrating center and the root of neuronal material
The compartment analogy: AXON:PRE = DEND:POST = astrocyte-body:ASTRO = supply line : terminal.
---
## Resource variables
### DAY budget (one per component)
Aggregates fast energy AND fast consumables — everything needed to run moment-to-moment.
- **pre_budget** — ATP for VGCC gating, vesicle fusion (SNARE), VATPase vesicle refill,
plus fast consumables: vesicle membrane lipids, synaptotagmin recycling.
- **post_budget** — ATP for the NaK pump (membrane reset after current), NMDA current
handling, plus fast actin monomers for transient spine changes and receptor-recycling lipids.
- **dend_budget** — ATP for bAP propagation (NaK reset along branch), local translation
(ribosome running cost), SERCA Ca²⁺ resequestration, plus fast mRNA consumed by translation.
- **soma_budget** — ATP for AP generation (Na⁺/K⁺ currents + NaK reset), CREB
phosphorylation, nuclear Ca²⁺ handling, plus shipping running costs.
- **axon_budget** — ATP for AP propagation at nodes of Ranvier, kinesin/dynein motor
running cost, fast myelin maintenance.
- **astro_central_budget** — ATP from glycolysis at the astrocyte cell body; funds EAAT
clearance, serine→D-serine synthesis, lactate export, fast process motility.
### astro_lactate[i]
Lactate exported from the astrocyte cell body to synapse i. Biologically: glucose →
(glycolysis) → lactate, released into extracellular space, absorbed by neuronal MCT2
transporters, converted to pyruvate → TCA → ATP in the neuron's mitochondria. The astrocyte
is the primary fast-energy supplier to pre, post, and dend.
### NIGHT energy (one per component) — NOT recoverable
ATP for structural assembly. Distinct from DAY budget because it is spent on building, and
the work of assembly is thermodynamically gone once done (cannot be recovered by disassembly).
- pre_energy: RIM/Munc13 incorporation, VGCC clustering.
- post_energy: CaMKII anchoring, actin polymerization, PSD scaffold remodeling.
- dend_energy: mitochondria incorporation, cytoskeletal reinforcement.
- soma_energy: ribosome biogenesis, ion-channel incorporation.
- axon_energy: myelination, microtubule stabilization.
- astro_energy: process retraction, ECM secretion, racemase upregulation.
### NIGHT material (one per component) — RECOVERABLE
Slow structural proteins. Recoverable because disassembly (LTD) returns the proteins to a
reusable pool (ubiquitin-proteasome → amino acids; internalized receptors → endosomal reserve).
- **soma_material** (root) — all neuronal structural proteins from CREB-driven synthesis:
AMPA subunits, PSD scaffold, AZ scaffold, mRNA transcripts (Arc, BDNF), organelles.
- **dend_material** — from soma: Arc/plasticity mRNA, mitochondria, cytoskeletal proteins,
AMPA subunits in transit to spines.
- **post_material** — from dend: AMPA receptor subunits (GluA1/2), PSD scaffold (PSD-95,
SHANK, Homer), structural actin, CaMKII.
- **axon_material** — from soma: kinesin/dynein motors, microtubule components, myelin proteins.
- **pre_material** — from axon: RIM, Munc13, VGCC subunits, structural vesicle proteins.
- **astro_material** (root: astrocyte cell body) — EAAT proteins, serine racemase, ECM
proteins (Glypicans, Thrombospondins), process cytoskeleton.
**Why energy and material are separate in NIGHT but combined in DAY:** during DAY both are
fast consumables replenished on the same timescale, so one `budget` variable suffices. During
NIGHT they diverge — material is recoverable after LTD, energy is not — so they must be two
variables. This asymmetry (material returns to the pool, energy is gone) is what makes one
synapse's depression genuinely fund another's potentiation.
---
## Structural variables (strength ceilings — written in NIGHT)
Each aggregates several correlated structural properties into one capacity.
- **pre_structure** — active zone capacity:
slot_ceiling (number of vesicle docking slots) + VGCC_coupling (Ca²⁺-channel proximity to
slots, sets release efficiency) + refill_ceiling (max RRP replenishment rate).
- **post_structure** — spine sensitivity capacity:
slot_ceiling (number of PSD anchoring slots for AMPA) + spine_volume (local reserve and
actin machinery) + reserve_ceiling (endosomal AMPA pool size).
- **dend_structure** — branch capacity:
bAP_fidelity(position) (mitochondrial density sets propagation strength, attenuates with
distance) + translation_ceiling (local mRNA capacity) + transport_speed (cytoskeletal integrity).
- **soma_structure** — somatic output capacity:
baseline_threshold (inverse: ion-channel density at axon initial segment) + AP_reliability
(Na⁺ channel density) + synthesis_ceiling (ribosome density + CREB machinery).
- **axon_structure** — axonal capacity:
propagation reliability (myelination density) + transport_ceiling (motor density + microtubule
integrity) + mitochondrial density.
- **astro_structure** — astrosynaptic environmental capacity:
perisynaptic_distance⁻¹ (wall proximity — closer = more glutamate contained) + EAAT_density
(clearance ceiling) + Dserine_tonic (baseline co-agonist) + ECM_integrity.
**Self-reinforcing both directions:** tighter wrap + more tonic D-serine make future
potentiation easier; looser wrap + zero tonic D-serine make future depression easier.
---
## Budget ceilings (endurance ceilings — written in NIGHT)
- **{component}_budget_ceiling** — the maximum fuel the component can hold / the maximum
duration of sustained behavior. Biologically: mitochondrial density and local fuel-storage
capacity. Built by activity-driven mitochondrial biogenesis; lost by mitophagy when idle.
Parallel to structure: structure is strength capacity, budget_ceiling is endurance capacity.
---
## Trace variables
### fast_trace (one per component) — DAY only, decays automatically
The local record of recent activity that biases the next behavior.
- **pre_fast_trace** — residual presynaptic Ca²⁺ after spikes (τ≈100ms). Biases NT release
(facilitation) and provides tagging eligibility.
- **post_fast_trace** — spine Ca²⁺ amplitude × rise-speed (τ≈tens ms). Encodes the LTP-vs-LTD
instruction (fast rise → CaMKII → potentiation; slow rise → phosphatase → depression).
- **dend_fast_trace** — branch Ca²⁺ from bAP + spine spillover (τ≈300ms). Integrates branch co-activity.
- **soma_fast_trace** — nuclear Ca²⁺ from each AP (τ≈seconds). Drives toward CREB activation.
- **axon_fast_trace** — propagation load (τ≈seconds). High load → Na⁺ inactivation at branch
points → propagation failure (this is axonal short-term depression).
- **astro_fast_trace** — perisynaptic Ca²⁺ from mGluR5 activation by glutamate spillover
(τ≈seconds). Drives D-serine release.
### soma timing traces (emergent refractory + adaptation + alignment)
- **soma_Na_inactivation** (τ≈ms) — sodium-channel inactivation after an AP. Its recovery IS
the refractory period (emergent, not a hardcoded timer). High → absolute refractory; decaying
→ relative refractory; recovered → normal.
- **soma_adaptation** (τ≈100s of ms) — slow K⁺ channel (SK/M-type) activation accumulating
over a spike train, raising threshold. This is spike-frequency adaptation.
- **soma_refractory_alignment** — deposited when a suprathreshold input arrives during
refractoriness (a missed coincidence). Speeds future recovery so the soma aligns to its input
rhythm. Bottom-up: no rhythm is represented; alignment emerges from accumulated local
mismatches and decays when mismatches stop (self-limiting).
### possible_tag (one per component) — intermediate, τ≈smin
Graded accumulation of tagging eligibility. For POST, this is the CANDIDATE tag lifetime.
### endurance_need (one per component) — intermediate, τ≈smin
Deposited when budget depletion interrupts a behavior that was on a LOCALLY successful
trajectory. Records that fuel — not structure, not significance — was the binding constraint
on a forming success. Requires NO dopamine (homeostatic, not associative).
**Local success proxy per component** (each uses only its own state + arrived signals):
- PRE: own fast_trace high (was releasing strongly), optionally amplified by retrograde
messenger (endocannabinoid / NO / BDNF) that has arrived.
- POST: own Ca²⁺ climbing toward tagging threshold (naturally local).
- DEND: own branch strongly active (high branch voltage/Ca²⁺) when propagation fell short.
- SOMA: own nuclear Ca²⁺ climbing toward CREB.
- AXON: own propagation load high (was carrying a strong train).
- ASTRO: own local glutamate/Ca²⁺ high (was under heavy clearance/D-serine demand).
### tag (one per component) — DAY→NIGHT bridge, τ≈hours
The validated record of significance that survives to NIGHT and gates strength commits.
Formed by coincidence of local eligibility + non-local validation (dopamine).
**POST is special — two-phase, three coincidences:**
- CANDIDATE: local Ca²⁺ above threshold + astrosynapse D-serine present (coincidence 1).
- amplified when bAP confirms soma fired (coincidence 2).
- STABLE: CANDIDATE + dopamine within stabilization window (coincidence 3).
Biologically: early CaMKII creates a labile tag (early-LTP); PKA driven by dopamine via D1R
stabilizes it (late-LTP). Without dopamine, the candidate degrades — early-LTP reverses.
---
## Behaviors — biological meaning
### PRE | AP — neurotransmitter release
`NT_flux = RRP × sat(pre_fast_trace, K_release)` models continuous NT release proportional to
the readily-releasable pool and a saturating Ca²⁺ drive (synaptotagmin's cooperative Ca²⁺
sensitivity, simplified to a saturating curve). RRP depletes as released (short-term depression
as a consequence) and refills via VATPase (energy-throttled, so low budget deepens depression).
The mGluR2/3 brake is presynaptic autoinhibition by spillover (Gi → reduced VGCC opening).
### POST | NOT_bAP — three calcium sources, two plasticity cases
- **Source 1 (AMPA):** glutamate opens AMPA → depolarizing current + small Ca²⁺; the
depolarization begins ejecting the NMDA Mg²⁺ block.
- **Source 2 (NMDA):** if depolarized enough (Mg²⁺ ejected) AND D-serine present (astrocyte
co-agonist) AND glutamate bound → large Ca²⁺ influx. This is the coincidence detector.
- **Source 3 (bAP, separate context):** back-propagating AP adds depolarization + Ca²⁺,
amplifying an existing signal supralinearly.
- **Case 1 (STP):** high Ca²⁺ drives AMPA receptors from the local reserve to the surface,
bounded by the anchoring-slot ceiling. Fast, reversible, NO dopamine. When Ca²⁺ falls,
receptors drift back — short-term depression as a passive consequence, never signaled.
- **Case 2 (LTP tag):** high Ca²⁺ + (later) dopamine sets the tag that NIGHT uses to raise the
slot ceiling. NIGHT builds slots; DAY fills them.
### DEND | bAP — bidirectional signaling
Propagates the bAP from soma toward spines (fidelity attenuates with distance — distal spines
get weaker confirmation, are harder to potentiate) and integrates spine signals toward the soma.
### SOMA | AP — integration, firing, emergent timing
Fires when integrated branch input exceeds a threshold that is the baseline (from structure)
raised by adaptation and modulated by neuromodulators, gated by the emergent refractory state.
Each AP deposits three traces (inactivation → refractory, adaptation → threshold rise, nuclear
Ca²⁺ → plasticity). The soma is the coincidence detector at the cellular scale (nuclear Ca²⁺ +
dopamine → CREB), and the production bottleneck: its tag gates how much material all downstream
components get in NIGHT.
### AXON | AP — reliable propagation with frequency-dependent failure
Propagation reliability is set by myelination and degraded by high-frequency load (Na⁺
inactivation at branch points = axonal STD). The axon also transports material to boutons and
sets the timescale of presynaptic structural commits.
### ASTRO | CONTINUOUS — gatekeeper and energy hub
Clears glutamate (EAAT), supplies D-serine (the NMDA co-agonist that gates postsynaptic LTP),
and distributes lactate to the territory by demand-weighting (active synapses generating more
clearance load pull more fuel; slow synapses get less). The same spillover that excites the
astrocyte (mGluR5 → Ca²⁺ → D-serine) also brakes the presynapse (mGluR2/3 → Gi) — one signal,
opposite effects via different receptors. The astrocyte is the energy root and the gain control
of the whole synapse.
---
## NIGHT operations — biological meaning
- **Step 1 (replenish/distribute):** overnight protein synthesis peaks (CREB-driven, gated by
soma_tag — corresponds to slow-wave-sleep replay). Soma material flows to branches/axon then
spines/boutons; astrocyte material flows to astrosynapses, tag-weighted.
- **Step 2 (strength commits):** tagged components build structure — more slots, tighter
coupling, tighter astrosynaptic wrap. Coherence bonus when pre+post+astro all tagged (the
whole synapse agrees). astro_structure self-reinforces.
- **Step 2b (endurance commits):** components with high endurance_need build budget_ceiling —
mitochondrial biogenesis. Competes with step 2 for the same material/energy.
- **Step 3 (passive decay):** both ceilings decay; maintenance from the remaining pool resists
decay only where sufficient. Depotentiation and endurance-loss are both by neglect — no
signal weakens anything; unmaintained capacity simply drifts down. Recovered material (not
energy) returns to pools.
- **Step 4 (homeostatic scaling):** if the soma fired too much overall, all synapses scale down
proportionally (sleep-associated global downscaling), preserving relative differences.
- **Step 5 (clear traces):** fast traces, possible tags, endurance needs, and soma timing traces
reset; tags below expiry clear, above-expiry tags carry forward (multi-night consolidation);
structure and budget_ceiling persist.
### Shockwave lockdown
Emergency global astrocytic Ca²⁺ wave → GABA + ATP release → mass AMPA internalization and
hyperpolarization. Bypasses budget gates. A circuit breaker against runaway excitation.
---
## Pool-filling: private reserve vs contested supply
The pseudocode uses two filling primitives, distinguished by where the resource comes from.
**`fill` (private reserve).** The pool is replenished from a source the component owns
outright, uncontested by siblings, bounded by the component's own ceiling and a rate cap.
- RRP refill — vesicles mobilized from the bouton's own reserve pool toward the docking-slot
ceiling, rate-limited by VATPase. The reserve is private to the bouton.
- SOMA self-replenish — the soma fuels itself from its own mitochondria toward its budget
ceiling. No other component draws on it.
**`refill` (contested supply).** The pool is replenished from a supply that multiple
components compete for, rationed by demand (gap to ceiling).
- pre/post/dend/axon budgets — drawn from astrocytic lactate (shared across all synapses the
astrocyte wraps) plus shipment from soma/axon/dendrite (shared across downstream targets).
**Neither primitive (their own forms).** Some inflows are not fills toward a ceiling:
- AMPA surface insertion — Ca²⁺-driven rate from the spine's private endosomal reserve, with
an explicit passive drift-back (short-term depression) when Ca²⁺ is low. Not a steady fill.
- D-serine release — demand-driven (saturating in astro Ca²⁺) and budget-limited, like NT
release; a release process, not a pool top-up.
- Root productions — `glycolysis(glucose)` at the astrocyte and `CREB_synth(soma_tag)` at the
soma are the system's energy and material roots: raw inflows capped only by the external
vascular supply, not fills toward an internal ceiling.
The distinction matters biologically: a private reserve guarantees a component some autonomy
(the bouton can refill its RRP from its own vesicles even when lactate is scarce), while a
contested supply couples a component's fate to its neighbours' demands (operational budget
fails first where many active synapses compete for the same lactate).
---
## PRE ↔ POST interaction: local computation, message-only coupling
The presynapse and postsynapse never read each other's internal state. They interact only
by writing to and reading from shared cleft channels. Each side computes entirely locally on
what it has: its own variables plus whatever signals have arrived in the cleft. This is the
message-passing realization of the locality principle.
**Forward channel — glutamate (PRE → POST and ASTRO).** The presynapse writes glutamate via
NT_flux. The postsynapse reads it (AMPA, NMDA) and the astrosynapse reads it (clearance,
mGluR5). The astrosynapse clears it. PRE never knows whether POST responded — it only emits.
**Gate channel — astro_Dserine (ASTRO → POST).** The astrosynapse writes D-serine; the
postsynapse reads it as the obligatory NMDA co-agonist. POST cannot open NMDA without this
arrived signal, but it does not read the astrocyte's state — only the delivered D-serine.
**Backward channel + — retro_NO (POST → PRE).** When the postsynapse's NMDA opens (Mg²⁺
ejected, D-serine present, glutamate bound), nNOS — physically tethered to the NMDA receptor
through PSD-95 — synthesises nitric oxide (and, on a slower timescale, BDNF is released).
These diffuse retrogradely to the presynapse. Biologically this is the classic retrograde
messenger of LTP: it tells the bouton that its release landed on a postsynapse that genuinely
responded. In the model, POST emits `retro_NO` proportional to its own NMDA-driven calcium —
computed purely from POST's local state — and PRE reads it as `retro_NO_local`.
`retro_NO_local` is exactly the grounding of the presynaptic endurance signal. The
presynapse's local success proxy is "I was releasing strongly" (`pre_fast_trace` high). On
its own that only says the bouton was working hard, not that the work mattered. `retro_NO`
adds the missing confirmation — that the postsynapse responded — without PRE ever reading
POST's calcium. So PRE deposits endurance need as `pre_fast_trace × (1 + retro_NO_local)`:
strong release that was confirmed effective makes the strongest claim that fuel, not
futility, was what interrupted a forming success. retro_NO is short-lived (NO degrades and
diffuses within seconds), so the channel decays fast — confirmation must be recent to count.
**Backward channel — retro_eCB (POST → PRE).** When the postsynapse is strongly
depolarised, it synthesises endocannabinoids (2-AG, anandamide) that diffuse retrogradely and
bind presynaptic CB1 receptors, suppressing release. This is depolarisation-induced
suppression of excitation (DSE) — a homeostatic negative feedback: an over-driven postsynapse
tells the presynapse to release less. In the model, POST emits `retro_eCB` from its own
membrane potential, and PRE reads it as `retro_eCB_local`, which reduces the release drive
`sat(...) × (1 - retro_eCB_local)`. Again POST computes from its own state; PRE adjusts from
the arrived signal; neither reads the other's interior.
The two backward channels are opposite-signed messages the postsynapse sends about its own
condition: retro_NO says "your input was effective — worth sustaining," retro_eCB says "I am
saturated — ease off." Together with the forward glutamate and the D-serine gate, they make
the synapse a fully message-coupled system of locally-computing components.
**Why RRP refill is in NOT_AP only.** During an AP the bouton releases — RRP depletes. Refill
(VATPase reloading vesicles from the reserve pool) is a recovery process that proceeds between
spikes. Placing `fill(RRP, ...)` only in the NOT_AP context makes the AP context pure
depletion and the NOT_AP context pure recovery. A consequence falls out for free: during
sustained high-frequency firing there are many AP steps and few NOT_AP steps, so RRP depletes
faster than it recovers — short-term depression deepens with frequency, with no explicit
depression rule. The release itself is throttled further when budget is low (VATPase refill
is energy-limited), coupling metabolic state to the depth of depression.
@@ -0,0 +1,510 @@
# Tripartite Synapse — Pseudocode v10
> Companion document: `tripartite_synapse_v10_biology.md` explains the biological
> meaning of every variable and behavior. This document is the logic only.
---
## Conventions
```
SCOPE = { DAY, NIGHT }
CONTEXT = { AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS }
COMPONENTS = { PRE, POST, DEND, SOMA, AXON, ASTRO }
DAY variables
budget fast resource (energy + consumables), consumed by behavior
fast_trace local record, decays in mss, biases next behavior
possible_tag accumulates from fast_trace, decays in smin
endurance_need accumulates on interrupted local success, decays in smin
DAY→NIGHT bridge
tag decays in hours; POST: CANDIDATE → STABLE
NIGHT variables
energy assembly ATP, NOT recoverable
material structural proteins, RECOVERABLE after decay
structure strength ceiling — READ in DAY, WRITTEN in NIGHT
budget_ceiling endurance ceiling — READ in DAY, WRITTEN in NIGHT
LOCALITY RULE
every evaluation uses only local state + signals that have arrived.
no component reads another compartment's internal state.
CLEFT MESSAGE CHANNELS (the only PRE/POST/ASTRO interaction — each writes, others read)
glutamate PRE → POST, ASTRO (forward transmitter; cleared by ASTRO)
astro_Dserine ASTRO → POST (NMDA co-agonist gate)
retro_NO POST → PRE (+) (NO/BDNF: "release reached a responsive target")
retro_eCB POST → PRE () (endocannabinoid: "over-driven, suppress release" = DSE)
Each channel decays/clears; a component reads a channel into a local copy and computes locally.
```
---
## Saturating form (used wherever a graded signal drives output)
```
sat(x, K) = x / (K + x)
```
---
## Fixed parameters
```
K_release K_AMPA K_Dserine
Mg_eject Ca_STP Ca_TAG eCB_thr
elig dop_thr tag_thr tag_expiry
traj_thr endur_thr
spillover inactivation overload
homeostatic_ceiling decay_rate capacity_decay_rate recycle
dopamine NE ACh // organism broadcast (external)
glucose // vascular ceiling (external)
geometry // dendritic topology (external)
```
---
---
# DAY
Execution contexts (AP, bAP, CONTINUOUS): run behavior, spend budget, deposit traces.
Replenishment contexts (NOT_AP, NOT_bAP): competitive refill, ship downstream, decay traces, set tags.
---
## Pool-filling primitives
Two shapes share the core "rise toward a ceiling, bounded by the gap, paying budget":
```
// PRIVATE: fill own pool from own reserve toward own ceiling, at a rate cap
fill(pool, ceiling, rate_cap, cost, budget):
amount = min(rate_cap, ceiling - pool)·Δt // bounded by rate AND gap
pool += amount
budget -= amount·cost
// CONTESTED: fill toward ceiling by a rationed share of a shared supply S
refill(component c from supply S):
demand = c.budget_ceiling - c.budget // claim = gap to ceiling
total = Σ demand over components on S
factor = min(1, S / (total + ε))
c.budget += demand × factor // never exceeds ceiling
S -= demand × factor
```
Choose by source: a pool drawn from a **private reserve** uses `fill`; a pool drawn from a
**contested shared supply** uses `refill`. The distinction is biologically real — RRP comes
from the bouton's private reserve pool, while operational budget comes from astrocytic lactate
that neighbours compete for.
---
## PRE
```
// ─── PRESYNAPSE EXTERNAL INTERFACE ────────────────────────────────────────
// PRE computes locally. Everything below crosses its boundary as a signal it
// emits or a resource/signal it receives. It never reads another component's state.
//
// OUTPUT (PRE writes; others read)
// glutamate → POST, ASTRO forward transmitter; ASTRO clears it
//
// RESOURCES IN (others write; PRE reads in NOT_AP)
// astro_lactate[syn] ← ASTRO primary fast fuel → pre_budget
// axon_ship_pre ← AXON secondary fuel → pre_budget
// ship(axon_budget → pre_budget, gap_to(pre))
// pre_material ← AXON (NIGHT) AZ proteins (RIM, Munc13, VGCC subunits)
// pre_energy ← SOMA (NIGHT) assembly ATP for active-zone construction
//
// BACKWARD MESSAGES IN (POST writes from its own state; PRE reads)
// retro_NO (+) ← POST "release reached a responsive target" → endurance
// retro_eCB () ← POST DSE: "over-driven, release less" → brake
//
// CLEFT SELF-FEEDBACK (PRE reads the channel it writes)
// glutamate ← cleft spillover autoreceptor brake (mGluR2/3 on PRE)
//
// ORGANISM BROADCAST IN (external; arrives as a local level)
// dopamine ← VTA gates pre_tag (the non-local coincidence)
// NE, ACh ← LC, basal excitability/threshold context
//
// OWN STRUCTURE (written NIGHT, read DAY)
// pre_structure slot_ceiling, VGCC_coupling, refill_ceiling
// pre_budget_ceiling endurance ceiling (bounds replenishment)
//
// EMERGENCY
// shockwave_lockdown ← ASTRO global Ca²⁺ wave overrides PRE
// ──────────────────────────────────────────────────────────────────────────
DAY | AP:
// SENSE — deposit fast trace (residual Ca²⁺ from this spike; also drives release)
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release, or fail if depleted
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted LOCAL success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local) // received DSE brake
if RRP > 0:
NT_flux = RRP × drive
// EMIT — glutamate into cleft (read by POST, ASTRO)
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autoreceptor brake
// no RECOVER here — RRP refills in NOT_AP; high-frequency firing depletes
// faster than it recovers → short-term depression deepens
DAY | NOT_AP:
// RECEIVE — latch arrived backward messages; replenish budget (contested supply)
retro_NO_local = retro_NO
retro_eCB_local = retro_eCB
refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER — refill RRP from private reserve toward its ceiling
fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength) — eligibility → possible_tag → tag (needs dopamine)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY — all traces and channels recede, closing their windows
pre_fast_trace *= decay(100ms)
pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min)
pre_tag *= decay(hr)
dopamine *= decay(ms) // broadcast transient fades
retro_NO *= decay(s); retro_eCB *= decay(s) // backward channels clear
```
---
## POST
```
DAY | NOT_bAP:
refill(post from astro_lactate[syn] + dend_ship_post)
// SOURCE 1 — AMPA: current + small Ca + begins Mg ejection
a = sat(glutamate, K_AMPA)
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
// SOURCE 2 — NMDA: large Ca if local coincidence
if Vm > Mg_eject and astro_Dserine > thr and glutamate > 0:
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// POST → PRE (+): nNOS coupled to NMDA emits NO/BDNF — "your release was effective"
// backward brake to PRE (): strong depolarization → endocannabinoid (DSE)
if Vm > eCB_thr:
retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
// POST → PRE (): "I am over-driven — reduce release"
post_fast_trace *= decay(ms)
// CASE 1 — short-term potentiation: fill slots from private reserve (no dopamine)
// NOT generic fill(): rate is Ca-driven, and the else-branch is the STD consequence
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace),
post_structure.slot_ceiling) // private: spine endosomal reserve
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline) // STD = consequence
// interrupted success (LOCAL: my Ca was climbing toward a tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// CASE 2 — tagging CANDIDATE
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_budget -= pka_cost
dopamine *= decay(ms)
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag // STABLE
post_tag *= decay(hr)
DAY | bAP:
// SOURCE 3 — bAP: depolarization + Ca, amplifies existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
DAY | bAP:
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity,
dend_budget, geometry)
dend_budget -= prop_cost × reached
// interrupted success (LOCAL: my branch was strongly active)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_fast_trace *= decay(300ms)
dend_budget -= branch_Ca_cost
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
dend_fast_trace *= decay(300ms); dend_endurance_need *= decay(min)
refill(dend from astro_lactate[branch] + soma_ship_dend)
ship(dend_budget → post_budget, gap_to(post))
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
dend_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
dend_tag *= decay(hr)
if dend_tag > tag_expiry and dend_budget > translate_cost:
dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
```
---
## SOMA
```
DAY | AP:
threshold = soma_structure.baseline / (1) // baseline strength
× (1 + soma_adaptation)
× neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// interrupted success (LOCAL: nuclear Ca climbing toward CREB)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca() // → plasticity
soma_budget -= nuclear_cost
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
soma_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_tag *= decay(hr); soma_budget -= creb_cost
DAY | NOT_AP:
// bottom-up alignment: suprathreshold input during refractory (LOCAL)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
soma_adaptation *= decay(τ_adapt)
soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_endurance_need *= decay(min)
fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget) // private: own mitochondria, no external cost
branch_Vm = integrate(DEND.branch_Vm, branches)
ship(soma_budget → dend_budget, gap_to(dend))
ship(soma_budget → axon_budget, gap_to(axon))
```
---
## AXON
```
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
if axon_budget < prop_cost:
reliability *= budget_factor
// interrupted success (LOCAL: I was propagating a strong train)
if axon_fast_trace > traj_thr:
axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
axon_fast_trace *= decay(s); axon_endurance_need *= decay(min)
refill(axon from soma_ship_axon + astro_lactate[shaft])
ship(axon_budget → pre_budget, gap_to(pre))
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
axon_possible_tag *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
axon_tag *= decay(hr)
```
---
## ASTRO
```
DAY | CONTINUOUS:
astro_central_budget += glycolysis(glucose)·Δt // root, capped by glucose
// demand-weighted lactate allocation across territory
for each astrosynapse i:
demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand · lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor
astro_central_budget -= astro_lactate[i] × lactate_cost
// per-astrosynapse fast operation (synapse i)
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt
astro_central_budget -= clearance × EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
// interrupted success (LOCAL: I was under high demand)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
astro_Dserine[i] += got; astro_central_budget -= got × Ds_cost
drive_pre[i] *= brake // same signal, PRE brake
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
astro_possible_tag[i] *= decay(s); dopamine *= decay(ms)
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
astro_tag[i] *= decay(hr)
astro_endurance_need[i] *= decay(min)
if astro_fast_trace[i] > overload: trigger(lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
Build ceilings (structure = strength, budget_ceiling = endurance) from DAY evidence.
Two economies (energy: astrocyte→astrosynapse ; material: soma→spine/bouton) compete.
Unmaintained ceilings decay; recovered material funds the rest.
---
## Step 1 — Replenish and distribute
```
NIGHT | 1:
// energy economy (astrocyte central → astrosynapses, tag-weighted)
astro_central_budget += overnight_glycolysis(glucose)·Δt
astro_central_energy += overnight_astro_energy()·Δt
astro_central_material += astro_cellbody_synth()·Δt
W = Σ astro_tag[i] over astro_tag[i] > tag_expiry
for each i with astro_tag[i] > tag_expiry:
w = astro_tag[i]/W
astro_energy[i] += astro_central_energy × w
astro_material[i] += astro_central_material × w
// material economy (soma → branch/axon → spine/bouton)
soma_budget += overnight_mito()·Δt
soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material × f_dend; axon_material += soma_material × f_axon
soma_material -= (f_dend + f_axon)·soma_material
post_material += dend_material × f_spine; dend_material -= f_spine·dend_material
pre_material += axon_material × f_bouton; axon_material -= f_bouton·axon_material
{pre,post,dend,axon}_energy += soma_energy × f_energy[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve × f[·]·Δt
```
## Step 2 — Strength commits (raise structure)
```
NIGHT | 2:
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? bonus : 1
for each component c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy × f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ × assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
// astro_structure self-reinforcing: higher → future LTP easier
```
## Step 2b — Endurance commits (raise budget_ceiling)
```
NIGHT | 2b:
// driven by endurance_need (interrupted local success), NO dopamine
// competes with step 2 for the SAME material + energy
for each component c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material × f_cap, c_energy × f_cap)
c_budget_ceiling += Δ
c_material -= Δ; c_energy -= Δ × biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
```
## Step 3 — Passive decay (both ceilings, by neglect)
```
NIGHT | 3:
remaining = total_material - consumed_by_commits
maint = remaining × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost:
structure += full_maint; budget_ceiling += full_cap_maint
else:
structure += maint × frac; budget_ceiling += maint × cap_frac
// both drift down — depotentiation / endurance-loss by neglect
for each synapse with net_change < 0:
rec = |net_change| × recycle
{pre,post,astro}_material += rec × frac // material recovered, energy not
```
## Step 4 — Homeostatic scaling
```
NIGHT | 4:
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse:
post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction × recycle
```
## Step 5 — Clear traces
```
NIGHT | 5:
all fast_trace = 0; all possible_tag = 0; all endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition; consumes budget; deposits fast_trace.
fast_trace + non-local coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
traces decay in NOT/CONTINUOUS contexts.
NIGHT tag → raise structure
endurance_need → raise budget_ceiling
both draw the SAME material + energy → strength and endurance compete
unmaintained ceilings decay → freed material funds the rest.
LOCALITY every evaluation uses only local state + arrived signals.
cross-compartment influence travels only as signals that become local.
```
@@ -0,0 +1,480 @@
# Tripartite Synapse — Pseudocode v11
> Companion: `tripartite_synapse_v11_biology.md` explains the biology of every variable.
> Changes from v10: each component now carries its own PARAMETERS and EXTERNAL INTERFACE
> blocks; behaviors are organized into functional groups within each context; pool-filling
> primitives return their increment (applied by the caller); the astrocyte no longer writes
> PRE's drive (the spillover brake is PRE reading its own cleft).
---
## Functional groups (the uniform template, applied within each context)
```
RECEIVE take in resources + signals that arrived from outside
BEHAVE the component's defining action
EMIT send out — signals (messages) and resources (shipments) across the boundary
SENSE deposit the fast trace that records the behavior
RECOVER refill own private pools consumed by behaving
EVALUATE judge the behavior — strength (needs dopamine) + endurance (interrupted success)
DECAY let traces recede, closing their windows
```
Groups sit inside the DAY contexts (Option A): execution contexts (AP/bAP/CONTINUOUS) carry
BEHAVE/EMIT/SENSE/endurance-EVALUATE; replenishment contexts (NOT_AP/NOT_bAP) carry
RECEIVE/RECOVER/strength-EVALUATE/DECAY. Not every component uses every group.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS (each component writes, others read)
glutamate PRE → POST, ASTRO forward transmitter; ASTRO clears it
astro_Dserine ASTRO → POST NMDA co-agonist gate
retro_NO POST → PRE (+) "release reached a responsive target"
retro_eCB POST → PRE () DSE: "over-driven, release less"
SHIPMENT CHANNELS (source writes, target reads in its RECEIVE)
soma_ship_dend SOMA→DEND soma_ship_axon SOMA→AXON
dend_ship_post DEND→POST axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve
amount = min(rate, ceiling - pool)·Δt
budget -= amount·cost // intrinsic refill cost
return amount
refill(c from supply S) -> amount: // CONTESTED supply
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε))
S -= demand·factor // consumes shared supply
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // DIRECTED transfer
amount = min(from_budget·frac, demand_sig) // demand_sig = propagated tag
from_budget -= amount·(1 + cost)
return amount // caller writes shipment channel
```
---
## SHARED parameters (organism / physical / universal plasticity machinery)
```
// organism broadcasts (external; arrive as local levels)
dopamine NE ACh
// physical (external)
glucose // vascular energy ceiling — root
geometry // dendritic topology — bAP attenuation
// universal plasticity gates (same mechanism in every component)
elig dop_thr tag_thr tag_expiry // strength: eligibility → tag
traj_thr endur_thr // endurance: interrupted-success → need
// universal NIGHT
decay_rate capacity_decay_rate recycle
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
// decay-time convention: each *= decay(τ) means relax toward 0 with time-constant τ
```
---
---
# DAY
---
## PRE
```
// PARAMETERS (pre)
// K_release half-max Ca²⁺ for release release_cost gate to release
// fusion_cost per unit NT_flux vatpase_cost per unit RRP refilled
// spillover cleft level for autobrake brake autoreceptor factor
//
// EXTERNAL INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE astro_lactate[syn] ← ASTRO (primary fuel) ; axon_ship_pre ← AXON (fuel)
// retro_NO, retro_eCB ← POST (backward messages)
// pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// READ glutamate (own cleft, autobrake) ; dopamine (VTA, gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | AP:
// SENSE
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release or fail
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted local success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local)
if RRP > 0:
NT_flux = RRP × drive
// EMIT
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
pre_budget += refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY
pre_fast_trace *= decay(100ms); pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min); pre_tag *= decay(hr)
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
```
---
## POST
```
// PARAMETERS (post)
// K_AMPA half-max glu for AMPA AMPA_Ca Ca fraction via AMPA
// AMPA_cost NMDA_cost bAP_cost pka_cost traffic_cost req_cost
// Mg_eject Vm to eject Mg block Dserine_thr NMDA co-agonist gate
// Ca_STP fill-slots threshold Ca_TAG tagging threshold
// eCB_thr Vm for endocannabinoid (DSE) drift baseline (STD relaxation)
// NO_synth_cost eCB_synth_cost
//
// EXTERNAL INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND
// post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// READ glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP (via dend_structure.bAP_fidelity)
// dopamine (VTA, stabilizes tag)
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | NOT_bAP:
// RECEIVE
post_budget += refill(post from astro_lactate[syn] + dend_ship_post)
// BEHAVE + SENSE — three Ca sources feed post_fast_trace
a = sat(glutamate, K_AMPA) // SOURCE 1: AMPA
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0: // SOURCE 2: NMDA
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+)
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ()
if Vm > eCB_thr: retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE — STP fill slots (Ca-driven, private reserve); else STD drift (consequence)
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace), post_structure.slot_ceiling)
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline)
// EVALUATE (endurance) — interrupted local success (own Ca climbing toward tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// EVALUATE (strength) — CANDIDATE then STABLE (dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// DECAY
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_tag *= decay(hr); dopamine *= decay(ms)
DAY | bAP:
// BEHAVE + SENSE — SOURCE 3: bAP amplifies an existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
// PARAMETERS (dend)
// prop_cost branch_Ca_cost integrate_cost translate_cost
//
// EXTERNAL INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA
// dend_material, dend_energy ← SOMA(NIGHT)
// READ SOMA.fired (bAP trigger) ; POST.Vm + spine spillover (to integrate)
// dopamine ; ACh (commit-threshold context)
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
DAY | bAP:
// BEHAVE — propagate bAP (may fall short if depleted), integrate spines
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, dend_budget, geometry)
dend_budget -= prop_cost × reached
// EVALUATE (endurance) — propagation cut short while branch strongly active (LOCAL)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
// SENSE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT — propagated bAP to spines; integrated voltage to soma
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// RECEIVE
dend_budget += refill(dend from astro_lactate[branch] + soma_ship_dend)
// EMIT — ship budget downstream to spines (demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// EVALUATE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// BEHAVE — local translation if tagged (fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
// DECAY
dend_fast_trace *= decay(300ms); dend_possible_tag *= decay(s)
dend_endurance_need *= decay(min); dend_tag *= decay(hr)
```
---
## SOMA
```
// PARAMETERS (soma)
// ap_cost nuclear_cost creb_cost mito_output (self-fuel rate)
// inactivation ap_amp ap_contrib base_recovery
// τ_Na τ_adapt τ_nuclear τ_align
//
// EXTERNAL INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE self (mitochondria, ROOT) ; branch_Vm ← DEND
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
DAY | AP:
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE — fire if able
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// EVALUATE (endurance) — fuel cut a firing train approaching CREB (LOCAL)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost // EMIT: fired → AXON, DEND
// SENSE — three traces from one AP
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// EVALUATE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// BEHAVE — bottom-up refractory alignment (suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// RECOVER — recovery rate sped by alignment trace
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// RECEIVE — self-replenish (private root) + integrate input
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
branch_Vm = integrate(DEND.branch_Vm, branches)
// EMIT — ship downstream (demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// DECAY
soma_adaptation *= decay(τ_adapt); soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
soma_tag *= decay(hr); dopamine *= decay(ms)
```
---
## AXON
```
// PARAMETERS (axon)
// prop_cost budget_factor (depleted-propagation penalty)
//
// EXTERNAL INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO
// axon_material, axon_energy ← SOMA(NIGHT)
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
// BEHAVE — propagate (degraded if depleted)
if axon_budget < prop_cost:
reliability *= budget_factor
// EVALUATE (endurance) — propagating a strong train when fuel failed (LOCAL)
if axon_fast_trace > traj_thr: axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT — delivered APs reach boutons
// SENSE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// RECEIVE
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// EMIT — ship budget to boutons (demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// EVALUATE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// DECAY
axon_fast_trace *= decay(s); axon_possible_tag *= decay(s)
axon_endurance_need *= decay(min); axon_tag *= decay(hr)
```
---
## ASTRO
```
// PARAMETERS (astro)
// K_Dserine half-max Ca for D-serine Ds_max Ds_frac Ds_cost
// EAAT_cost per unit glutamate cleared lactate_cost per unit exported
// spillover overflow threshold overload lockdown threshold
//
// EXTERNAL INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// READ glutamate ← PRE (clearance + spillover) ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE — root production, capped by glucose
astro_central_budget += glycolysis(glucose)·Δt
// EMIT — demand-weighted lactate allocation across territory
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE — clear glutamate; supply tonic D-serine
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// SENSE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// BEHAVE + EMIT — D-serine pulse (demand-driven, budget-limited)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// EVALUATE (endurance) — ran out of synthesis under high own demand (LOCAL)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// EVALUATE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
astro_tag[i] *= decay(hr)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
System-wide consolidation (not a per-component DAY cycle). Build ceilings from DAY evidence.
```
NIGHT | 1 REPLENISH & DISTRIBUTE
// energy economy: astrocyte central → astrosynapses (astro_tag-weighted)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
// material economy: soma → branch/axon → spine/bouton
soma_budget += overnight_mito()·Δt; soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material·f_dend; axon_material += soma_material·f_axon; soma_material -= …
post_material += dend_material·f_spine; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·f[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve·f[·]·Δt
NIGHT | 2 STRENGTH COMMITS (raise structure)
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
NIGHT | 2b ENDURANCE COMMITS (raise budget_ceiling) — no dopamine; competes with step 2
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
NIGHT | 3 PASSIVE DECAY (both ceilings, by neglect)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint; budget_ceiling += full_cap_maint
else: structure += maint·frac; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // material recovered, energy not
{pre,post,astro}_material += |net_change|·recycle·frac
NIGHT | 4 HOMEOSTATIC SCALING
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 CLEAR TRACES
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY per context, per component: RECEIVE → BEHAVE/EMIT/SENSE → RECOVER → EVALUATE → DECAY
behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition (refill = contested, fill = private, ship = directed)
fast_trace + dopamine coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
NIGHT tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → freed material funds the rest
LOCAL every evaluation uses only own state + arrived signals; coupling is via channels.
```
@@ -0,0 +1,480 @@
# Tripartite Synapse — Pseudocode v11
> Companion: `tripartite_synapse_v11_biology.md` explains the biology of every variable.
> Changes from v10: each component now carries its own PARAMETERS and EXTERNAL INTERFACE
> blocks; behaviors are organized into functional groups within each context; pool-filling
> primitives return their increment (applied by the caller); the astrocyte no longer writes
> PRE's drive (the spillover brake is PRE reading its own cleft).
---
## Functional groups (the uniform template, applied within each context)
```
RECEIVE take in resources + signals that arrived from outside
BEHAVE the component's defining action
EMIT send out — signals (messages) and resources (shipments) across the boundary
SENSE deposit the fast trace that records the behavior
RECOVER refill own private pools consumed by behaving
EVALUATE judge the behavior — strength (needs dopamine) + endurance (interrupted success)
DECAY let traces recede, closing their windows
```
Groups sit inside the DAY contexts (Option A): execution contexts (AP/bAP/CONTINUOUS) carry
BEHAVE/EMIT/SENSE/endurance-EVALUATE; replenishment contexts (NOT_AP/NOT_bAP) carry
RECEIVE/RECOVER/strength-EVALUATE/DECAY. Not every component uses every group.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS (each component writes, others read)
glutamate PRE → POST, ASTRO forward transmitter; ASTRO clears it
astro_Dserine ASTRO → POST NMDA co-agonist gate
retro_NO POST → PRE (+) "release reached a responsive target"
retro_eCB POST → PRE () DSE: "over-driven, release less"
SHIPMENT CHANNELS (source writes, target reads in its RECEIVE)
soma_ship_dend SOMA→DEND soma_ship_axon SOMA→AXON
dend_ship_post DEND→POST axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve
amount = min(rate, ceiling - pool)·Δt
budget -= amount·cost // intrinsic refill cost
return amount
refill(c from supply S) -> amount: // CONTESTED supply
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε))
S -= demand·factor // consumes shared supply
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // DIRECTED transfer
amount = min(from_budget·frac, demand_sig) // demand_sig = propagated tag
from_budget -= amount·(1 + cost)
return amount // caller writes shipment channel
```
---
## SHARED parameters (organism / physical / universal plasticity machinery)
```
// organism broadcasts (external; arrive as local levels)
dopamine NE ACh
// physical (external)
glucose // vascular energy ceiling — root
geometry // dendritic topology — bAP attenuation
// universal plasticity gates (same mechanism in every component)
elig dop_thr tag_thr tag_expiry // strength: eligibility → tag
traj_thr endur_thr // endurance: interrupted-success → need
// universal NIGHT
decay_rate capacity_decay_rate recycle
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
// decay-time convention: each *= decay(τ) means relax toward 0 with time-constant τ
```
---
---
# DAY
---
## PRE
```
// PARAMETERS (pre)
// K_release half-max Ca²⁺ for release release_cost gate to release
// fusion_cost per unit NT_flux vatpase_cost per unit RRP refilled
// spillover cleft level for autobrake brake autoreceptor factor
//
// EXTERNAL INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE astro_lactate[syn] ← ASTRO (primary fuel) ; axon_ship_pre ← AXON (fuel)
// retro_NO, retro_eCB ← POST (backward messages)
// pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// READ glutamate (own cleft, autobrake) ; dopamine (VTA, gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | AP:
// SENSE
pre_fast_trace += spike_Ca(input_freq)
// BEHAVE — release or fail
if pre_budget < release_cost:
suppress(NT_flux)
// EVALUATE (endurance) — interrupted local success, confirmed by retro_NO
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
drive = sat(pre_fast_trace, K_release) × (1 - retro_eCB_local)
if RRP > 0:
NT_flux = RRP × drive
// EMIT
glutamate += NT_flux·Δt
RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
pre_budget += refill(pre from astro_lactate[syn] + axon_ship_pre)
// RECOVER
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// EVALUATE (strength)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// DECAY
pre_fast_trace *= decay(100ms); pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min); pre_tag *= decay(hr)
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
```
---
## POST
```
// PARAMETERS (post)
// K_AMPA half-max glu for AMPA AMPA_Ca Ca fraction via AMPA
// AMPA_cost NMDA_cost bAP_cost pka_cost traffic_cost req_cost
// Mg_eject Vm to eject Mg block Dserine_thr NMDA co-agonist gate
// Ca_STP fill-slots threshold Ca_TAG tagging threshold
// eCB_thr Vm for endocannabinoid (DSE) drift baseline (STD relaxation)
// NO_synth_cost eCB_synth_cost
//
// EXTERNAL INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND
// post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// READ glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP (via dend_structure.bAP_fidelity)
// dopamine (VTA, stabilizes tag)
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | NOT_bAP:
// RECEIVE
post_budget += refill(post from astro_lactate[syn] + dend_ship_post)
// BEHAVE + SENSE — three Ca sources feed post_fast_trace
a = sat(glutamate, K_AMPA) // SOURCE 1: AMPA
AMPA_current = a × AMPA_surface; Vm += AMPA_current
post_fast_trace += AMPA_Ca·AMPA_current; post_budget -= AMPA_cost
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0: // SOURCE 2: NMDA
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+)
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ()
if Vm > eCB_thr: retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE — STP fill slots (Ca-driven, private reserve); else STD drift (consequence)
if post_fast_trace > Ca_STP:
AMPA_surface = min(AMPA_surface + Ca_insert(post_fast_trace), post_structure.slot_ceiling)
post_budget -= traffic_cost
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline)
// EVALUATE (endurance) — interrupted local success (own Ca climbing toward tag)
if post_budget < req_cost and post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
// EVALUATE (strength) — CANDIDATE then STABLE (dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace
post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// DECAY
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_tag *= decay(hr); dopamine *= decay(ms)
DAY | bAP:
// BEHAVE + SENSE — SOURCE 3: bAP amplifies an existing signal
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
// PARAMETERS (dend)
// prop_cost branch_Ca_cost integrate_cost translate_cost
//
// EXTERNAL INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA
// dend_material, dend_energy ← SOMA(NIGHT)
// READ SOMA.fired (bAP trigger) ; POST.Vm + spine spillover (to integrate)
// dopamine ; ACh (commit-threshold context)
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
DAY | bAP:
// BEHAVE — propagate bAP (may fall short if depleted), integrate spines
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, dend_budget, geometry)
dend_budget -= prop_cost × reached
// EVALUATE (endurance) — propagation cut short while branch strongly active (LOCAL)
if reached < full and dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
// SENSE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT — propagated bAP to spines; integrated voltage to soma
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// RECEIVE
dend_budget += refill(dend from astro_lactate[branch] + soma_ship_dend)
// EMIT — ship budget downstream to spines (demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// EVALUATE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// BEHAVE — local translation if tagged (fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
commit_threshold *= 1/(1 + ACh·gain)
// DECAY
dend_fast_trace *= decay(300ms); dend_possible_tag *= decay(s)
dend_endurance_need *= decay(min); dend_tag *= decay(hr)
```
---
## SOMA
```
// PARAMETERS (soma)
// ap_cost nuclear_cost creb_cost mito_output (self-fuel rate)
// inactivation ap_amp ap_contrib base_recovery
// τ_Na τ_adapt τ_nuclear τ_align
//
// EXTERNAL INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE self (mitochondria, ROOT) ; branch_Vm ← DEND
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
DAY | AP:
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE — fire if able
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// EVALUATE (endurance) — fuel cut a firing train approaching CREB (LOCAL)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
fired = True; soma_budget -= ap_cost // EMIT: fired → AXON, DEND
// SENSE — three traces from one AP
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// EVALUATE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// BEHAVE — bottom-up refractory alignment (suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// RECOVER — recovery rate sped by alignment trace
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// RECEIVE — self-replenish (private root) + integrate input
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
branch_Vm = integrate(DEND.branch_Vm, branches)
// EMIT — ship downstream (demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// DECAY
soma_adaptation *= decay(τ_adapt); soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
soma_tag *= decay(hr); dopamine *= decay(ms)
```
---
## AXON
```
// PARAMETERS (axon)
// prop_cost budget_factor (depleted-propagation penalty)
//
// EXTERNAL INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO
// axon_material, axon_energy ← SOMA(NIGHT)
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
DAY | AP:
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace))
// BEHAVE — propagate (degraded if depleted)
if axon_budget < prop_cost:
reliability *= budget_factor
// EVALUATE (endurance) — propagating a strong train when fuel failed (LOCAL)
if axon_fast_trace > traj_thr: axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT — delivered APs reach boutons
// SENSE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// RECEIVE
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// EMIT — ship budget to boutons (demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// EVALUATE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// DECAY
axon_fast_trace *= decay(s); axon_possible_tag *= decay(s)
axon_endurance_need *= decay(min); axon_tag *= decay(hr)
```
---
## ASTRO
```
// PARAMETERS (astro)
// K_Dserine half-max Ca for D-serine Ds_max Ds_frac Ds_cost
// EAAT_cost per unit glutamate cleared lactate_cost per unit exported
// spillover overflow threshold overload lockdown threshold
//
// EXTERNAL INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// READ glutamate ← PRE (clearance + spillover) ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE — root production, capped by glucose
astro_central_budget += glycolysis(glucose)·Δt
// EMIT — demand-weighted lactate allocation across territory
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE — clear glutamate; supply tonic D-serine
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// SENSE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// BEHAVE + EMIT — D-serine pulse (demand-driven, budget-limited)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// EVALUATE (endurance) — ran out of synthesis under high own demand (LOCAL)
if got < want and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// EVALUATE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
astro_tag[i] *= decay(hr)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
System-wide consolidation (not a per-component DAY cycle). Build ceilings from DAY evidence.
```
NIGHT | 1 REPLENISH & DISTRIBUTE
// energy economy: astrocyte central → astrosynapses (astro_tag-weighted)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
// material economy: soma → branch/axon → spine/bouton
soma_budget += overnight_mito()·Δt; soma_energy += overnight_soma_energy()·Δt
soma_material += CREB_synth(soma_tag)·Δt // bottleneck
dend_material += soma_material·f_dend; axon_material += soma_material·f_axon; soma_material -= …
post_material += dend_material·f_spine; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·f[·]
{pre,post,dend,axon}_budget += astro_lactate_reserve·f[·]·Δt
NIGHT | 2 STRENGTH COMMITS (raise structure)
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost
if Δ < slot_cost: queue(c_strength_deficit → next NIGHT)
NIGHT | 2b ENDURANCE COMMITS (raise budget_ceiling) — no dopamine; competes with step 2
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost
if Δ < cap_cost: queue(c_endurance_deficit → next NIGHT)
NIGHT | 3 PASSIVE DECAY (both ceilings, by neglect)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse:
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint; budget_ceiling += full_cap_maint
else: structure += maint·frac; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // material recovered, energy not
{pre,post,astro}_material += |net_change|·recycle·frac
NIGHT | 4 HOMEOSTATIC SCALING
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 CLEAR TRACES
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
DAY per context, per component: RECEIVE → BEHAVE/EMIT/SENSE → RECOVER → EVALUATE → DECAY
behavior runs within structure (strength) and budget_ceiling (endurance),
both filled by competition (refill = contested, fill = private, ship = directed)
fast_trace + dopamine coincidence → tag (strength evidence)
depletion + interrupted LOCAL success → endurance_need (endurance evidence)
NIGHT tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → freed material funds the rest
LOCAL every evaluation uses only own state + arrived signals; coupling is via channels.
```
@@ -0,0 +1,535 @@
# Tripartite Synapse — Pseudocode v13
> Companion: `tripartite_synapse_v13_biology.md`.
> Changes from v12:
> (1) per-spike calcium deposit (frequency stays emergent, not a parameter)
> (2) BEHAVE splits FUEL shortfall (→ endurance) from OCCUPANCY shortfall (→ STD)
> (3) endurance feedback term only where a retrograde signal actually arrives
> (4) TRACE absorbs EVALUATE → seven-group grammar
> (5) parameter declarations completed (ship_cost, ACh_gain, NIGHT block)
> (6) shipment is a transit-delayed flow; every flow has a timescale
> (7) all group labels are standalone headers at one column
---
## Functional groups (seven-group grammar)
```
RECEIVE take in resources + signals that arrived from outside (boundary: in)
TRACE maintain the trace hierarchy — deposit fast trace; accumulate
possible_tag + endurance_need; stabilize tag on coincidence
ADJUST compute local operating parameters from structure + traces + modulators
BEHAVE the component's defining action, within both ceilings
EMIT send out — signals (messages) + resources (shipments) (boundary: out)
RECOVER refill own private pools consumed by behaving
DECAY let traces recede, closing their windows
```
EVALUATE merged into TRACE: judging a behavior is always maintaining a trace, whether or not
a trace is written. BEHAVE and EMIT stay separate — EMIT is the output half of the locality
interface (RECEIVE/EMIT are the only boundary crossings). TRACE spans all timescales: the
soma's inactivation, adaptation, and nuclear-Ca deposits are all TRACE. Order within a context
follows data dependencies; TRACE reads/writes whatever trace state is current.
EVERY FLOW HAS A TIMESCALE. Decay relaxes toward 0 over τ; creation/arrival relaxes toward a
target over τ — the same first-order operator. Within-step writes are the special case τ ≪ Δt.
Rate-limited inflows (fill/refill/flux·Δt) carry their τ implicitly; shipment carries an
explicit transit delay (see `transit`).
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS SHIPMENT CHANNELS (transit-delayed)
glutamate PRE → POST, ASTRO soma_ship_dend SOMA→DEND
astro_Dserine ASTRO → POST soma_ship_axon SOMA→AXON
retro_NO POST → PRE (+) dend_ship_post DEND→POST
retro_eCB POST → PRE () axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve, rate-limited (implicit τ)
amount = min(rate, ceiling - pool)·Δt; budget -= amount·cost; return amount
refill(c from supply S) -> amount: // CONTESTED supply, gap-bounded
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε)); S -= demand·factor
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // emit into transit (not to target directly)
amount = min(from_budget·frac, demand_sig); from_budget -= amount·(1+ship_cost); return amount
transit(channel, τ_transport) -> arrival: // delivers in-transit cargo over τ
arrival = channel·(Δt/τ_transport); channel -= arrival; return arrival
```
---
## SHARED parameters
```
dopamine NE ACh // organism broadcasts (external)
glucose geometry // physical (external)
elig dop_thr tag_thr tag_expiry // strength gates (universal)
traj_thr endur_thr // endurance gates (universal)
ship_cost // transport overhead (all shipments)
τ_transport_{dend,axon,spine,bouton} // shipment transit times (distance-dependent)
ε
```
## NIGHT parameters (consolidation only)
```
slot_cost cap_cost f_cap // commit sizes / endurance fraction
maint_frac cap_frac // maintenance allocation
decay_rate capacity_decay_rate recycle // passive decay + recovery
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
f_dend f_axon f_spine f_bouton // material distribution fractions
{dend,axon,pre,post}_ship_frac // DAY shipment fractions
{dend,axon,pre,post}_energy_frac // energy distribution fractions
```
---
---
# DAY
---
## PRE
The presynaptic bouton releases neurotransmitter and gathers evidence about whether that
release was worth strengthening and worth sustaining. Its behavior unfolds across two DAY
contexts and the NIGHT scope.
**During DAY, during AP — the bouton releases neurotransmitter.** The amount released depends on
residual **calcium** from recent spikes (the fast trace, setting the drive), the current
**VGCC coupling occupancy** (how tightly calcium channels are coupled to docking slots right
now — filled short-term, bounded by structure), the two **retrograde messages** from the
postsynapse (`retro_eCB` brakes the drive; `retro_NO` will confirm release reached a responsive
target), and the availability of both **fuel and vesicles**. Two shortfalls are read
differently: a fuel shortfall on a succeeding release is evidence the bouton needs more
*endurance*; an empty pool with fuel to spare is ordinary short-term depression.
**During DAY, during NOT_AP — the bouton consolidates, potentiates short-term, and recovers.**
With no spike to release, it latches the retrograde messages (RECEIVE); maintains its traces —
accumulating eligibility toward a dopamine-gated tag (TRACE); transiently tightens its VGCC
coupling from accumulated eligibility, with no dopamine, a reversible short-term potentiation
bounded by the structural ceiling (BEHAVE); refills both its budget (contested supply) and its
vesicle pool (private reserve) (RECOVER); and lets its traces decay, closing the windows (DECAY).
**During NIGHT — the bouton's ceilings are rewritten.** NIGHT raises the bouton's **structure**
(active-zone capacity, including the VGCC-coupling ceiling) where a validated tag accumulated,
and its **budget capacity** (mitochondrial endurance) where fuel repeatedly interrupted a
succeeding release. Both draw on the same finite material and energy shipped down the axon, so
the two kinds of growth compete — and whatever is not maintained drifts back down.
```
// PARAMETERS K_release · release_cost · fusion_cost · vatpase_cost · spillover · brake
// stp_thr · coupling_gain · coupling_drift · VGCC_baseline
// INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE retro_NO, retro_eCB ← POST (signals latched; resources refill in RECOVER)
// READ glutamate (own cleft, autobrake) ; dopamine (gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// VGCC_active (occupancy: current coupling, filled toward VGCC_coupling ceiling)
// SUPPLY astro_lactate[syn] ← ASTRO ; axon_ship_pre ← AXON ; pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// EMERGENCY shockwave_lockdown ← ASTRO
DAY | AP:
// TRACE (Ca²⁺ bolus from THIS spike — also drives release; frequency is emergent)
pre_fast_trace += spike_Ca(pre_structure.VGCC_coupling)
// ADJUST (release drive from residual Ca²⁺ × current coupling occupancy, + DSE brake)
drive = sat(pre_fast_trace × VGCC_active, K_release) × (1 - retro_eCB_local)
// BEHAVE (release; two distinct failure modes)
if pre_budget < release_cost:
// FUEL shortfall → endurance evidence (retro_NO-confirmed local success)
suppress(NT_flux)
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)
exit
if RRP == 0:
// OCCUPANCY shortfall → short-term depression (NOT endurance; fuel was fine)
suppress(NT_flux)
exit
NT_flux = RRP × drive; RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
// EMIT (glutamate into cleft)
glutamate += NT_flux·Δt
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE (latch backward messages — signals only)
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
// TRACE (strength: eligibility → tag via dopamine)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag
// BEHAVE (short-term potentiation: eligibility tightens coupling, NO dopamine; drifts back)
if pre_possible_tag > stp_thr:
VGCC_active = min(VGCC_active + coupling_gain × pre_possible_tag, pre_structure.VGCC_coupling)
else:
VGCC_active = max(VGCC_active - coupling_drift·Δt, VGCC_baseline) // STD = consequence
// RECOVER (refill BOTH pools: contested budget + private RRP)
pre_budget += refill(pre from astro_lactate[syn] + transit(axon_ship_pre, τ_transport_bouton))
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// DECAY
pre_fast_trace *= decay(100ms); pre_possible_tag *= decay(s)
pre_endurance_need *= decay(min); pre_tag *= decay(hr)
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
```
---
## POST
```
// PARAMETERS K_AMPA · AMPA_Ca · AMPA_cost · NMDA_cost · bAP_cost · pka_cost · traffic_cost
// req_cost · Mg_eject · Dserine_thr · Ca_STP · Ca_TAG · eCB_thr · drift · baseline
// NO_synth_cost · eCB_synth_cost
// INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND ; post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// READ glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP (dend_structure.bAP_fidelity) ; dopamine
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// EMERGENCY shockwave_lockdown ← ASTRO
// NOTE POST endurance is own-state only (own Ca climbing); no arrived feedback term.
DAY | NOT_bAP:
// RECEIVE
post_budget += refill(post from astro_lactate[syn] + transit(dend_ship_post, τ_transport_spine))
// ADJUST (AMPA drive from arrived glutamate)
a = sat(glutamate, K_AMPA)
// BEHAVE (SOURCE 1 AMPA: current + small Ca + begins Mg ejection)
AMPA_current = a × AMPA_surface; Vm += AMPA_current; post_budget -= AMPA_cost
// TRACE (Ca deposited by AMPA)
post_fast_trace += AMPA_Ca·AMPA_current
// BEHAVE (SOURCE 2 NMDA: large Ca on local coincidence)
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0:
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+ NO/BDNF: "release reached a responsive target")
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ( endocannabinoid / DSE when over-driven)
if Vm > eCB_thr:
retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE (STP fill slots from private reserve ; else STD drift = consequence)
if post_fast_trace > Ca_STP:
if post_budget < traffic_cost:
// FUEL shortfall → endurance (own Ca was climbing toward a tag)
if post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
else if AMPA_surface < post_structure.slot_ceiling:
AMPA_surface += Ca_insert(post_fast_trace); post_budget -= traffic_cost
// else: surface already at slot_ceiling → structure-limited (not endurance)
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline) // STD = consequence
// TRACE (strength: CANDIDATE then STABLE via dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace; post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// DECAY
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
post_tag *= decay(hr); dopamine *= decay(ms)
DAY | bAP:
// BEHAVE (SOURCE 3 bAP: depolarization + Ca, amplifies existing signal)
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
// TRACE (supralinear boost only if a CANDIDATE is present)
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
```
// PARAMETERS prop_cost · branch_Ca_cost · integrate_cost · translate_cost · ACh_gain
// INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA ; dend_material, dend_energy ← SOMA(NIGHT)
// READ SOMA.fired ; POST.Vm + spine spillover ; dopamine ; ACh
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
// NOTE DEND endurance fires only on FUEL-limited propagation, not structural attenuation;
// own-state proxy (strong branch activity); no arrived feedback term.
DAY | bAP:
// ADJUST (propagation strength from structure — inside propagate())
// BEHAVE (propagate bAP; distinguish fuel-limited vs structure-limited shortfall)
if dend_budget < prop_cost:
// FUEL shortfall → endurance (branch was strongly active)
if dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
bAP_local, reached = propagate_partial(dend_budget)
else:
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, geometry)
// reached < full here is structural attenuation (distance), NOT endurance
dend_budget -= prop_cost × reached
// TRACE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT (integrated voltage to soma ; propagated bAP already reached spines)
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// RECEIVE
dend_budget += refill(dend from astro_lactate[branch] + transit(soma_ship_dend, τ_transport_dend))
// TRACE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// ADJUST (commit threshold lowered by attention)
commit_threshold *= 1/(1 + ACh·ACh_gain)
// EMIT (ship budget to spines; demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// BEHAVE (local translation if tagged — fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
// DECAY
dend_fast_trace *= decay(300ms); dend_possible_tag *= decay(s)
dend_endurance_need *= decay(min); dend_tag *= decay(hr)
```
---
## SOMA
```
// PARAMETERS ap_cost · nuclear_cost · creb_cost · mito_output · inactivation · ap_amp · ap_contrib
// base_recovery · τ_Na · τ_adapt · τ_nuclear · τ_align
// INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE self (mitochondria, ROOT) ; branch_Vm ← DEND
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
// NOTE SOMA endurance fires only on FUEL shortfall (budget < ap_cost);
// refractory / sub-threshold are timing limits, not endurance. Own-state proxy.
DAY | AP:
// ADJUST (threshold from structure + adaptation + neuromodulators ; refractory gate)
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE (fire if able)
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// FUEL shortfall → endurance (firing was approaching CREB)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
// EMIT (fired → AXON, DEND)
fired = True; soma_budget -= ap_cost
// TRACE (three traces from one AP — all timescales)
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// TRACE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// RECEIVE (self-replenish from private root ; integrate input)
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
branch_Vm = integrate(DEND.branch_Vm, branches)
// TRACE (bottom-up refractory alignment: suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// EMIT (ship downstream into transit; demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// RECOVER (inactivation recovery sped by alignment trace → emergent refractory)
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// DECAY
soma_adaptation *= decay(τ_adapt); soma_fast_trace *= decay(τ_nuclear)
soma_refractory_alignment *= decay(τ_align) // self-limiting
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
soma_tag *= decay(hr); dopamine *= decay(ms)
```
---
## AXON
```
// PARAMETERS prop_cost · budget_factor
// INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO ; axon_material, axon_energy ← SOMA(NIGHT)
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
// NOTE AXON endurance fires only on FUEL shortfall; load-driven failure fail(fast_trace)
// is axonal STD (a consequence), not endurance. Own-state proxy.
DAY | AP:
// ADJUST (reliability from structure load-driven failure)
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace)) // fail() = STD, not endurance
// BEHAVE (propagate; FUEL shortfall degrades + flags endurance)
if axon_budget < prop_cost:
reliability *= budget_factor
if axon_fast_trace > traj_thr: // FUEL-limited → endurance
axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT (delivered APs reach boutons)
// TRACE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// RECEIVE
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// TRACE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// EMIT (ship to boutons; demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// DECAY
axon_fast_trace *= decay(s); axon_possible_tag *= decay(s)
axon_endurance_need *= decay(min); axon_tag *= decay(hr)
```
---
## ASTRO
```
// PARAMETERS K_Dserine · Ds_max · Ds_frac · Ds_cost · EAAT_cost · lactate_cost · spillover · overload
// INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// READ glutamate ← PRE (clearance + spillover) ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// NOTE ASTRO endurance fires on BUDGET-limited synthesis (got<want via low budget);
// material/precursor-limited synthesis is a material limit, not endurance. Own-state proxy.
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE (root production, capped by glucose)
astro_central_budget += glycolysis(glucose)·Δt
// ADJUST (demand weights across territory)
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
// EMIT (demand-weighted lactate to all components)
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE (clear glutamate ; supply tonic D-serine)
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// TRACE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// ADJUST (D-serine demand from spillover)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
// BEHAVE + EMIT (D-serine pulse to POST gate)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// TRACE (endurance: BUDGET-limited synthesis under high own demand)
if got < want and astro_central_budget low and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// TRACE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min); astro_tag[i] *= decay(hr)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
Same grammar on ceilings, once per cycle.
```
NIGHT | 1 RECEIVE + ADJUST + EMIT (replenish, weight, distribute)
// RECEIVE overnight production at roots (capped by glucose; gated by soma_tag)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
soma_{budget,energy} += overnight_*()·Δt ; soma_material += CREB_synth(soma_tag)·Δt
// ADJUST tag-weighted shares
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
// EMIT distribute material + energy down the supply chains
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
dend_material += soma_material·f_dend ; axon_material += soma_material·f_axon ; soma_material -= …
post_material += dend_material·f_spine ; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·{·}_energy_frac
{pre,post,dend,axon}_budget += astro_lactate_reserve·{·}_frac·Δt
NIGHT | 2 TRACE + BEHAVE (strength commits → raise structure)
// ADJUST coherence bonus when pre, post, astro tags align
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
// TRACE+BEHAVE build structure for tagged components
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f_cap)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost; if Δ < slot_cost: queue(→ next NIGHT)
NIGHT | 2b TRACE + BEHAVE (endurance commits → raise budget_ceiling ; no dopamine ; competes w/ 2)
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost; if Δ<cap_cost: queue
NIGHT | 3 DECAY + RECOVER (both ceilings decay by neglect ; material recovered)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse: // DECAY
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint ; budget_ceiling += full_cap_maint
else: structure += maint·frac ; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // RECOVER
{pre,post,astro}_material += |net_change|·recycle·frac // material recovered, energy not
NIGHT | 4 BEHAVE (homeostatic scaling)
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s ; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 DECAY (clear traces)
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
SEVEN-GROUP GRAMMAR, TWO TIMESCALES
RECEIVE · TRACE · ADJUST · BEHAVE · EMIT · RECOVER · DECAY
DAY grammar on OCCUPANCY within two ceilings (structure=strength, budget_ceiling=endurance)
TRACE yields two evidence streams from local state + arrived signals:
fast_trace + dopamine → tag (strength)
FUEL shortfall + interrupted LOCAL success → endurance_need (endurance)
OCCUPANCY/structure/timing shortfalls → short-term depression (NOT endurance)
NIGHT same grammar on the CEILINGS:
tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → recovered material funds the rest
FLOWS every flow has a timescale: decay relaxes toward 0 over τ, arrival toward a target
over τ; shipment is transit-delayed; rate-limited inflows carry τ implicitly.
LOCAL every group uses only own state + arrived signals; RECEIVE/EMIT are the only crossings.
```
@@ -0,0 +1,372 @@
# Logic Principles of the Tripartite Synapse Model
These are the principles that govern the system's logic — not the syntax in which it is
expressed, but the reasoning that shapes every variable, every behavior, and every
transition. They are organized into ten categories, from the most foundational to the
most emergent. The final category shows how principles that are stated entirely in local
terms necessarily produce a holistic system — a whole that no part represents but that
every part participates in.
---
## I. Resource and Conservation
**Nothing is free.** Every behavior consumes a resource. There is no operation in the
system that does not draw something down. This is not a constraint added on top of the
logic — it is the foundation. Selectivity, competition, and forgetting all emerge from
the single fact that resources are finite.
**Resources are redistributed, not created.** The total pool is bounded by an external
ceiling. Within it, the system only moves resources around — from one synapse to another,
from a dismantled structure back into the pool. No internal process manufactures capacity;
it only reallocates. Learning is therefore always at the expense of something else.
**Two distinct resources, two distinct conservation laws.** Energy is a flow — consumed
and replenished continuously, gone after use. Material is a stock — incorporated into
structures and recovered when structures are dismantled. They have different sources,
different timescales, and different recovery dynamics. A behavior can be energetically
affordable yet materially limited, or vice versa. Conflating them would destroy both
conservation laws; keeping them separate is what makes resource accounting honest.
**Every economy has a single capped root.** Each resource traces back to one producer
with a hard ceiling — the astrocyte cell body for synaptic energy, the soma for neuronal
material. Everything downstream competes for shares of that capped production. The ceiling
is the ultimate arbiter of how much the system can do, and it is set outside the system.
**Conservation makes one synapse's gain another's loss.** Because resources are shared and
finite, strengthening one site necessarily reduces what is available elsewhere. This
coupling is not designed — it is the automatic consequence of drawing from a common pool.
Depression at one synapse returns resources that partially fund potentiation at another.
---
## II. Time and Scope
**Behavior and structural change occupy separate scopes.** Fast behavior happens in DAY;
permanent change happens in NIGHT. This separation prevents transient activity from
directly rewriting architecture — otherwise every noise spike would remodel the system.
The scope boundary is what makes the system both responsive and stable.
**DAY accumulates evidence; NIGHT acts on it.** No permanent decision is made in the
moment. DAY only gathers traces. NIGHT reads the aggregated evidence and commits. The
system always defers commitment to a consolidation phase that operates on accumulated
evidence, never on a single instant.
**Timescale is meaning.** Fast traces decay in milliseconds, tags in hours, structures
over days. The decay constant of a variable is not a parameter — it is what the variable
means. A fast-decaying variable is a momentary signal; a slow-decaying one is a
commitment. Putting two timescales in one variable destroys both meanings — which is why
every quantity that carries both a momentary and a lasting role must be split into two
variables with two decay constants.
**Time windows are enforced by chemistry, not by clocks.** The system never checks a
timer. Coincidence windows emerge from the competition between accumulation and decay. A
signal must arrive while a trace is still elevated; the window opens when the trace crosses
threshold and closes when it decays below it. Timing is a consequence of dynamics, never
an explicit rule.
**The rest period is the execution window.** DAY fills the system with evidence but
commits nothing. NIGHT executes — writing structure and budget capacity, replenishing
pools, clearing traces. Neither scope alone suffices: DAY without NIGHT produces learning
that cannot consolidate; NIGHT without DAY produces replenishment with nothing to
consolidate. The alternation is not incidental — it is architectural.
---
## III. Capacity and Occupancy
**NIGHT builds containers; DAY fills them.** Every slow variable is a capacity — a ceiling
on what behavior can achieve. NIGHT changes the ceiling; DAY operates within it. The two
never do each other's job: NIGHT never places a receptor, DAY never builds a slot. This
single principle organizes the entire architecture.
**Short-term change is occupancy; long-term change is capacity.** Filling a container is
fast and reversible; resizing it is slow and persistent. The same physical quantity —
receptor count, vesicle count, fuel level — has a fast component (how full) and a slow
component (how big), governed by entirely different processes at entirely different scopes.
**Two capacities, two drives, one pool.** Structure is the capacity for strength — how
powerfully each behavior can act. Budget capacity is the capacity for endurance — how long
behavior can be sustained. Both are ceilings built at NIGHT and filled competitively at
DAY. Both draw from the same finite material and energy, so strength and endurance compete:
investing endurance somewhere cannot strengthen elsewhere.
**A ceiling is never free, even during DAY.** Building a ceiling at NIGHT costs material
and energy; filling it at DAY costs a competitive share of a shared resource. Structure
must be filled by winning occupancy; budget capacity must be filled by winning shared fuel.
A high ceiling of either kind makes a large standing claim that the component can satisfy
only if it out-competes its neighbors. Capacity that cannot be filled is capacity wasted.
**Structure shapes form, not just maximum.** Structure does not merely set a ceiling — it
shapes the transfer function between input and output at every moment. Tightly clustered
calcium channels make each spike more reliably coupled to release; more anchoring slots
make each glutamate pulse more faithfully converted to current; tonic D-serine keeps the
gate chronically primed. The architecture conditions the quality of behavior continuously,
not just its peak.
---
## IV. The Timescale Ladder
This is the spine the other principles hang from. The system's quantities occupy four nested
tiers, and timescale is not incidental to them — it *is* what distinguishes them.
**Four tiers, by timescale.** FAST traces (milliseconds to seconds) — the residual calcium, the
synaptic current, the immediate response. MEDIUM occupancy and evidence (seconds to minutes) —
the filled receptor surface and channel coupling, the accumulating possible-tag, the endurance
need. The SLOW tag (hours) — the validated bridge to consolidation. PERSISTENT capacity
(written only at NIGHT, drifting over days) — the structure and budget ceilings. Each tier
decays on its own timescale, and that decay constant is the tier's meaning: a fast-decaying
quantity is a momentary signal, a slow one a commitment, and a non-decaying one a capacity.
**The tiers are a ladder, not just four speeds.** Each rung's output is the next rung's input,
and the coupling runs in two directions at once.
**Capacity flows downward — each slower tier sets the ceiling for the faster one below it.**
Persistent structure bounds how far medium occupancy can fill; medium occupancy (current
coupling, current receptor surface) bounds how strongly fast behavior can act. A behavior never
acts beyond the occupancy currently filled, and occupancy never fills beyond the structure built
last night. The ceiling at every level was set by the level above, on a slower timescale.
**Evidence flows upward — each faster tier accumulates toward the slower one above it.** Fast
traces accumulate into medium evidence (possible-tag and endurance-need); medium evidence
bridges, on coincidence with validation, into the slow tag; the slow tag commits, at NIGHT, into
persistent capacity. Each tier is the evidence from which the next slower tier is built, and
nothing reaches a slower tier without having accumulated through the faster ones first.
**Both pathways are instances of the climb.** The strength pathway (fast trace → medium
possible-tag → slow tag → persistent structure) and the endurance pathway (fast trace → medium
endurance-need → persistent budget ceiling) are the same upward flow of evidence, differing only
in what validates the climb — associative dopamine for strength, homeostatic fuel-shortfall for
endurance. And both ceilings they build then flow back downward as the bounds the next day's
behavior runs within.
**This single image contains the model's whole logic.** Capacity-versus-occupancy is the
downward flow; the two evidence streams are the upward flow; the DAY/NIGHT split is just where
the ladder is climbed (evidence accumulates by DAY) versus where it is committed (capacity is
written at NIGHT). The functional groups enact the ladder: ADJUST and BEHAVE read capacity
downward, TRACE accumulates evidence upward, and NIGHT commits the top of the upward flow into
the source of the downward flow. To understand the system is to see that it is a four-rung ladder
with capacity descending and evidence ascending, turning once per DAY/NIGHT cycle.
**The ladder governs pools as well as traces — and a pool's recovery timescale is what its
exhaustion means.** Each tier has a depletion process, a recovery process, and a failure meaning,
and the three are bound together by the tier's timescale. *Fast* pools (the readily-releasable
vesicle pool) deplete and recover fast, so their shortfall is transient — short-term depression,
self-correcting within a second once activity slows. *Medium* pools (the operational budget)
deplete and recover at the medium scale, so their shortfall is a standing constraint, not
instantly self-correcting — which is exactly why it is worth recording as endurance evidence.
*Persistent* capacity (structure) changes only at NIGHT, so its "shortfall" is a structural limit
that cannot be fixed in DAY at all. The recovery timescale of a pool therefore determines what
kind of thing its exhaustion *is*: a passing inconvenience, a standing problem worth consolidating
against, or a hard ceiling. This is the same "timescale = meaning" principle that governs traces,
now applied to pools — and it is why the model can read a behavior's failure mode off which pool
ran dry: fast-pool exhaustion is STD, medium-pool exhaustion is endurance evidence, persistent-pool
limit is structural. Depletion and recovery are the pool-side mirror of creation and decay: a pool
is drawn down by behaving and refilled toward its ceiling, just as a trace is deposited by behaving
and relaxes toward zero, and in both cases the timescale is the meaning.
---
## V. Locality
**Only local evaluation.** Every decision a component makes — to act, to deposit a trace,
to register an interrupted success — uses only information physically present in that
component. A component cannot read another compartment's internal state. The presynapse
does not know the postsynapse's calcium; the dendrite does not know which distal spines are
active; the astrosynapse does not know whether the postsynapse is waiting. Each judges from
its own state alone.
**Cross-compartment influence travels only as signals that arrive and become local.**
Information crosses a boundary only by being sent — feedforward transmission, retrograde
messengers, neuromodulatory broadcast. A signal in transit is invisible; a signal that has
arrived is local and can be read. The presynapse can incorporate downstream success only
through the portion the postsynapse chose to release as a retrograde messenger, and only
after it landed. Downstream reaches upstream by emitting; upstream never reaches into
downstream.
**Each component's notion of success is its own.** Because evaluation is local, "was my
interrupted behavior worth sustaining" is answered by the component's own activity —
was I working hard and effectively from my own point of view — optionally amplified by
feedback that has arrived. The local proxy differs by component (strong release for the
presynapse, climbing calcium for the postsynapse, strong propagation for the axon) but the
shape is identical everywhere: my own vigorous, effective activity, plus whatever feedback
reached me.
---
## VI. Validation and Non-Locality
**Short-term change is local; long-term change is non-local.** A component can transiently
strengthen from its own activity alone — occupancy rises with calcium, no permission needed.
But permanent change requires validation from beyond itself. Cheap reversible change is
autonomous; expensive permanent change requires external authorization.
**Permanent change requires coincidence across spatial scales.** A tag forms only when a
local eligibility signal meets one or more non-local confirmations that have arrived as
signals. The number of required coincidences reflects the component's position in the
hierarchy — the postsynapse, the primary memory locus, requires three (astrosynapse,
soma, organism). Each scale confirms something the previous scale cannot know about itself.
**The whole validates the part; the part cannot validate itself.** A synapse cannot know
whether its activity was behaviorally significant — that information exists only at the
organism level and arrives as the neuromodulatory broadcast. This is why the system is
open: the highest validation enters from outside any component being modified, carried
inward as a signal that becomes local at the point of use.
**Strength is associative; endurance is homeostatic.** Strength requires significance —
the dopamine coincidence that says "this was worth saving." Endurance requires only that
fuel, not structure or significance, was the binding constraint on a forming success — it
needs no validation, because metabolic sustainability is not the organism's to judge. A
component earns strength by completing validated coincidences and earns endurance by
running out of fuel at the verge of its own local success.
---
## VII. Selection and Asymmetry
**Potentiation is the active drive; depotentiation is its shadow.** The entire machinery
is oriented toward strengthening what is significant and sustaining what is fuel-limited.
There is no symmetric machinery for weakening. Weakening happens to whatever the building
machinery did not select, as a consequence of the resources building consumed. The system
is built to learn; forgetting is the cost of learning.
**Depression is never explicit — it is what happens when building does not.** No signal
says "weaken this." Ceilings of both kinds decay continuously and are held up only by
maintenance. When building consumes the shared resources, unmaintained ceilings drift down.
Depression is the absence of maintenance, not the presence of a depression signal — and the
same is true of lost endurance, which is idle metabolic capacity removed for lack of use.
**Selection requires winning on multiple independent criteria.** To be permanently
strengthened a synapse must be both active enough to be fueled and significant enough to be
validated — independent gates. To be sustainable it must additionally earn endurance where
fuel was the limit. Activity without significance is not saved; significance without
sustainable activity cannot be maintained. The conjunction filters for connections that are
genuinely valuable and genuinely viable.
**Equilibrium is the residual of imperfection.** Where alignment or balance is achieved,
the very success removes the signal that drove it, allowing slow drift back toward
imbalance, which regenerates the driving signal. The soma that aligns to its input rhythm
stops generating the mismatch that aligned it, drifts, and re-aligns. The component that
builds enough endurance stops depleting, loses the endurance signal, and lets capacity
decay until depletion returns. The system hovers near optimum, never resting there,
continuously corrected by the small errors its own imperfect state produces.
---
## VIII. Bottom-Up Emergence
**Complex temporal behavior emerges from local reactive traces, not explicit computation.**
The soma aligns with its input rhythm without representing the rhythm — it leaves a trace
when input arrives during refractoriness and lets that trace speed future recovery.
Prediction, anticipation, and rhythm-tracking emerge from purely local reactive deposits,
never from a model of the future.
**The system never represents what it is becoming tuned to.** A potentiated synapse does
not contain a representation of its pattern — it is physically biased toward it. The tuning
is the structure, not a description of the structure. Prediction is implicit physical bias,
not explicit expectation. The same is true of every adaptation: refractory alignment,
endurance conditioning, astrosynaptic wrapping — all are bias, none is description.
**Global organization arises from local competition.** Sparsification, normalization, and
winner-take-more dynamics are nowhere computed centrally. They emerge automatically from
many local units drawing from shared pools. The astrocyte does not decide which synapses to
fuel — the synapses' own demands, each a purely local quantity, competing for capped
production, produce the allocation. No allocator exists; the allocation is real.
---
## IX. Coupling, Openness, and Boundedness
**Couplings create trajectories, not just states.** Some variables, once moved, make
further movement in the same direction easier — the astrosynapse wrapping tighter after
potentiation, which makes future potentiation easier. These self-reinforcing couplings give
the system momentum: it does not merely occupy states, it follows trajectories, deepening
whatever direction it has begun. The astrosynapse is the strongest such coupling — the gain
control that reshapes the input itself, amplifying whatever trajectory the synapse is on.
**The same signal can serve opposite functions through different receptors.** Glutamate
spillover brakes the presynapse while exciting the astrocyte — one ligand, two receptor
types, opposite cascades, simultaneous opposite effects. Function is determined by the
receiver, not the signal. One event coordinates multiple responses with no coordinating
mechanism.
**Energy availability is itself a selective pressure, parallel to validation.** Beyond the
explicit activity-and-reward gating, the simple availability of fuel continuously selects
which components can participate. A synapse that cannot be fueled cannot generate the
activity that would let it be tagged. Metabolism silently shapes what can be learned, in
parallel with and independent of the plasticity machinery.
**The system is finite and open, not infinite and closed.** It has bounded components and a
bounded state space, and it receives inputs it cannot generate from within — sensory drive,
neuromodulatory validation, metabolic supply. Because it is finite, its self-modification
does not generate infinite regress. Because it is open, its highest validation comes from
outside itself.
**The fixed points are made explicit, not hidden.** The parameters the system cannot modify
from within — thresholds, the vascular ceiling, the neuromodulatory signals — are declared
as fixed. They are the system's boundary with what it did not set and cannot inspect.
Making them explicit is the honest acknowledgment that every self-modifying system operates
within constraints it did not choose.
**Validation comes from embedding, not from internal consistency.** The system does not
certify its own changes. Whether a structural change was good is answered by the organism's
subsequent experience in the world, fed back through the neuromodulatory system. Correctness
is determined by the coupling between system and environment, not by any internal criterion.
The fixed point lies outside: the system acts, the world responds, and the response — not
any internal check — determines what was worth keeping.
---
## X. From Local Expression to Holistic System
The preceding principles are stated almost entirely in local terms. Every behavior is a
local component acting on its own state within its own budget. Every evaluation uses only
local information and signals that have arrived. Every trace is a local record; every tag a
local conjunction; every commit a local draw on a shared pool. Nowhere is there a central
controller, a global plan, a representation of the whole. And yet the system behaves as a
whole. This final category states why the local necessarily becomes holistic.
**The whole exists in the shared pools, not in any component.** The only thing every
component touches is the finite resource it competes for. No component sees the whole, but
every component is coupled to every other through the pool they share. When one draws, all
others have less; when one returns, all others have more. The pool is the medium through
which purely local actions become globally consequential. The holism is not represented
anywhere — it is enacted in the competition for a common, capped resource.
**Coincidence across scales stitches the levels into one.** A permanent change at the
smallest scale requires confirmation from progressively larger scales — astrosynapse, soma,
organism. Each scale contributes what the scale below cannot know about itself. The result
is that no permanent change reflects a single level; every one reflects an agreement across
all levels that happened to align in a window. The system's memory is therefore never local
even though every step that produced it was. The whole writes itself into the part, through
the part's requirement for non-local confirmation.
**Signals make the boundaries permeable without dissolving them.** Components remain
strictly local — they cannot read each other — yet they are not isolated, because they emit
and receive signals. Feedforward transmission, retrograde feedback, and broadcast
neuromodulation knit the local components into a communicating whole without ever giving any
component access to another's interior. The system is simultaneously fully local in its
evaluation and fully connected in its dynamics. This is the precise sense in which a
holistic system is built from local parts: not by any part containing the whole, but by the
parts being coupled through resources and signals into a dynamics that no part could produce
alone.
**The whole has properties no component has.** Sparsification, rhythm, equilibrium,
prediction, memory, the joint selection for significance-and-sustainability — none of these
exists in any single component. They are properties of the coupled population drawing on
shared pools and exchanging signals over the DAY-NIGHT cycle. The component knows only its
own state and its own budget; the system knows what to remember, what to sustain, and what
to let fade. The gap between these is not bridged by any component understanding more — it
is bridged by the structure of the coupling itself. The holistic behavior is real, it is
not represented anywhere, and it could not be removed without removing the couplings that
constitute it.
**This is what it means for understanding to be enacted rather than encoded.** The system
does not contain a model of what it is doing. It does not represent the pattern it learns,
the rhythm it tracks, or the criterion by which it selects. Each of these is a physical bias
distributed across local components coupled through shared resources and signals. The whole
is not in any part and not in any representation — it is in the doing, in the ongoing
competitive, signal-mediated, scope-alternating process itself. A local expression, faithful
to locality at every step, produces a holistic system precisely because the locality is
coupled — and coupling, not representation, is what makes a whole.
@@ -0,0 +1,720 @@
# Tripartite Synapse — Pseudocode v14
> Companion: `tripartite_synapse_v14_biology.md` · principle: `logic_principles` (Timescale Ladder).
> Changes from v13:
> (1) every component has a plain-language intro (DAY/AP · DAY/NOT_AP · NIGHT)
> (2) budget refill regrouped RECEIVE → RECOVER everywhere (RECEIVE = signals only)
> (3) presynaptic short-term potentiation (possible_tag → VGCC occupancy) — see PRE
> (4) FOUR TIERS surfaced: FAST (mss) · MEDIUM (smin) · SLOW (hr) · PERSISTENT (NIGHT)
> DECAY groups are banded by tier; the group-to-tier ladder is stated once below
> (5) variable-type table in conventions maps each quantity to its tier
---
## Functional groups (seven-group grammar)
```
RECEIVE take in resources + signals that arrived from outside (boundary: in)
TRACE maintain the trace hierarchy — deposit fast trace; accumulate
possible_tag + endurance_need; stabilize tag on coincidence
ADJUST compute local operating parameters from structure + traces + modulators
BEHAVE the component's defining action, within both ceilings
EMIT send out — signals (messages) + resources (shipments) (boundary: out)
RECOVER refill own private pools consumed by behaving
DECAY let traces recede, closing their windows
```
EVALUATE merged into TRACE: judging a behavior is always maintaining a trace, whether or not
a trace is written. BEHAVE and EMIT stay separate — EMIT is the output half of the locality
interface (RECEIVE/EMIT are the only boundary crossings). TRACE spans all timescales: the
soma's inactivation, adaptation, and nuclear-Ca deposits are all TRACE. Order within a context
follows data dependencies; TRACE reads/writes whatever trace state is current.
EVERY FLOW HAS A TIMESCALE. Decay relaxes toward 0 over τ; creation/arrival relaxes toward a
target over τ — the same first-order operator. Within-step writes are the special case τ ≪ Δt.
Rate-limited inflows (fill/refill/flux·Δt) carry their τ implicitly; shipment carries an
explicit transit delay (see `transit`).
THE GROUPS MOVE BETWEEN TIERS (the ladder; see logic_principles "The Timescale Ladder").
Four tiers: FAST (mss) · MEDIUM (smin) · SLOW (hr) · PERSISTENT (NIGHT-written). The groups
move evidence UP the ladder and read capacity DOWN it:
```
ADJUST reads PERSISTENT ceiling + FAST trace → sets this step's operating point (down)
BEHAVE acts at FAST, bounded by the PERSISTENT ceiling (down)
TRACE deposits FAST, accumulates FAST→MEDIUM evidence, stabilizes MEDIUM→SLOW tag (up)
RECOVER refills toward the PERSISTENT ceiling (down)
DECAY relaxes FAST · MEDIUM · SLOW (PERSISTENT never decays in DAY)
NIGHT commits SLOW tag + MEDIUM endurance_need → PERSISTENT ceilings (up)
```
Capacity flows downward (slow sets the ceiling for fast); evidence flows upward (fast
accumulates toward slow). Each component's DECAY group below is banded by tier to show this.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
VARIABLE TIERS (timescale = meaning; see logic_principles "The Timescale Ladder")
FAST (mss) immediate response fast_trace
MEDIUM (smin) occupancy + evidence possible_tag · endurance_need · VGCC_active · AMPA_surface · RRP
SLOW (hr) consolidation bridge tag
─────────────────────────────────────────────────────────────────────────────
PERSISTENT (NIGHT) capacity (the ceilings) structure · budget_ceiling
energy (not recoverable) · material (recoverable)
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS SHIPMENT CHANNELS (transit-delayed)
glutamate PRE → POST, ASTRO soma_ship_dend SOMA→DEND
astro_Dserine ASTRO → POST soma_ship_axon SOMA→AXON
retro_NO POST → PRE (+) dend_ship_post DEND→POST
retro_eCB POST → PRE () axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve, rate-limited (implicit τ)
amount = min(rate, ceiling - pool)·Δt; budget -= amount·cost; return amount
refill(c from supply S) -> amount: // CONTESTED supply, gap-bounded
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε)); S -= demand·factor
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // emit into transit (not to target directly)
amount = min(from_budget·frac, demand_sig); from_budget -= amount·(1+ship_cost); return amount
transit(channel, τ_transport) -> arrival: // delivers in-transit cargo over τ
arrival = channel·(Δt/τ_transport); channel -= arrival; return arrival
```
---
## SHARED parameters
```
dopamine NE ACh // organism broadcasts (external)
glucose geometry // physical (external)
elig dop_thr tag_thr tag_expiry // strength gates (universal)
traj_thr endur_thr // endurance gates (universal)
ship_cost // transport overhead (all shipments)
τ_transport_{dend,axon,spine,bouton} // shipment transit times (distance-dependent)
ε
```
## NIGHT parameters (consolidation only)
```
slot_cost cap_cost f_cap // commit sizes / endurance fraction
maint_frac cap_frac // maintenance allocation
decay_rate capacity_decay_rate recycle // passive decay + recovery
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
f_dend f_axon f_spine f_bouton // material distribution fractions
{dend,axon,pre,post}_ship_frac // DAY shipment fractions
{dend,axon,pre,post}_energy_frac // energy distribution fractions
```
---
---
# DAY
---
## PRE
The presynaptic bouton releases neurotransmitter and gathers evidence about whether that
release was worth strengthening and worth sustaining. Its behavior unfolds across two DAY
contexts and the NIGHT scope.
**During DAY, during AP — the bouton releases neurotransmitter.** The amount released depends on
residual **calcium** from recent spikes (the fast trace, setting the drive), the current
**VGCC coupling occupancy** (how tightly calcium channels are coupled to docking slots right
now — filled short-term, bounded by structure), the two **retrograde messages** from the
postsynapse (`retro_eCB` brakes the drive; `retro_NO` will confirm release reached a responsive
target), and the availability of both **fuel and vesicles**. Two shortfalls are read
differently: a fuel shortfall on a succeeding release is evidence the bouton needs more
*endurance*; an empty pool with fuel to spare is ordinary short-term depression.
**During DAY, during NOT_AP — the bouton consolidates, potentiates short-term, and recovers.**
With no spike to release, it latches the retrograde messages (RECEIVE); maintains its traces —
accumulating eligibility toward a dopamine-gated tag (TRACE); transiently tightens its VGCC
coupling from accumulated eligibility, with no dopamine, a reversible short-term potentiation
bounded by the structural ceiling (BEHAVE); refills both its budget (contested supply) and its
vesicle pool (private reserve) (RECOVER); and lets its traces decay, closing the windows (DECAY).
**During NIGHT — the bouton's ceilings are rewritten.** NIGHT raises the bouton's **structure**
(active-zone capacity, including the VGCC-coupling ceiling) where a validated tag accumulated,
and its **budget capacity** (mitochondrial endurance) where fuel repeatedly interrupted a
succeeding release. Both draw on the same finite material and energy shipped down the axon, so
the two kinds of growth compete — and whatever is not maintained drifts back down.
```
// PARAMETERS K_release · release_cost · fusion_cost · vatpase_cost · spillover · brake
// stp_thr · coupling_gain · coupling_drift · VGCC_baseline
// INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE retro_NO, retro_eCB ← POST (signals latched; resources refill in RECOVER)
// READ glutamate (own cleft, autobrake) ; dopamine (gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// VGCC_active (occupancy: current coupling, filled toward VGCC_coupling ceiling)
// SUPPLY astro_lactate[syn] ← ASTRO ; axon_ship_pre ← AXON ; pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// EMERGENCY shockwave_lockdown ← ASTRO
//
// TRACE CREATION MODES (every trace: trace += input·Δt trace·(Δt/τ_decay))
// impulse input = quantum·δ(event) — a point event; no rise time, τ = decay only (FAST)
// accumulate input = rate(condition)·Δt — ramps while a condition holds; τ = rise AND decay (MEDIUM/SLOW)
// A trace's tier is set by BOTH its creation mode and its decay: the fast trace is impulse-created
// and fast-decaying; possible_tag/endurance_need are slowly accumulated and medium-decaying.
DAY | AP:
// TRACE FAST · impulse (Ca²⁺ bolus from THIS spike — a point event; no rise time,
// decay alone sets its τ; frequency is emergent from impulse-rate vs decay)
pre_fast_trace += spike_Ca(pre_structure.VGCC_coupling)·δ(spike)
// ADJUST (release drive from residual Ca²⁺ × current coupling occupancy, + DSE brake)
drive = sat(pre_fast_trace × VGCC_active, K_release) × (1 - retro_eCB_local)
// BEHAVE (release; two distinct failure modes)
if pre_budget < release_cost:
// FUEL shortfall → endurance evidence (retro_NO-confirmed local success)
suppress(NT_flux)
// TRACE MEDIUM · accumulate (ramps while fuel keeps interrupting a succeeding release)
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)·Δt
exit
if RRP == 0:
// OCCUPANCY shortfall → short-term depression (NOT endurance; fuel was fine)
suppress(NT_flux)
exit
NT_flux = RRP × drive; RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
// EMIT (glutamate into cleft)
glutamate += NT_flux·Δt
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE (latch backward messages — signals only)
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
// TRACE (strength pathway — evidence climbs the ladder)
// MEDIUM · accumulate (ramps while fast_trace stays eligible; rise-rate is its τ_rise)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace·Δt
// SLOW · accumulate (ramps only on dopamine coincidence; rise gated by validation)
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag·Δt
// BEHAVE (short-term potentiation: eligibility tightens coupling, NO dopamine; drifts back)
if pre_possible_tag > stp_thr:
VGCC_active = min(VGCC_active + coupling_gain × pre_possible_tag, pre_structure.VGCC_coupling)
else:
VGCC_active = max(VGCC_active - coupling_drift·Δt, VGCC_baseline) // STD = consequence
// RECOVER (refill BOTH pools: contested budget + private RRP)
pre_budget += refill(pre from astro_lactate[syn] + transit(axon_ship_pre, τ_transport_bouton))
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// DECAY
// FAST (mss)
pre_fast_trace *= decay(100ms)
// MEDIUM (smin)
pre_possible_tag *= decay(s); pre_endurance_need *= decay(min)
// SLOW (hr)
pre_tag *= decay(hr)
// (signals) arrived channels fade
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
// (PERSISTENT: pre_structure, pre_budget_ceiling — no DAY decay; NIGHT only)
```
---
## POST
The postsynaptic spine is the synapse's primary memory locus: it detects coincident input,
runs the calcium dynamics that decide potentiation versus depression, and requires the most
validation (three coincidences) before committing. Its behavior unfolds across two DAY
contexts and the NIGHT scope.
**During DAY, during NOT_bAP — the spine integrates input and decides plasticity.** Three
calcium sources feed its fast trace: AMPA current (small Ca, begins ejecting the NMDA Mg block),
NMDA (large Ca, but only on the local coincidence of depolarization + astrocyte D-serine +
glutamate), and — in the bAP context — the back-propagating spike. High calcium drives AMPA
receptors to the surface (short-term potentiation, occupancy filled toward the slot ceiling, no
dopamine); when calcium falls, they drift back (short-term depression as a consequence). The
spine also emits two retrograde messages from its own state — NO when it responded, an
endocannabinoid brake when over-driven — and accumulates a dopamine-gated tag toward
consolidation. A fuel shortfall while calcium was climbing toward a tag is endurance evidence;
a surface already at its ceiling is a structural limit, not endurance.
**During DAY, during bAP — the back-propagating spike confirms coincidence.** The somatic spike
arrives at the spine, adds depolarization and calcium, and supralinearly amplifies an existing
candidate — the soma's confirmation that it fired, one of the three coincidences the spine
requires.
**During NIGHT — the spine's ceilings are rewritten.** NIGHT raises **structure** (the AMPA
slot ceiling, spine volume) where a validated tag accumulated — with a coherence bonus when pre,
post, and astro all tagged the same synapse — and **budget capacity** where fuel interrupted a
climbing calcium trajectory. Both draw the same finite pool, so they compete; unmaintained
ceilings drift down.
```
// PARAMETERS K_AMPA · AMPA_Ca · AMPA_cost · NMDA_cost · bAP_cost · pka_cost · traffic_cost
// req_cost · Mg_eject · Dserine_thr · Ca_STP · Ca_TAG · eCB_thr · drift · baseline
// NO_synth_cost · eCB_synth_cost
// INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE (signals) glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP ← DEND/SOMA ; dopamine
// READ glutamate ; astro_Dserine ; bAP (dend_structure.bAP_fidelity) ; dopamine
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// SUPPLY astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND ; post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// EMERGENCY shockwave_lockdown ← ASTRO
// NOTE POST endurance is own-state only (own Ca climbing); no arrived feedback term.
DAY | NOT_bAP:
// ADJUST (AMPA drive from arrived glutamate)
a = sat(glutamate, K_AMPA)
// BEHAVE (SOURCE 1 AMPA: current + small Ca + begins Mg ejection)
AMPA_current = a × AMPA_surface; Vm += AMPA_current; post_budget -= AMPA_cost
// TRACE (Ca deposited by AMPA)
post_fast_trace += AMPA_Ca·AMPA_current
// BEHAVE (SOURCE 2 NMDA: large Ca on local coincidence)
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0:
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+ NO/BDNF: "release reached a responsive target")
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ( endocannabinoid / DSE when over-driven)
if Vm > eCB_thr:
retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE (STP fill slots from private reserve ; else STD drift = consequence)
if post_fast_trace > Ca_STP:
if post_budget < traffic_cost:
// FUEL shortfall → endurance (own Ca was climbing toward a tag)
if post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
else if AMPA_surface < post_structure.slot_ceiling:
AMPA_surface += Ca_insert(post_fast_trace); post_budget -= traffic_cost
// else: surface already at slot_ceiling → structure-limited (not endurance)
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline) // STD = consequence
// TRACE (strength: CANDIDATE then STABLE via dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace; post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// RECOVER (refill budget from contested supply)
post_budget += refill(post from astro_lactate[syn] + transit(dend_ship_post, τ_transport_spine))
// DECAY
// FAST (mss) — post_fast_trace already decayed above (intra-step, pre-tagging)
// MEDIUM (smin)
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
// SLOW (hr)
post_tag *= decay(hr)
// (signals)
dopamine *= decay(ms)
// (PERSISTENT: post_structure, post_budget_ceiling — no DAY decay; NIGHT only)
DAY | bAP:
// BEHAVE (SOURCE 3 bAP: depolarization + Ca, amplifies existing signal)
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
// TRACE (supralinear boost only if a CANDIDATE is present)
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
```
---
## DEND
The dendritic branch is the postsynapse's supply line and the neuron's input integrator. It
carries the back-propagating spike out to its spines, integrates their voltages toward the
soma, and ships material and budget to the spines it supports. Its behavior unfolds across two
DAY contexts and the NIGHT scope.
**During DAY, during bAP — the branch propagates and integrates.** When the soma fires, the
branch propagates the back-propagating spike toward its spines, with a fidelity that attenuates
with distance (distal spines get weaker confirmation, are harder to potentiate). It deposits
branch calcium and integrates its spines' voltages into a single branch signal sent on to the
soma. A fuel shortfall that cuts propagation short while the branch was strongly active is
endurance evidence; propagation that simply attenuates with distance is a structural limit, not
endurance.
**During DAY, during NOT_bAP — the branch consolidates, supplies, and recovers.** It maintains
its tag toward consolidation, lowers its commit threshold under acetylcholine (attention),
ships budget down to its spines (demand-weighted by their tags), runs local translation if
tagged, refills its own budget from astrocytic lactate and somatic shipment, and lets its
traces decay.
**During NIGHT — the branch's ceilings are rewritten.** NIGHT raises **structure** (bAP
fidelity, translation capacity) where a validated tag accumulated and **budget capacity** where
fuel interrupted strong branch activity, both from the shared pool, both competing; unmaintained
ceilings drift down.
```
// PARAMETERS prop_cost · branch_Ca_cost · integrate_cost · translate_cost · ACh_gain
// INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE (signals) SOMA.fired ; POST.Vm + spine spillover ; dopamine ; ACh
// READ SOMA.fired ; POST.Vm + spine spillover ; dopamine ; ACh
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
// SUPPLY astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA ; dend_material, dend_energy ← SOMA(NIGHT)
// NOTE DEND endurance fires only on FUEL-limited propagation, not structural attenuation;
// own-state proxy (strong branch activity); no arrived feedback term.
DAY | bAP:
// ADJUST (propagation strength from structure — inside propagate())
// BEHAVE (propagate bAP; distinguish fuel-limited vs structure-limited shortfall)
if dend_budget < prop_cost:
// FUEL shortfall → endurance (branch was strongly active)
if dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
bAP_local, reached = propagate_partial(dend_budget)
else:
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, geometry)
// reached < full here is structural attenuation (distance), NOT endurance
dend_budget -= prop_cost × reached
// TRACE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT (integrated voltage to soma ; propagated bAP already reached spines)
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// TRACE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// ADJUST (commit threshold lowered by attention)
commit_threshold *= 1/(1 + ACh·ACh_gain)
// BEHAVE (local translation if tagged — fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
// EMIT (ship budget to spines; demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// RECOVER (refill budget from contested supply)
dend_budget += refill(dend from astro_lactate[branch] + transit(soma_ship_dend, τ_transport_dend))
// DECAY
// FAST (mss)
dend_fast_trace *= decay(300ms)
// MEDIUM (smin)
dend_possible_tag *= decay(s); dend_endurance_need *= decay(min)
// SLOW (hr)
dend_tag *= decay(hr)
// (PERSISTENT: dend_structure, dend_budget_ceiling — no DAY decay; NIGHT only)
```
---
## SOMA
The soma is the neuron's integrating center and the root of its structural material. It sums
the branch inputs, fires when they exceed a threshold it sets from its own adaptation and the
neuromodulators, and ships material and budget out to the dendrites and axon. Its timing —
refractoriness, adaptation, rhythm alignment — emerges bottom-up from local traces, never from
a represented clock. Its behavior unfolds across two DAY contexts and the NIGHT scope.
**During DAY, during AP — the soma integrates and fires.** It computes its firing threshold
from its baseline (structure), its accumulated adaptation, and the neuromodulators, and checks
its refractory state; if the integrated branch input clears the threshold and fuel allows, it
fires. One spike deposits three traces at three timescales — sodium inactivation (refractory),
slow-potassium adaptation (threshold rise), and nuclear calcium (toward CREB and the tag). A
fuel shortfall while nuclear calcium was climbing is endurance evidence; being refractory or
sub-threshold is a timing limit, not endurance.
**During DAY, during NOT_AP — the soma recovers, aligns, and supplies.** It self-replenishes
from its own mitochondria (its private root), integrates the latest branch inputs, deposits a
refractory-alignment trace when suprathreshold input arrived during its refractory period (so it
aligns to its input rhythm bottom-up), ships budget to dendrites and axon (demand-weighted by
their tags), recovers from refractoriness at a rate its alignment trace speeds up, and lets its
traces decay.
**During NIGHT — the soma's ceilings are rewritten, and it gates the whole neuron's material.**
NIGHT raises **structure** (excitability, synthesis capacity) and **budget capacity** from the
shared pool; crucially the soma's own tag gates CREB-driven synthesis, so how much material all
downstream components receive depends on the soma having been tagged.
```
// PARAMETERS ap_cost · nuclear_cost · creb_cost · mito_output · inactivation · ap_amp · ap_contrib
// base_recovery · τ_Na · τ_adapt · τ_nuclear · τ_align
// INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE (signals) branch_Vm ← DEND ; dopamine ; NE ; ACh
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
// SUPPLY self (mitochondria, ROOT — private)
// NOTE SOMA endurance fires only on FUEL shortfall (budget < ap_cost);
// refractory / sub-threshold are timing limits, not endurance. Own-state proxy.
DAY | AP:
// ADJUST (threshold from structure + adaptation + neuromodulators ; refractory gate)
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE (fire if able)
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// FUEL shortfall → endurance (firing was approaching CREB)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
// EMIT (fired → AXON, DEND)
fired = True; soma_budget -= ap_cost
// TRACE (three traces from one AP — FAST nuclear-Ca, MEDIUM adaptation, refractory)
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// TRACE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
DAY | NOT_AP:
// RECEIVE (integrate latest branch input — signal)
branch_Vm = integrate(DEND.branch_Vm, branches)
// TRACE (bottom-up refractory alignment: suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// EMIT (ship downstream into transit; demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// RECOVER (self-replenish from private root ; inactivation recovery sped by alignment)
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// DECAY
// FAST (mss) — refractory + nuclear-Ca + alignment (sub-second to seconds)
soma_fast_trace *= decay(τ_nuclear); soma_refractory_alignment *= decay(τ_align) // self-limiting
// MEDIUM (smin) — adaptation + tagging evidence
soma_adaptation *= decay(τ_adapt)
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
// SLOW (hr)
soma_tag *= decay(hr)
// (signals)
dopamine *= decay(ms)
// (PERSISTENT: soma_structure, soma_budget_ceiling — no DAY decay; NIGHT only)
```
---
## AXON
The axon carries the soma's spike out to its boutons and is the presynapse's supply line. It
propagates reliably or not depending on its myelination and its recent load, and ships material
and budget to the boutons. Its behavior unfolds across two DAY contexts and the NIGHT scope.
**During DAY, during AP — the axon propagates the spike.** Reliability is set by structure
(myelination) and degraded by recent high-frequency load (sodium inactivation at branch points —
axonal short-term depression). A fuel shortfall while carrying a strong train is endurance
evidence; load-driven failure is short-term depression, a consequence, not endurance.
**During DAY, during NOT_AP — the axon supplies and recovers.** It maintains its tag, ships
budget to its boutons (demand-weighted by their tags), refills its own budget from somatic
shipment and astrocytic lactate, and lets its traces decay.
**During NIGHT — the axon's ceilings are rewritten.** NIGHT raises **structure** (myelination,
transport capacity) and **budget capacity** from the shared pool, both competing; unmaintained
ceilings drift down.
```
// PARAMETERS prop_cost · budget_factor
// INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE (signals) SOMA.fired ; dopamine
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
// SUPPLY soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO ; axon_material, axon_energy ← SOMA(NIGHT)
// NOTE AXON endurance fires only on FUEL shortfall; load-driven failure fail(fast_trace)
// is axonal STD (a consequence), not endurance. Own-state proxy.
DAY | AP:
// ADJUST (reliability from structure load-driven failure)
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace)) // fail() = STD, not endurance
// BEHAVE (propagate; FUEL shortfall degrades + flags endurance)
if axon_budget < prop_cost:
reliability *= budget_factor
if axon_fast_trace > traj_thr: // FUEL-limited → endurance
axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT (delivered APs reach boutons)
// TRACE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// TRACE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// EMIT (ship to boutons; demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// RECOVER (refill budget from contested supply)
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// DECAY
// FAST (mss)
axon_fast_trace *= decay(s)
// MEDIUM (smin)
axon_possible_tag *= decay(s); axon_endurance_need *= decay(min)
// SLOW (hr)
axon_tag *= decay(hr)
// (PERSISTENT: axon_structure, axon_budget_ceiling — no DAY decay; NIGHT only)
```
---
## ASTRO
The astrosynapse is the synapse's gatekeeper and energy hub. It clears glutamate, supplies the
D-serine that gates postsynaptic NMDA, and distributes lactate across its territory by demand.
Unlike the others it runs in a single continuous context rather than spiking, and its structure
reshapes the synapse's operating point rather than just its range.
**During DAY, continuously — the astrosynapse clears, gates, and fuels.** It produces energy at
its cell body (glycolysis from glucose, the system's energy root), then allocates lactate across
its astrosynapses weighted by each one's clearance demand. At each astrosynapse it clears
spillover glutamate (EAAT) and supplies tonic D-serine; when spillover is high it adds a
demand-driven D-serine pulse, brakes nothing of the presynapse directly (the presynaptic brake
is PRE reading its own cleft), deposits its calcium trace, and accumulates a dopamine-gated tag.
A D-serine pulse cut short by low budget while demand was high is endurance evidence; one cut
short by precursor/material exhaustion is a material limit, not endurance. Excess overflow
triggers the protective shockwave lockdown.
**During NIGHT — the astrosynapse's ceilings are rewritten.** NIGHT raises **structure**
(perisynaptic wrap, EAAT density, tonic D-serine) where a validated tag accumulated and **budget
capacity** where budget-limited synthesis recurred; astro_structure is self-reinforcing in both
directions, so it amplifies whatever trajectory the synapse is already on.
```
// PARAMETERS K_Dserine · Ds_max · Ds_frac · Ds_cost · EAAT_cost · lactate_cost · spillover · overload
// INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE (signals) glutamate ← PRE (clearance + spillover) ; dopamine
// READ glutamate ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// SUPPLY glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// NOTE ASTRO endurance fires on BUDGET-limited synthesis (got<want via low budget);
// material/precursor-limited synthesis is a material limit, not endurance. Own-state proxy.
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE (root production, capped by glucose)
astro_central_budget += glycolysis(glucose)·Δt
// ADJUST (demand weights across territory)
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
// EMIT (demand-weighted lactate to all components)
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE (clear glutamate ; supply tonic D-serine)
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// TRACE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// ADJUST (D-serine demand from spillover)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
// BEHAVE + EMIT (D-serine pulse to POST gate)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// TRACE (endurance: BUDGET-limited synthesis under high own demand)
if got < want and astro_central_budget low and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// TRACE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
// FAST (mss) — astro_fast_trace already decayed above (intra-step)
// MEDIUM (smin)
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
// SLOW (hr)
astro_tag[i] *= decay(hr)
// (PERSISTENT: astro_structure, astro_budget_ceiling — no DAY decay; NIGHT only)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT
Same grammar on ceilings, once per cycle.
```
NIGHT | 1 RECEIVE + ADJUST + EMIT (replenish, weight, distribute)
// RECEIVE overnight production at roots (capped by glucose; gated by soma_tag)
astro_central_{budget,energy,material} += overnight_*(glucose, …)·Δt
soma_{budget,energy} += overnight_*()·Δt ; soma_material += CREB_synth(soma_tag)·Δt
// ADJUST tag-weighted shares
for each i with astro_tag[i] > tag_expiry: w = astro_tag[i]/Σastro_tag
// EMIT distribute material + energy down the supply chains
astro_energy[i] += astro_central_energy·w; astro_material[i] += astro_central_material·w
dend_material += soma_material·f_dend ; axon_material += soma_material·f_axon ; soma_material -= …
post_material += dend_material·f_spine ; pre_material += axon_material·f_bouton
{pre,post,dend,axon}_energy += soma_energy·{·}_energy_frac
{pre,post,dend,axon}_budget += astro_lactate_reserve·{·}_frac·Δt
NIGHT | 2 TRACE + BEHAVE (strength commits → raise structure)
// ADJUST coherence bonus when pre, post, astro tags align
coherence = (pre_tag, post_tag, astro_tag all > tag_expiry) ? coherence_factor : 1
// TRACE+BEHAVE build structure for tagged components
for each c with c_tag > tag_expiry:
Δ = min(slot_cost, c_material, c_energy·f_cap)
c_structure += Δ × (coherence if c in {pre,post,astro} else 1)
c_material -= Δ; c_energy -= Δ·assembly_cost; if Δ < slot_cost: queue(→ next NIGHT)
NIGHT | 2b TRACE + BEHAVE (endurance commits → raise budget_ceiling ; no dopamine ; competes w/ 2)
for each c with c_endurance_need > endur_thr:
Δ = min(cap_cost, c_material·f_cap, c_energy·f_cap)
c_budget_ceiling += Δ; c_material -= Δ; c_energy -= Δ·biogenesis_cost; if Δ<cap_cost: queue
NIGHT | 3 DECAY + RECOVER (both ceilings decay by neglect ; material recovered)
maint = (total_material - consumed) × maint_frac / synapse_count
for each synapse: // DECAY
{pre,post,dend,astro}_structure -= decay_rate·Δt
{pre,post,dend,astro}_budget_ceiling -= capacity_decay_rate·Δt
if maint ≥ maint_cost: structure += full_maint ; budget_ceiling += full_cap_maint
else: structure += maint·frac ; budget_ceiling += maint·cap_frac
for each synapse with net_change < 0: // RECOVER
{pre,post,astro}_material += |net_change|·recycle·frac // material recovered, energy not
NIGHT | 4 BEHAVE (homeostatic scaling)
if soma_tag > homeostatic_ceiling:
s = homeostatic_ceiling / soma_tag
for each synapse: post_structure.slot_ceiling *= s ; pre_structure.slot_ceiling *= s
soma_material += Σ reduction·recycle
NIGHT | 5 DECAY (clear traces)
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
for each tag: if tag < tag_expiry: tag = 0 // else carry forward
// structure and budget_ceiling PERSIST
```
---
## One-view summary
```
SEVEN-GROUP GRAMMAR, TWO TIMESCALES
RECEIVE · TRACE · ADJUST · BEHAVE · EMIT · RECOVER · DECAY
DAY grammar on OCCUPANCY within two ceilings (structure=strength, budget_ceiling=endurance)
TRACE yields two evidence streams from local state + arrived signals:
fast_trace + dopamine → tag (strength)
FUEL shortfall + interrupted LOCAL success → endurance_need (endurance)
OCCUPANCY/structure/timing shortfalls → short-term depression (NOT endurance)
NIGHT same grammar on the CEILINGS:
tag → structure ; endurance_need → budget_ceiling ; both draw one pool (compete)
unmaintained ceilings decay → recovered material funds the rest
FLOWS every flow has a timescale: decay relaxes toward 0 over τ, arrival toward a target
over τ; shipment is transit-delayed; rate-limited inflows carry τ implicitly.
LOCAL every group uses only own state + arrived signals; RECEIVE/EMIT are the only crossings.
```
@@ -0,0 +1,454 @@
# Tripartite Synapse — Biological Reference (companion to v16 pseudocode)
> Companion to `tripartite_synapse_v16_pseudocode.md` · principle: `logic_principles_v3`.
> v16 gives NIGHT a hierarchy of homeostatic actors at scales above the single synapse, and a
> phased structure. The actors of consolidation are not the actors of transmission: by day the
> six local components transmit; by night a hierarchy — astrocyte territory, the whole neuron,
> and (as an external signal) the assembly/network — renormalizes and reallocates. Early-night
> cycles downscale the day's transient changes (synaptic homeostasis); later cycles consolidate
> the survivors. Occupancy filled by day (receptor surface, channel coupling) is returned to
> baseline each night, so only what was written into a structural ceiling persists.
---
## The three synaptic components and their support structures
A SYNAPSE is composed of three first-class components:
- **PRE** — presynaptic bouton (the axon's terminal at this synapse)
- **POST** — postsynaptic spine (the dendrite's terminal at this synapse)
- **ASTRO** — astrosynapse, the perisynaptic astrocytic process (the astrocyte's terminal)
Each has an upstream support structure that supplies it:
- **AXON** supplies PRE (transmission + transport from soma)
- **DEND** supplies POST (integration + transport from soma)
- the **astrocyte cell body** supplies ASTRO (energy + ECM material)
- **SOMA** is the integrating center and the root of neuronal material
The compartment analogy: AXON:PRE = DEND:POST = astrocyte-body:ASTRO = supply line : terminal.
---
## Resource variables
### DAY budget (one per component)
Aggregates fast energy AND fast consumables — everything needed to run moment-to-moment.
- **pre_budget** — ATP for VGCC gating, vesicle fusion (SNARE), VATPase vesicle refill,
plus fast consumables: vesicle membrane lipids, synaptotagmin recycling.
- **post_budget** — ATP for the NaK pump (membrane reset after current), NMDA current
handling, plus fast actin monomers for transient spine changes and receptor-recycling lipids.
- **dend_budget** — ATP for bAP propagation (NaK reset along branch), local translation
(ribosome running cost), SERCA Ca²⁺ resequestration, plus fast mRNA consumed by translation.
- **soma_budget** — ATP for AP generation (Na⁺/K⁺ currents + NaK reset), CREB
phosphorylation, nuclear Ca²⁺ handling, plus shipping running costs.
- **axon_budget** — ATP for AP propagation at nodes of Ranvier, kinesin/dynein motor
running cost, fast myelin maintenance.
- **astro_central_budget** — ATP from glycolysis at the astrocyte cell body; funds EAAT
clearance, serine→D-serine synthesis, lactate export, fast process motility.
### astro_lactate[i]
Lactate exported from the astrocyte cell body to synapse i. Biologically: glucose →
(glycolysis) → lactate, released into extracellular space, absorbed by neuronal MCT2
transporters, converted to pyruvate → TCA → ATP in the neuron's mitochondria. The astrocyte
is the primary fast-energy supplier to pre, post, and dend.
### NIGHT energy (one per component) — NOT recoverable
ATP for structural assembly. Distinct from DAY budget because it is spent on building, and
the work of assembly is thermodynamically gone once done (cannot be recovered by disassembly).
- pre_energy: RIM/Munc13 incorporation, VGCC clustering.
- post_energy: CaMKII anchoring, actin polymerization, PSD scaffold remodeling.
- dend_energy: mitochondria incorporation, cytoskeletal reinforcement.
- soma_energy: ribosome biogenesis, ion-channel incorporation.
- axon_energy: myelination, microtubule stabilization.
- astro_energy: process retraction, ECM secretion, racemase upregulation.
### NIGHT material (one per component) — RECOVERABLE
Slow structural proteins. Recoverable because disassembly (LTD) returns the proteins to a
reusable pool (ubiquitin-proteasome → amino acids; internalized receptors → endosomal reserve).
- **soma_material** (root) — all neuronal structural proteins from CREB-driven synthesis:
AMPA subunits, PSD scaffold, AZ scaffold, mRNA transcripts (Arc, BDNF), organelles.
- **dend_material** — from soma: Arc/plasticity mRNA, mitochondria, cytoskeletal proteins,
AMPA subunits in transit to spines.
- **post_material** — from dend: AMPA receptor subunits (GluA1/2), PSD scaffold (PSD-95,
SHANK, Homer), structural actin, CaMKII.
- **axon_material** — from soma: kinesin/dynein motors, microtubule components, myelin proteins.
- **pre_material** — from axon: RIM, Munc13, VGCC subunits, structural vesicle proteins.
- **astro_material** (root: astrocyte cell body) — EAAT proteins, serine racemase, ECM
proteins (Glypicans, Thrombospondins), process cytoskeleton.
**Why energy and material are separate in NIGHT but combined in DAY:** during DAY both are
fast consumables replenished on the same timescale, so one `budget` variable suffices. During
NIGHT they diverge — material is recoverable after LTD, energy is not — so they must be two
variables. This asymmetry (material returns to the pool, energy is gone) is what makes one
synapse's depression genuinely fund another's potentiation.
---
## Structural variables (strength ceilings — written in NIGHT)
Each aggregates several correlated structural properties into one capacity.
- **pre_structure** — active zone capacity:
slot_ceiling (number of vesicle docking slots) + VGCC_coupling (Ca²⁺-channel proximity to
slots, sets release efficiency) + refill_ceiling (max RRP replenishment rate).
- **post_structure** — spine sensitivity capacity:
slot_ceiling (number of PSD anchoring slots for AMPA) + spine_volume (local reserve and
actin machinery) + reserve_ceiling (endosomal AMPA pool size).
- **dend_structure** — branch capacity:
bAP_fidelity(position) (mitochondrial density sets propagation strength, attenuates with
distance) + translation_ceiling (local mRNA capacity) + transport_speed (cytoskeletal integrity).
- **soma_structure** — somatic output capacity:
baseline_threshold (inverse: ion-channel density at axon initial segment) + AP_reliability
(Na⁺ channel density) + synthesis_ceiling (ribosome density + CREB machinery).
- **axon_structure** — axonal capacity:
propagation reliability (myelination density) + transport_ceiling (motor density + microtubule
integrity) + mitochondrial density.
- **astro_structure** — astrosynaptic environmental capacity:
perisynaptic_distance⁻¹ (wall proximity — closer = more glutamate contained) + EAAT_density
(clearance ceiling) + Dserine_tonic (baseline co-agonist) + ECM_integrity.
**Self-reinforcing both directions:** tighter wrap + more tonic D-serine make future
potentiation easier; looser wrap + zero tonic D-serine make future depression easier.
---
## Budget ceilings (endurance ceilings — written in NIGHT)
- **{component}_budget_ceiling** — the maximum fuel the component can hold / the maximum
duration of sustained behavior. Biologically: mitochondrial density and local fuel-storage
capacity. Built by activity-driven mitochondrial biogenesis; lost by mitophagy when idle.
Parallel to structure: structure is strength capacity, budget_ceiling is endurance capacity.
---
## Trace variables
### fast_trace (one per component) — DAY only, decays automatically
The local record of recent activity that biases the next behavior.
- **pre_fast_trace** — residual presynaptic Ca²⁺ after spikes (τ≈100ms). Biases NT release
(facilitation) and provides tagging eligibility.
- **post_fast_trace** — spine Ca²⁺ amplitude × rise-speed (τ≈tens ms). Encodes the LTP-vs-LTD
instruction (fast rise → CaMKII → potentiation; slow rise → phosphatase → depression).
- **dend_fast_trace** — branch Ca²⁺ from bAP + spine spillover (τ≈300ms). Integrates branch co-activity.
- **soma_fast_trace** — nuclear Ca²⁺ from each AP (τ≈seconds). Drives toward CREB activation.
- **axon_fast_trace** — propagation load (τ≈seconds). High load → Na⁺ inactivation at branch
points → propagation failure (this is axonal short-term depression).
- **astro_fast_trace** — perisynaptic Ca²⁺ from mGluR5 activation by glutamate spillover
(τ≈seconds). Drives D-serine release.
### soma timing traces (emergent refractory + adaptation + alignment)
- **soma_Na_inactivation** (τ≈ms) — sodium-channel inactivation after an AP. Its recovery IS
the refractory period (emergent, not a hardcoded timer). High → absolute refractory; decaying
→ relative refractory; recovered → normal.
- **soma_adaptation** (τ≈100s of ms) — slow K⁺ channel (SK/M-type) activation accumulating
over a spike train, raising threshold. This is spike-frequency adaptation.
- **soma_refractory_alignment** — deposited when a suprathreshold input arrives during
refractoriness (a missed coincidence). Speeds future recovery so the soma aligns to its input
rhythm. Bottom-up: no rhythm is represented; alignment emerges from accumulated local
mismatches and decays when mismatches stop (self-limiting).
### possible_tag (one per component) — intermediate, τ≈smin
Graded accumulation of tagging eligibility. For POST, this is the CANDIDATE tag lifetime.
### endurance_need (one per component) — intermediate, τ≈smin
Deposited when budget depletion interrupts a behavior that was on a LOCALLY successful
trajectory. Records that fuel — not structure, not significance — was the binding constraint
on a forming success. Requires NO dopamine (homeostatic, not associative).
**Local success proxy per component** (each uses only its own state + arrived signals):
- PRE: own fast_trace high (was releasing strongly), optionally amplified by retrograde
messenger (endocannabinoid / NO / BDNF) that has arrived.
- POST: own Ca²⁺ climbing toward tagging threshold (naturally local).
- DEND: own branch strongly active (high branch voltage/Ca²⁺) when propagation fell short.
- SOMA: own nuclear Ca²⁺ climbing toward CREB.
- AXON: own propagation load high (was carrying a strong train).
- ASTRO: own local glutamate/Ca²⁺ high (was under heavy clearance/D-serine demand).
### tag (one per component) — DAY→NIGHT bridge, τ≈hours
The validated record of significance that survives to NIGHT and gates strength commits.
Formed by coincidence of local eligibility + non-local validation (dopamine).
**POST is special — two-phase, three coincidences:**
- CANDIDATE: local Ca²⁺ above threshold + astrosynapse D-serine present (coincidence 1).
- amplified when bAP confirms soma fired (coincidence 2).
- STABLE: CANDIDATE + dopamine within stabilization window (coincidence 3).
Biologically: early CaMKII creates a labile tag (early-LTP); PKA driven by dopamine via D1R
stabilizes it (late-LTP). Without dopamine, the candidate degrades — early-LTP reverses.
---
## Behaviors — biological meaning
### PRE | AP — neurotransmitter release
`NT_flux = RRP × sat(pre_fast_trace, K_release)` models continuous NT release proportional to
the readily-releasable pool and a saturating Ca²⁺ drive (synaptotagmin's cooperative Ca²⁺
sensitivity, simplified to a saturating curve). RRP depletes as released (short-term depression
as a consequence) and refills via VATPase (energy-throttled, so low budget deepens depression).
The mGluR2/3 brake is presynaptic autoinhibition by spillover (Gi → reduced VGCC opening).
### POST | NOT_bAP — three calcium sources, two plasticity cases
- **Source 1 (AMPA):** glutamate opens AMPA → depolarizing current + small Ca²⁺; the
depolarization begins ejecting the NMDA Mg²⁺ block.
- **Source 2 (NMDA):** if depolarized enough (Mg²⁺ ejected) AND D-serine present (astrocyte
co-agonist) AND glutamate bound → large Ca²⁺ influx. This is the coincidence detector.
- **Source 3 (bAP, separate context):** back-propagating AP adds depolarization + Ca²⁺,
amplifying an existing signal supralinearly.
- **Case 1 (STP):** high Ca²⁺ drives AMPA receptors from the local reserve to the surface,
bounded by the anchoring-slot ceiling. Fast, reversible, NO dopamine. When Ca²⁺ falls,
receptors drift back — short-term depression as a passive consequence, never signaled.
- **Case 2 (LTP tag):** high Ca²⁺ + (later) dopamine sets the tag that NIGHT uses to raise the
slot ceiling. NIGHT builds slots; DAY fills them.
### DEND | bAP — bidirectional signaling
Propagates the bAP from soma toward spines (fidelity attenuates with distance — distal spines
get weaker confirmation, are harder to potentiate) and integrates spine signals toward the soma.
### SOMA | AP — integration, firing, emergent timing
Fires when integrated branch input exceeds a threshold that is the baseline (from structure)
raised by adaptation and modulated by neuromodulators, gated by the emergent refractory state.
Each AP deposits three traces (inactivation → refractory, adaptation → threshold rise, nuclear
Ca²⁺ → plasticity). The soma is the coincidence detector at the cellular scale (nuclear Ca²⁺ +
dopamine → CREB), and the production bottleneck: its tag gates how much material all downstream
components get in NIGHT.
### AXON | AP — reliable propagation with frequency-dependent failure
Propagation reliability is set by myelination and degraded by high-frequency load (Na⁺
inactivation at branch points = axonal STD). The axon also transports material to boutons and
sets the timescale of presynaptic structural commits.
### ASTRO | CONTINUOUS — gatekeeper and energy hub
Clears glutamate (EAAT), supplies D-serine (the NMDA co-agonist that gates postsynaptic LTP),
and distributes lactate to the territory by demand-weighting (active synapses generating more
clearance load pull more fuel; slow synapses get less). The same spillover that excites the
astrocyte (mGluR5 → Ca²⁺ → D-serine) also brakes the presynapse (mGluR2/3 → Gi) — one signal,
opposite effects via different receptors. The astrocyte is the energy root and the gain control
of the whole synapse.
---
## NIGHT operations — biological meaning
- **Step 1 (replenish/distribute):** overnight protein synthesis peaks (CREB-driven, gated by
soma_tag — corresponds to slow-wave-sleep replay). Soma material flows to branches/axon then
spines/boutons; astrocyte material flows to astrosynapses, tag-weighted.
- **Step 2 (strength commits):** tagged components build structure — more slots, tighter
coupling, tighter astrosynaptic wrap. Coherence bonus when pre+post+astro all tagged (the
whole synapse agrees). astro_structure self-reinforces.
- **Step 2b (endurance commits):** components with high endurance_need build budget_ceiling —
mitochondrial biogenesis. Competes with step 2 for the same material/energy.
- **Step 3 (passive decay):** both ceilings decay; maintenance from the remaining pool resists
decay only where sufficient. Depotentiation and endurance-loss are both by neglect — no
signal weakens anything; unmaintained capacity simply drifts down. Recovered material (not
energy) returns to pools.
- **Step 4 (homeostatic scaling):** if the soma fired too much overall, all synapses scale down
proportionally (sleep-associated global downscaling), preserving relative differences.
- **Step 5 (clear traces):** fast traces, possible tags, endurance needs, and soma timing traces
reset; tags below expiry clear, above-expiry tags carry forward (multi-night consolidation);
structure and budget_ceiling persist.
### Shockwave lockdown
Emergency global astrocytic Ca²⁺ wave → GABA + ATP release → mass AMPA internalization and
hyperpolarization. Bypasses budget gates. A circuit breaker against runaway excitation.
---
## Pool-filling: private reserve vs contested supply
The pseudocode uses two filling primitives, distinguished by where the resource comes from.
**`fill` (private reserve).** The pool is replenished from a source the component owns
outright, uncontested by siblings, bounded by the component's own ceiling and a rate cap.
- RRP refill — vesicles mobilized from the bouton's own reserve pool toward the docking-slot
ceiling, rate-limited by VATPase. The reserve is private to the bouton.
- SOMA self-replenish — the soma fuels itself from its own mitochondria toward its budget
ceiling. No other component draws on it.
**`refill` (contested supply).** The pool is replenished from a supply that multiple
components compete for, rationed by demand (gap to ceiling).
- pre/post/dend/axon budgets — drawn from astrocytic lactate (shared across all synapses the
astrocyte wraps) plus shipment from soma/axon/dendrite (shared across downstream targets).
**Neither primitive (their own forms).** Some inflows are not fills toward a ceiling:
- AMPA surface insertion — Ca²⁺-driven rate from the spine's private endosomal reserve, with
an explicit passive drift-back (short-term depression) when Ca²⁺ is low. Not a steady fill.
- D-serine release — demand-driven (saturating in astro Ca²⁺) and budget-limited, like NT
release; a release process, not a pool top-up.
- Root productions — `glycolysis(glucose)` at the astrocyte and `CREB_synth(soma_tag)` at the
soma are the system's energy and material roots: raw inflows capped only by the external
vascular supply, not fills toward an internal ceiling.
The distinction matters biologically: a private reserve guarantees a component some autonomy
(the bouton can refill its RRP from its own vesicles even when lactate is scarce), while a
contested supply couples a component's fate to its neighbours' demands (operational budget
fails first where many active synapses compete for the same lactate).
---
## PRE ↔ POST interaction: local computation, message-only coupling
The presynapse and postsynapse never read each other's internal state. They interact only
by writing to and reading from shared cleft channels. Each side computes entirely locally on
what it has: its own variables plus whatever signals have arrived in the cleft. This is the
message-passing realization of the locality principle.
**Forward channel — glutamate (PRE → POST and ASTRO).** The presynapse writes glutamate via
NT_flux. The postsynapse reads it (AMPA, NMDA) and the astrosynapse reads it (clearance,
mGluR5). The astrosynapse clears it. PRE never knows whether POST responded — it only emits.
**Gate channel — astro_Dserine (ASTRO → POST).** The astrosynapse writes D-serine; the
postsynapse reads it as the obligatory NMDA co-agonist. POST cannot open NMDA without this
arrived signal, but it does not read the astrocyte's state — only the delivered D-serine.
**Backward channel + — retro_NO (POST → PRE).** When the postsynapse's NMDA opens (Mg²⁺
ejected, D-serine present, glutamate bound), nNOS — physically tethered to the NMDA receptor
through PSD-95 — synthesises nitric oxide (and, on a slower timescale, BDNF is released).
These diffuse retrogradely to the presynapse. Biologically this is the classic retrograde
messenger of LTP: it tells the bouton that its release landed on a postsynapse that genuinely
responded. In the model, POST emits `retro_NO` proportional to its own NMDA-driven calcium —
computed purely from POST's local state — and PRE reads it as `retro_NO_local`.
`retro_NO_local` is exactly the grounding of the presynaptic endurance signal. The
presynapse's local success proxy is "I was releasing strongly" (`pre_fast_trace` high). On
its own that only says the bouton was working hard, not that the work mattered. `retro_NO`
adds the missing confirmation — that the postsynapse responded — without PRE ever reading
POST's calcium. So PRE deposits endurance need as `pre_fast_trace × (1 + retro_NO_local)`:
strong release that was confirmed effective makes the strongest claim that fuel, not
futility, was what interrupted a forming success. retro_NO is short-lived (NO degrades and
diffuses within seconds), so the channel decays fast — confirmation must be recent to count.
**Backward channel — retro_eCB (POST → PRE).** When the postsynapse is strongly
depolarised, it synthesises endocannabinoids (2-AG, anandamide) that diffuse retrogradely and
bind presynaptic CB1 receptors, suppressing release. This is depolarisation-induced
suppression of excitation (DSE) — a homeostatic negative feedback: an over-driven postsynapse
tells the presynapse to release less. In the model, POST emits `retro_eCB` from its own
membrane potential, and PRE reads it as `retro_eCB_local`, which reduces the release drive
`sat(...) × (1 - retro_eCB_local)`. Again POST computes from its own state; PRE adjusts from
the arrived signal; neither reads the other's interior.
The two backward channels are opposite-signed messages the postsynapse sends about its own
condition: retro_NO says "your input was effective — worth sustaining," retro_eCB says "I am
saturated — ease off." Together with the forward glutamate and the D-serine gate, they make
the synapse a fully message-coupled system of locally-computing components.
**Why RRP refill is in NOT_AP only.** During an AP the bouton releases — RRP depletes. Refill
(VATPase reloading vesicles from the reserve pool) is a recovery process that proceeds between
spikes. Placing `fill(RRP, ...)` only in the NOT_AP context makes the AP context pure
depletion and the NOT_AP context pure recovery. A consequence falls out for free: during
sustained high-frequency firing there are many AP steps and few NOT_AP steps, so RRP depletes
faster than it recovers — short-term depression deepens with frequency, with no explicit
depression rule. The release itself is throttled further when budget is low (VATPase refill
is energy-limited), coupling metabolic state to the depth of depression.
---
## Presynaptic short-term potentiation — VGCC coupling occupancy
`VGCC_active` is the presynaptic parallel to the postsynaptic `AMPA_surface`. Both are MEDIUM-tier
occupancy variables: a current operating value filled toward a NIGHT-built ceiling, no dopamine,
reversible, drifting back when undriven.
Biologically, `VGCC_active` represents the effective coupling between voltage-gated calcium
channels and the vesicle docking slots — how reliably each calcium influx is converted into
release. Repeated eligible activity (accumulated `pre_possible_tag`) transiently tightens this
coupling — through calcium-channel facilitation, active-zone protein phosphorylation, and
channel-to-sensor proximity changes — raising release efficiency without changing the number of
channels (which is the structural ceiling `pre_structure.VGCC_coupling`, written only at NIGHT).
When eligibility falls, the coupling relaxes back to baseline over seconds-to-minutes: presynaptic
short-term depression as the passive consequence of undriven coupling, never a signalled act.
This gives the presynapse a genuine intermediate-timescale memory it previously lacked — a
"this bouton has been reliably active lately" state that outlasts individual spikes and bursts,
filling the gap between the fast trace (residual calcium, ~100 ms) and the tag (hours). It also
completes the capacity/occupancy symmetry across the synapse: both PRE and POST now fill a
MEDIUM occupancy variable toward a PERSISTENT structural ceiling, rather than PRE reading its
ceiling directly as if capacity and occupancy were the same thing.
---
## NIGHT as iterated NREM cycles — the biology
The distributed, cyclic NIGHT models sleep-dependent consolidation more faithfully than a single
commit step.
**Why cycles, not one event.** NREM sleep proceeds in repeated cycles (the ultradian ~90-minute
rhythm, and within it the <1 Hz slow oscillation with its up- and down-states). Protein synthesis,
hippocampalcortical replay, and synaptic renormalization all advance incrementally across these
cycles rather than in a single consolidation moment. Modeling NIGHT as a loop of cycles captures
this: each cycle is a small, local round of produce → transport → incorporate.
**Production each cycle (the roots).** The soma's CREB-driven transcription/translation produces a
batch of structural material per cycle, gated by the soma's own tag (replay-driven activity).
The astrocyte cell body produces a batch of energy (glycolysis) and ECM material per cycle, capped
by glucose. These are the two roots; everything downstream lives on what they ship.
**Transport over cycles (the descent).** Material and energy move one hop down the supply chains
per cycle — soma → dendrite/axon → spine/bouton; astrocyte body → astrosynapses — by the same
motor transport that carries cargo by day, now at the consolidation timescale. A distal bouton on
a long axon therefore receives its material only after several cycles, so its consolidation lags
a proximal one. This is the NIGHT-scale image of the transit delay.
**Incorporation and tag consumption (the commit).** A tagged synapse incorporates arrived material
into structure (more receptor slots, tighter active zone, tighter astrocytic wrap) or into budget
capacity (mitochondrial biogenesis), spending energy on the assembly. The tag is consumed in
proportion to what was built — the molecular tag (CaMKII/PKA-maintained eligibility) is discharged
as capture completes. A strong tag is satisfied early; a marginal one waits for later cycles.
**Two ways the night ends.** Either the standing tags are all spent (consolidation finished — the
rested case) or the night's metabolic budget is exhausted (ran out of night — the overloaded
case). Unspent tags are not discarded: they persist (decaying slowly) into the next day and
compete again the next night, so importance is re-tested across nights and a marginal memory may
consolidate over several nights or, if it decays first, never.
**Energy is the irreversible cost.** Material released when an unmaintained structure is pruned
returns to the pool and is reused; the energy burned to build or to prune is gone. Across a
lifetime this energy throughput bounds how much the system can ever consolidate — the metabolic
arrow of time underlying the whole model.
---
## NIGHT's hierarchy of actors — the biology
**Why the actors differ from DAY's.** Transmission is local — a bouton releases, a spine
integrates, an astrosynapse clears. Consolidation is not: it involves quantities no single
synapse can see. Whether one synapse's strengthening "fits" depends on the neuron's total
synaptic weight; reallocating metabolic support depends on an astrocyte's whole territory;
deciding which memories to replay depends on assemblies of neurons. So NIGHT is enacted by
actors at higher scales, each conserving a quantity at its scale.
**The astrocyte territory (Tier 2).** The astrocyte cell body supports hundreds to thousands of
synapses. By day it allocates lactate by demand; by night it reallocates its produced energy and
ECM material across its whole territory, biased by the demand it accumulated and by replay. This
is a genuine territory-level actor — the astrocyte is the metabolic arbiter of its domain, and
its nightly reallocation decides which of its synapses can afford to consolidate.
**The neuron as a whole (Tier 1).** Synaptic homeostasis (the synaptic homeostasis hypothesis of
Tononi and Cirelli) operates on the neuron's *total* synaptic weight: across sleep, the cell's
synapses are renormalized downward multiplicatively, preserving relative differences while
restoring overall excitability and freeing capacity. This is a neuron-scale operation — no synapse
can perform it, because no synapse knows the cell's total weight. In the model the neuron
accumulates that total by day and renormalizes it by night, scaling all the cell's structures by
a common factor when the total exceeds the cell's budget.
**The assembly / network (Tier 0, external).** Systems consolidation — hippocampalcortical replay
— reactivates the day's patterns across ensembles of neurons during NREM, and this dialogue
selects which assemblies are written into cortex. This is a network-scale process beyond a single
neuron, so the model treats it as an external arrived signal (`replay_reweight`), exactly as it
treats dopamine and glucose. Fully modeling it requires a network of these neurons.
**Occupancy downscaling — why only ceilings persist.** During the day, synapses fill occupancy:
receptors trafficked to the surface (AMPA_surface), calcium-channel coupling tightened
(VGCC_active), eligibility accumulated (possible_tag). These are transient and reversible. If they
carried across the night undiminished, a synapse could become lastingly strong without ever
earning a tag or paying the consolidation cost — bypassing the entire validation machinery.
Multiplicative-global downscaling during early-night cycles returns occupancy to baseline. A
synapse that was tagged and had its *ceiling* raised starts the next day strong; one that merely
filled occupancy during the day starts back at baseline. The relative potentiation survives only
where it was written into structure — which is precisely synaptic homeostasis enforcing that the
slow tier carries the learning and the fast/medium tier is renewed each day.
**Why phased.** A single sweep cannot both reset and build, because building should act on the
*post-reset* landscape. Early cycles are subtractive (downscale occupancy, renormalize weight,
make metabolic room); later cycles are additive (commit the survivors). This is the NREM arc —
slow-wave-dominated downscaling early, selective consolidation later — and it makes each cycle's
*kind* depend on where in the night it falls, so the cycles are genuinely different operations,
not installments of one.
@@ -0,0 +1,974 @@
# Tripartite Synapse — Pseudocode v16
> Companion: `tripartite_synapse_v16_biology.md` · principle: `logic_principles_v3`.
> Changes from v15 — NIGHT gains HIGHER-SCALE ACTORS and a PHASED structure:
> (1) NIGHT is enacted by a hierarchy of homeostatic actors, NOT the DAY components alone:
> COMPONENT (commits own ceilings) → ASTROCYTE territory (reallocates across its synapses)
> → NEURON (renormalizes total weight) → [assembly/network replay: external arrived signal]
> (2) the NEURON and ASTROCYTE-territory actors ACCUMULATE aggregate traces by DAY
> (total weight/activity; territory demand) and ACT by NIGHT (renormalize; reallocate)
> (3) OCCUPANCY is reset each NIGHT: multiplicative-global downscaling drives VGCC_active,
> AMPA_surface, possible_tag back toward baseline — only CEILINGS persist across a night
> (4) NIGHT is PHASED: early cycles DOWNSCALE (subtractive, reset occupancy, make room),
> late cycles COMMIT (additive, build ceilings for the survivors)
> (5) governing rule: what persists across a night must have EARNED persistence —
> occupancy that earned no tag returns to baseline; the system acts locally, consolidates
> hierarchically
> Carried: cyclic NIGHT, tag-as-fuel, emergent termination, DAY-up/NIGHT-down, seven-group grammar.
---
## Functional groups (seven-group grammar)
```
RECEIVE take in resources + signals that arrived from outside (boundary: in)
TRACE maintain the trace hierarchy — deposit fast trace; accumulate
possible_tag + endurance_need; stabilize tag on coincidence
ADJUST compute local operating parameters from structure + traces + modulators
BEHAVE the component's defining action, within both ceilings
EMIT send out — signals (messages) + resources (shipments) (boundary: out)
RECOVER refill own private pools consumed by behaving
DECAY let traces recede, closing their windows
```
EVALUATE merged into TRACE: judging a behavior is always maintaining a trace, whether or not
a trace is written. BEHAVE and EMIT stay separate — EMIT is the output half of the locality
interface (RECEIVE/EMIT are the only boundary crossings). TRACE spans all timescales: the
soma's inactivation, adaptation, and nuclear-Ca deposits are all TRACE. Order within a context
follows data dependencies; TRACE reads/writes whatever trace state is current.
EVERY FLOW HAS A TIMESCALE. Decay relaxes toward 0 over τ; creation/arrival relaxes toward a
target over τ — the same first-order operator. Within-step writes are the special case τ ≪ Δt.
Rate-limited inflows (fill/refill/flux·Δt) carry their τ implicitly; shipment carries an
explicit transit delay (see `transit`).
THE GROUPS MOVE BETWEEN TIERS (the ladder; see logic_principles "The Timescale Ladder").
Four tiers: FAST (mss) · MEDIUM (smin) · SLOW (hr) · PERSISTENT (NIGHT-written). The groups
move evidence UP the ladder and read capacity DOWN it:
```
ADJUST reads PERSISTENT ceiling + FAST trace → sets this step's operating point (down)
BEHAVE acts at FAST, bounded by the PERSISTENT ceiling (down)
TRACE deposits FAST, accumulates FAST→MEDIUM evidence, stabilizes MEDIUM→SLOW tag (up)
RECOVER refills toward the PERSISTENT ceiling (down)
DECAY relaxes FAST · MEDIUM · SLOW (PERSISTENT never decays in DAY)
NIGHT commits SLOW tag + MEDIUM endurance_need → PERSISTENT ceilings (up)
```
Capacity flows downward (slow sets the ceiling for fast); evidence flows upward (fast
accumulates toward slow). Each component's DECAY group below is banded by tier to show this.
NIGHT IS THE SAME GRAMMAR, ITERATED, WITH THE FLOW REVERSED. NIGHT is not a separate section —
each component carries a `NIGHT |` block, and a driver loops all blocks for cycle = 1,2,3…
until the night ends. DAY runs bottom-up (consumers act first, evidence ascends leaves→roots);
NIGHT runs top-down (producers act first, capacity descends roots→leaves). Per cycle, each
component:
```
RECEIVE take in the material + energy batch that arrived from my producer this cycle
TRACE read my own tag / endurance_need (the standing demand)
ADJUST size this cycle's commit from material + energy actually on hand
BEHAVE commit a BATCH: structure += Δ (from tag) ; budget_ceiling += Δ' (from need)
spend material + energy ; SPEND the tag/need by the committed amount (tag-as-fuel)
EMIT ship a batch of material + energy one hop down to my consumers (demand-weighted)
RECOVER reclaim material from any ceiling that decayed this cycle (energy is NOT recovered)
DECAY unmaintained ceilings drift down a little; tags decay a little
```
Roots (SOMA, ASTRO cell body) PRODUCE the batch each cycle (RECEIVE = production, capped by
glucose / CREB). The night ends when DEMAND is exhausted (no tag stands above tag_expiry,
system-wide) OR SUPPLY is spent (the night's energy throughput is used up) — whichever first.
Unspent tags are NOT cleared; they carry to the next DAY and compete again next NIGHT. The
top-down order needs no schedule: iterating the local cycle delivers capacity to distal sites
over successive cycles, as transport physically does.
NIGHT'S ACTORS ARE NOT DAY'S ACTORS — THE SYSTEM ACTS LOCALLY, CONSOLIDATES HIERARCHICALLY.
DAY is enacted by the six local components. NIGHT is enacted by a HIERARCHY of homeostatic
actors, each conserving a quantity at its own scale and constraining the scale below:
```
[ ASSEMBLY / NETWORK ] replay re-presents the day across neurons (EXTERNAL signal)
↓ constrains → arrives as replay_reweight[·] (like dopamine/glucose: external)
NEURON (the whole cell) conserves TOTAL synaptic weight; renormalizes so no synapse
↓ constrains grows beyond the cell's global budget; drives occupancy downscaling
ASTROCYTE territory conserves total metabolic output; reallocates energy/material
↓ constrains across ALL synapses it wraps, by accumulated territory demand
COMPONENT commits its own ceilings within the allocation handed down
```
These higher actors are DORMANT-BUT-ACCUMULATING by DAY and ACTIVE-AND-CONSTRAINING by NIGHT.
By DAY they only integrate an aggregate trace of the components' emitted activity (they sum
what was emitted, never read a component's interior — locality holds): the NEURON accumulates
`neuron_total_weight` and `neuron_activity`; the ASTROCYTE territory accumulates
`astro_territory_demand[·]`. By NIGHT they act on those aggregates: the astrocyte reallocates,
the neuron renormalizes. The assembly/network tier is not modelled here; its effect enters as
an external arrived signal `replay_reweight`, exactly as dopamine and glucose do.
NIGHT IS PHASED. Early cycles DOWNSCALE (subtractive): occupancy filled during the day —
VGCC_active, AMPA_surface, possible_tag — is driven back toward baseline by multiplicative-global
scaling, and total weight is renormalized. Late cycles COMMIT (additive): the survivors' tags
build ceilings. The rule the phasing enforces: WHAT PERSISTS ACROSS A NIGHT MUST HAVE EARNED
PERSISTENCE. Occupancy that earned no tag returns to baseline; only ceilings carry forward. The
relative potentiation of a tagged synapse survives because it was written into its ceiling, not
because its transient occupancy was spared.
---
## Conventions
```
SCOPE = {DAY, NIGHT} CONTEXT = {AP, NOT_AP, bAP, NOT_bAP, CONTINUOUS}
VARIABLE TIERS (timescale = meaning; see logic_principles "The Timescale Ladder")
FAST (mss) immediate response fast_trace
MEDIUM (smin) occupancy + evidence possible_tag · endurance_need · VGCC_active · AMPA_surface · RRP
SLOW (hr) consolidation bridge tag
─────────────────────────────────────────────────────────────────────────────
PERSISTENT (NIGHT) capacity (the ceilings) structure · budget_ceiling
energy (not recoverable) · material (recoverable)
DAY budget · fast_trace · possible_tag · endurance_need
BRIDGE tag (POST: CANDIDATE→STABLE)
NIGHT energy (not recoverable) · material (recoverable) · structure · budget_ceiling
LOCALITY only local state + arrived signals; no component reads another's internal state.
CLEFT MESSAGE CHANNELS SHIPMENT CHANNELS (transit-delayed)
glutamate PRE → POST, ASTRO soma_ship_dend SOMA→DEND
astro_Dserine ASTRO → POST soma_ship_axon SOMA→AXON
retro_NO POST → PRE (+) dend_ship_post DEND→POST
retro_eCB POST → PRE () axon_ship_pre AXON→PRE
```
---
## Primitives (return the increment; caller applies it)
```
sat(x, K) = x / (K + x)
fill(pool, ceiling, rate, cost, budget) -> amount: // PRIVATE reserve, rate-limited (implicit τ)
amount = min(rate, ceiling - pool)·Δt; budget -= amount·cost; return amount
refill(c from supply S) -> amount: // CONTESTED supply, gap-bounded
demand = c.budget_ceiling - c.budget
factor = min(1, S / (Σ demand over components on S + ε)); S -= demand·factor
return demand·factor
ship(from_budget, demand_sig, frac, cost) -> amount: // emit into transit (not to target directly)
amount = min(from_budget·frac, demand_sig); from_budget -= amount·(1+ship_cost); return amount
transit(channel, τ_transport) -> arrival: // delivers in-transit cargo over τ
arrival = channel·(Δt/τ_transport); channel -= arrival; return arrival
```
---
## SHARED parameters
```
dopamine NE ACh // organism broadcasts (external)
replay_reweight[·] // assembly/network replay re-weighting (external, NIGHT)
glucose geometry // physical (external)
elig dop_thr tag_thr tag_expiry // strength gates (universal)
traj_thr endur_thr // endurance gates (universal)
ship_cost // transport overhead (all shipments)
{dend,axon,pre,post}_ship_frac // DAY budget-shipment fractions
τ_transport_{dend,axon,spine,bouton} // shipment transit times (distance-dependent)
ε
```
## NIGHT parameters (consolidation only)
```
slot_batch cap_batch f_cap // per-CYCLE commit sizes / endurance fraction
night_energy_ceiling // total energy a single night can spend (supply bound)
Δt_cycle // duration of one NIGHT cycle
maint_frac cap_frac // maintenance allocation
decay_rate capacity_decay_rate recycle // passive ceiling decay + material recovery
homeostatic_ceiling coherence_factor assembly_cost biogenesis_cost maint_cost
f_dend f_axon f_spine f_bouton // per-cycle material/energy ship fractions (down the chain)
downscale_factor // per-early-cycle multiplicative occupancy reset (<1)
neuron_weight_ceiling // the cell's total-weight budget (renormalization target)
early_phase_frac // fraction of night cycles that are DOWNSCALE phase
```
---
---
# DAY
---
## PRE
The presynaptic bouton releases neurotransmitter and gathers evidence about whether that
release was worth strengthening and worth sustaining. Its behavior unfolds across two DAY
contexts and the NIGHT scope.
**During DAY, during AP — the bouton releases neurotransmitter.** The amount released depends on
residual **calcium** from recent spikes (the fast trace, setting the drive), the current
**VGCC coupling occupancy** (how tightly calcium channels are coupled to docking slots right
now — filled short-term, bounded by structure), the two **retrograde messages** from the
postsynapse (`retro_eCB` brakes the drive; `retro_NO` will confirm release reached a responsive
target), and the availability of both **fuel and vesicles**. Two shortfalls are read
differently: a fuel shortfall on a succeeding release is evidence the bouton needs more
*endurance*; an empty pool with fuel to spare is ordinary short-term depression.
**During DAY, during NOT_AP — the bouton consolidates, potentiates short-term, and recovers.**
With no spike to release, it latches the retrograde messages (RECEIVE); maintains its traces —
accumulating eligibility toward a dopamine-gated tag (TRACE); transiently tightens its VGCC
coupling from accumulated eligibility, with no dopamine, a reversible short-term potentiation
bounded by the structural ceiling (BEHAVE); refills both its budget (contested supply) and its
vesicle pool (private reserve) (RECOVER); and lets its traces decay, closing the windows (DECAY).
**During NIGHT — the bouton's ceilings are rewritten.** NIGHT raises the bouton's **structure**
(active-zone capacity, including the VGCC-coupling ceiling) where a validated tag accumulated,
and its **budget capacity** (mitochondrial endurance) where fuel repeatedly interrupted a
succeeding release. Both draw on the same finite material and energy shipped down the axon, so
the two kinds of growth compete — and whatever is not maintained drifts back down.
```
// PARAMETERS K_release · release_cost · fusion_cost · vatpase_cost · spillover · brake
// stp_thr · coupling_gain · coupling_drift · VGCC_baseline
// INTERFACE
// EMIT glutamate → POST, ASTRO
// RECEIVE retro_NO, retro_eCB ← POST (signals latched; resources refill in RECOVER)
// READ glutamate (own cleft, autobrake) ; dopamine (gates tag)
// OWN pre_structure{slot_ceiling, VGCC_coupling, refill_ceiling} ; pre_budget_ceiling
// VGCC_active (occupancy: current coupling, filled toward VGCC_coupling ceiling)
// SUPPLY astro_lactate[syn] ← ASTRO ; axon_ship_pre ← AXON ; pre_material ← AXON(NIGHT) ; pre_energy ← SOMA(NIGHT)
// EMERGENCY shockwave_lockdown ← ASTRO
//
// TRACE CREATION MODES (every trace: trace += input·Δt trace·(Δt/τ_decay))
// impulse input = quantum·δ(event) — a point event; no rise time, τ = decay only (FAST)
// accumulate input = rate(condition)·Δt — ramps while a condition holds; τ = rise AND decay (MEDIUM/SLOW)
// A trace's tier is set by BOTH its creation mode and its decay: the fast trace is impulse-created
// and fast-decaying; possible_tag/endurance_need are slowly accumulated and medium-decaying.
DAY | AP:
// TRACE FAST · impulse (Ca²⁺ bolus from THIS spike — a point event; no rise time,
// decay alone sets its τ; frequency is emergent from impulse-rate vs decay)
pre_fast_trace += spike_Ca(pre_structure.VGCC_coupling)·δ(spike)
// ADJUST (release drive from residual Ca²⁺ × current coupling occupancy, + DSE brake)
drive = sat(pre_fast_trace × VGCC_active, K_release) × (1 - retro_eCB_local)
// BEHAVE (release; two distinct failure modes)
if pre_budget < release_cost:
// FUEL shortfall → endurance evidence (retro_NO-confirmed local success)
suppress(NT_flux)
// TRACE MEDIUM · accumulate (ramps while fuel keeps interrupting a succeeding release)
if pre_fast_trace > traj_thr:
pre_endurance_need += pre_fast_trace × (1 + retro_NO_local)·Δt
exit
if RRP == 0:
// OCCUPANCY shortfall → short-term depression (NOT endurance; fuel was fine)
suppress(NT_flux)
exit
NT_flux = RRP × drive; RRP -= NT_flux·Δt; pre_budget -= NT_flux·fusion_cost
// EMIT (glutamate into cleft)
glutamate += NT_flux·Δt
if glutamate > spillover: drive *= brake // own-cleft autobrake
DAY | NOT_AP:
// RECEIVE (latch backward messages — signals only)
retro_NO_local = retro_NO; retro_eCB_local = retro_eCB
// TRACE (strength pathway — evidence climbs the ladder)
// MEDIUM · accumulate (ramps while fast_trace stays eligible; rise-rate is its τ_rise)
if pre_fast_trace > elig: pre_possible_tag += pre_fast_trace·Δt
// SLOW · accumulate (ramps only on dopamine coincidence; rise gated by validation)
if dopamine > dop_thr and pre_possible_tag > tag_thr:
pre_tag += dopamine × pre_possible_tag·Δt
// BEHAVE (short-term potentiation: eligibility tightens coupling, NO dopamine; drifts back)
if pre_possible_tag > stp_thr:
VGCC_active = min(VGCC_active + coupling_gain × pre_possible_tag, pre_structure.VGCC_coupling)
else:
VGCC_active = max(VGCC_active - coupling_drift·Δt, VGCC_baseline) // STD = consequence
// RECOVER (refill BOTH pools: contested budget + private RRP)
pre_budget += refill(pre from astro_lactate[syn] + transit(axon_ship_pre, τ_transport_bouton))
RRP += fill(RRP, pre_structure.slot_ceiling, pre_structure.refill_ceiling, vatpase_cost, pre_budget)
// DECAY
// FAST (mss)
pre_fast_trace *= decay(100ms)
// MEDIUM (smin)
pre_possible_tag *= decay(s); pre_endurance_need *= decay(min)
// SLOW (hr)
pre_tag *= decay(hr)
// (signals) arrived channels fade
dopamine *= decay(ms); retro_NO *= decay(s); retro_eCB *= decay(s)
// (PERSISTENT: pre_structure, pre_budget_ceiling — no DAY decay; NIGHT only)
NIGHT | cycle: // leaf consumer (no downstream emit)
// RECEIVE batch arrived from AXON (material) + SOMA (energy) this cycle
pre_material += transit(pre_material_ship, τ_transport_bouton)
pre_energy += transit(pre_energy_ship, τ_transport_bouton)
// TRACE read standing demand
// (pre_tag → structure ; pre_endurance_need → budget_ceiling)
// ADJUST size commits from material + energy on hand
coh = coherence_signal // arrived: pre+post+astro tags aligned
// BEHAVE commit batches; spend tag/need as fuel
if pre_tag > tag_expiry:
Δ = min(slot_batch, pre_material, pre_energy·f_cap)
pre_structure += Δ × coh; pre_material -= Δ; pre_energy -= Δ·assembly_cost
pre_tag -= Δ // tag-as-fuel
if pre_endurance_need > endur_thr:
Δ' = min(cap_batch, pre_material·f_cap, pre_energy·f_cap)
pre_budget_ceiling += Δ'; pre_material -= Δ'; pre_energy -= Δ'·biogenesis_cost
pre_endurance_need -= Δ'
// EMIT (none — bouton is a leaf; nothing downstream)
// RECOVER reclaim material from any ceiling that decayed this cycle
pre_material += pre_ceiling_shrinkage·recycle // energy NOT recovered
// DECAY unmaintained ceilings + tags drift down a little
pre_structure -= decay_rate·Δt_cycle; pre_budget_ceiling -= capacity_decay_rate·Δt_cycle
pre_structure += min(pre_maint, maint_cost); pre_budget_ceiling += min(pre_cap_maint, cap_cost)
pre_tag *= decay(slow); pre_endurance_need *= decay(slow)
```
---
## POST
The postsynaptic spine is the synapse's primary memory locus: it detects coincident input,
runs the calcium dynamics that decide potentiation versus depression, and requires the most
validation (three coincidences) before committing. Its behavior unfolds across two DAY
contexts and the NIGHT scope.
**During DAY, during NOT_bAP — the spine integrates input and decides plasticity.** Three
calcium sources feed its fast trace: AMPA current (small Ca, begins ejecting the NMDA Mg block),
NMDA (large Ca, but only on the local coincidence of depolarization + astrocyte D-serine +
glutamate), and — in the bAP context — the back-propagating spike. High calcium drives AMPA
receptors to the surface (short-term potentiation, occupancy filled toward the slot ceiling, no
dopamine); when calcium falls, they drift back (short-term depression as a consequence). The
spine also emits two retrograde messages from its own state — NO when it responded, an
endocannabinoid brake when over-driven — and accumulates a dopamine-gated tag toward
consolidation. A fuel shortfall while calcium was climbing toward a tag is endurance evidence;
a surface already at its ceiling is a structural limit, not endurance.
**During DAY, during bAP — the back-propagating spike confirms coincidence.** The somatic spike
arrives at the spine, adds depolarization and calcium, and supralinearly amplifies an existing
candidate — the soma's confirmation that it fired, one of the three coincidences the spine
requires.
**During NIGHT — the spine's ceilings are rewritten.** NIGHT raises **structure** (the AMPA
slot ceiling, spine volume) where a validated tag accumulated — with a coherence bonus when pre,
post, and astro all tagged the same synapse — and **budget capacity** where fuel interrupted a
climbing calcium trajectory. Both draw the same finite pool, so they compete; unmaintained
ceilings drift down.
```
// PARAMETERS K_AMPA · AMPA_Ca · AMPA_cost · NMDA_cost · bAP_cost · pka_cost · traffic_cost
// req_cost · Mg_eject · Dserine_thr · Ca_STP · Ca_TAG · eCB_thr · drift · baseline
// NO_synth_cost · eCB_synth_cost
// INTERFACE
// EMIT retro_NO (+), retro_eCB () → PRE
// RECEIVE (signals) glutamate ← PRE ; astro_Dserine ← ASTRO ; bAP ← DEND/SOMA ; dopamine
// READ glutamate ; astro_Dserine ; bAP (dend_structure.bAP_fidelity) ; dopamine
// OWN post_structure{slot_ceiling, spine_volume, reserve_ceiling} ; post_budget_ceiling
// SUPPLY astro_lactate[syn] ← ASTRO ; dend_ship_post ← DEND ; post_material ← DEND(NIGHT) ; post_energy ← SOMA(NIGHT)
// EMERGENCY shockwave_lockdown ← ASTRO
// NOTE POST endurance is own-state only (own Ca climbing); no arrived feedback term.
DAY | NOT_bAP:
// ADJUST (AMPA drive from arrived glutamate)
a = sat(glutamate, K_AMPA)
// BEHAVE (SOURCE 1 AMPA: current + small Ca + begins Mg ejection)
AMPA_current = a × AMPA_surface; Vm += AMPA_current; post_budget -= AMPA_cost
// TRACE (Ca deposited by AMPA)
post_fast_trace += AMPA_Ca·AMPA_current
// BEHAVE (SOURCE 2 NMDA: large Ca on local coincidence)
if Vm > Mg_eject and astro_Dserine > Dserine_thr and glutamate > 0:
post_fast_trace += NMDA_Ca(glutamate)·rise_speed(); post_budget -= NMDA_cost
// EMIT (+ NO/BDNF: "release reached a responsive target")
retro_NO += NO_emit(post_fast_trace); post_budget -= NO_synth_cost
// EMIT ( endocannabinoid / DSE when over-driven)
if Vm > eCB_thr:
retro_eCB += eCB_emit(Vm); post_budget -= eCB_synth_cost
post_fast_trace *= decay(ms)
// BEHAVE (STP fill slots from private reserve ; else STD drift = consequence)
if post_fast_trace > Ca_STP:
if post_budget < traffic_cost:
// FUEL shortfall → endurance (own Ca was climbing toward a tag)
if post_fast_trace > traj_thr and post_fast_trace_rising:
post_endurance_need += post_fast_trace
else if AMPA_surface < post_structure.slot_ceiling:
AMPA_surface += Ca_insert(post_fast_trace); post_budget -= traffic_cost
// else: surface already at slot_ceiling → structure-limited (not endurance)
else:
AMPA_surface = max(AMPA_surface - drift·Δt, baseline) // STD = consequence
// TRACE (strength: CANDIDATE then STABLE via dopamine)
if post_fast_trace > Ca_TAG: post_possible_tag += post_fast_trace; post_budget -= pka_cost
if dopamine > dop_thr and post_possible_tag > tag_thr:
post_tag += dopamine × post_possible_tag
// RECOVER (refill budget from contested supply)
post_budget += refill(post from astro_lactate[syn] + transit(dend_ship_post, τ_transport_spine))
// DECAY
// FAST (mss) — post_fast_trace already decayed above (intra-step, pre-tagging)
// MEDIUM (smin)
post_possible_tag *= decay(min); post_endurance_need *= decay(min)
// SLOW (hr)
post_tag *= decay(hr)
// (signals)
dopamine *= decay(ms)
// (PERSISTENT: post_structure, post_budget_ceiling — no DAY decay; NIGHT only)
DAY | bAP:
// BEHAVE (SOURCE 3 bAP: depolarization + Ca, amplifies existing signal)
Vm += bAP_depol × dend_structure.bAP_fidelity; post_budget -= bAP_cost
// TRACE (supralinear boost only if a CANDIDATE is present)
if post_possible_tag > Ca_TAG: post_fast_trace += bAP_Ca_boost()
NIGHT | cycle: // leaf consumer (no downstream emit)
// RECEIVE batch arrived from DEND (material) + SOMA (energy) this cycle
post_material += transit(post_material_ship, τ_transport_spine)
post_energy += transit(post_energy_ship, τ_transport_spine)
// TRACE read standing demand (post_tag → structure ; post_endurance_need → budget_ceiling)
// ADJUST coherence applies to POST (synaptic component)
coh = coherence_signal
// BEHAVE commit batches; spend tag/need as fuel
if post_tag > tag_expiry:
Δ = min(slot_batch, post_material, post_energy·f_cap)
post_structure += Δ × coh; post_material -= Δ; post_energy -= Δ·assembly_cost
post_tag -= Δ
if post_endurance_need > endur_thr:
Δ' = min(cap_batch, post_material·f_cap, post_energy·f_cap)
post_budget_ceiling += Δ'; post_material -= Δ'; post_energy -= Δ'·biogenesis_cost
post_endurance_need -= Δ'
// EMIT (none — spine is a leaf)
// RECOVER reclaim material from decayed ceilings
post_material += post_ceiling_shrinkage·recycle // energy NOT recovered
// DECAY
post_structure -= decay_rate·Δt_cycle; post_budget_ceiling -= capacity_decay_rate·Δt_cycle
post_structure += min(post_maint, maint_cost); post_budget_ceiling += min(post_cap_maint, cap_cost)
post_tag *= decay(slow); post_endurance_need *= decay(slow)
```
---
## DEND
The dendritic branch is the postsynapse's supply line and the neuron's input integrator. It
carries the back-propagating spike out to its spines, integrates their voltages toward the
soma, and ships material and budget to the spines it supports. Its behavior unfolds across two
DAY contexts and the NIGHT scope.
**During DAY, during bAP — the branch propagates and integrates.** When the soma fires, the
branch propagates the back-propagating spike toward its spines, with a fidelity that attenuates
with distance (distal spines get weaker confirmation, are harder to potentiate). It deposits
branch calcium and integrates its spines' voltages into a single branch signal sent on to the
soma. A fuel shortfall that cuts propagation short while the branch was strongly active is
endurance evidence; propagation that simply attenuates with distance is a structural limit, not
endurance.
**During DAY, during NOT_bAP — the branch consolidates, supplies, and recovers.** It maintains
its tag toward consolidation, lowers its commit threshold under acetylcholine (attention),
ships budget down to its spines (demand-weighted by their tags), runs local translation if
tagged, refills its own budget from astrocytic lactate and somatic shipment, and lets its
traces decay.
**During NIGHT — the branch's ceilings are rewritten.** NIGHT raises **structure** (bAP
fidelity, translation capacity) where a validated tag accumulated and **budget capacity** where
fuel interrupted strong branch activity, both from the shared pool, both competing; unmaintained
ceilings drift down.
```
// PARAMETERS prop_cost · branch_Ca_cost · integrate_cost · translate_cost · ACh_gain
// INTERFACE
// EMIT bAP_local → POST ; branch_Vm → SOMA ; dend_ship_post → POST
// RECEIVE (signals) SOMA.fired ; POST.Vm + spine spillover ; dopamine ; ACh
// READ SOMA.fired ; POST.Vm + spine spillover ; dopamine ; ACh
// OWN dend_structure{bAP_fidelity(pos), translation_ceiling, transport_speed} ; dend_budget_ceiling
// SUPPLY astro_lactate[branch] ← ASTRO ; soma_ship_dend ← SOMA ; dend_material, dend_energy ← SOMA(NIGHT)
// NOTE DEND endurance fires only on FUEL-limited propagation, not structural attenuation;
// own-state proxy (strong branch activity); no arrived feedback term.
DAY | bAP:
// ADJUST (propagation strength from structure — inside propagate())
// BEHAVE (propagate bAP; distinguish fuel-limited vs structure-limited shortfall)
if dend_budget < prop_cost:
// FUEL shortfall → endurance (branch was strongly active)
if dend_fast_trace > traj_thr:
dend_endurance_need += dend_fast_trace
bAP_local, reached = propagate_partial(dend_budget)
else:
bAP_local, reached = propagate(SOMA.fired, dend_structure.bAP_fidelity, geometry)
// reached < full here is structural attenuation (distance), NOT endurance
dend_budget -= prop_cost × reached
// TRACE
dend_fast_trace += bAP_Ca(bAP_local) + spine_spillover(); dend_budget -= branch_Ca_cost
// EMIT (integrated voltage to soma ; propagated bAP already reached spines)
branch_Vm = integrate(POST.Vm, spines); dend_budget -= integrate_cost
DAY | NOT_bAP:
// TRACE (strength)
if dend_fast_trace > elig: dend_possible_tag += dend_fast_trace
if dopamine > dop_thr and dend_possible_tag > tag_thr:
dend_tag += dopamine × dend_possible_tag
// ADJUST (commit threshold lowered by attention)
commit_threshold *= 1/(1 + ACh·ACh_gain)
// BEHAVE (local translation if tagged — fills dend capacity faster)
if dend_tag > tag_expiry and dend_budget > translate_cost: dend_budget -= translate_cost
// EMIT (ship budget to spines; demand = post tag)
dend_ship_post = ship(dend_budget, post_demand, post_ship_frac, ship_cost)
// RECOVER (refill budget from contested supply)
dend_budget += refill(dend from astro_lactate[branch] + transit(soma_ship_dend, τ_transport_dend))
// DECAY
// FAST (mss)
dend_fast_trace *= decay(300ms)
// MEDIUM (smin)
dend_possible_tag *= decay(s); dend_endurance_need *= decay(min)
// SLOW (hr)
dend_tag *= decay(hr)
// (PERSISTENT: dend_structure, dend_budget_ceiling — no DAY decay; NIGHT only)
NIGHT | cycle: // intermediate node (relays down to POST)
// RECEIVE batch arrived from SOMA this cycle
dend_material += transit(soma_material_to_dend, τ_transport_dend)
dend_energy += transit(soma_energy_to_dend, τ_transport_dend)
// TRACE read standing demand (dend_tag → structure ; dend_endurance_need → budget_ceiling)
// ADJUST (no coherence — DEND is not a synaptic component)
// BEHAVE commit batches; spend tag/need as fuel
if dend_tag > tag_expiry:
Δ = min(slot_batch, dend_material, dend_energy·f_cap)
dend_structure += Δ; dend_material -= Δ; dend_energy -= Δ·assembly_cost; dend_tag -= Δ
if dend_endurance_need > endur_thr:
Δ' = min(cap_batch, dend_material·f_cap, dend_energy·f_cap)
dend_budget_ceiling += Δ'; dend_material -= Δ'; dend_energy -= Δ'·biogenesis_cost
dend_endurance_need -= Δ'
// EMIT ship remaining batch one hop down to POST (demand = post tag)
post_material_ship += ship(dend_material, post_demand, f_spine, ship_cost)
post_energy_ship += ship(dend_energy, post_demand, f_spine, ship_cost)
// RECOVER reclaim material from decayed ceilings
dend_material += dend_ceiling_shrinkage·recycle // energy NOT recovered
// DECAY
dend_structure -= decay_rate·Δt_cycle; dend_budget_ceiling -= capacity_decay_rate·Δt_cycle
dend_structure += min(dend_maint, maint_cost); dend_budget_ceiling += min(dend_cap_maint, cap_cost)
dend_tag *= decay(slow); dend_endurance_need *= decay(slow)
```
---
## SOMA
The soma is the neuron's integrating center and the root of its structural material. It sums
the branch inputs, fires when they exceed a threshold it sets from its own adaptation and the
neuromodulators, and ships material and budget out to the dendrites and axon. Its timing —
refractoriness, adaptation, rhythm alignment — emerges bottom-up from local traces, never from
a represented clock. Its behavior unfolds across two DAY contexts and the NIGHT scope.
**During DAY, during AP — the soma integrates and fires.** It computes its firing threshold
from its baseline (structure), its accumulated adaptation, and the neuromodulators, and checks
its refractory state; if the integrated branch input clears the threshold and fuel allows, it
fires. One spike deposits three traces at three timescales — sodium inactivation (refractory),
slow-potassium adaptation (threshold rise), and nuclear calcium (toward CREB and the tag). A
fuel shortfall while nuclear calcium was climbing is endurance evidence; being refractory or
sub-threshold is a timing limit, not endurance.
**During DAY, during NOT_AP — the soma recovers, aligns, and supplies.** It self-replenishes
from its own mitochondria (its private root), integrates the latest branch inputs, deposits a
refractory-alignment trace when suprathreshold input arrived during its refractory period (so it
aligns to its input rhythm bottom-up), ships budget to dendrites and axon (demand-weighted by
their tags), recovers from refractoriness at a rate its alignment trace speeds up, and lets its
traces decay.
**During NIGHT — the soma's ceilings are rewritten, and it gates the whole neuron's material.**
NIGHT raises **structure** (excitability, synthesis capacity) and **budget capacity** from the
shared pool; crucially the soma's own tag gates CREB-driven synthesis, so how much material all
downstream components receive depends on the soma having been tagged.
```
// PARAMETERS ap_cost · nuclear_cost · creb_cost · mito_output · inactivation · ap_amp · ap_contrib
// base_recovery · τ_Na · τ_adapt · τ_nuclear · τ_align
// INTERFACE
// EMIT fired → AXON (propagate) + DEND (bAP) ; soma_ship_dend → DEND ; soma_ship_axon → AXON
// RECEIVE (signals) branch_Vm ← DEND ; dopamine ; NE ; ACh
// READ dopamine ; NE ; ACh
// OWN soma_structure{baseline_threshold, AP_reliability, synthesis_ceiling} ; soma_budget_ceiling
// SUPPLY self (mitochondria, ROOT — private)
// NOTE SOMA endurance fires only on FUEL shortfall (budget < ap_cost);
// refractory / sub-threshold are timing limits, not endurance. Own-state proxy.
DAY | AP:
// ADJUST (threshold from structure + adaptation + neuromodulators ; refractory gate)
threshold = soma_structure.baseline_threshold × (1 + soma_adaptation) × neuromod(NE, ACh)
can_fire = soma_Na_inactivation < inactivation
// BEHAVE (fire if able)
if branch_Vm > threshold and can_fire:
if soma_budget < ap_cost:
// FUEL shortfall → endurance (firing was approaching CREB)
if soma_fast_trace > traj_thr and soma_fast_trace_rising:
soma_endurance_need += soma_fast_trace
exit
// EMIT (fired → AXON, DEND)
fired = True; soma_budget -= ap_cost
// TRACE (three traces from one AP — FAST nuclear-Ca, MEDIUM adaptation, refractory)
soma_Na_inactivation += ap_amp // → refractory (emergent)
soma_adaptation += ap_contrib // → threshold rise
soma_fast_trace += nuclear_Ca(); soma_budget -= nuclear_cost
// TRACE (strength)
if soma_fast_trace > elig: soma_possible_tag += soma_fast_trace
if dopamine > dop_thr and soma_possible_tag > tag_thr:
soma_tag += dopamine × soma_possible_tag
soma_budget -= creb_cost
// TRACE (NEURON-level aggregator — the cell sums what its components emit, by DAY)
neuron_activity += 1 // total firing this day
neuron_total_weight += Σ all component structure across the cell // running weight tally
DAY | NOT_AP:
// RECEIVE (integrate latest branch input — signal)
branch_Vm = integrate(DEND.branch_Vm, branches)
// TRACE (bottom-up refractory alignment: suprathreshold input during refractory)
if branch_Vm > threshold and soma_Na_inactivation > inactivation:
soma_refractory_alignment += (branch_Vm - threshold) × soma_Na_inactivation
// EMIT (ship downstream into transit; demand = propagated tags)
soma_ship_dend = ship(soma_budget, dend_demand, dend_ship_frac, ship_cost)
soma_ship_axon = ship(soma_budget, axon_demand, axon_ship_frac, ship_cost)
// RECOVER (self-replenish from private root ; inactivation recovery sped by alignment)
soma_budget += fill(soma_budget, soma_budget_ceiling, mito_output, 0, soma_budget)
recovery = base_recovery × (1 + soma_refractory_alignment)
soma_Na_inactivation *= decay(τ_Na / recovery)
// DECAY
// FAST (mss) — refractory + nuclear-Ca + alignment (sub-second to seconds)
soma_fast_trace *= decay(τ_nuclear); soma_refractory_alignment *= decay(τ_align) // self-limiting
// MEDIUM (smin) — adaptation + tagging evidence
soma_adaptation *= decay(τ_adapt)
soma_possible_tag *= decay(s); soma_endurance_need *= decay(min)
// SLOW (hr)
soma_tag *= decay(hr)
// (signals)
dopamine *= decay(ms)
// (PERSISTENT: soma_structure, soma_budget_ceiling — no DAY decay; NIGHT only)
NIGHT | cycle: // ROOT (neuronal material) — produces each cycle
// RECEIVE = PRODUCTION: synthesize this cycle's batch, gated by own tag, capped externally
soma_material += CREB_synth(soma_tag)·Δt_cycle // material — recoverable
soma_energy += mito_synth()·Δt_cycle // energy — NOT recoverable, bounded by night budget
night_energy_spent += mito_synth()·Δt_cycle // track against night supply ceiling
// TRACE read standing demand (soma_tag → structure ; soma_endurance_need → budget_ceiling)
// ADJUST (no coherence — SOMA is not a synaptic component)
// BEHAVE commit own batches
if soma_tag > tag_expiry:
Δ = min(slot_batch, soma_material, soma_energy·f_cap)
soma_structure += Δ; soma_material -= Δ; soma_energy -= Δ·assembly_cost; soma_tag -= Δ
if soma_endurance_need > endur_thr:
Δ' = min(cap_batch, soma_material·f_cap, soma_energy·f_cap)
soma_budget_ceiling += Δ'; soma_material -= Δ'; soma_energy -= Δ'·biogenesis_cost
soma_endurance_need -= Δ'
// EMIT ship batches one hop down to DEND and AXON (demand = propagated tags)
soma_material_to_dend += ship(soma_material, dend_demand, f_dend, ship_cost)
soma_material_to_axon += ship(soma_material, axon_demand, f_axon, ship_cost)
soma_energy_to_dend += ship(soma_energy, dend_demand, f_dend, ship_cost)
soma_energy_to_axon += ship(soma_energy, axon_demand, f_axon, ship_cost)
// RECOVER reclaim material from decayed ceilings (own + returned from downstream)
soma_material += soma_ceiling_shrinkage·recycle
// DECAY
soma_structure -= decay_rate·Δt_cycle; soma_budget_ceiling -= capacity_decay_rate·Δt_cycle
soma_structure += min(soma_maint, maint_cost); soma_budget_ceiling += min(soma_cap_maint, cap_cost)
soma_tag *= decay(slow); soma_endurance_need *= decay(slow)
```
---
## AXON
The axon carries the soma's spike out to its boutons and is the presynapse's supply line. It
propagates reliably or not depending on its myelination and its recent load, and ships material
and budget to the boutons. Its behavior unfolds across two DAY contexts and the NIGHT scope.
**During DAY, during AP — the axon propagates the spike.** Reliability is set by structure
(myelination) and degraded by recent high-frequency load (sodium inactivation at branch points —
axonal short-term depression). A fuel shortfall while carrying a strong train is endurance
evidence; load-driven failure is short-term depression, a consequence, not endurance.
**During DAY, during NOT_AP — the axon supplies and recovers.** It maintains its tag, ships
budget to its boutons (demand-weighted by their tags), refills its own budget from somatic
shipment and astrocytic lactate, and lets its traces decay.
**During NIGHT — the axon's ceilings are rewritten.** NIGHT raises **structure** (myelination,
transport capacity) and **budget capacity** from the shared pool, both competing; unmaintained
ceilings drift down.
```
// PARAMETERS prop_cost · budget_factor
// INTERFACE
// EMIT APs_delivered → PRE (propagation) ; axon_ship_pre → PRE
// RECEIVE (signals) SOMA.fired ; dopamine
// READ SOMA.fired ; dopamine
// OWN axon_structure{propagation, transport_ceiling, mito_density} ; axon_budget_ceiling
// SUPPLY soma_ship_axon ← SOMA ; astro_lactate[shaft] ← ASTRO ; axon_material, axon_energy ← SOMA(NIGHT)
// NOTE AXON endurance fires only on FUEL shortfall; load-driven failure fail(fast_trace)
// is axonal STD (a consequence), not endurance. Own-state proxy.
DAY | AP:
// ADJUST (reliability from structure load-driven failure)
reliability = axon_structure.propagation × (1 - fail(axon_fast_trace)) // fail() = STD, not endurance
// BEHAVE (propagate; FUEL shortfall degrades + flags endurance)
if axon_budget < prop_cost:
reliability *= budget_factor
if axon_fast_trace > traj_thr: // FUEL-limited → endurance
axon_endurance_need += axon_fast_trace
delivered = fired × reliability; axon_budget -= prop_cost × delivered
// EMIT (delivered APs reach boutons)
// TRACE
axon_fast_trace += delivered; axon_fast_trace *= decay(s)
DAY | NOT_AP:
// TRACE (strength)
if axon_fast_trace > elig: axon_possible_tag += axon_fast_trace
if dopamine > dop_thr and axon_possible_tag > tag_thr:
axon_tag += dopamine × axon_possible_tag
// EMIT (ship to boutons; demand = pre tag)
axon_ship_pre = ship(axon_budget, pre_demand, pre_ship_frac, ship_cost)
// RECOVER (refill budget from contested supply)
axon_budget += refill(axon from soma_ship_axon + astro_lactate[shaft])
// DECAY
// FAST (mss)
axon_fast_trace *= decay(s)
// MEDIUM (smin)
axon_possible_tag *= decay(s); axon_endurance_need *= decay(min)
// SLOW (hr)
axon_tag *= decay(hr)
// (PERSISTENT: axon_structure, axon_budget_ceiling — no DAY decay; NIGHT only)
NIGHT | cycle: // intermediate node (relays down to PRE)
// RECEIVE batch arrived from SOMA this cycle
axon_material += transit(soma_material_to_axon, τ_transport_dend)
axon_energy += transit(soma_energy_to_axon, τ_transport_dend)
// TRACE read standing demand (axon_tag → structure ; axon_endurance_need → budget_ceiling)
// ADJUST (no coherence — AXON is not a synaptic component)
// BEHAVE commit batches; spend tag/need as fuel
if axon_tag > tag_expiry:
Δ = min(slot_batch, axon_material, axon_energy·f_cap)
axon_structure += Δ; axon_material -= Δ; axon_energy -= Δ·assembly_cost; axon_tag -= Δ
if axon_endurance_need > endur_thr:
Δ' = min(cap_batch, axon_material·f_cap, axon_energy·f_cap)
axon_budget_ceiling += Δ'; axon_material -= Δ'; axon_energy -= Δ'·biogenesis_cost
axon_endurance_need -= Δ'
// EMIT ship remaining batch one hop down to PRE (demand = pre tag)
pre_material_ship += ship(axon_material, pre_demand, f_bouton, ship_cost)
pre_energy_ship += ship(axon_energy, pre_demand, f_bouton, ship_cost)
// RECOVER reclaim material from decayed ceilings
axon_material += axon_ceiling_shrinkage·recycle // energy NOT recovered
// DECAY
axon_structure -= decay_rate·Δt_cycle; axon_budget_ceiling -= capacity_decay_rate·Δt_cycle
axon_structure += min(axon_maint, maint_cost); axon_budget_ceiling += min(axon_cap_maint, cap_cost)
axon_tag *= decay(slow); axon_endurance_need *= decay(slow)
```
---
## ASTRO
The astrosynapse is the synapse's gatekeeper and energy hub. It clears glutamate, supplies the
D-serine that gates postsynaptic NMDA, and distributes lactate across its territory by demand.
Unlike the others it runs in a single continuous context rather than spiking, and its structure
reshapes the synapse's operating point rather than just its range.
**During DAY, continuously — the astrosynapse clears, gates, and fuels.** It produces energy at
its cell body (glycolysis from glucose, the system's energy root), then allocates lactate across
its astrosynapses weighted by each one's clearance demand. At each astrosynapse it clears
spillover glutamate (EAAT) and supplies tonic D-serine; when spillover is high it adds a
demand-driven D-serine pulse, brakes nothing of the presynapse directly (the presynaptic brake
is PRE reading its own cleft), deposits its calcium trace, and accumulates a dopamine-gated tag.
A D-serine pulse cut short by low budget while demand was high is endurance evidence; one cut
short by precursor/material exhaustion is a material limit, not endurance. Excess overflow
triggers the protective shockwave lockdown.
**During NIGHT — the astrosynapse's ceilings are rewritten.** NIGHT raises **structure**
(perisynaptic wrap, EAAT density, tonic D-serine) where a validated tag accumulated and **budget
capacity** where budget-limited synthesis recurred; astro_structure is self-reinforcing in both
directions, so it amplifies whatever trajectory the synapse is already on.
```
// PARAMETERS K_Dserine · Ds_max · Ds_frac · Ds_cost · EAAT_cost · lactate_cost · spillover · overload
// INTERFACE
// EMIT astro_lactate[i] → pre/post/dend budgets ; astro_Dserine[i] → POST (gate)
// RECEIVE (signals) glutamate ← PRE (clearance + spillover) ; dopamine
// READ glutamate ; dopamine
// OWN astro_structure{perisynaptic_distance⁻¹, EAAT, Dserine_tonic, ECM} ; astro_budget_ceiling
// SUPPLY glucose (ROOT) ; astro_material, astro_energy ← cell body (NIGHT)
// NOTE ASTRO endurance fires on BUDGET-limited synthesis (got<want via low budget);
// material/precursor-limited synthesis is a material limit, not endurance. Own-state proxy.
// EMERGENCY emits shockwave_lockdown on overload
DAY | CONTINUOUS: // per astrosynapse i
// RECEIVE (root production, capped by glucose)
astro_central_budget += glycolysis(glucose)·Δt
// ADJUST (demand weights across territory)
for each i: demand[i] = clearance_load[i] × astro_structure[i].delivery_eff
for each i: astro_territory_demand[i] += demand[i]·Δt // TRACE: territory-level aggregator (by DAY)
factor = min(1, astro_central_budget / (Σ demand·lactate_cost + ε))
// EMIT (demand-weighted lactate to all components)
for each i:
astro_lactate[i] = demand[i] × factor; astro_central_budget -= astro_lactate[i]·lactate_cost
// BEHAVE (clear glutamate ; supply tonic D-serine)
glutamate[i] -= astro_structure[i].EAAT × glutamate[i]·Δt; astro_central_budget -= clearance·EAAT_cost
astro_Dserine[i] += astro_structure[i].Dserine_tonic·Δt
if glutamate[i] > spillover:
// TRACE
astro_fast_trace[i] += mGluR_Ca(); astro_fast_trace[i] *= decay(s)
// ADJUST (D-serine demand from spillover)
want = sat(astro_fast_trace[i], K_Dserine) × Ds_max
got = min(want, astro_central_budget × Ds_frac)
// BEHAVE + EMIT (D-serine pulse to POST gate)
astro_Dserine[i] += got; astro_central_budget -= got·Ds_cost
// TRACE (endurance: BUDGET-limited synthesis under high own demand)
if got < want and astro_central_budget low and astro_fast_trace[i] > traj_thr:
astro_endurance_need[i] += (want - got)
// TRACE (strength)
if astro_fast_trace[i] > elig: astro_possible_tag[i] += astro_fast_trace[i]
if dopamine > dop_thr and astro_possible_tag[i] > tag_thr:
astro_tag[i] += dopamine × astro_possible_tag[i]
// DECAY
// FAST (mss) — astro_fast_trace already decayed above (intra-step)
// MEDIUM (smin)
astro_possible_tag[i] *= decay(s); astro_endurance_need[i] *= decay(min)
// SLOW (hr)
astro_tag[i] *= decay(hr)
// (PERSISTENT: astro_structure, astro_budget_ceiling — no DAY decay; NIGHT only)
// EMERGENCY
if astro_fast_trace[i] > overload: emit(shockwave_lockdown)
NIGHT | cycle: // ROOT (synaptic energy + ECM) — produces each cycle
// RECEIVE = PRODUCTION: glycolysis + ECM synthesis this cycle, capped by glucose
astro_central_energy += overnight_glycolysis(glucose)·Δt_cycle // energy — NOT recoverable
astro_central_material += astro_cellbody_synth()·Δt_cycle // material — recoverable
night_energy_spent += overnight_glycolysis(glucose)·Δt_cycle
// ADJUST tag-weighted shares across the territory
W = Σ astro_tag[i] over astro_tag[i] > tag_expiry
// EMIT distribute this cycle's batch to astrosynapses (demand = own tag)
for each i with astro_tag[i] > tag_expiry:
w = astro_tag[i]/W
astro_energy[i] += astro_central_energy·w
astro_material[i] += astro_central_material·w
// BEHAVE each astrosynapse commits; spend tag/need as fuel (coherence applies — synaptic)
for each astrosynapse i:
coh = coherence_signal[i]
if astro_tag[i] > tag_expiry:
Δ = min(slot_batch, astro_material[i], astro_energy[i]·f_cap)
astro_structure[i] += Δ × coh // self-reinforcing both directions
astro_material[i] -= Δ; astro_energy[i] -= Δ·assembly_cost; astro_tag[i] -= Δ
if astro_endurance_need[i] > endur_thr:
Δ' = min(cap_batch, astro_material[i]·f_cap, astro_energy[i]·f_cap)
astro_budget_ceiling[i] += Δ'; astro_material[i] -= Δ'
astro_energy[i] -= Δ'·biogenesis_cost; astro_endurance_need[i] -= Δ'
// RECOVER reclaim material from decayed ceilings
astro_central_material += astro_ceiling_shrinkage·recycle // energy NOT recovered
// DECAY
for each i:
astro_structure[i] -= decay_rate·Δt_cycle; astro_budget_ceiling[i] -= capacity_decay_rate·Δt_cycle
astro_structure[i] += min(astro_maint[i], maint_cost)
astro_budget_ceiling[i] += min(astro_cap_maint[i], cap_cost)
astro_tag[i] *= decay(slow); astro_endurance_need[i] *= decay(slow)
```
---
## Special — Shockwave Lockdown
```
DAY or NIGHT | OVERLOAD:
Vm = HYPERPOLARIZED; AMPA_surface = mass_internalize() → post reserve
axon_fast_trace += overdrive(); astro_central_budget -= emergency_cost
```
---
---
# NIGHT — the driver (a hierarchy of actors, phased)
NIGHT runs a loop of cycles. Each cycle has FOUR actor tiers acting in order from the top of the
hierarchy down: the external replay signal arrives, the NEURON renormalizes, the ASTROCYTE
territory reallocates, then the COMPONENTS commit within what they were handed. The night is
PHASED: early cycles DOWNSCALE (reset occupancy, renormalize weight — subtractive, make room),
later cycles COMMIT (build ceilings for the survivors — additive). It ends emergently.
```
NIGHT driver:
night_energy_spent = 0
N_cycles_early = early_phase_frac × estimated_cycles
repeat cycle = 1, 2, 3, …:
phase = (cycle ≤ N_cycles_early) ? DOWNSCALE : COMMIT
// ── TIER 0: ASSEMBLY/NETWORK (external) ───────────────────────────────
// replay_reweight[s] arrives this cycle: re-presents the day's patterns and
// re-weights which synapses the assembly found significant (external signal).
// ── TIER 1: NEURON (renormalize total weight; drive occupancy downscaling) ──
if phase == DOWNSCALE:
// multiplicative-global occupancy reset — only CEILINGS will persist
for each synapse s:
VGCC_active[s] *= downscale_factor
AMPA_surface[s] *= downscale_factor
possible_tag[s] *= downscale_factor // medium evidence renormalized too
// renormalize total committed weight toward the cell's budget (Tononi-style)
if neuron_total_weight > neuron_weight_ceiling:
g = neuron_weight_ceiling / neuron_total_weight
for each component c in cell: c_structure *= g
soma_material += Σ reduction·recycle // freed material returns to pool
// ── TIER 2: ASTROCYTE territory (reallocate metabolic support) ─────────
// reallocate this cycle's energy/material across the territory by accumulated demand,
// re-weighted by replay — the astrocyte is the metabolic arbiter of its synapses
for each astrosynapse i:
astro_alloc[i] = (astro_territory_demand[i] × replay_reweight[i])
/ Σ(astro_territory_demand × replay_reweight)
// (astro_alloc biases each synapse's share of the astrocyte's produced batch this cycle)
// ── TIER 3: COMPONENTS (commit within the allocation handed down) ──────
// coherence signal (cross-component) from this cycle's standing tags
for each synapse s:
coherence_signal[s] = (pre_tag[s], post_tag[s], astro_tag[s] all > tag_expiry)
? coherence_factor : 1
if phase == COMMIT:
run PRE, POST, DEND, SOMA, AXON, ASTRO NIGHT | cycle // build ceilings
else:
run SOMA, ASTRO NIGHT | cycle (PRODUCE + EMIT only) // pre-stage material downstream
// ── termination — emergent, OR of two conditions ──────────────────────
night_energy_spent updated by the roots' production this cycle
demand_left = Σ all tags > tag_expiry (system-wide)
if demand_left ≈ 0: break // DEMAND exhausted (rested)
if night_energy_spent ≥ night_energy_ceiling: break // SUPPLY spent (overloaded)
// ── CODA (once at end of night) ────────────────────────────────────────────
// clear DAY traces and the DAY aggregators; occupancy already reset by downscaling
all fast_trace, possible_tag, endurance_need = 0
soma_Na_inactivation = soma_adaptation = soma_refractory_alignment = 0
neuron_activity = 0; neuron_total_weight = recomputed from surviving structure
astro_territory_demand[·] = 0
// tags are NOT cleared — unspent tags carry forward, decaying on their slow τ
// structure and budget_ceiling PERSIST as the next DAY's ceilings
// VGCC_active / AMPA_surface have been returned to baseline by downscaling
```
Notes. (1) The phasing makes cycles genuinely different: an early cycle reshapes the landscape
(reset occupancy, renormalize weight, pre-stage material), a late cycle builds on the reshaped
landscape — so what gets committed depends on the order, and could not be computed in one shot.
(2) Higher actors never read a component's interior: the neuron renormalizes a sum it accumulated
from emitted activity; the astrocyte reallocates by demand it accumulated; coherence and replay
arrive as signals. Locality holds — the system acts locally and consolidates hierarchically.
(3) Occupancy is reset every night, so each DAY starts from baseline occupancy against whatever
ceilings persisted: the only thing that carries a day forward is what earned a ceiling.
---
## One-view summary
```
SEVEN-GROUP GRAMMAR, TWO SCOPES, ONE LADDER
RECEIVE · TRACE · ADJUST · BEHAVE · EMIT · RECOVER · DECAY
DAY grammar on OCCUPANCY within two ceilings (structure=strength, budget_ceiling=endurance)
bottom-up: consumers act, evidence ascends leaves→roots
TRACE yields two evidence streams from local state + arrived signals:
fast_trace + dopamine → tag (strength)
FUEL shortfall + interrupted LOCAL success → endurance_need (endurance)
OCCUPANCY/structure/timing shortfalls → short-term depression (NOT endurance)
NIGHT enacted by a HIERARCHY of actors (not the DAY components alone), PHASED:
assembly/network replay (external) → NEURON renormalize total weight + downscale occupancy
→ ASTROCYTE territory reallocate → COMPONENTS commit ceilings within what's handed down
early cycles DOWNSCALE (reset occupancy multiplicatively-global, make room),
late cycles COMMIT (build ceilings for survivors)
higher actors ACCUMULATE aggregate traces by DAY, ACT by NIGHT (locality holds)
ends when DEMAND exhausted (no tag stands) OR SUPPLY spent (night energy used)
what persists must EARN it: occupancy resets to baseline, only CEILINGS carry;
unspent tags carry to next night; material recycles, ENERGY does not (arrow of time)
RULE the system ACTS LOCALLY (DAY, local components) and CONSOLIDATES HIERARCHICALLY (NIGHT)
FLOWS every flow has a timescale; shipment is transit-delayed (distal fills over cycles)
LOCAL every group uses only own state + arrived signals; RECEIVE/EMIT are the only crossings
```
@@ -0,0 +1,571 @@
# Logic Principles of the Tripartite Synapse Model
These are the principles that govern the model's logic — not the syntax in which it is
expressed, but the reasoning that shapes every variable, every behavior, every transition.
A note on language. This document does not say "the system." There is no system — only local
components, each reading arrived signals and acting on its own state. "System," "whole,"
"network," "the organism's memory" are names applied from outside, by us, describing what
coupled local components do together. The first principle states this; the rest honor it by
never speaking in the voice of a whole that does not exist. Where a sentence seems to want "the
system does X," it is rewritten as "local components, contextualized thus, do X locally" —
because the form of the document should enact its central claim, that locality goes all the way
down and all the way up, with no privileged vantage anywhere inside.
The nine categories run foundation-first. The closing category — the Three-Phase Ring — is the
integrator: it shows how a single cycle of ACTION, EVALUATION, and PREPARATION, run locally by
every component and turned in two directions (outward by DAY, inward by NIGHT), is where all the
flows the earlier categories describe actually happen in time. It comes last because it uses
everything established before it. Its sharpest claim: a phase is a *role*, not a fixed event, so
the same physical machinery — a release, a structural change — serves as ACTION in one scope and
EVALUATION in the other, and the two scopes enter the ring at different phases. A vocabulary note
on motion: causation *circulates* across scales (category VI); the ring *turns* across phases
(category IX). Two different loops, two different words, kept distinct.
---
## I. There Is No System; Holism Is Real but Only Described
**There is no system — only local components.** Nowhere in the model is there a controller, a
global plan, a representation of the whole, or a vantage from which the whole is seen. There are
only components, each reading the signals that physically reached it and acting on its own state.
Every behavior is local; every evaluation uses only local state and arrived signals; every trace
is a local record; every commitment a local draw on a shared pool. "System" is our word for the
aggregate, spoken from outside. No component is the system, occupies its standpoint, or can read
it — not the smallest bouton and not the highest integrating actor.
**And yet what we describe as holism is real.** Memory, rhythm, selection, consolidation,
sparsification — these are real behaviors, not illusions. The puzzle is that they are real
without any whole existing to bear them. The resolution: they are *enacted* by coupled locals,
never *encoded* in any one of them or in any representation. The holism is in the doing — the
ongoing competitive, signal-mediated, scope-alternating process of many local components — not
in any part and not in any model the parts contain.
**What couples the locals is what we then describe as a whole.** Three couplings do all the work.
*Shared pools*: the only thing every component touches is the finite resource it competes for;
when one draws, the others have less, when one returns, the others have more — local actions
become mutually consequential through a common, capped resource. *Cross-scale coincidence*: a
lasting change requires confirmations from larger scales that no component can produce for itself,
so every lasting change records an agreement across scales that no single scale authored.
*Signals*: components cannot read each other, but they emit and receive, so they are coupled
without any one gaining access to another's interior. Through these three, purely local action
acquires what we describe — from outside — as global organization.
**The properties we call holistic belong to no component.** Rhythm, equilibrium, memory, the
joint selection for significance-and-sustainability — none exists in any single component. They
are descriptions of the coupled population over the DAY/NIGHT alternation. The gap between "what
a component knows" (only its own state) and "what we describe the population as doing" (choosing
what to keep) is not bridged by any component knowing more. It is bridged by the coupling itself.
Understanding, here, is enacted, not encoded — and "the system understanding" is only ever our
shorthand for coupled locals enacting, faithfully local at every step, holistic only in our
description.
**Even the cycle is local.** Each component runs its own three-phase ring (category IX), its
phase boundaries set by its own trace decays, not by any shared clock. There is no global cycle
any more than a global controller — only many local rings, loosely coupled through shared pools
and signals, which we describe together as "the rhythm." The turning is real in each component;
the collective rhythm is our description of many local turnings.
---
## II. Two Contextualizations, and the Loop Between Them
**DAY and NIGHT are not two phases of a system; they are two contextualizations of the same
local components.** A component does one kind of thing always: it reads arrived signals and acts
on local state. What changes between DAY and NIGHT is the *context* that fixes what those signals
mean, who the component's counterparties are, and what is scarce. By "DAY" we name the
contextualization in which the relevant environment is the external world and the component's
information is about exogenous events. By "NIGHT" we name the contextualization in which the
relevant environment is the internal economy and the information is about endogenous
resource-state. The component cannot tell which it is in — it has no access to "the scope" any
more than to "the system." It reads local signals, and context makes them mean what they mean.
**Each contextualization has its own environment and its own information.** NIGHT is not the
absence of an environment — it is interaction redirected from the world to the self. By day a
component interfaces outward, perceiving sensory-driven events and reward; by night it interfaces
inward, perceiving how much resource reached it, what its peers are claiming, what coheres. Both
are full perceive-act loops against a real environment. Resource levels and demand-signals are
the night's perceptual field exactly as glutamate and dopamine are the day's. "Internal" and
"external" are relative to the subject one fixes; from a component's own standpoint there is only
"my environment" — the signals reaching me — which happens to be the world by day and the economy
by night.
**A component is thus two contextualizations sharing one structure.** By day it is an
environmental interface; by night an economic agent. The two share only the structure, and the
structure is exactly what carries between them: the night-agent builds the ceiling the day-
interface will operate within, and the day-interface generates the evidence (the tag) that
authorizes the night-agent to build. The tag is information becoming a resource-claim at the
boundary — the single unit that crosses from the day's information-context to the night's
resource-context.
**The move between the two is an emergent local transition, not an imposed clock.** There is no
global day/night switch. Each component enters its NIGHT when its own activity is low and an
arrived sleep-pressure signal is high, and returns to its DAY when that signal falls. Both
conditions are read locally — own activity, arrived signal — so the transition is itself a local
decision. Components therefore cross over at different times: a wave, not a switch (local sleep).
The signal that carries them is itself the product of locals: activity generates fatigue; fatigue,
integrated by one component (the hypothalamic actor) that does nothing but integrate fatigue and
emit pressure, raises sleep-pressure; high pressure plus a component's own quiet opens its
restructuring window; restructuring discharges fatigue; discharge lowers pressure; the component
re-enters DAY. DAY and NIGHT are the two phases of one homeostatic loop the local components run
on themselves — neither imposed from outside nor scheduled from above. The component never knows
it is "in NIGHT"; it reads a signal level and its own activity, and what results we call night.
**The mechanistic root of the alternation: behavior and restructuring exclude each other.** A
component cannot rebuild its structure while it is busy behaving — the two compete for the same
substrate. Only when its activity is low does it have the access to its own architecture that
restructuring requires. The brief low-activity gaps within a day permit small adjustments; the
sustained, widespread quiet that the sleep-pressure signal creates permits the large ones. NIGHT
is not an arbitrary time for consolidation — it is the condition under which consolidation is
*possible*, because quiet is what grants a component access to itself.
**Two distinct couplings join the scopes — do not conflate them.** The scopes are connected in
two independent ways. The *fatigue loop* is the **switch**: it controls *when* a component crosses
between DAY and NIGHT (activity → fatigue → sleep-pressure → transition), a purely temporal
control carrying no content. The *evaluation handoff* is the **payload**: it passes *what* each
scope leaves for the other (the tag minted by day's evaluation, consolidated by night; the
structure minted by night's evaluation, read by the next day — see category IX). One says when to
switch; the other says what crosses. A reader who merges them loses the fact that a component
could switch scopes with nothing to hand off (a quiet day leaves no tag) or hold a rich payload
that waits several switches to be honored (a tag consolidated over several nights). Switch and
payload are orthogonal.
---
## III. Locality and Signals
**Only local evaluation.** Every decision a component makes — to act, to deposit a trace, to
register an interrupted success — uses only information physically present in it. It cannot read
another component's interior. The presynapse does not know the postsynapse's calcium; the
dendrite does not know which distal spines are active; the astrosynapse does not know whether the
postsynapse is waiting. Each judges from its own state alone.
**A component cannot read the whole, either.** The completion of locality: not only can no
component read another's interior, none can read "the system," "the scope," or the global state.
There is no aggregate vantage available anywhere inside — not even to the integrating actors, who
read only the summed emissions that reached them and emit signals in turn, with no more access to
the whole than a bouton has. Locality holds up the hierarchy as strictly as across it.
**Cross-component influence travels only as signals that arrive and become local.** Information
crosses a boundary only by being emitted — feedforward transmission, retrograde messengers,
neuromodulatory and sleep-pressure broadcast, the demand and recycled resource of the night
economy. A signal in transit is invisible; a signal that has arrived is local and can be read.
Downstream reaches upstream by emitting; upstream never reaches into downstream. Every coupling
in the model is of this form — an emission that becomes, on arrival, another component's local
state.
**Everything emits; nothing is a pure sink.** No component only consumes. Each, whatever it
receives, emits something a neighbor will read — its transmitter, its retrograde feedback, its
fatigue, its demand, its recycled material, or simply its activity for an integrating actor to
sum. The direction of emission reverses with context (see the two Logic panels): outward and
downstream by day, inward and upstream by night. But the invariant holds in both — there are no
leaves and no sinks, only a reversal of which way "out" points.
---
## IV. Resource and Conservation
**Nothing is free.** Every behavior consumes a resource. There is no operation that does not draw
something down. This is not a constraint added on top of the logic — it is its foundation.
Selectivity, competition, and forgetting all follow from the single fact that resources are
finite.
**Resources are redistributed, not created.** The pools are bounded by external ceilings. Within
them, resource is only moved — from one site to another, from a dismantled structure back to the
pool. No internal process manufactures capacity; it only reallocates. A gain anywhere is paid for
by a loss elsewhere — coupling that is not designed but is the automatic consequence of drawing
from a common pool.
**Two resources, two conservation laws.** Energy is a flow — produced and consumed, gone after
use. Material is a stock — incorporated into structure and recovered when structure is dismantled.
Different sources, different recovery. A behavior can be energetically affordable yet materially
limited, or the reverse. Keeping them distinct is what makes the accounting honest.
**Material circulates; energy ratchets — energy is the one irreversible flow.** This is the sharp
form of the distinction, and it is the arrow of time. Material cycles indefinitely: spent into a
ceiling, recovered when that ceiling decays, returned to be spent again. Energy does not. It is
produced fresh at the roots, burned irreversibly on the work of building and behaving, never
recovered. Everything else cycles or relaxes — traces decay and reform, occupancy fills and
drains, material recycles — but energy only ever goes down per unit produced, capped externally by
glucose. The total learning the local components can ever do is bounded by their lifetime energy
throughput, and no internal cleverness lifts that bound. The irreversibility of energy is what
makes them age.
**Every economy has a single capped root.** Each resource traces to one producer with a hard
ceiling — the astrocyte cell body for synaptic energy, the soma for neuronal material. Everything
downstream competes for shares of that capped production. The ceiling is set from outside and is
the ultimate arbiter of how much can be done.
**Scarcity is what forces choice, and choosing is learning.** What is consolidated is the outcome
of bounded demand (the standing tags and endurance needs) meeting bounded supply (the energy and
material produced each night), and the match need not clear — a night may run out of energy before
it runs out of demand. Unmet demand is not discarded but carried forward and retried. The
selective pressure is, at bottom, this repeated failure of supply to fully meet demand: it is
*because* not everything can be afforded that there must be choosing, and the choosing is the
learning.
---
## V. The Timescale Ladder
The spine. Every quantity sits on one of four nested tiers, and timescale is not incidental to it
— timescale *is* its meaning.
**Four tiers.** FAST traces (mss): residual calcium, synaptic current — the immediate response.
MEDIUM occupancy and evidence (smin): the filled receptor surface and channel coupling, the
accumulating possible-tag, the endurance need. The SLOW tag (hours): the validated bridge to
consolidation. PERSISTENT capacity (written only at night, drifting over days): the structure and
budget ceilings. A quantity's decay constant is what it means — a fast-decaying quantity is a
momentary signal, a slow one a commitment, a non-decaying one a capacity. Putting two timescales
in one variable destroys both meanings, which is why a quantity carrying both a momentary and a
lasting role is split into two.
**Capacity and occupancy are two rungs, not a separate principle.** What was once stated as
"night builds containers, day fills them" is simply this: the PERSISTENT tier is written at night
and bounds the MEDIUM tier, which fills by day within it. The same physical quantity — receptor
count, vesicle coupling, fuel level — has a fast/medium component (how full, occupancy) and a
persistent component (how big, capacity), governed by different processes at different tiers.
Short-term change is occupancy; long-term change is capacity; they never do each other's job.
**Two capacities, two drives, one pool.** Structure is the capacity for strength — how powerfully
a behavior can act. Budget capacity is the capacity for endurance — how long it can be sustained.
Both are persistent ceilings, both filled competitively at the medium tier, both drawn from the
same finite material and energy, so strength and endurance compete. A ceiling of either kind is
never free even by day: filling it costs a competitive share of a shared pool, and a high ceiling
makes a large standing claim satisfiable only by out-competing neighbors. Capacity that cannot be
filled is wasted.
**Structure shapes form, not just maximum.** A ceiling does not merely cap — it conditions the
transfer function at every moment. Tighter calcium-channel coupling makes each spike more reliably
coupled to release; more anchoring slots convert each pulse more faithfully to current; tonic
co-agonist keeps the gate primed. The persistent tier shapes the quality of behavior continuously,
not only its peak.
**The tiers are a ladder: each rung's output is the next rung's input, in both directions.**
*Evidence ascends* — fast traces accumulate into medium evidence, which bridges (on validated
coincidence) into the slow tag, which commits at night into persistent capacity; nothing reaches
a slower tier without accumulating through the faster ones. *Capacity descends* — persistent
structure bounds medium occupancy, which bounds fast behavior; the ceiling at each level was set
by the level above, on a slower timescale. Both the strength pathway (trace → possible-tag → tag
→ structure) and the endurance pathway (trace → endurance-need → budget ceiling) are the same
upward climb, differing only in what validates it: associative dopamine for strength, homeostatic
fuel-shortfall for endurance.
**A pool's recovery timescale is what its exhaustion means.** The ladder governs pools as well as
traces. A *fast* pool (the readily-releasable vesicle pool) depletes and recovers fast, so its
shortfall is transient — short-term depression, self-correcting once activity slows. A *medium*
pool (operational budget) recovers at the medium scale, so its shortfall is a standing constraint
worth recording as endurance evidence. *Persistent* capacity changes only at night, so its
"shortfall" is a structural limit unfixable in the day. This is why a behavior's failure mode can
be read off which pool ran dry: fast-pool exhaustion is depression, medium-pool exhaustion is
endurance evidence, persistent limit is structural. Depletion-and-recovery is the pool-side mirror
of creation-and-decay — drawn down by behaving, refilled toward a ceiling — and in both, the
timescale is the meaning.
**The ladder is structure; the ring is timing; they are orthogonal and they compose.** The ladder
(this category) is about *tiers of persistence* — which quantities last how long, and how capacity
descends while evidence ascends. The three-phase ring (category IX) is about *phases of a cycle*
when a component acts, evaluates, and prepares. These are independent axes: one could have the
ladder without a cyclic ring (a pure feedforward hierarchy) or a ring without four tiers (a cycle
at one timescale). They compose in a specific way: the ring's phases are *where the ladder's flows
occur*. ACTION injects at the bottom of the ladder (deposits the fast trace). EVALUATION enacts
the up-flow (works the fast trace into medium evidence and the slow tag). PREPARATION enacts the
down-flow (reads the descended capacity as the readiness the next action runs within). So the two
pictures are not two names for one thing — the ladder says what persists, the ring says when each
persistence-flow happens, and evaluation-is-up / preparation-is-down is where they meet.
---
## VI. Causation Circulates — Emergence Up, Constraint Down, Command Nowhere
The model has causation in two directions, and the whole point is that they coexist without
either becoming control.
**Emergence flows up.** What we describe as global organization — sparsification, normalization,
winner-take-more, the allocation of fuel — is nowhere computed centrally. It emerges from many
local components drawing on shared pools. No allocator decides which synapses to fuel; the
synapses' own demands, each purely local, competing for capped production, produce the allocation.
No allocator exists; the allocation is real. The local emissions sum, through the pool, into an
aggregate no component authored.
**Constraint flows down.** An integrating actor holds an aggregate its constituents cannot see —
total weight, territory demand, accumulated fatigue — and broadcasts it back as a constraint each
constituent then interprets locally. The neuron, summing emitted activity it never reads interiors
to obtain, broadcasts a renormalization that each component applies to itself. This is top-down,
but it is constraint, not command: the higher actor sets a bound; the lower still decides locally
within it.
**Command exists nowhere.** This is the load-bearing claim. The downward direction never becomes a
higher component deciding for a lower one, nor a lower one deciding for itself in isolation. No
actor authorizes its own restructuring — each is put in the position to restructure by the actor
above it, which holds the aggregate it cannot see and opens the quiet window it cannot open, then
*broadcasts*, never reaching in. The soma cannot decide within the soma; it is put in position by
the neuron — which is itself put in position by the integrated fatigue, which is itself the sum of
what the components emitted. Causation circulates — up as emergence, down as constraint — and the
circle closes with no controller anywhere on it. Every integrating actor is itself only another
local component reading summed arrived signals; none is "the system" in disguise.
**The recursive grant repeats at every scale.** The relationship is the same all the way up: the
astrosynapse is put in position by the astrocyte; the soma, bouton, spine, branch, axon by the
neuron; the neuron and astrocyte by the hypothalamic fatigue signal; the synaptic strengthening by
the organism's dopamine and the assembly's replay. Each scale grants its constituents the
conditions they cannot grant themselves — an aggregate they cannot see, a window they cannot open —
and grants it by signal, never by reaching in. The hierarchy is real, the circulation is closed,
and at no point does it produce a seer of the whole or a commander of the parts.
**This cross-scale circulation enters each component's ring at a definite phase.** Causation
*circulates* across scales (this category); a component's ring *turns* across phases (category IX) —
two different loops. They meet at a definite point: the downward constraint arrives at the
component's PREPARATION phase, whose subject is precisely "what is handed down from above," and the
upward emergence departs as what the component emits during ACTION and commits during EVALUATION,
which sums into the aggregate the scale above will read. So the vertical arm of the cross-scale
circulation is lived, inside each component, as the vertical phase of its ring. The three subjects
of the ring (beside / self / above) are the three ways a component connects to everything else, and
each of the other categories' flows plugs into the phase whose subject matches it.
---
## VII. Selection and Asymmetry
**Building is the active drive; weakening is its shadow.** All the machinery is oriented toward
strengthening what is significant and sustaining what is fuel-limited. There is no symmetric
machinery for weakening. Weakening happens to whatever the building machinery did not select, as a
consequence of the resources building consumed. The orientation is toward learning; forgetting is
its cost.
**Depression is never explicit — it is what happens when building does not.** No signal says
"weaken this." Ceilings of both kinds decay continuously and are held up only by maintenance; when
building consumes the shared resource, unmaintained ceilings drift down. Depression is the absence
of maintenance, not the presence of a depression signal — and the same is true of lost endurance,
idle capacity removed for lack of use, and of occupancy, which drifts back the moment its driving
trace decays. In ring terms (category IX), this decay lives in the PREPARATION phase: weakening is
what preparation's settling does to whatever evaluation did not supply enough to maintain. There is
no weakening phase because weakening is un-honored decay inside the preparing phase.
**Validation enters from beyond the part; the part cannot validate itself.** A component cannot
know whether its own activity was significant — that information exists only at a larger scale and
arrives as a signal (the neuromodulatory broadcast for the organism's verdict, replay for the
assembly's). Cheap reversible change is autonomous; expensive lasting change requires authorization
that enters from outside the component being changed. This is why lasting change always records a
coincidence across scales: each scale confirms what the one below cannot know about itself.
**Strength is associative; endurance is homeostatic.** Strength requires significance — the
dopamine coincidence saying "this was worth saving." Endurance requires only that fuel, not
structure or significance, was the binding constraint on a forming success — it needs no external
validation, because metabolic sustainability is not the organism's to judge but the component's own
to register. Two independent criteria, and selection requires winning on both: activity without
significance is not saved; significance without sustainable fuel cannot be maintained. The
conjunction filters for connections both valuable and viable.
**Equilibrium is the residual of imperfection.** Where alignment or balance is reached, the success
removes the very signal that drove it, allowing slow drift back, which regenerates the signal. The
soma that aligns to its input rhythm stops generating the mismatch that aligned it, drifts, and
re-aligns. The component that builds enough endurance stops depleting, loses the signal, and lets
capacity decay until depletion returns. Each component hovers near its own optimum, never resting
there, corrected continuously by the small errors its own imperfect state produces. What we
describe as a stable population is the sum of these local never-quite-settlings.
---
## VIII. Coupling, Openness, and Boundedness
**Couplings create trajectories, not just states.** Some variables, once moved, make further
movement the same way easier — the astrosynapse wrapping tighter after potentiation, easing future
potentiation. These self-reinforcing couplings give momentum: components do not merely occupy
states, they follow trajectories, deepening whatever direction they have begun. The astrosynapse is
the strongest such coupling — the gain control that reshapes the input itself, amplifying whatever
trajectory a synapse is on.
**The same signal serves opposite functions through different receivers.** Glutamate spillover
brakes the presynapse while exciting the astrosynapse — one ligand, two receptor types, opposite
cascades, simultaneous opposite effects. Function is set by the receiver, not the signal. One event
coordinates several responses with no coordinating mechanism.
**Metabolic availability is a selective pressure parallel to validation.** Beyond the explicit
activity-and-reward gating, the bare availability of fuel continuously selects which components can
participate: one that cannot be fueled cannot generate the activity that would let it be tagged.
Metabolism silently shapes what can be learned, independent of and parallel to the plasticity
machinery.
**Finite and open, not infinite and closed.** The components are bounded and their state space is
bounded, and they receive inputs they cannot generate from within — sensory drive, neuromodulatory
and replay validation, metabolic supply. Because they are finite, their self-modification generates
no infinite regress. Because they are open, their highest validation comes from outside any
component being changed.
**The fixed points are explicit, not hidden.** The quantities the components cannot modify from
within — thresholds, the vascular ceiling, the neuromodulatory and replay signals — are declared as
given. They are the boundary with what the components did not set and cannot inspect. Making them
explicit is the honest acknowledgment that every self-modifying process operates within constraints
it did not choose. Correctness is never certified internally: whether a change was good is answered
by the organism's later experience in the world, fed back as signal. The fixed point lies outside —
the components act, the world responds, and the response, not any internal check, determines what
was worth keeping.
---
## IX. The Three-Phase Ring, and Its Two Turnings
This is the integrator. Everything above describes *what* flows — resource, evidence, constraint,
signals, capacity. This category describes *when*: the single cycle each local component turns,
and how the earlier categories' flows distribute across its phases. One ring, run locally by every
component, turned in two directions — outward by DAY, inward by NIGHT.
**The ring has three phases, given by the three relationships a component stands in.** A component
relates to exactly three things — its peers beside it, itself, and what is above it — and the ring
is one turn through all three:
- **ACTION** (subject: peers, *lateral*). The defining interaction with the component's
counterparties. It is punctate — an event — and it deposits a fast trace, the residue the rest of
the turn will read.
- **EVALUATION** (subject: self, *local*, handing to the other scope). In the quiet after the
action, the component reads the fast trace and works it up the ladder into slower evidence. It
never acts; its product is an inert token minted for the *other* scope.
- **PREPARATION** (subject: what is above, *vertical*, readying the next action in this scope). As
the trace decays, the component settles its pools and gates forward, reads what has descended, and
assembles the readiness the next action will run on. Preparation is the sole gateway to action.
The order around the ring is ACTION → EVALUATION → PREPARATION → ACTION. Because it is a ring, no
phase is first; each turn's preparation feeds the next turn's action, and each turn's evaluation
reads the action that preceded it. A phase is a *role*, not a fixed physical event: the same
physical machinery (a release, a structural change) can serve as different phases in different
scopes, and each scope enters the ring at a different phase — the rotation is worked out in "The
two turnings" below.
**The ring is necessary; its co-location in one component is not.** What the logic guarantees is
that the ring *closes* — that every action is evaluated and every action is prepared for — not that
any single component runs all three phases itself. A component necessarily has ACTION: the local
act it performs is what makes it a component at all. But the EVALUATION and PREPARATION of that act
may live in *other* components. Take the calcium channel as a component: its ACTION is letting Ca²⁺
in — that is its whole local act. It does not evaluate whether the influx mattered (the presynapse
does, reading the resulting trace) nor prepare its own next opening (its coupling readiness is set
by presynaptic short-term potentiation, and above that by neuronal provisioning). The channel is
almost pure action; its evaluation and preparation sit in the components around and above it. Yet
the ring is intact — the influx is acted, evaluated, and prepared for — merely spread across three
components rather than turned within one. So the ring is a property of *coupled components*, not of
the individual: a component contributes its action, its neighbors and superiors contribute the
evaluation and preparation that action requires, and together they close a ring none of them runs
alone. This is the same frame as category I — there is no ring-bearing "self," only local
components whose coupled actions we describe as one closing ring.
**Action is always local; evaluation and preparation may be local or contextual.** This is the
axis beneath the previous point. A phase is *local* when the acting component supplies it itself,
*contextual* when a surrounding or higher component supplies it. Evaluation and preparation come in
both forms: the presynapse evaluates its own release and prepares its own next release (local),
while the calcium channel's influx is evaluated by the presynapse and prepared by neuronal
provisioning (contextual). Action admits no such split — it is always local, and necessarily so.
A component can hold an aggregate and evaluate a neighbor's trace on its behalf, or provision a
neighbor's readiness; but it cannot *act on a neighbor's behalf*, because the action simply is the
local event occurring in that component. To perform another's action would mean it was never that
component's action to begin with. Acting-for-another is not action but signalling. So the one phase
that can never be contextual is action, and this falls directly out of what action is — which is
why every component necessarily has its own action, while its evaluation and preparation may be
scattered into its context.
**The phases are event-delimited and decay-timed, never clocked.** A phase has no fixed duration.
The action is the boundary where preparation ends and behaving begins; the fast trace's decay below
threshold is roughly where evaluation ends and preparation resumes. The quiet interval between
actions — a component's refractory-like period, whether literal refractoriness at the soma or the
NOT-active steps at the bouton — is where evaluation and preparation live, and its length is set by
the firing pattern. A fast train compresses preparation to nothing (no time to refill: depression);
sparse action gives preparation its full extent. Timing here is chemistry, not a timer (category V).
**Evaluation and preparation share the fast trace but send it two ways.** The same trace the action
deposits is read by both: evaluation reads it for *significance* (climbing toward the tag, for the
other scope), preparation reads it for *readiness* (tuning the next action's timing and thresholds,
in this scope). The soma makes this visible — its nuclear-calcium climbs toward the tag
(evaluation), while its inactivation, adaptation, and alignment traces tune the next spike
(preparation) — all from the one spike's deposit. Evaluation looks up and across scopes; preparation
looks around the ring to the next action.
**Evaluation reaches the next action only through preparation.** Evaluation never acts; it lays down
inert evidence. For that evidence to shape a future action it must pass through preparation, on one
of two timescales. Within a scope: evaluation's medium products (possible-tag, endurance-need)
become preparation's inputs, folded into near-term readiness. Across scopes: evaluation's slow
product (the tag) waits, is consolidated into structure, and structure is read by the next scope's
preparation. Either way — evaluation proposes, preparation disposes, action runs. The one-way ring
is what separates gathering from acting by exactly the time it takes preparation (or the night) to
honor what evaluation proposed; that separation is where deliberation lives.
**The coincidences of the action sort by timescale.** Where a component detects the coincidences
that authorize a lasting change depends on whether they must be instantaneous. Coincidences that
must be simultaneous are detected *in ACTION* by the receptors themselves — the postsynaptic NMDA
gate passing large calcium only when presynaptic glutamate, astrocytic co-agonist, and local
depolarization align, amplified by the descended back-propagating spike. Coincidences that can be
integrated over the quiet are detected *in EVALUATION* by trace accumulation — the organism's
dopamine gating the tag over the following interval. Same logic (require several partners to align),
sorted into the phase whose timescale it fits: instantaneous coincidence is action, integrable
coincidence is evaluation.
### The two turnings
One ring, turned in two directions. The three phases and their subjects are invariant across DAY
and NIGHT; what rotates is the *content* flowing through them (information by day, resource by
night) and — the sharp point — *which physical event counts as which phase*. From a component's
own standpoint there is no "open" or "closed" scope: each turning runs against *its* environment,
the world by day and the economy by night.
**The same physical event is ACTION in one scope and EVALUATION in the other.** This is the
deepest form of the duality. Transmitter release is the day's ACTION — the defining outward deed,
transmitting to the world — and the fast trace is its byproduct, later evaluated. But the *same
release*, run at night, is EVALUATION: the component releases not to transmit but as a *probe*, to
read its own fast trace as a measure of how much it participates in the re-evoked pattern. And the
structural change, which the day can only *mark* (the tag is an inert claim pointing at a
restructuring that never happens by day), is the night's ACTION — its defining, irreversible deed.
So the defining act of each scope is the assessment-instrument of the other: release is
day-action / night-evaluation; restructuring is night-action / day-inert-mark. The scopes do not
merely run the ring in two directions — they swap which event is the deed and which is the
measurement. Because it is a ring, each scope simply enters at a different phase: the day enters at
ACTION (act, then evaluate, then prepare — it must act first, the world will not wait); the night
enters at PREPARATION (prepare, then measure, then act — it can afford to look before it leaps).
**DAY — the ring turned outward.** PREPARATION reads the descended structure and refills the pools;
ACTION is the cleft exchange (release, integrate, clear) against the world, leaving the fast trace;
EVALUATION climbs the ladder to the tag — significance worked up, minted for the night. Currency:
information, cheap, gathered passively. Ladder direction: evidence ascending. Token minted: the
**tag**.
**NIGHT — the ring turned inward, as a sequence of replay cycles.** PREPARATION imports material
and energy and *primes* the component's own spontaneous threshold from its own standing tag (a high
tag lowers the threshold, raising occupancy). ACTION is the structural change — general homeostatic
lowering, then rebuilding where the tag still stands and participation was confirmed, consuming the
tag on the build. EVALUATION is the probe: the component spontaneously releases/fires and reads its
fast trace as *participation* in the re-evoked pattern — no dopamine, because significance is
already settled; this measures only circuit centrality. Currency: resource, scarce. Ladder
direction: capacity descending. Token minted: the **structure**.
**Replay is how the undifferentiated tag is spent on specific behaviors — and it needs no
orchestrator.** A component's tag accumulates by day from *many* behaviors into a single
magnitude — how much change it needs, stripped of what for. It cannot spend that lump correctly in
one commit (that would build a blend serving no behavior). Replay re-presents the day's behaviors
one at a time so the lump can be allocated to each. The mechanism is local and emergent: at night,
freed from external drive, components spontaneously fire; where a tag has lowered a component's
threshold, intrinsic fluctuation ignites it, and the activation propagates through the *same
pathways used by day*, re-evoking the pattern — but only where *every* link is primed (each
component's own tag lowered its own threshold), so a pattern carries only if it was significant all
the way around. This coherence is mechanical, not checked: an un-primed link breaks the loop at the
gap. The re-evoked components run their *structural* logic, not their significance logic — they are
not re-asking "did this matter" (settled) but "how much do I change for this." The replaying
assembly is not an actor; it is the coincidence of many components' own lowered thresholds
propagating through recurrent coupling — holism enacted, not encoded (category I).
**Why night cycles: the tag depletes, and depletion re-sorts the queue.** Each re-evocation lets
the participating components allocate a *slice* of their tag to that behavior and consume it — which
raises their thresholds back, so that pattern steps aside and the *next*-deepest tag surfaces on the
next cycle. The night sweeps its repertoire in rough order of tag depth, strongest most often, each
pattern depleting and yielding to the next, exactly as a vesicle pool depletes and refills to
schedule release one scale down. This is why the tag is spent incrementally across cycles rather
than all at once, why strong memories replay repeatedly, and why consolidation is a gentle settling
over many cycles (and many nights) rather than a single commit. The night ends when the tag is
exhausted (well-rested — every significant pattern replayed and its structure rebuilt) or the
night's energy is spent (overloaded — unspent tags carry forward). A pattern that never re-evokes
before its tag decays is simply never built — which is how the turning forgets.
**The two turnings are stitched by evaluation, and the fatigue loop switches between them.** Each
scope's EVALUATION mints the token the *other* scope will consume: day-evaluation mints the tag
that night spends; night-evaluation (participation) gates the structure that the next day operates
within. This *payload* handoff is distinct from the *switch* — the fatigue loop (category II) that
decides *when* a component crosses between scopes. One says what crosses; the other says when to
cross; they are orthogonal (category II). So the DAY/NIGHT alternation is one ring, entered at two
different phases, handing off to itself through evaluation, switched by fatigue — not two separate
machines.
@@ -0,0 +1,553 @@
---
include_toc: true
---
# presynapse.md
## PRESYNAPSE
Expansions and modulations:
- is expanded and developed by: [AXON](axon.md)
- is tuned by: [ORGANISM](../../organism.md), organs, modules
- expands and tunes: [PRE_VGG](pre_vgcc.md)
- develops _Ca2, _Rrp
```Gen
include:
pre_vgcc.md
PRESYNAPSE
type: comprehension
expansion:
// il tub serve al tuning
_@pre_vgcc: TUB [ comprehension: PRE_VGCC, full: 10x, active: 5x, empty: 2x ]
intrication:
// Scope
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
// Context
*AP: INTRICATION [ ref: &SOMA.*AP ]
*TunPossible: INTRICATION [ ref: &NEURON.*TunPossible ]
// Tub
_NT: INTRICATION [ ref: &ASTROSYNAPSE._NT ]
_ATP: INTRICATION [ ref: &ASTROCYTE._ATP ]
_eCB: INTRICATION [ ref: &POSTSYNAPSE._eCB ]
instantiation:
// Context
*VcggIncrease: CONTEXT []
*VcggDecrease: CONTEXT []
*Ca2PrePreActiveDecrease: CONTEXT []
*Ca2PreActiveDecrease: CONTEXT []
*RrpPreActiveDecrease: CONTEXT []
*RrpPreActiveDecrease: CONTEXT []
// Tub
_Ca2: TUB [ full: 60x, active: 30x, empty: 0x ]
_Rrp: TUB [ full: 30x, active: 15x, empty: 0x ]
_Rp: TUB [ full: 30x, active: 15x, empty: 0x ]
_CaTracesHigh: TUB [ full: 50x, active: 0x, empty: 0x ]
_CaTracesMedium: TUB [ full: 50x, active: 0x, empty: 0x ]
_CaTracesLow: TUB [ full: 50x, active: 0x, empty: 0x ]
_Ca2FullDev: TUB [ full: 100x, active: _Ca2.full, empty: 40x ]
_RrpFullDev: TUB [ full: 100x, active: _Rrp.full, empty: 40x ]
# serve al DEV
// Behaviour
$: BEHAVIOUR [ behaviour: MAIN ]
$: BEHAVIOUR [ behaviour: TUN_VGCC ]
$: BEHAVIOUR [ behaviour: DEV_TUBS ]
```
### !DAY | MAIN
```Gen
MAIN
type: behaviour
within_scope: !DAY
snippet:
// *AP
@: ACCUMULATOR [ snippet: NTreleaseLow, rf: active 12x ]
@: ACCUMULATOR [ snippet: NTreleaseMedium, rf: active 9x ]
@: ACCUMULATOR [ snippet: NTreleaseHigh, rf: active 6x ]
@: ACCUMULATOR [ snippet: TracesAccLow, rf: active 3x ]
@: ACCUMULATOR [ snippet: TracesAccMedium, rf: active 6x ]
@: ACCUMULATOR [ snippet: TracesAccHigh, rf: active 10x ]
// NOT *AP
@: ACCUMULATOR [ snippet: eCBClearenceMedium, rf: active 24x ]
@: ACCUMULATOR [ snippet: eCBClearenceLow, rf: active 48x ]
@: ACCUMULATOR [ snippet: RPShuttleLow, rf: active 24x ]
@: ACCUMULATOR [ snippet: RPShuttleMedium, rf: active 48x ]
@: ACCUMULATOR [ snippet: RefillGlutamine, rf: active 24x ]
@: ACCUMULATOR [ snippet: TracesClearance, rf: active 30x ]
```
**Tubs:**
- **\_Ca2**: Calcium Ion entering the Presynapse when VCGG open that influence NT release. Normally returns to ~0 between spikes; stays elevated when pumps fail. They are key to check the concentration, release NT and modulation
- **\_Rrp**: Readily Releasable Pool: The Readily Releasable Pool consists of the vesicles that are "docked" and "primed" at the active zone of the synapse. This pool is very small (usually only about 0.5% to 5% of total vesicles) and can be exhausted quickly during high-frequency firing, leading to "short-term depression" of the signal. Here we consider them as NT ready to be released.
- **\_Rp**: Reserve Pool: The bulk of the vesicles held further back in the terminal, often tethered by a protein called synapsin. These are only mobilized during intense, prolonged stimulation. This makes up the vast majority of the vesicles (up to 80% or 90%). Here we consider them NT in reserve that can be transfered to RRP and created using Glutamine from Astorcyte.
- **\_NT**: Neuro Transmitter, released in the synapse by the vescicles. The release increses NT and decreases RRP
- **\_CaTracesXXX**: sono le tracce di permanenza della concentrazione di Ca2. Servono alla modulazione (TUN)
- **\_eCB**: retrograde signal updates from postsynapsis (postsynaptic input)
#### *AP
Il rilascio di NT lo facciamo nel contesto di AP. Biologicamente dovrebbe avvenire solo in base alle concentrazioni, quindi anche al difuori degli AP.
RF di interacting deve essere MOLTO piu' basso di un RF di AP. In maniera da essere attivo varie volte nel contesto di un episodio di AP. Il che ha senso perche' un AP e' SOMA ad un tempo piu' alto che i comportamenti di PRE. Questo poi per permettere la diversa contestualizzazione degli episodi di NTrelease, a piu' o meno alta velocita'.
![nt-release.png](.attachments/nt-release.png)
Non consideriamo le vesicles come liberate, ma direttamente gli NT. Questo permette di gestire la quantita' rilasciata di NT, invece di gestire un numero di vescicles. Nella realta' ciascuna vesicle contiene migliaia di NT. Qui mettiamo un floor a questo tipo di comprensione.
Ci sono 4 casi che dipendono da RRP, Ca2 e indirettamente da concentrazione di NT nella SYN che diventa mGLur che limita in VGCC l'entrata di Ca2. L'idea e' che la quantita' di RRP sia il driver principale. Gli NT liberati sono di piu' al crescere di RRP e Ca2 e di meno (indirettamente) al crescere della concentrazione di NT gia' liberati nella SYN. Gli NT nella sinapsi fanno da moderazione alla ulteriore liberazione di NT, ma non bloccano mai totalmente. NT suppression only matters when everything else is already at maximum, which is exactly the biological purpose: it prevents runaway release during peak activity, not during moderate activity.
---
NT empty. Qui siamo contestualizzati se Ca2 full, il che dovrebbe significare indirettamente che non ci sono NT nella SYN.
In tutti i casi di NT
##### NTreleaseLow
```Gen
NTreleaseLow
type: accumulator
in_context: *AP
hypothesis: _Ca2 mediumness AND _Rrp mediumness AND NOT _ATP empty
action: [ _Rrp decrease, _NT increase, _ATP decrease ]
trace: None
```
##### NTreleaseMedium
```Gen
NTreleaseMedium
type: accumulator
in_context: *AP
hypothesis: ( _Ca2 fullness AND _Rrp mediumness ) OR
( _Ca2 mediumness AND _Rrp fullness ) AND
NOT _ATP empty
action: [ _Rrp decrease, _NT increase, _ATP decrease ]
trace: None
```
##### NTreleaseHigh
```Gen
NTreleaseHigh
type: accumulator
in_context: *AP
hypothesis: _Ca2 fullness AND _Rrp fullness AND
NOT _ATP empty
action: [ _Rrp decrease, NT increase, _ATP decrease ]
trace: None
```
##### Ca2TracesAccLow
Serve a:
- fare il tuning dei VGCC
- dare la velocita' al trasporto di vesicles da RP a RRP, anche se non avendo ancora compreso \_ATP, la velocita' non cambia molto la sostanza.
- le tracce vengono eliminate quando il neurone e' in pausa, lontano da uno spike train, *TunPossible
- Abbiamo 3 tracce, high, medium and low. Andiamo a verificare una combinazione di queste per fare la modulazione
- RF e' a 10, questo dovrebbe essere un RF di campionamento durante *AP context che dovremmo assicurarci sia tipo 100. Il che implicherebbe 10 campionamenti.
- The biological meaning is that a synapse that has just been through a burst is primed for fast recovery — the molecular machinery for vesicle docking is already engaged, calcium-dependent priming factors are still elevated, and the system is in a ready state. A synapse that has been silent for several seconds has cooled down and replenishes slowly.
- So after one second of silence CaTrace has fallen to ~37% of its peak value, after two seconds to ~14%, after three seconds to ~5%. It asymptotes toward zero but never exactly reaches it. Between spikes, Ca2 falls toward zero as the pumps clear it. The result is that CaTrace encodes not the instantaneous calcium level but the recent history of calcium activity — a smoothed, time-averaged measure of how active the synapse has been over the past one to two seconds.
```Gen
Ca2TracesAccuLow
type: accumulator
in_context: *AP
hypothesis: _Ca2 emptiness
action: [ _CaTraceLow increase ]
trace: None
```
##### Ca2TracesAccMedium
```Gen
Ca2TracesAccMedium
type: accumulator
in_context: *AP
hypothesis: _Ca2 mediumness
action: [ _CaTraceMed increase ]
trace: None
```
##### Ca2TracesAccHigh
```Gen
Ca2TracesAccumulationHigh
type: accumulator
in_context: *AP
hypothesis: _Ca2 fullness
action: [ _CaTraceHigh increase ]
trace: None
```
#### NOT *AP
##### eCBClearance
eCB dipende da POST. Tende a modulare l'entrata di Ca2 degli VGCC.
Qui non facciamo un flush di eCB, riduciamo ogni mezzo secondo (context) di un RF di questo episodio.
```Gen
eCBClearance: ( active: 24x ) # Slow
type: accumulator
in_context: NOT *AP
hypothesis: NOT _eCB empty
action: [ _eCB decrease ]
trace: None
```
##### RPShuttleLow
This happens in the seconds loop, once per second.
The "Hard Bottleneck" State. Recruitment is throttled by a lack of signal, a lack of supply, or a lack of space. If even one of these "Near-Stop" conditions is met, the rate cannot exceed "Slow," regardless of the other two conditions.
Rate: 0.00 0.25
```Gen
RPShuttleLow
type: accumulator
in_context: NOT *AP
hypothesis: _CaTraceLow fullness OR
_RP emptiness OR
_Rrp fullness
action: [ _RP decrease, _Rrp increase ]
trace: None
```
##### RPShuttleMedium
The "Sub-Optimal" State. The machinery is working, but it's held back by partial limitations. This covers cases where the signal is steady but the "piston" isn't firing at full speed, or where a high vacancy in the RRP (emptiness) forces a low signal to work a bit harder.
Rate: 0.50 0.97
```Gen
RPShuttleMedium
type: accumulator
in_context: *AP
hypothesis: ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp mediumness ) OR
( _CaTraceHigh fullness AND _RP mediumness AND _Rrp mediumness ) OR # signal boost
( _CaTraceMedium fullness AND _RP fullness AND _Rrp mediumness ) OR # supply boost
( _CaTraceMedium fullness AND _RP mediumness AND _Rrp emptiness ) # vacancy boost
action: [ _RP decrease, _Rrp increase ]
trace: None
```
##### RPShuttleHigh
The "High Performance" State. Multiple systems are optimized, but one is still at a "mediumness" level. This represents an active synapse that hasn't reached its absolute peak because either the supply is only 50% or the \_Rrp isn't empty enough to create that "maximal vacuum" pull.
Rate: 1.25 1.94
```Gen
RPShuttleHigh
type: accumulator
in_context: *AP
hypothesis: ( _CaTraceHigh fullness AND _RP fullness AND _Rrp mediumness ) OR # signal + supply
( _CaTraceHigh fullness AND _RP mediumness AND _Rrp emptiness ) OR # signal + vacancy
( _CaTraceMedium fullness AND _RP fullness AND _Rrp emptiness ) # supply + vacancy
action: [ _RP decrease, _Rrp increase ]
trace: None
```
##### RefillRPGlutamine
This happens in the minutes loop, once per minute, via the glutamine shuttle from the astrocyte. It is a two-step process across two cells.
Step 1 — astrocyte side
The astrocyte has been accumulating cleared glutamate from the cleft since the last minutes-loop execution. Its glutamine synthetase enzyme converts that glutamate into glutamine, filling the Glutamine_pool. The fraction successfully converted per cycle is conversion_efficiency, which is set by glucose availability and boosted temporarily if the astrocyte calcium wave fired during the preceding seconds:
refill_RP = Glutamine_pool * conversion_efficiency
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)
Step 2 — presynapse side
The glutamine crosses into the presynapse, where glutaminase converts it back into glutamate. That glutamate is immediately repackaged into vesicles and added to N_RP:
**The asymmetry that makes depletion possible**:
The chain reveals why sustained high-frequency firing eventually depletes the synapse even with all replenishment mechanisms running.
The RRP holds at most `Max_RRP = 20` vesicles. At 20 Hz with strong Ca2, release can draw 2-4 vesicles per spike — potentially exhausting the RRP in under a second. The seconds loop can move vesicles from RP to RRP at a maximum rate of `k_rec_fast = 5 /s`, meaning at most 5 vesicles per second under ideal conditions. Release outpaces recruitment by roughly an order of magnitude during a burst.
The RP holds up to `Max_RP = 200` vesicles — ten times the RRP. At sustained 20 Hz the RP can sustain firing for tens of seconds even after the RRP is repeatedly emptied, as long as recruitment keeps pace. But the minutes loop only refills N_RP once per minute at a rate limited by `Glutamine_pool * conversion_efficiency`. If glucose is low or the astrocyte wave has not fired, this replenishment may add only a fraction of what was consumed.
The result is a three-tier buffer with mismatched timescales:
RRP — depletes in seconds, refilled in seconds (fast but shallow)
RP — depletes in minutes, refilled in minutes (deep but slow)
Gln — depletes over bursts, refilled by glucose (slowest, astrocyte-dependent)
Each tier buys time for the one below it to respond. When all three are depleted simultaneously — which only happens under prolonged high-frequency firing with insufficient glucose — the synapse has no remaining buffer and goes silent until the minutes loop restores the Glutamine_pool.
##### Ca2TracesClearance
Qui facciamo un flush di CaTraceX. Deve essere fatto a valle del tuning.
```Gen
Ca2TracesClearance
type: accumulator
in_context: NOT *TunPossible
hypothesis: NOT _CaTraceHigh empty
action: [ _CaTRaceHigh decrease ]
trace: None
hypothesis: NOT _CaTraceMedium empty
action: [ _CaTRaceMedium decrease ]
trace: None
hypothesis: NOT _CaTraceLow empty
action: [ _CaTRaceLow decrease ]
trace: None
```
### !DAY | TUN_VGCC
```Gen
TUN_VGCC
// qui stiamo attivando e disattivando PRE_VGCC. Fra un massimo full e minimo empty (empty puo' non essere 0)
type: behaviour
activity_scope: !DAY
snippet:
// *TunPossible
@: CONTEXTOR [ snippet: VgccCheck, rf: active 60x ]
// *VcggIncrease
@: ACCUMULATOR [ snippet: VcggIncrease, rf:active 10x ]
// *VcggDecrease
@: ACCUMULATOR [ snippet: VcggDecrease, rf:active 10x ]
```
#### *TunPossible
##### VgccCheck
Qui controlliamo che ci siano le condizioni per aumentare o diminuire l'attivazione di VGCC
```Gen
VgccCheck
type contextor
in_context: *TunPossible
condition: _CaTraceHigh fullness
out_context: *VcggIncrease
condition: _CaTraceLow fullness
out_context: *VcggDecrease
```
#### *VcggIncrease
##### VcggIncrease
```Gen
VcggIncrease
type: accumulator
in_context: *VcggIncrease
hypothesis:
action:
trace:
```
#### *VcggDecrease
##### VcggDecrease
```Gen
VcggDecrease
type: accumulator
in_context: *VcggDecrease
hypothesis:
action:
trace:
```
### !NIGHT | DEV_TUBS
```Gen
DEV_TUBS
type: behaviour
activity_scope: !NIGHT
snippet:
# *fixed
@: CONTEXTOR [ snippet: Ca2Check, rf: active 60x ]
*CaFullDecrease
@: ACCUMULATOR [ snippet: CaFullDecrease, rf: active 10x ]
*Ca2FullIncrease
@: ACCUMULATOR [ snippet: Ca2FullIncrease, rf: active 10x ]
# *fixed
@: CONTEXTOR [ snippet: RrpCheck, rf: active 60x ]
*RrpFullDecrease
@: ACCUMULATOR [ snippet: RrpFullDecrease, rf: active 10x ]
*IncreaseRrpFull
@: ACCUMULATOR [ snippet: IncreaseRrpFull, rf: active 10x ]
```
#### *fixed
##### Ca2Check
***Tens Milliseconds Time Scale***
```Gen
Ca2Check
type: contextor
in_context: *fixed
condition: ( empty )
out_context: *CaFullDecrease
condition: ( full)
out_context: *Ca2FullIncrease
```
##### *CaFullDecrease
###### CaFullDecrease
```Gen
DecreasePreCa2Full
type: accumulator
in_context: *CaFullDecrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
##### *Ca2FullIncrease
###### Ca2FullIncrease
```Gen
IncreasePreCa2Full
type: accumulator
in_context: *Ca2FullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
#### *fixed
##### RrpCheck
***Tens Milliseconds Time Scale***
```Gen
RrpCheck
type: contextor
in_context: *fixed
condition: ( empty )
out_context: *RrpFullDecrease
condition: ( full)
out_context: *IncreaseRrpFull
```
##### *RrpFullDecrease
###### RrpFullDecrease
```Gen
DecreasePreRrpFull
type: accumulator
in_context: *RrpFullDecrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
##### *RrpFullIncrease
###### RrpFullIncrease
```Gen
RrpFullIncrease
type: accumulator
in_context: *RrpFullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
@@ -1,690 +0,0 @@
# Tripartite Synapse - Multi-Scale Computational Model
# =====================================================
# Presynaptic + Postsynaptic perspectives, fully integrated.
#
# Change log:
# ORIG - present from the original document
# NEW - added in the missing-behavior integration pass
# DET - deterministic Ca2+-driven vesicle release
# NKA - explicit Na/K-ATPase V_pre decay and ATP cost
# POST-ATP - postsynaptic Ca2+ dynamics and ATP loop
# FIX - corrections applied in this pass:
# * NT_released_this_window accumulator (was missing entirely)
# * k_rec_fast / k_rec_slow converted to /s, recruitment moved to Loop 2
# * dt_slow_s added
# * mGluR now reads NT_released_this_window (not NT_cleft snapshot)
# * IP3 now reads NT_released_this_window (not cleared_NT residual)
# * wave_active flag + conversion_efficiency boost on astrocyte wave
# * CDI rise gated to spike window only
#
# Clock structure:
# Loop 1 - dt = 1 ms (Ca2+, vesicle release, traces, postsynaptic fast)
# Loop 2 - dt = 1000 ms (astrocyte clearance, eCB, mGluR, recruitment)
# Loop 3 - dt = 60000 ms (glutamine shuttle, metabolic health)
#
# =======================================================================
# THREE CLOSED LOOPS
# =======================================================================
#
# PRESYNAPTIC:
# NT loop : release (ms) -> cleft -> astrocyte clearance (s) ->
# glutamine shuttle (min) -> RP refill -> RRP -> release
# Ca2+ loop : VGCC influx (ms) -> Tr_Ca -> recruitment speed (s) ->
# eCB retrograde from post (s) -> VGCC suppression
# ATP loop : NKA + pump costs (ms) -> ATP_demand (min) -> ATP_level ->
# pump_scale -> Ca2+ clearance rate -> CDI recovery
#
# POSTSYNAPTIC:
# NT detection loop : NT_cleft -> AMPA -> V_post -> desensitization ->
# reduces next response
# Ca2+ coincidence : NMDA (NT + V_post) -> Ca_post -> eCB -> pre brake
# ATP loop : NKA + PMCA costs (ms) -> ATP_demand_post (min) ->
# ATP_level_post -> pump_scale_post -> Ca_post clearance
#
# SHARED:
# eCB_level : post synthesises -> pre reads (retrograde brake)
# NT_cleft : pre releases -> post detects -> astrocyte clears
# Glucose_level : astrocyte supplies both sides from same budget
#
# =======================================================================
# METABOLIC SILENCING CASCADE (presynaptic)
# =======================================================================
# [CASCADE 1] HIGH FIRING -> VESICLE DEPLETION (~seconds)
# release rate >> recruitment rate -> N_RRP -> 0
# [CASCADE 2] HIGH FIRING -> ATP DEPLETION (~minutes)
# NKA + PMCA + docking demand > glucose-driven supply
# [CASCADE 3] LOW ATP -> PUMP FAILURE
# pump_scale = Hill(ATP_level) -> cleared_PMCA/SERCA fall
# [CASCADE 4] PUMP FAILURE -> RESIDUAL Ca2+ STAYS HIGH
# Ca_micro persists between spikes
# [CASCADE 5] RESIDUAL Ca2+ -> CDI LOCKS VGCCs SHUT
# CDI rise (spike only) + recovery blocked by Ca2+ -> CDI -> 1
# [CASCADE 6] SYNAPSE SILENCES (excitotoxicity protection)
# effective_conductance = N_VGCC*(1-eCB)*(1-CDI)*(1-mGluR*alpha)
# -> 0; NCX auto-reset when drive stops
#
# POSTSYNAPTIC ATP CASCADE (no CDI equivalent -> dangerous):
# [POST-ATP 1] HIGH V_post + NMDA -> ATP_demand_post rises
# [POST-ATP 2] ATP_level_post falls -> pump_scale_post falls
# [POST-ATP 3] Ca_post clearance slows -> Ca_post stays elevated
# [POST-ATP 4] Ca_post > eCB_threshold without real coincidence
# -> false retrograde signal suppresses presynapse
# [POST-ATP 5] Critically low ATP_post -> runaway Ca_post -> excitotoxicity
# =======================================================================
import numpy as np
# -----------------------------------------------------------------------
# CLOCK
# -----------------------------------------------------------------------
dt = 1.0 # ms
dt_slow = 1000.0 # ms
dt_meta = 60_000.0 # ms
High_Freq_Multiplier = int(dt_slow / dt) # 1000
Metabolic_Multiplier = int(dt_meta / dt) # 60000
dt_s = dt / 1000.0 # 0.001 s/step - for /s rate constants in Loop 1
dt_slow_s = dt_slow / 1000.0 # 1.0 s/step - for /s rate constants in Loop 2
# -----------------------------------------------------------------------
# PRESYNAPTIC PARAMETERS
# -----------------------------------------------------------------------
# -- Voltage / membrane --
tau_V_pre = 2.0 # ms - AP waveform decay (Na/K-ATPase recharge)
V_pre_peak = 1.0 # a.u. - normalised AP peak
V_rest = 0.0 # a.u. - resting potential
V_pre_voltage = -10.0 # mV - driving force for compute_flux
NKA_cost_per_AP = 0.002 # ATP units per AP (dominant drain at high rates)
# -- Ca2+ influx & buffering --
N_VGCC = 100 # number of VGCCs (ceiling of effective_conductance)
k_flux = 0.05 # Ca2+ influx per open channel per unit driving force
B_total = 1.0 # total buffer capacity (normalised)
tau_buffer_rebind = 200.0 # ms - buffer recharge time constant
# -- Ca2+ clearance (/ms constants) --
k_PMCA = 0.03 # ATP-dependent primary pump
k_NCX = 0.10 # ATP-independent floor
k_SERCA = 0.01 # ATP-dependent ER pump
ATP_half = 0.3 # Hill half-saturation for presynaptic pumps
ATP_cost_PMCA = 0.0005 # ATP per unit Ca2+ extruded by PMCA
ATP_cost_SERCA = 0.0002 # ATP per unit Ca2+ pumped into ER
ATP_cost_docking = 0.001 # ATP per vesicle docked (RP->RRP)
# -- Deterministic release (Hill + NT suppression) --
k_rel = 0.5 # max releasable fraction of RRP per spike
KD_rel = 1.0 # half-saturation [Ca2+]
n_rel = 4 # Hill cooperativity (synaptotagmin-1)
NT_suppression_weight = 0.3 # max NT_cleft brake on release fraction
NT_suppression_sat = 50.0 # NT_cleft level that saturates suppression
# -- CDI --
k_CDI_rise = 0.8 # /s - CDI build rate (applied * dt_s, spike only)
Ca_micro_saturation = 2.0 # normalisation ceiling for CDI recovery
k_CDI_rec = 0.015 # /s - CDI de-inactivation rate (applied * dt_s)
# -- Vesicle pools --
Max_RRP = 20
Max_RP = 200
# -- Calcium trace --
tau_Tr_Ca = 1000.0 # ms
T_high = 0.6 # Tr_Ca threshold -> fast recruitment
T_low = 0.2 # Tr_Ca threshold -> slow recruitment
# -- RP->RRP recruitment (/s, runs in Loop 2) --
k_rec_fast = 5.0 # /s - fast recruitment (at Tr_Ca > T_high)
k_rec_slow = 0.5 # /s - slow recruitment (at Tr_Ca < T_low)
# -- NT accumulator for Loop 2 signals --
NT_window_sat = 40.0 # vesicles/s that saturates mGluR and IP3
# at 20 Hz releasing ~2/spike = 40/s
# -- eCB retrograde brake --
tau_eCB_rise = 2000.0
tau_eCB_decay = 10_000.0
eCB_threshold = 0.7 # Ca_post level that triggers eCB synthesis
# -- mGluR presynaptic autoreceptor --
Km_mGluR = 0.5
tau_mGluR = 2000.0 # ms
alpha_mGluR = 0.4 # max fractional VGCC suppression
# -- Astrocyte / IP3 --
tau_IP3 = 3000.0 # ms
IP3_threshold = 0.8
wave_boost = 0.2 # conversion_efficiency boost when wave fires
tau_wave_decay = 2 # metabolic cycles before boost decays back
# -- Glutamine shuttle --
conversion_efficiency_base = 0.8
# -- NT cleft --
tau_NT_decay = 5.0 # ms
# -----------------------------------------------------------------------
# POSTSYNAPTIC PARAMETERS
# -----------------------------------------------------------------------
# -- NMDA coincidence detection --
k_NMDA = 0.08 # Ca_post influx per unit NT * (1 - Mg_block) per ms
V_NMDA_half = 0.3 # V_post at which Mg block is 50% lifted
# -- Ca_post clearance --
k_Ca_post_clear = 0.05 # /ms - ATP-dependent PMCA in spine
k_Ca_post_NCX = 0.02 # /ms - ATP-independent NCX floor
ATP_half_post = 0.3 # Hill half-saturation for postsynaptic pumps
# -- Postsynaptic ATP costs --
NKA_cost_per_bAP_post = 0.002 # ATP per unit V_post per s (continuous)
ATP_cost_Ca_post_pump = 0.0005 # ATP per unit Ca_post cleared
ATP_demand_scale_post = 50.0 # normalisation (same as presynaptic)
# -- Receptor desensitization --
tau_membrane = 20.0 # ms
tau_desensitization = 500.0 # ms
# -----------------------------------------------------------------------
# HELPER FUNCTIONS
# -----------------------------------------------------------------------
def compute_flux(conductance, voltage):
return k_flux * conductance * abs(voltage)
def deterministic_release(N_RRP, Ca_micro, NT_cleft):
# Hill equation: Ca2+ sensor cooperativity (synaptotagmin-1, n=4)
Ca_n = Ca_micro ** n_rel
release_frac = k_rel * Ca_n / (Ca_n + KD_rel ** n_rel)
# NT suppression: physical crowding + fast local autoreceptors
NT_norm = min(1.0, NT_cleft / NT_suppression_sat)
release_frac = release_frac * (1.0 - NT_suppression_weight * NT_norm)
release_frac = np.clip(release_frac, 0.0, 1.0)
return max(0.0, release_frac * N_RRP)
def map_trace_to_speed(Tr_Ca):
# Returns /s recruitment rate based on Tr_Ca level
if Tr_Ca > T_high:
return k_rec_fast
elif Tr_Ca < T_low:
return k_rec_slow
else:
t = (Tr_Ca - T_low) / (T_high - T_low)
return k_rec_slow + t * (k_rec_fast - k_rec_slow)
def compute_pump_atp_factor(atp, atp_half):
# Hill function: ATP gates pump speed (shared by pre and post)
return (atp ** 2) / (atp ** 2 + atp_half ** 2)
def compute_EPSP(receptor_conductance):
return receptor_conductance * 0.1
def compute_astrocyte_metabolic_health(Glucose_level, ATP_demand_accumulated,
demand_scale=50.0):
# Converts glucose supply and accumulated demand into ATP_level (0->1)
# and conversion_efficiency (0->1). Both sides use this function with
# their own demand accumulators but the same Glucose_level — shared
# metabolic vulnerability.
health = np.clip(Glucose_level - ATP_demand_accumulated / demand_scale,
0.0, 1.0)
return health, health # (conversion_efficiency, ATP_level)
def trigger_slow_astrocyte_calcium_wave():
# Placeholder - gliotransmitter release over ~10 s
pass
# -----------------------------------------------------------------------
# STATE VARIABLES
# -----------------------------------------------------------------------
# -- Presynaptic membrane --
V_pre_state = 0.0
# -- Presynaptic Ca2+ --
Ca_micro = 0.0
Ca_ER = 0.5
Ca_buffer_bound = 0.0
B_free = B_total
# -- CDI --
CDI_factor = 0.0
# -- Vesicle pools --
N_RRP = 15.0
N_RP = 150.0
# -- Calcium trace --
Tr_Ca = 0.0
# -- NT cleft --
NT_cleft = 0.0
# -- NT accumulator for slow signals --
# FIX: this was missing. Accumulates every ms in Loop 1,
# consumed by mGluR and IP3 in Loop 2, reset each second.
NT_released_this_window = 0.0
# -- Postsynaptic membrane + receptors --
V_post = 0.0
receptor_conductance = 0.0
Desensitization_level = 0.0
V_post_history = []
# -- Postsynaptic Ca2+ (spine compartment) --
Ca_post = 0.0
# Driven by NMDA coincidence (NT + V_post). Cleared by PMCA (ATP-gated)
# and NCX (always). Drives eCB synthesis. No CDI equivalent ->
# elevated Ca_post under ATP failure has no self-limiting mechanism.
# -- Retrograde / autoreceptor --
eCB_level = 0.0
mGluR_activation = 0.0
# -- Astrocyte --
IP3 = 0.0
wave_active = 0 # countdown: cycles remaining of wave boost
Glutamine_pool = 50.0
# -- Presynaptic ATP --
ATP_level = 1.0
ATP_demand = 0.0
conversion_efficiency = conversion_efficiency_base
Glucose_level = 1.0 # set < 1.0 to engage metabolic silencing
# -- Postsynaptic ATP --
ATP_level_post = 1.0 # separate pool; same glucose budget as presynaptic
ATP_demand_post = 0.0 # accumulates from NKA (V_post) and PMCA (Ca_post)
# -----------------------------------------------------------------------
# MAIN SIMULATION LOOP
# -----------------------------------------------------------------------
def run_simulation(spike_train, total_steps, bAP_train=None):
"""
spike_train : list of int - presynaptic AP timestep indices
total_steps : int
bAP_train : list of int - postsynaptic bAP timestep indices (optional)
if None, no bAPs are delivered
"""
global V_pre_state
global Ca_micro, Ca_ER, Ca_buffer_bound, B_free
global CDI_factor
global N_RRP, N_RP, Tr_Ca, NT_cleft, NT_released_this_window
global V_post, receptor_conductance, Desensitization_level, V_post_history
global Ca_post
global eCB_level, mGluR_activation
global IP3, wave_active, Glutamine_pool
global ATP_level, ATP_demand, conversion_efficiency, Glucose_level
global ATP_level_post, ATP_demand_post
log = {k: [] for k in [
"V_pre_state", "Ca_micro", "Ca_ER", "CDI_factor", "B_free",
"N_RRP", "N_RP", "Tr_Ca", "NT_cleft",
"V_post", "Ca_post", "eCB_level", "mGluR_activation",
"released_NT", "ATP_level", "ATP_demand",
"ATP_level_post", "ATP_demand_post",
]}
spike_set = set(spike_train)
bAP_set = set(bAP_train) if bAP_train else set()
for step in range(total_steps):
# ==============================================================
# LOOP 1 — HIGH-FREQUENCY (dt = 1 ms)
# ==============================================================
V_pre = 1 if step in spike_set else 0
bAP = 1 if step in bAP_set else 0
released_NT = 0.0
# -- 1A. PRESYNAPTIC MEMBRANE / Na-K-ATPase -------------------
# AP fires: membrane jumps to peak, then decays with tau_V_pre.
# Ca2+ influx uses V_pre_state (continuous) not binary V_pre,
# giving a temporal influx profile that tapers as membrane repolarises.
if V_pre == 1:
V_pre_state = V_pre_peak
ATP_demand += NKA_cost_per_AP # dominant presynaptic ATP cost
V_pre_state += (V_rest - V_pre_state) * dt / tau_V_pre
# -- 1B. PRESYNAPTIC Ca2+ INFLUX ------------------------------
# Three multiplicative brakes on effective_conductance:
# eCB_level : retrograde brake from postsynapse (Loop 2)
# CDI_factor : Ca2+-dependent inactivation (below)
# mGluR_activation : autoreceptor brake (Loop 2)
effective_conductance = (
N_VGCC
* (1.0 - eCB_level)
* (1.0 - CDI_factor)
* (1.0 - mGluR_activation * alpha_mGluR)
)
raw_influx = compute_flux(effective_conductance, V_pre_state)
# Buffer proteins capture a fraction immediately (fast sponge).
# B_free -> 0 during sustained bursting -> capture_fraction -> 0
# -> full raw_influx enters Ca_micro (CASCADE 4 acceleration).
capture_fraction = B_free / B_total
captured = raw_influx * capture_fraction
B_free = max(0.0, B_free - captured)
Ca_buffer_bound += captured
Ca_micro += (raw_influx - captured)
# -- 1C. VESICLE RELEASE --------------------------------------
# Deterministic: Hill Ca2+ sensor * NT suppression * N_RRP.
# Runs every ms that Ca_micro > 0 (release profile follows Ca2+
# transient, not locked to spike flag).
if N_RRP > 0 and Ca_micro > 0:
released_NT = deterministic_release(N_RRP, Ca_micro, NT_cleft)
released_NT = min(released_NT, N_RRP)
N_RRP -= released_NT
NT_cleft += released_NT
# FIX: accumulate for Loop 2 mGluR and IP3 signals.
# This is the only correct way to feed slow signals from fast
# events — snapshot of NT_cleft at Loop 2 time would be ~0
# because passive diffusion has already cleared it.
NT_released_this_window += released_NT
# Passive NT diffusion out of cleft each ms.
NT_cleft *= (1.0 - dt / tau_NT_decay)
NT_cleft = max(0.0, NT_cleft)
# -- 1D. PRESYNAPTIC Ca2+ CLEARANCE ---------------------------
# pump_scale: Hill(ATP_level) — bridges Loop 3 ATP to Loop 1 clearance.
# NCX is ATP-independent (floor); PMCA and SERCA are ATP-gated.
pump_scale = compute_pump_atp_factor(ATP_level, ATP_half)
cleared_PMCA = k_PMCA * Ca_micro * pump_scale
cleared_NCX = k_NCX * Ca_micro
cleared_SERCA = k_SERCA * Ca_micro * pump_scale
Ca_micro -= (cleared_PMCA + cleared_NCX + cleared_SERCA)
Ca_micro = max(0.0, Ca_micro)
Ca_ER += cleared_SERCA
ATP_demand += ATP_cost_PMCA * cleared_PMCA
ATP_demand += ATP_cost_SERCA * cleared_SERCA
# Buffer recharge: bound Ca2+ slowly re-releases back to cytosol.
# During pump failure this sustains Ca_micro elevation (CASCADE 4).
rebind_flux = Ca_buffer_bound * dt / tau_buffer_rebind
Ca_micro += rebind_flux
Ca_buffer_bound = max(0.0, Ca_buffer_bound - rebind_flux)
B_free = B_total - Ca_buffer_bound
# -- 1E. CDI — RISE (spike only) AND RECOVERY (every ms) ------
# RISE: Ca2+ entering through open channels inactivates them locally.
# Gated to spike window — requires channels to be open.
# (Running every ms was wrong: CDI needs Ca2+ flowing through
# the channel, not ambient cytosolic Ca2+.)
if V_pre == 1:
CDI_factor += k_CDI_rise * Ca_micro * dt_s
# RECOVERY: continuous, suppressed when Ca_micro is high.
# Self-locking: pump failure -> Ca_micro high -> recovery ~0
# -> CDI_factor -> 1 -> effective_conductance -> 0 (CASCADE 5-6).
CDI_recovery_rate = k_CDI_rec * (1.0 - Ca_micro / Ca_micro_saturation)
CDI_factor = np.clip(CDI_factor - CDI_recovery_rate * dt_s, 0.0, 1.0)
# -- 1F. CALCIUM TRACE ----------------------------------------
# Leaky integrator — integrates full Ca2+ waveform every ms
# including inter-spike clearance. Drives Loop 2 recruitment speed.
Tr_Ca = Tr_Ca + (Ca_micro - Tr_Ca / tau_Tr_Ca) * dt
# -- 1G. POSTSYNAPTIC: NT DETECTION & AMPA --------------------
# Desensitization reduces effective NT — sustained NT exposure
# progressively silences receptors (postsynaptic equivalent of CDI).
effective_NT = released_NT * (1.0 - Desensitization_level)
receptor_conductance += effective_NT * 0.05
receptor_conductance *= (1.0 - dt / tau_membrane)
V_post += compute_EPSP(receptor_conductance) - (V_post / tau_membrane) * dt
V_post = max(0.0, V_post)
Desensitization_level += NT_cleft * 0.001 * dt
Desensitization_level -= (Desensitization_level / tau_desensitization) * dt
Desensitization_level = np.clip(Desensitization_level, 0.0, 1.0)
V_post_history.append(V_post)
if len(V_post_history) > 5000:
V_post_history.pop(0)
# -- 1H. POSTSYNAPTIC: NMDA COINCIDENCE DETECTION -------------
# Ca_post enters only when BOTH conditions hold simultaneously:
# (1) NT_cleft > 0 — ligand gate (glutamate present)
# (2) V_post elevated — voltage gate (Mg2+ block lifted)
# Mg block removal is a sigmoid of V_post.
# bAP (backpropagating AP) boosts V_post further, enabling
# full NMDA opening and larger Ca_post surge.
V_post_effective = V_post + (bAP * 0.5) # bAP adds depolarisation
Mg_block_removal = V_post_effective / (V_post_effective + V_NMDA_half)
NMDA_Ca_influx = k_NMDA * NT_cleft * Mg_block_removal
Ca_post += NMDA_Ca_influx
# Postsynaptic NKA: membrane recharge cost proportional to V_post.
# [POST-ATP 1] Dominant postsynaptic ATP drain at high activity.
ATP_demand_post += NKA_cost_per_bAP_post * V_post * dt_s
# -- 1I. POSTSYNAPTIC: Ca_post CLEARANCE ----------------------
# pump_scale_post: Hill(ATP_level_post) — same structure as presynaptic.
# NCX is ATP-independent floor (enables auto-reset after ATP recovery).
# [POST-ATP 3] When pump_scale_post falls, Ca_post stays elevated ->
# eCB threshold crossed without genuine coincidence -> false retrograde.
pump_scale_post = compute_pump_atp_factor(ATP_level_post, ATP_half_post)
cleared_Ca_post_pump = k_Ca_post_clear * Ca_post * pump_scale_post
cleared_Ca_post_NCX = k_Ca_post_NCX * Ca_post
Ca_post -= (cleared_Ca_post_pump + cleared_Ca_post_NCX)
Ca_post = max(0.0, Ca_post)
# [POST-ATP 2] ATP cost of postsynaptic PMCA.
ATP_demand_post += ATP_cost_Ca_post_pump * cleared_Ca_post_pump
# -- RECORD ---------------------------------------------------
log["V_pre_state"].append(V_pre_state)
log["Ca_micro"].append(Ca_micro)
log["Ca_ER"].append(Ca_ER)
log["CDI_factor"].append(CDI_factor)
log["B_free"].append(B_free)
log["N_RRP"].append(N_RRP)
log["N_RP"].append(N_RP)
log["Tr_Ca"].append(Tr_Ca)
log["NT_cleft"].append(NT_cleft)
log["V_post"].append(V_post)
log["Ca_post"].append(Ca_post)
log["eCB_level"].append(eCB_level)
log["mGluR_activation"].append(mGluR_activation)
log["released_NT"].append(released_NT)
log["ATP_level"].append(ATP_level)
log["ATP_demand"].append(ATP_demand)
log["ATP_level_post"].append(ATP_level_post)
log["ATP_demand_post"].append(ATP_demand_post)
# ==============================================================
# LOOP 2 — SLOW / ASTROCYTE (dt_slow = 1 s)
# ==============================================================
if (step % High_Freq_Multiplier) == 0:
# Astrocyte EAAT clearance — active NT removal from cleft.
cleared_NT = NT_cleft * 0.3
NT_cleft = max(0.0, NT_cleft - cleared_NT)
# FIX: IP3 integrates NT_released_this_window (total release
# since last Loop 2), not the post-diffusion NT_cleft residual
# which is ~0 by the time Loop 2 runs.
IP3 += NT_released_this_window - (IP3 / tau_IP3) * dt_slow
IP3 = max(0.0, IP3)
if IP3 > IP3_threshold:
trigger_slow_astrocyte_calcium_wave()
# FIX: wave boosts conversion_efficiency in the next mins cycle.
# The astrocyte responds to heavy load by upregulating its
# recycling machinery — shipping more glutamine back to the
# presynapse. Boost decays over tau_wave_decay metabolic cycles.
wave_active = tau_wave_decay
# FIX: mGluR reads NT_released_this_window (accumulated release
# load), not NT_cleft snapshot. NT_cleft is ~0 at Loop 2 time
# due to diffusion; the accumulator correctly represents the
# burst load the autoreceptor has sensed during this window.
NT_window_norm = min(1.0, NT_released_this_window / NT_window_sat)
mGluR_target = NT_window_norm
mGluR_activation += (mGluR_target - mGluR_activation) * (dt_slow / tau_mGluR)
mGluR_activation = np.clip(mGluR_activation, 0.0, 1.0)
# FIX: reset accumulator for next window.
NT_released_this_window = 0.0
# eCB retrograde synthesis: now driven by Ca_post (spine Ca2+),
# not V_post_history. The actual eCB synthesis in the spine is
# triggered by Ca2+-dependent enzymes (DAGL, PLC), not voltage.
# Under normal conditions Ca_post only rises with coincidence.
# Under POST-ATP failure Ca_post stays elevated without genuine
# coincidence -> false retrograde signal (POST-ATP 4).
recent_Ca_post = (np.mean(log["Ca_post"][-2000:])
if len(log["Ca_post"]) >= 2000
else (np.mean(log["Ca_post"]) if log["Ca_post"] else 0.0))
eCB_signal = max(0.0, recent_Ca_post - eCB_threshold)
if eCB_signal > 0:
eCB_level += eCB_signal * (dt_slow / tau_eCB_rise)
else:
eCB_level -= eCB_level * (dt_slow / tau_eCB_decay)
eCB_level = np.clip(eCB_level, 0.0, 1.0)
# FIX: RP->RRP recruitment moved here from Loop 1.
# Biological timescale: vesicle docking and priming take seconds,
# not milliseconds. k_rec_fast/slow are /s; * dt_slow_s = 1.0 s
# gives dimensionless per-step fraction — no hidden unit scaling.
current_recruitment_rate = map_trace_to_speed(Tr_Ca) # /s
refill_amount = (current_recruitment_rate * dt_slow_s
* N_RP * (Max_RRP - N_RRP) / Max_RRP)
refill_amount = max(0.0, refill_amount)
refill_amount = min(refill_amount, N_RP)
N_RRP = min(N_RRP + refill_amount, Max_RRP)
N_RP = max(0.0, N_RP - refill_amount)
ATP_demand += ATP_cost_docking * refill_amount
# ==============================================================
# LOOP 3 — METABOLIC (dt_meta = 1 min)
# ==============================================================
if (step % Metabolic_Multiplier) == 0:
# Presynaptic ATP: glucose supply minus accumulated demand.
conversion_efficiency, ATP_level = compute_astrocyte_metabolic_health(
Glucose_level, ATP_demand
)
ATP_demand = 0.0
# FIX: wave boost applied to conversion_efficiency.
# Astrocyte calcium wave (triggered by high IP3) upregulates
# glutamine synthetase -> faster NT recycling -> more RP refill.
# Boost decays over tau_wave_decay cycles.
if wave_active > 0:
conversion_efficiency = min(1.0, conversion_efficiency + wave_boost)
wave_active -= 1
# Glutamine shuttle: astrocyte converts cleared NT to glutamine,
# presynapse repackages it into vesicles -> N_RP replenished.
refill_RP = Glutamine_pool * conversion_efficiency
N_RP = min(Max_RP, N_RP + refill_RP)
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)
# Postsynaptic ATP: same glucose budget, own demand accumulator.
# Both sides draw from Glucose_level -> shared metabolic vulnerability.
# Presynaptic silence reduces NT -> less NMDA -> less Ca_post ->
# less ATP_demand_post: presynaptic protection indirectly
# protects the postsynapse.
_, ATP_level_post = compute_astrocyte_metabolic_health(
Glucose_level, ATP_demand_post, ATP_demand_scale_post
)
ATP_demand_post = 0.0
return log
# -----------------------------------------------------------------------
# EXAMPLE USAGE
# -----------------------------------------------------------------------
if __name__ == "__main__":
import matplotlib.pyplot as plt
total_steps = 10_000 # 10 seconds
# Presynaptic 20 Hz burst for 2 s.
spike_train = list(range(0, 2000, 50))
# Postsynaptic bAPs coincident with every 5th presynaptic spike
# (simulates partial coincidence for NMDA activation).
bAP_train = list(range(0, 2000, 250))
results = run_simulation(spike_train, total_steps, bAP_train)
t = np.arange(total_steps) * dt
fig, axes = plt.subplots(8, 1, figsize=(12, 18), sharex=True)
fig.suptitle("Tripartite Synapse — Presynaptic + Postsynaptic", fontsize=13)
axes[0].plot(t, results["V_pre_state"], color="slateblue", lw=0.8)
axes[0].set_ylabel("V_pre")
axes[0].set_title("Presynaptic membrane (AP waveform)", fontsize=9, loc="left")
axes[1].plot(t, results["Ca_micro"], color="darkorange", lw=0.8)
axes[1].set_ylabel("[Ca2+] pre")
axes[1].set_title("CASCADE 4 — presynaptic Ca2+", fontsize=9, loc="left")
axes[2].plot(t, results["CDI_factor"], color="firebrick", lw=0.8, label="CDI")
axes[2].plot(t, results["B_free"], color="steelblue", lw=0.8, label="Buffer free")
axes[2].set_ylabel("CDI / Buffer")
axes[2].set_title("CASCADE 5 — CDI lock-out", fontsize=9, loc="left")
axes[2].legend(fontsize=8)
axes[3].plot(t, results["N_RRP"], color="teal", lw=0.8, label="RRP")
axes[3].plot(t, results["N_RP"], color="purple", lw=0.8, label="RP")
axes[3].set_ylabel("Vesicles")
axes[3].set_title("CASCADE 1 — vesicle depletion", fontsize=9, loc="left")
axes[3].legend(fontsize=8)
axes[4].plot(t, results["NT_cleft"], color="darkgreen", lw=0.8, label="NT cleft")
axes[4].plot(t, results["mGluR_activation"], color="saddlebrown", lw=0.8, label="mGluR")
axes[4].plot(t, results["eCB_level"], color="crimson", lw=0.8, label="eCB")
axes[4].set_ylabel("Cleft / Feedback")
axes[4].set_title("CASCADE 6 — three brakes on conductance", fontsize=9, loc="left")
axes[4].legend(fontsize=8)
axes[5].plot(t, results["V_post"], color="navy", lw=0.8, label="V_post")
axes[5].plot(t, results["Ca_post"], color="coral", lw=0.8, label="Ca_post (spine)")
axes[5].set_ylabel("Postsynaptic")
axes[5].set_title("Postsynaptic potential + NMDA spine Ca2+", fontsize=9, loc="left")
axes[5].legend(fontsize=8)
axes[6].plot(t, results["ATP_level"], color="goldenrod", lw=0.8, label="ATP pre")
axes[6].plot(t, results["ATP_level_post"], color="darkorange", lw=0.8, label="ATP post")
axes[6].set_ylabel("ATP level")
axes[6].set_title("CASCADE 2 / POST-ATP — presynaptic and postsynaptic ATP", fontsize=9, loc="left")
axes[6].legend(fontsize=8)
axes[7].plot(t, results["ATP_demand"], color="tomato", lw=0.8, label="demand pre")
axes[7].plot(t, results["ATP_demand_post"], color="orangered", lw=0.8, label="demand post")
axes[7].set_ylabel("ATP demand")
axes[7].set_title("Accumulated ATP demand (resets each min cycle)", fontsize=9, loc="left")
axes[7].set_xlabel("Time (ms)")
axes[7].legend(fontsize=8)
plt.tight_layout()
plt.savefig("./synapse_simulation.png", dpi=150)
plt.close()
print("Done.")
@@ -1,714 +0,0 @@
# Tripartite Synapse - Multi-Scale Computational Model
# =====================================================
# Presynaptic perspective, with all missing behaviors integrated.
#
# Change log:
# ORIG - present from the original document
# NEW - added in the missing-behavior integration pass
# DET - this pass: deterministic Ca2+-driven vesicle release
# NKA - this pass: explicit Na/K-ATPase V_pre decay and ATP cost
#
# Clock structure:
# Loop 1 - dt = 1 ms (Ca2+, vesicle release, short-term traces)
# Loop 2 - dt = 1000 ms (astrocyte clearance, eCB, mGluR feedback)
# Loop 3 - dt = 60000 ms (glutamine shuttle, metabolic health)
#
# =======================================================================
# METABOLIC SILENCING CASCADE - variable map
# =======================================================================
# Each step of the cascade is tagged inline with [CASCADE n].
#
# [CASCADE 1] HIGH FIRING RATE -> VESICLE DEPLETION (fast, ~seconds)
# Driver : spike_train density -> released_NT per ms
# Victim : N_RRP, N_RP
# Bottleneck : RP->RRP recruitment cannot keep up at high rates.
# Outcome : N_RRP -> 0, released_NT -> 0, NT_cleft collapses.
#
# [CASCADE 2] HIGH FIRING RATE -> ATP DEPLETION (slow, ~minutes)
# Driver : Na/K-ATPase recharge cost per AP (NKA_cost_per_AP)
# + PMCA/SERCA pump load + vesicle re-docking
# Victim : ATP_demand accumulator -> ATP_level
# Bottleneck : Glucose_level sets replenishment ceiling.
# Outcome : ATP_level < 1, pump_scale < 1.
#
# [CASCADE 3] LOW ATP -> PUMP FAILURE (PMCA / SERCA slow)
# Driver : pump_scale = Hill(ATP_level)
# Victim : cleared_PMCA, cleared_SERCA
# Outcome : total Ca2+ clearance rate drops.
#
# [CASCADE 4] PUMP FAILURE -> RESIDUAL Ca2+ STAYS HIGH
# Driver : reduced clearance + saturated buffer
# Victim : Ca_micro
# Outcome : Ca_micro persists between spikes.
#
# [CASCADE 5] RESIDUAL Ca2+ -> CDI STAYS ACTIVE (VGCCs lock shut)
# Driver : Ca_micro > 0 between spikes
# Victim : CDI_factor
# Outcome : CDI_factor -> 1, effective_conductance -> 0.
#
# [CASCADE 6] RESULT - SYNAPSE SILENCES (excitotoxicity protection)
# Driver : CDI_factor ~= 1
# Mechanism : effective_conductance = N_VGCC
# * (1 - eCB_level)
# * (1 - CDI_factor)
# * (1 - mGluR*alpha_mGluR)
# -> raw_influx ~= 0 -> no release.
# Auto-reset : NCX keeps clearing; CDI recovers once drive stops.
# =======================================================================
import numpy as np
# -----------------------------------------------------------------------
# PARAMETERS
# -----------------------------------------------------------------------
dt = 1.0 # ms - high-freq timestep
dt_slow = 1000.0 # ms - astrocyte / slow loop timestep
dt_meta = 60_000.0 # ms - metabolic loop timestep
High_Freq_Multiplier = int(dt_slow / dt) # 1000
Metabolic_Multiplier = int(dt_meta / dt) # 60000
# Unit-conversion scalar: biological rate constants in /s, timestep in ms.
# increment = k [/s] * signal * dt_s [s/step] -> dimensionless per step
dt_s = dt / 1000.0 # 0.001 s per 1 ms step
# -----------------------------------------------------------------------
# -- Voltage / membrane (NKA) --
# -----------------------------------------------------------------------
tau_V_pre = 2.0 # NKA: ms - membrane repolarisation time constant after AP
# The AP waveform decays with this time constant.
# Controls how long Ca2+ channels see a depolarised membrane.
V_pre_peak = 1.0 # NKA: normalised peak depolarisation on each AP (dimensionless)
V_rest = 0.0 # NKA: resting membrane potential (normalised)
V_pre_voltage = -10.0 # ORIG: driving force used in compute_flux (mV, kept for continuity)
# Na/K-ATPase ATP cost
NKA_cost_per_AP = 0.002 # NKA: ATP units consumed per AP for Na/K-ATPase recharge.
# This is the largest single ATP cost per spike.
# [CASCADE 2] Accumulates in ATP_demand each time V_pre = 1;
# at 20 Hz that is 0.002 * 20 = 0.04 ATP units/s,
# dominating pump and docking costs at high rates.
# -----------------------------------------------------------------------
# -- Calcium influx & buffering --
# -----------------------------------------------------------------------
N_VGCC = 100 # ORIG: number of presynaptic VGCCs
# [CASCADE 6] Absolute ceiling of Ca2+ influx.
k_flux = 0.05 # ORIG: Ca2+ influx per open channel per unit driving force (a.u.)
B_total = 1.0 # ORIG: total buffer capacity (normalised)
# [CASCADE 4] Saturates during bursting; B_free -> 0.
tau_buffer_rebind = 200.0 # NEW: ms - buffer recharge time constant
# -----------------------------------------------------------------------
# -- Ca2+ clearance rate constants (/ms, already per-millisecond) --
# -----------------------------------------------------------------------
# [CASCADE 3] All three define maximum clearance; PMCA and SERCA are ATP-gated.
k_PMCA = 0.03 # NEW: plasma membrane Ca-ATPase - primary, ATP-dependent
k_NCX = 0.10 # NEW: sodium-calcium exchanger - fast, NOT ATP-dependent
k_SERCA = 0.01 # NEW: ER pump - slowest, ATP-dependent
ATP_half = 0.3 # NEW: Hill half-saturation for ATP-dependent pumps
# ATP cost of pumping (per unit Ca2+ cleared per ms)
ATP_cost_PMCA = 0.0005 # NKA: ATP units per unit Ca2+ extruded by PMCA per ms
# [CASCADE 2] Second-largest ongoing ATP drain after NKA.
ATP_cost_SERCA = 0.0002 # NKA: ATP units per unit Ca2+ pumped into ER per ms
# -----------------------------------------------------------------------
# -- Deterministic vesicle release (replaces stochastic_release) --
# -----------------------------------------------------------------------
# The Ca2+-sensor model (synaptotagmin cooperativity):
#
# release_fraction = k_rel * Ca_micro^n / (Ca_micro^n + KD_rel^n)
# * (1 - NT_suppression_weight * NT_cleft_norm)
#
# Term 1 - Hill equation:
# k_rel : maximum fraction of RRP releasable per spike (saturation ceiling)
# KD_rel : [Ca2+] at half-maximum release (half-saturation constant)
# n_rel : Hill cooperativity exponent (~4 for synaptotagmin-1)
#
# Term 2 - NT suppression modulation:
# NT_suppression_weight : how strongly accumulated cleft NT reduces the
# releasable fraction (autoreceptor-independent brake,
# represents physical occlusion of release sites and
# depletion-sensing).
# NT_cleft_norm : NT_cleft normalised to NT_suppression_sat (0 -> 1).
#
# The product is clamped to [0, 1] before multiplying by N_RRP,
# so released_NT is always a real non-negative number <= N_RRP.
k_rel = 0.5 # DET: max releasable fraction of RRP per spike (0->1)
# Lower = more reluctant synapse at any [Ca2+].
KD_rel = 1.0 # DET: half-saturation [Ca2+] (same a.u. as Ca_micro)
# Higher KD = release only at high [Ca2+] peaks.
n_rel = 4 # DET: Hill exponent - cooperativity of Ca2+ sensor
# n=4 matches synaptotagmin-1 (four C2 domain sites).
# Higher n = sharper threshold, more digital release.
NT_suppression_weight = 0.3 # DET: strength of NT_cleft feedback on release fraction
# 0 = no suppression; 1 = full block at saturation.
NT_suppression_sat = 50.0 # DET: NT_cleft level that saturates the suppression term
# (same units as NT_cleft vesicle count)
ATP_cost_docking = 0.001 # NKA: ATP units per vesicle docked (RP -> RRP per step)
# [CASCADE 2] Docking is ATP-dependent (NSF/SNAPs);
# adds to ATP_demand proportionally to refill_amount.
# -----------------------------------------------------------------------
# -- CDI (calcium-dependent inactivation) --
# -----------------------------------------------------------------------
k_CDI_rise = 0.8 # ORIG: CDI build rate (/s per unit Ca_micro)
Ca_micro_saturation = 2.0 # NEW: normalisation ceiling for CDI recovery
k_CDI_rec = 0.015 # NEW: CDI de-inactivation rate (/s)
# Both expressed in /s; applied with * dt_s in the loop.
# -----------------------------------------------------------------------
# -- Vesicle pools --
# -----------------------------------------------------------------------
Max_RRP = 20 # ORIG: [CASCADE 1] ceiling of the firing-ready pool
Max_RP = 200 # ORIG: [CASCADE 1] ceiling of the reserve pool
# -----------------------------------------------------------------------
# -- Trace integrator (RP->RRP recruitment speed) --
# -----------------------------------------------------------------------
tau_Tr_Ca = 1000.0 # ORIG: ms - calcium trace decay
T_high = 0.6 # ORIG: trace threshold -> fast recruitment
T_low = 0.2 # ORIG: trace threshold -> slow recruitment
k_rec_fast = 5.0 # /s — fast RP->RRP recruitment rate
# At high Tr_Ca: refills ~5% of headroom per second.
# Full RRP recovery from empty takes ~4-5 s of sustained activity.
k_rec_slow = 0.5 # /s — slow RP->RRP recruitment rate
# At low Tr_Ca: refills ~0.5% of headroom per second.
# Matches the ~30-60 s recovery seen after deep depletion.
dt_slow_s = dt_slow / 1000.0 # 1.0 s — the slow loop timestep in seconds
# -----------------------------------------------------------------------
# -- Postsynaptic --
# -----------------------------------------------------------------------
tau_membrane = 20.0 # ORIG: ms
tau_desensitization = 500.0 # ORIG: ms
# -----------------------------------------------------------------------
# -- eCB retrograde brake --
# -----------------------------------------------------------------------
# [CASCADE 6] Slow retrograde suppressor of effective_conductance.
tau_eCB_rise = 2000.0 # ORIG: ms
tau_eCB_decay = 10_000.0 # ORIG: ms
eCB_threshold = 0.7 # ORIG: V_post level that triggers eCB synthesis
# -----------------------------------------------------------------------
# -- mGluR presynaptic autoreceptor --
# -----------------------------------------------------------------------
# [CASCADE 6] Fastest conductance brake; reads NT_cleft directly.
Km_mGluR = 0.5 # NEW: Michaelis-Menten half-saturation for NT_cleft
tau_mGluR = 2000.0 # NEW: ms
alpha_mGluR = 0.4 # NEW: max fractional VGCC suppression
# -----------------------------------------------------------------------
# -- Astrocyte / IP3 --
# -----------------------------------------------------------------------
tau_IP3 = 3000.0 # ORIG: ms
IP3_threshold = 0.8 # ORIG
# -----------------------------------------------------------------------
# -- Glutamine shuttle --
# -----------------------------------------------------------------------
conversion_efficiency_base = 0.8 # ORIG: fraction of Gln pool converted per cycle
# -----------------------------------------------------------------------
# -- NT cleft --
# -----------------------------------------------------------------------
tau_NT_decay = 5.0 # ms - passive NT diffusion / dilution out of cleft
# -----------------------------------------------------------------------
# HELPER FUNCTIONS
# -----------------------------------------------------------------------
def compute_flux(conductance, voltage):
# ORIG: Ca2+ influx into microdomain.
# [CASCADE 4] Collapses to near zero once CASCADE 6 locks conductance.
return k_flux * conductance * abs(voltage)
def deterministic_release(N_RRP, Ca_micro, NT_cleft):
# DET: Deterministic Ca2+-driven vesicle release.
#
# Replaces stochastic_release (binomial with p = p_base * Ca_micro).
#
# Biology: synaptotagmin-1 is the fast Ca2+ sensor. Its four C2-domain
# Ca2+-binding sites give steep, cooperative Ca2+ sensitivity (Hill n~4).
# Release is not random per vesicle but is driven by the microdomain [Ca2+]
# that the sensor actually sees. At low [Ca2+] essentially no vesicles fuse;
# at high [Ca2+] a saturating fraction fuses within the AP window.
#
# Step 1: Hill equation gives Ca2+-dependent release fraction (0 -> k_rel).
Ca_n = Ca_micro ** n_rel
release_frac = k_rel * Ca_n / (Ca_n + KD_rel ** n_rel)
#
# Step 2: NT suppression modulation (0 -> 1, then inverted).
# Accumulated NT_cleft represents: (a) depletion sensing via presynaptic
# autoreceptors that are faster than the mGluR loop, and (b) physical
# competition for release site access at the active zone.
# This is distinct from the mGluR brake which reduces VGCC conductance;
# this term reduces the fraction of already-docked vesicles that fuse.
NT_norm = min(1.0, NT_cleft / NT_suppression_sat)
suppression = NT_suppression_weight * NT_norm
release_frac = release_frac * (1.0 - suppression)
release_frac = np.clip(release_frac, 0.0, 1.0)
#
# Step 3: Apply to pool size and floor at zero.
released = release_frac * N_RRP
return max(0.0, released)
def map_trace_to_speed(Tr_Ca):
# ORIG: Maps calcium trace to RP->RRP recruitment rate.
# [CASCADE 1] k_rec_fast lags release at high firing; collapse is
# self-accelerating as N_RP and headroom both shrink.
if Tr_Ca > T_high:
return k_rec_fast
elif Tr_Ca < T_low:
return k_rec_slow
else:
t = (Tr_Ca - T_low) / (T_high - T_low)
return k_rec_slow + t * (k_rec_fast - k_rec_slow)
def map_calcium_to_inactivation(Ca_micro):
# ORIG: Ca2+ drives CDI increment each ms.
# k_CDI_rise is /s; * dt_s gives dimensionless per-step increment.
# [CASCADE 5] Accumulates between spikes under pump failure.
return k_CDI_rise * Ca_micro * dt_s
def compute_pump_atp_factor(ATP_level):
# NEW: Hill function - ATP gates PMCA and SERCA speed.
# [CASCADE 3] Bridge from ATP_level (Loop 3) to clearance rate (Loop 1).
# ATP=1.0 -> ~0.92 (near full) | ATP=0.3 -> 0.50 | ATP=0.1 -> ~0.10
return (ATP_level ** 2) / (ATP_level ** 2 + ATP_half ** 2)
def compute_EPSP(receptor_conductance):
# ORIG: postsynaptic potential increment.
return receptor_conductance * 0.1
def compute_postsynaptic_eCB_signal(V_post_history):
# ORIG: eCB synthesis from sustained postsynaptic activity.
# [CASCADE 6] Slow retrograde brake; persists 10 s after burst ends.
recent_mean = (np.mean(V_post_history[-2000:])
if len(V_post_history) >= 2000
else np.mean(V_post_history))
if recent_mean > eCB_threshold:
return recent_mean - eCB_threshold
return 0.0
def compute_astrocyte_metabolic_health(Glucose_level, ATP_demand_accumulated):
# ORIG + NKA: Converts Glucose_level and accumulated ATP demand into:
# ATP_level -> [CASCADE 2->3 bridge] read every ms in Loop 1
# conversion_efficiency -> [CASCADE 1] gates glutamine shuttle throughput
#
# NKA change: ATP_demand_accumulated (summed in Loop 1 each ms) is now
# subtracted from health before clamping, so high firing rates visibly
# reduce ATP_level within the same metabolic window.
# The demand term is normalised by a scale factor so that a physiological
# 20 Hz burst causes a ~20% ATP drop over one minute.
ATP_demand_scale = 50.0 # normalisation: demand at 20 Hz over 60 s ~ 1.0
health = np.clip(Glucose_level - ATP_demand_accumulated / ATP_demand_scale,
0.0, 1.0)
return health, health # (conversion_efficiency, ATP_level)
def trigger_slow_astrocyte_calcium_wave():
# ORIG: placeholder - would release gliotransmitters over ~10 s.
pass
# -----------------------------------------------------------------------
# STATE VARIABLES (initial values)
# -----------------------------------------------------------------------
# -- Voltage / membrane --
V_pre_state = 0.0 # NKA: continuous membrane potential (0=rest, 1=peak AP)
# Decays with tau_V_pre after each spike.
# Controls the effective driving window for Ca2+ influx.
# -- Presynaptic Ca2+ --
Ca_micro = 0.0 # ORIG: free cytosolic [Ca2+] in microdomain [CASCADE 4]
Ca_ER = 0.5 # NEW: Ca2+ stored in ER
Ca_buffer_bound = 0.0 # NEW: Ca2+ bound to buffer proteins
B_free = 1.0 # NEW: free buffer sites [CASCADE 4]
# -- CDI --
CDI_factor = 0.0 # ORIG [CASCADE 5,6]
# -- Vesicle pools --
N_RRP = 15.0 # ORIG: readily-releasable pool [CASCADE 1] (float for deterministic)
N_RP = 150.0 # ORIG: reserve pool [CASCADE 1]
# -- Calcium trace --
Tr_Ca = 0.0 # ORIG: integrative Ca2+ memory
# -- NT in cleft --
NT_cleft = 0.0 # ORIG [CASCADE 6]
# -- Postsynaptic --
V_post = 0.0
receptor_conductance = 0.0
Desensitization_level = 0.0
V_post_history = []
# -- Retrograde / autoreceptor --
eCB_level = 0.0 # ORIG [CASCADE 6]
mGluR_activation = 0.0 # NEW [CASCADE 6]
# -- Astrocyte --
IP3 = 0.0
Glutamine_pool = 50.0
# -- Metabolic --
ATP_level = 1.0 # NEW [CASCADE 2->3]
ATP_demand = 0.0 # NKA: accumulated ATP demand within current metabolic window
conversion_efficiency = 0.8 # ORIG
Glucose_level = 1.0 # ORIG: set < 1.0 to engage metabolic silencing cascade
# -----------------------------------------------------------------------
# MAIN SIMULATION LOOP
# -----------------------------------------------------------------------
def run_simulation(spike_train, total_steps):
"""
spike_train : list of int timestep indices at which an AP arrives
total_steps : int number of 1 ms steps to simulate
"""
global V_pre_state
global Ca_micro, Ca_ER, Ca_buffer_bound, B_free
global CDI_factor
global N_RRP, N_RP
global Tr_Ca, NT_cleft
global V_post, receptor_conductance, Desensitization_level, V_post_history
global eCB_level, mGluR_activation
global IP3, Glutamine_pool
global ATP_level, ATP_demand, conversion_efficiency, Glucose_level
log = {k: [] for k in [
"V_pre_state",
"Ca_micro", "Ca_ER", "CDI_factor", "B_free",
"N_RRP", "N_RP", "Tr_Ca", "NT_cleft",
"V_post", "eCB_level", "mGluR_activation",
"released_NT", "ATP_level", "ATP_demand",
]}
spike_set = set(spike_train)
for step in range(total_steps):
# ==============================================================
# LOOP 1 - HIGH-FREQUENCY (dt = 1 ms)
# ==============================================================
V_pre = 1 if step in spike_set else 0
released_NT = 0.0
# -- 1A. MEMBRANE VOLTAGE / Na-K-ATPase ------------------------
#
# NKA: V_pre_state is now a continuous variable.
# On each AP it jumps to V_pre_peak, then decays exponentially
# toward V_rest with time constant tau_V_pre (~2 ms).
# This models the width of the depolarisation window that keeps
# VGCCs open after the peak, giving Ca2+ influx a temporal profile
# rather than a single instantaneous pulse.
if V_pre == 1:
V_pre_state = V_pre_peak # AP fires: membrane jumps to peak
# Exponential decay toward rest (Na/K-ATPase restores the gradient)
V_pre_state += (V_rest - V_pre_state) * dt / tau_V_pre
# NKA: ATP cost of Na/K-ATPase recharge on each AP.
# Fired once per spike, not per ms — the cost is per action potential.
# [CASCADE 2] This is the dominant ATP drain at high firing rates.
if V_pre == 1:
ATP_demand += NKA_cost_per_AP
# -- 1B. PRESYNAPTIC Ca2+ INFLUX & VESICLE RELEASE -------------
#
# Ca2+ influx now uses V_pre_state (the continuous voltage) instead
# of the binary V_pre flag, so influx has the same temporal profile
# as the depolarisation window and tapers as the membrane repolarises.
# [CASCADE 6] OUTCOME: effective_conductance collapses when any of
# the three suppression terms approaches 1.
effective_conductance = (
N_VGCC
* (1.0 - eCB_level) # [CASCADE 6] retrograde brake
* (1.0 - CDI_factor) # [CASCADE 5->6] CDI lock-out
* (1.0 - mGluR_activation * alpha_mGluR) # [CASCADE 6] autoreceptor brake
)
# Ca2+ influx is gated by V_pre_state: significant only while the
# membrane is depolarised; tapers to zero as V_pre_state -> V_rest.
raw_influx = compute_flux(effective_conductance, V_pre_state)
# NEW: Buffer proteins capture a fraction of raw_influx immediately.
# [CASCADE 4] B_free -> 0 during sustained bursting (saturation).
capture_fraction = B_free / B_total
captured = raw_influx * capture_fraction
B_free = max(0.0, B_free - captured)
Ca_buffer_bound += captured
Ca_micro += (raw_influx - captured)
# DET: Deterministic Ca2+-driven vesicle release.
# Released on every ms that Ca_micro > 0 (not only on the spike flag),
# giving a smooth release profile that follows the Ca2+ transient.
# This is more physically accurate than gating release on V_pre == 1:
# in biology, vesicles fuse throughout the Ca2+ microdomain lifetime
# (~1-2 ms), not only at the exact moment of depolarisation.
# [CASCADE 1] released_NT draws from N_RRP; the Ca2+ and NT_cleft
# dependence means release self-limits as both Ca_micro
# falls (clearance) and NT_cleft rises (suppression).
if N_RRP > 0 and Ca_micro > 0:
released_NT = deterministic_release(N_RRP, Ca_micro, NT_cleft)
released_NT = min(released_NT, N_RP)
N_RRP -= released_NT
NT_cleft += released_NT
NT_released_this_window += released_NT # NEW: accumulator for Loop 2
# Passive diffusion — this is fine as-is, represents lateral escape
NT_cleft *= (1.0 - dt / tau_NT_decay)
NT_cleft = max(0.0, NT_cleft)
# -- 1C. Ca2+ CLEARANCE (every ms) ----------------------------
#
# [CASCADE 3] pump_scale: ATP bridge from Loop 3 to clearance.
pump_scale = compute_pump_atp_factor(ATP_level)
# [CASCADE 3->4] PMCA: primary, ATP-dependent.
cleared_PMCA = k_PMCA * Ca_micro * pump_scale
# [CASCADE 3 note] NCX: fast, NOT ATP-dependent. Floor, not rescue.
cleared_NCX = k_NCX * Ca_micro
# [CASCADE 3->4] SERCA: slowest, ATP-dependent.
cleared_SERCA = k_SERCA * Ca_micro * pump_scale
Ca_micro -= (cleared_PMCA + cleared_NCX + cleared_SERCA)
Ca_micro = max(0.0, Ca_micro)
Ca_ER += cleared_SERCA # ER store loaded while ATP is available
# NKA: ATP cost of PMCA and SERCA clearing Ca2+ this step.
# [CASCADE 2] Ongoing drain proportional to Ca2+ load; highest
# during the early burst when Ca_micro peaks.
ATP_demand += ATP_cost_PMCA * cleared_PMCA
ATP_demand += ATP_cost_SERCA * cleared_SERCA
# NEW: Buffer recharge - bound Ca2+ slowly re-releases to cytosol.
# [CASCADE 4] Sustains Ca_micro elevation during pump failure.
rebind_flux = Ca_buffer_bound * dt / tau_buffer_rebind
Ca_micro += rebind_flux
Ca_buffer_bound = max(0.0, Ca_buffer_bound - rebind_flux)
B_free = B_total - Ca_buffer_bound
# -- 1D. CDI - RISE AND RECOVERY --------------------------------
#
# [CASCADE 5] Rise: proportional to Ca_micro, fires every ms.
CDI_factor += map_calcium_to_inactivation(Ca_micro)
# [CASCADE 5] Recovery: suppressed when Ca_micro is high.
# Self-locking: pump failure -> Ca_micro high ->
# recovery_rate -> 0 -> CDI_factor -> 1 -> silence.
CDI_recovery_rate = k_CDI_rec * (1.0 - Ca_micro / Ca_micro_saturation)
CDI_factor = np.clip(CDI_factor - CDI_recovery_rate * dt_s, 0.0, 1.0)
# -- 1E. TRACE INTEGRATOR -------------------------------------
# ORIG: integrates Ca_micro; drives RP->RRP recruitment speed.
Tr_Ca = Tr_Ca + (Ca_micro - Tr_Ca / tau_Tr_Ca) * dt
# -- 1G. POSTSYNAPTIC FAST RESPONSE ---------------------------
# ORIG: receptor activation and desensitization.
effective_NT = released_NT * (1.0 - Desensitization_level)
receptor_conductance += effective_NT * 0.05
receptor_conductance *= (1.0 - dt / tau_membrane)
V_post += compute_EPSP(receptor_conductance) - (V_post / tau_membrane) * dt
V_post = max(0.0, V_post)
Desensitization_level += NT_cleft * 0.001 * dt
Desensitization_level -= (Desensitization_level / tau_desensitization) * dt
Desensitization_level = np.clip(Desensitization_level, 0.0, 1.0)
# ORIG: NT diffuses / dilutes out of cleft each ms.
NT_cleft *= (1.0 - dt / tau_NT_decay)
NT_cleft = max(0.0, NT_cleft)
V_post_history.append(V_post)
if len(V_post_history) > 5000:
V_post_history.pop(0)
# -- RECORD ---------------------------------------------------
log["V_pre_state"].append(V_pre_state)
log["Ca_micro"].append(Ca_micro)
log["Ca_ER"].append(Ca_ER)
log["CDI_factor"].append(CDI_factor)
log["B_free"].append(B_free)
log["N_RRP"].append(N_RRP)
log["N_RP"].append(N_RP)
log["Tr_Ca"].append(Tr_Ca)
log["NT_cleft"].append(NT_cleft)
log["V_post"].append(V_post)
log["eCB_level"].append(eCB_level)
log["mGluR_activation"].append(mGluR_activation)
log["released_NT"].append(released_NT)
log["ATP_level"].append(ATP_level)
log["ATP_demand"].append(ATP_demand)
# ==============================================================
# LOOP 2 - SLOW / ASTROCYTE (dt_slow = 1 s)
# ==============================================================
if (step % High_Freq_Multiplier) == 0:
# EAAT clearance: a fraction of what remains in the cleft
# (this is now meaningful because diffusion hasn't zeroed it yet
# at realistic tau_NT_decay values — but we also fix IP3 sourcing)
cleared_NT = NT_cleft * 0.3
NT_cleft = max(0.0, NT_cleft - cleared_NT)
# IP3 integrates total release load, not post-diffusion residual.
# This correctly represents the astrocyte sensing cumulative activity.
IP3 += NT_released_this_window - (IP3 / tau_IP3) * dt_slow
IP3 = max(0.0, IP3)
NT_released_this_window = 0.0 # reset accumulator for next window
if IP3 > IP3_threshold:
trigger_slow_astrocyte_calcium_wave()
# ORIG: eCB retrograde signal.
# [CASCADE 6] Second conductance brake (~2 s onset, 10 s decay).
eCB_signal = compute_postsynaptic_eCB_signal(V_post_history)
if eCB_signal > 0:
eCB_level += eCB_signal * (dt_slow / tau_eCB_rise)
else:
eCB_level -= eCB_level * (dt_slow / tau_eCB_decay)
eCB_level = np.clip(eCB_level, 0.0, 1.0)
# ── LOOP 2 — SLOW / ASTROCYTE (dt_slow = 1 s) ──────────────────────
# -- RP -> RRP RECRUITMENT (with pool guards) --------------------
# Runs once per second. k_rec_fast and k_rec_slow are in /s,
# so multiplying by dt_slow_s = 1.0 s gives a dimensionless
# per-step fraction — no hidden unit scaling needed.
#
# [CASCADE 1] Recruitment is the only counter-force to depletion.
# Even k_rec_fast fills only ~5% of headroom per second,
# lagging well behind release at high firing rates.
current_recruitment_rate = map_trace_to_speed(Tr_Ca) # /s
refill_amount = current_recruitment_rate * dt_slow_s * N_RP * (Max_RRP - N_RRP) / Max_RRP
refill_amount = max(0.0, refill_amount)
refill_amount = min(refill_amount, N_RP)
N_RRP = min(N_RRP + refill_amount, Max_RRP)
N_RP = max(0.0, N_RP - refill_amount)
# ATP cost of docking moves here too — it is per recruitment event,
# not per millisecond.
ATP_demand += ATP_cost_docking * refill_amount
# ==============================================================
# LOOP 3 - METABOLIC (dt_meta = 1 min)
# ==============================================================
if (step % Metabolic_Multiplier) == 0:
# NKA + ORIG: ATP_level is now driven by both Glucose_level
# (supply) and ATP_demand (demand accumulated over this window).
# [CASCADE 2] ATP_demand encodes all three cost sources:
# NKA_cost_per_AP - dominant at high firing rates
# ATP_cost_PMCA/SERCA - proportional to Ca2+ load
# ATP_cost_docking - proportional to recruitment rate
conversion_efficiency, ATP_level = compute_astrocyte_metabolic_health(
Glucose_level, ATP_demand
)
# Reset demand accumulator for the next metabolic window.
ATP_demand = 0.0
# [CASCADE 1 - slow refill] Glutamine shuttle rebuilds N_RP.
refill_RP = Glutamine_pool * conversion_efficiency
N_RP = min(Max_RP, N_RP + refill_RP)
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)
return log
# -----------------------------------------------------------------------
# EXAMPLE USAGE
# -----------------------------------------------------------------------
if __name__ == "__main__":
import matplotlib.pyplot as plt
total_steps = 10_000 # 10 seconds of simulated time
# 20 Hz burst for 2 s, then silence.
# Set Glucose_level = 0.2 to engage the full metabolic cascade.
spike_train = list(range(0, 2000, 50))
results = run_simulation(spike_train, total_steps)
t = np.arange(total_steps) * dt
fig, axes = plt.subplots(7, 1, figsize=(12, 16), sharex=True)
fig.suptitle("Tripartite Synapse - Presynaptic Model", fontsize=13)
axes[0].plot(t, results["V_pre_state"], color="slateblue", lw=0.8)
axes[0].set_ylabel("V_pre (a.u.)")
axes[0].set_title("NKA - membrane repolarises with tau_V_pre after each AP",
fontsize=9, loc="left")
axes[1].plot(t, results["Ca_micro"], color="darkorange", lw=0.8)
axes[1].set_ylabel("[Ca2+] free (a.u.)")
axes[1].set_title("CASCADE 4 - residual Ca2+ profile follows V_pre decay",
fontsize=9, loc="left")
axes[2].plot(t, results["CDI_factor"], color="firebrick", lw=0.8, label="CDI factor")
axes[2].plot(t, results["B_free"], color="steelblue", lw=0.8, label="Buffer free")
axes[2].set_ylabel("CDI / Buffer (0-1)")
axes[2].set_title("CASCADE 5 - CDI lock-out | CASCADE 4 - buffer saturation",
fontsize=9, loc="left")
axes[2].legend(fontsize=8)
axes[3].plot(t, results["N_RRP"], color="teal", lw=0.8, label="RRP")
axes[3].plot(t, results["N_RP"], color="purple", lw=0.8, label="RP")
axes[3].set_ylabel("Vesicles")
axes[3].set_title("CASCADE 1 - deterministic depletion (Hill Ca2+ sensor + NT suppression)",
fontsize=9, loc="left")
axes[3].legend(fontsize=8)
axes[4].plot(t, results["NT_cleft"], color="darkgreen", lw=0.8, label="NT cleft")
axes[4].plot(t, results["mGluR_activation"], color="saddlebrown", lw=0.8, label="mGluR")
axes[4].plot(t, results["eCB_level"], color="crimson", lw=0.8, label="eCB")
axes[4].set_ylabel("Cleft / Feedback")
axes[4].set_title("CASCADE 6 - three multiplicative brakes on effective_conductance",
fontsize=9, loc="left")
axes[4].legend(fontsize=8)
axes[5].plot(t, results["V_post"], color="navy", lw=0.8)
axes[5].set_ylabel("V_post (a.u.)")
axes[5].set_title("CASCADE 6 result - postsynaptic silence", fontsize=9, loc="left")
axes[6].plot(t, results["ATP_level"], color="goldenrod", lw=0.8, label="ATP level")
axes[6].plot(t, results["ATP_demand"], color="tomato", lw=0.8, label="ATP demand (cumul.)")
axes[6].set_ylabel("ATP (a.u.)")
axes[6].set_title("CASCADE 2 - NKA + pump + docking demand drives ATP depletion",
fontsize=9, loc="left")
axes[6].set_xlabel("Time (ms)")
axes[6].legend(fontsize=8)
plt.tight_layout()
plt.savefig("./synapse_simulation.png", dpi=150)
plt.close()
print("Done.")
@@ -1,883 +0,0 @@
# Tripartite Synapse - Multi-Scale Computational Model
# =====================================================
# Presynaptic + Postsynaptic perspectives, fully integrated.
#
# Change log:
# ORIG - present from the original document
# NEW - added in the missing-behavior integration pass
# DET - deterministic Ca2+-driven vesicle release
# NKA - explicit Na/K-ATPase V_pre decay and ATP cost
# POST-ATP - postsynaptic Ca2+ dynamics and ATP loop
# DEND - dendritic branch: EPSP summation, V_dend, V_bAP
# SOMA - somatic integration: V_soma, AP threshold, refractory,
# channel kinetics, emergent bAP replacing external bAP_train
# FIX - corrections applied in this pass:
# * NT_released_this_window accumulator (was missing entirely)
# * k_rec_fast / k_rec_slow converted to /s, recruitment moved to Loop 2
# * dt_slow_s added
# * mGluR now reads NT_released_this_window (not NT_cleft snapshot)
# * IP3 now reads NT_released_this_window (not cleared_NT residual)
# * wave_active flag + conversion_efficiency boost on astrocyte wave
# * CDI rise gated to spike window only
#
# Clock structure:
# Loop 1 - dt = 1 ms (Ca2+, vesicle release, traces, postsynaptic fast)
# Loop 2 - dt = 1000 ms (astrocyte clearance, eCB, mGluR, recruitment)
# Loop 3 - dt = 60000 ms (glutamine shuttle, metabolic health)
#
# =======================================================================
# THREE CLOSED LOOPS
# =======================================================================
#
# PRESYNAPTIC:
# NT loop : release (ms) -> cleft -> astrocyte clearance (s) ->
# glutamine shuttle (min) -> RP refill -> RRP -> release
# Ca2+ loop : VGCC influx (ms) -> Tr_Ca -> recruitment speed (s) ->
# eCB retrograde from post (s) -> VGCC suppression
# ATP loop : NKA + pump costs (ms) -> ATP_demand (min) -> ATP_level ->
# pump_scale -> Ca2+ clearance rate -> CDI recovery
#
# POSTSYNAPTIC:
# NT detection loop : NT_cleft -> AMPA -> V_post -> desensitization ->
# reduces next response
# Ca2+ coincidence : NMDA (NT + V_post) -> Ca_post -> eCB -> pre brake
# ATP loop : NKA + PMCA costs (ms) -> ATP_demand_post (min) ->
# ATP_level_post -> pump_scale_post -> Ca_post clearance
#
# SHARED:
# eCB_level : post synthesises -> pre reads (retrograde brake)
# NT_cleft : pre releases -> post detects -> astrocyte clears
# Glucose_level : astrocyte supplies both sides from same budget
#
# =======================================================================
# METABOLIC SILENCING CASCADE (presynaptic)
# =======================================================================
# [CASCADE 1] HIGH FIRING -> VESICLE DEPLETION (~seconds)
# release rate >> recruitment rate -> N_RRP -> 0
# [CASCADE 2] HIGH FIRING -> ATP DEPLETION (~minutes)
# NKA + PMCA + docking demand > glucose-driven supply
# [CASCADE 3] LOW ATP -> PUMP FAILURE
# pump_scale = Hill(ATP_level) -> cleared_PMCA/SERCA fall
# [CASCADE 4] PUMP FAILURE -> RESIDUAL Ca2+ STAYS HIGH
# Ca_micro persists between spikes
# [CASCADE 5] RESIDUAL Ca2+ -> CDI LOCKS VGCCs SHUT
# CDI rise (spike only) + recovery blocked by Ca2+ -> CDI -> 1
# [CASCADE 6] SYNAPSE SILENCES (excitotoxicity protection)
# effective_conductance = N_VGCC*(1-eCB)*(1-CDI)*(1-mGluR*alpha)
# -> 0; NCX auto-reset when drive stops
#
# POSTSYNAPTIC ATP CASCADE (no CDI equivalent -> dangerous):
# [POST-ATP 1] HIGH V_post + NMDA -> ATP_demand_post rises
# [POST-ATP 2] ATP_level_post falls -> pump_scale_post falls
# [POST-ATP 3] Ca_post clearance slows -> Ca_post stays elevated
# [POST-ATP 4] Ca_post > eCB_threshold without real coincidence
# -> false retrograde signal suppresses presynapse
# [POST-ATP 5] Critically low ATP_post -> runaway Ca_post -> excitotoxicity
# =======================================================================
import numpy as np
# -----------------------------------------------------------------------
# CLOCK
# -----------------------------------------------------------------------
dt = 1.0 # ms
dt_slow = 1000.0 # ms
dt_meta = 60_000.0 # ms
High_Freq_Multiplier = int(dt_slow / dt) # 1000
Metabolic_Multiplier = int(dt_meta / dt) # 60000
dt_s = dt / 1000.0 # 0.001 s/step - for /s rate constants in Loop 1
dt_slow_s = dt_slow / 1000.0 # 1.0 s/step - for /s rate constants in Loop 2
# -----------------------------------------------------------------------
# PRESYNAPTIC PARAMETERS
# -----------------------------------------------------------------------
# -- Voltage / membrane --
tau_V_pre = 2.0 # ms - AP waveform decay (Na/K-ATPase recharge)
V_pre_peak = 1.0 # a.u. - normalised AP peak
V_rest = 0.0 # a.u. - resting potential
V_pre_voltage = -10.0 # mV - driving force for compute_flux
NKA_cost_per_AP = 0.002 # ATP units per AP (dominant drain at high rates)
# -- Ca2+ influx & buffering --
N_VGCC = 100 # number of VGCCs (ceiling of effective_conductance)
k_flux = 0.05 # Ca2+ influx per open channel per unit driving force
B_total = 1.0 # total buffer capacity (normalised)
tau_buffer_rebind = 200.0 # ms - buffer recharge time constant
# -- Ca2+ clearance (/ms constants) --
k_PMCA = 0.03 # ATP-dependent primary pump
k_NCX = 0.10 # ATP-independent floor
k_SERCA = 0.01 # ATP-dependent ER pump
ATP_half = 0.3 # Hill half-saturation for presynaptic pumps
ATP_cost_PMCA = 0.0005 # ATP per unit Ca2+ extruded by PMCA
ATP_cost_SERCA = 0.0002 # ATP per unit Ca2+ pumped into ER
ATP_cost_docking = 0.001 # ATP per vesicle docked (RP->RRP)
# -- Deterministic release (Hill + NT suppression) --
k_rel = 0.5 # max releasable fraction of RRP per spike
KD_rel = 1.0 # half-saturation [Ca2+]
n_rel = 4 # Hill cooperativity (synaptotagmin-1)
NT_suppression_weight = 0.3 # max NT_cleft brake on release fraction
NT_suppression_sat = 50.0 # NT_cleft level that saturates suppression
# -- CDI --
k_CDI_rise = 0.8 # /s - CDI build rate (applied * dt_s, spike only)
Ca_micro_saturation = 2.0 # normalisation ceiling for CDI recovery
k_CDI_rec = 0.015 # /s - CDI de-inactivation rate (applied * dt_s)
# -- Vesicle pools --
Max_RRP = 20
Max_RP = 200
# -- Calcium trace --
tau_Tr_Ca = 1000.0 # ms
T_high = 0.6 # Tr_Ca threshold -> fast recruitment
T_low = 0.2 # Tr_Ca threshold -> slow recruitment
# -- RP->RRP recruitment (/s, runs in Loop 2) --
k_rec_fast = 5.0 # /s - fast recruitment (at Tr_Ca > T_high)
k_rec_slow = 0.5 # /s - slow recruitment (at Tr_Ca < T_low)
# -- NT accumulator for Loop 2 signals --
NT_window_sat = 40.0 # vesicles/s that saturates mGluR and IP3
# at 20 Hz releasing ~2/spike = 40/s
# -- eCB retrograde brake --
tau_eCB_rise = 2000.0
tau_eCB_decay = 10_000.0
eCB_threshold = 0.7 # Ca_post level that triggers eCB synthesis
# -- mGluR presynaptic autoreceptor --
Km_mGluR = 0.5
tau_mGluR = 2000.0 # ms
alpha_mGluR = 0.4 # max fractional VGCC suppression
# -- Astrocyte / IP3 --
tau_IP3 = 3000.0 # ms
IP3_threshold = 0.8
wave_boost = 0.2 # conversion_efficiency boost when wave fires
tau_wave_decay = 2 # metabolic cycles before boost decays back
# -- Glutamine shuttle --
conversion_efficiency_base = 0.8
# -- NT cleft --
tau_NT_decay = 5.0 # ms
# -----------------------------------------------------------------------
# POSTSYNAPTIC PARAMETERS
# -----------------------------------------------------------------------
# -- NMDA coincidence detection --
k_NMDA = 0.08 # Ca_post influx per unit NT * (1 - Mg_block) per ms
V_NMDA_half = 0.3 # V_post at which Mg block is 50% lifted
# -- Ca_post clearance --
k_Ca_post_clear = 0.05 # /ms - ATP-dependent PMCA in spine
k_Ca_post_NCX = 0.02 # /ms - ATP-independent NCX floor
ATP_half_post = 0.3 # Hill half-saturation for postsynaptic pumps
# -- Postsynaptic ATP costs --
NKA_cost_per_bAP_post = 0.002 # ATP per unit V_post per s (continuous)
ATP_cost_Ca_post_pump = 0.0005 # ATP per unit Ca_post cleared
ATP_demand_scale_post = 50.0 # normalisation (same as presynaptic)
# -- Receptor desensitization --
tau_membrane = 20.0 # ms
tau_desensitization = 500.0 # ms
# -----------------------------------------------------------------------
# DENDRITE PARAMETERS
# -----------------------------------------------------------------------
# DEND: Single passive dendritic branch connecting postsynaptic spines to soma.
# No active conductances, no spine-neck attenuation, no bAP distance decay.
# The branch sums EPSPs from all active spines (one spine in current model)
# and passes V_dend to the soma each ms.
tau_dend = 20.0 # DEND: ms - dendritic membrane time constant
# controls how long EPSPs persist before decaying
# longer tau -> broader temporal summation window
AMPA_weight = 0.1 # DEND: scales receptor_conductance -> EPSP contribution
# to V_dend; shared across all spines on the branch
# bAP: back-propagating AP from soma to all spines (no distance attenuation).
# Generated internally when V_soma crosses threshold (replaces external bAP_train).
V_bAP_peak = 1.0 # DEND: normalised bAP amplitude at all spines
tau_bAP = 3.0 # DEND: ms - bAP decay time constant
# controls width of coincidence window:
# longer tau_bAP -> NT arriving slightly after
# bAP can still achieve NMDA coincidence
# -----------------------------------------------------------------------
# SOMA PARAMETERS
# -----------------------------------------------------------------------
# SOMA: Leaky integrator with threshold crossing, channel kinetics, and
# refractory period. Firing emerges from V_soma dynamics — not driven by
# an external spike train. Each AP generates a bAP (sent to dendrite)
# and a forward AP (available as output for the next neuron's presynapse).
tau_soma = 20.0 # SOMA: ms - somatic membrane time constant
soma_weight = 0.5 # SOMA: scales V_dend contribution to V_soma
# reflects electrical coupling efficiency
V_soma_threshold = 0.5 # SOMA: normalised firing threshold (0->1)
# when V_soma crosses this, AP fires
V_soma_reset = 0.0 # SOMA: V_soma after AP (instantaneous reset
# after repolarisation completes)
# Channel kinetics — AP waveform profile
# SOMA: The AP is not instantaneous. After threshold crossing:
# (1) Na+ channels open -> V_soma rises to V_AP_peak (depolarisation)
# (2) K+ channels open -> V_soma falls past rest to V_AHP (repolarisation)
# (3) K+ channels close -> V_soma recovers to rest (V_soma_reset)
# tau_AP_rise and tau_AP_fall control the width and shape of the AP waveform.
V_AP_peak = 1.0 # SOMA: normalised AP peak amplitude
V_AHP = -0.1 # SOMA: after-hyperpolarisation trough (below rest)
# negative value: V_soma briefly goes below 0
tau_AP_rise = 0.5 # SOMA: ms - Na+ channel opening (rising phase)
tau_AP_fall = 1.5 # SOMA: ms - K+ channel repolarisation (falling phase)
tau_AHP = 5.0 # SOMA: ms - recovery from AHP back to rest
# Refractory period
# SOMA: After an AP fires, the soma cannot fire again until the membrane
# has recovered from inactivation and AHP.
# Absolute refractory: no firing possible regardless of input
# Relative refractory: firing possible but requires stronger input
t_refractory_abs = 2.0 # SOMA: ms - absolute refractory period
t_refractory_rel = 8.0 # SOMA: ms - relative refractory period (total from AP)
# during relative period threshold is elevated
# -----------------------------------------------------------------------
# HELPER FUNCTIONS
# -----------------------------------------------------------------------
def compute_flux(conductance, voltage):
return k_flux * conductance * abs(voltage)
def deterministic_release(N_RRP, Ca_micro, NT_cleft):
# Hill equation: Ca2+ sensor cooperativity (synaptotagmin-1, n=4)
Ca_n = Ca_micro ** n_rel
release_frac = k_rel * Ca_n / (Ca_n + KD_rel ** n_rel)
# NT suppression: physical crowding + fast local autoreceptors
NT_norm = min(1.0, NT_cleft / NT_suppression_sat)
release_frac = release_frac * (1.0 - NT_suppression_weight * NT_norm)
release_frac = np.clip(release_frac, 0.0, 1.0)
return max(0.0, release_frac * N_RRP)
def map_trace_to_speed(Tr_Ca):
# Returns /s recruitment rate based on Tr_Ca level
if Tr_Ca > T_high:
return k_rec_fast
elif Tr_Ca < T_low:
return k_rec_slow
else:
t = (Tr_Ca - T_low) / (T_high - T_low)
return k_rec_slow + t * (k_rec_fast - k_rec_slow)
def compute_pump_atp_factor(atp, atp_half):
# Hill function: ATP gates pump speed (shared by pre and post)
return (atp ** 2) / (atp ** 2 + atp_half ** 2)
def compute_EPSP(receptor_conductance):
return receptor_conductance * 0.1
def compute_astrocyte_metabolic_health(Glucose_level, ATP_demand_accumulated,
demand_scale=50.0):
# Converts glucose supply and accumulated demand into ATP_level (0->1)
# and conversion_efficiency (0->1). Both sides use this function with
# their own demand accumulators but the same Glucose_level — shared
# metabolic vulnerability.
health = np.clip(Glucose_level - ATP_demand_accumulated / demand_scale,
0.0, 1.0)
return health, health # (conversion_efficiency, ATP_level)
def trigger_slow_astrocyte_calcium_wave():
# Placeholder - gliotransmitter release over ~10 s
pass
# -----------------------------------------------------------------------
# STATE VARIABLES
# -----------------------------------------------------------------------
# -- Presynaptic membrane --
V_pre_state = 0.0
# -- Presynaptic Ca2+ --
Ca_micro = 0.0
Ca_ER = 0.5
Ca_buffer_bound = 0.0
B_free = B_total
# -- CDI --
CDI_factor = 0.0
# -- Vesicle pools --
N_RRP = 15.0
N_RP = 150.0
# -- Calcium trace --
Tr_Ca = 0.0
# -- NT cleft --
NT_cleft = 0.0
# -- NT accumulator for slow signals --
# FIX: this was missing. Accumulates every ms in Loop 1,
# consumed by mGluR and IP3 in Loop 2, reset each second.
NT_released_this_window = 0.0
# -- Postsynaptic membrane + receptors --
V_post = 0.0
receptor_conductance = 0.0
Desensitization_level = 0.0
V_post_history = []
# -- Postsynaptic Ca2+ (spine compartment) --
Ca_post = 0.0
# Driven by NMDA coincidence (NT + V_post). Cleared by PMCA (ATP-gated)
# and NCX (always). Drives eCB synthesis. No CDI equivalent ->
# elevated Ca_post under ATP failure has no self-limiting mechanism.
# -- Retrograde / autoreceptor --
eCB_level = 0.0
mGluR_activation = 0.0
# -- Astrocyte --
IP3 = 0.0
wave_active = 0 # countdown: cycles remaining of wave boost
Glutamine_pool = 50.0
# -- Presynaptic ATP --
ATP_level = 1.0
ATP_demand = 0.0
conversion_efficiency = conversion_efficiency_base
Glucose_level = 1.0 # set < 1.0 to engage metabolic silencing
# -- Dendrite --
V_dend = 0.0 # DEND: dendritic membrane potential (normalised, 0->1)
# sum of attenuated spine EPSPs, decaying each ms
# passed to soma each ms as the integration input
V_bAP = 0.0 # DEND: back-propagating AP amplitude at all spines (0->1)
# set to V_bAP_peak when soma fires
# decays with tau_bAP each ms
# replaces external bAP_train input
# -- Soma --
V_soma = 0.0 # SOMA: somatic membrane potential (normalised, 0->1)
# integrates V_dend, decays with tau_soma
# triggers AP when crosses V_soma_threshold
AP_phase = 'rest' # SOMA: current AP waveform phase
# 'rest' | 'rising' | 'falling' | 'ahp'
AP_phase_t = 0.0 # SOMA: ms elapsed in current AP phase
refractory_t = 0.0 # SOMA: ms remaining in refractory period (0 = not refractory)
# absolute refractory if refractory_t > t_refractory_rel - t_refractory_abs
# relative refractory if 0 < refractory_t <= t_refractory_rel - t_refractory_abs
soma_fired = False # SOMA: flag — soma fired this ms
# read by dendrite to trigger V_bAP
# read by simulation output as forward AP signal
# -- Postsynaptic ATP --
ATP_level_post = 1.0 # separate pool; same glucose budget as presynaptic
ATP_demand_post = 0.0 # accumulates from NKA (V_post) and PMCA (Ca_post)
# -----------------------------------------------------------------------
# MAIN SIMULATION LOOP
# -----------------------------------------------------------------------
def run_simulation(spike_train, total_steps):
"""
spike_train : list of int - presynaptic AP timestep indices
total_steps : int
if None, no bAPs are delivered
"""
global V_pre_state
global Ca_micro, Ca_ER, Ca_buffer_bound, B_free
global CDI_factor
global N_RRP, N_RP, Tr_Ca, NT_cleft, NT_released_this_window
global V_post, receptor_conductance, Desensitization_level, V_post_history
global Ca_post
global eCB_level, mGluR_activation
global IP3, wave_active, Glutamine_pool
global ATP_level, ATP_demand, conversion_efficiency, Glucose_level
global ATP_level_post, ATP_demand_post
global V_dend, V_bAP
global V_soma, AP_phase, AP_phase_t, refractory_t, soma_fired
log = {k: [] for k in [
"V_pre_state", "Ca_micro", "Ca_ER", "CDI_factor", "B_free",
"N_RRP", "N_RP", "Tr_Ca", "NT_cleft",
"V_post", "Ca_post", "eCB_level", "mGluR_activation",
"released_NT", "ATP_level", "ATP_demand",
"ATP_level_post", "ATP_demand_post",
"V_dend", "V_bAP", "V_soma", "soma_fired",
]}
spike_set = set(spike_train)
for step in range(total_steps):
# ==============================================================
# LOOP 1 — HIGH-FREQUENCY (dt = 1 ms)
# ==============================================================
V_pre = 1 if step in spike_set else 0
released_NT = 0.0
soma_fired = False
# -- 1A. PRESYNAPTIC MEMBRANE / Na-K-ATPase -------------------
# AP fires: membrane jumps to peak, then decays with tau_V_pre.
# Ca2+ influx uses V_pre_state (continuous) not binary V_pre,
# giving a temporal influx profile that tapers as membrane repolarises.
if V_pre == 1:
V_pre_state = V_pre_peak
ATP_demand += NKA_cost_per_AP # dominant presynaptic ATP cost
V_pre_state += (V_rest - V_pre_state) * dt / tau_V_pre
# -- 1B. PRESYNAPTIC Ca2+ INFLUX ------------------------------
# Three multiplicative brakes on effective_conductance:
# eCB_level : retrograde brake from postsynapse (Loop 2)
# CDI_factor : Ca2+-dependent inactivation (below)
# mGluR_activation : autoreceptor brake (Loop 2)
effective_conductance = (
N_VGCC
* (1.0 - eCB_level)
* (1.0 - CDI_factor)
* (1.0 - mGluR_activation * alpha_mGluR)
)
raw_influx = compute_flux(effective_conductance, V_pre_state)
# Buffer proteins capture a fraction immediately (fast sponge).
# B_free -> 0 during sustained bursting -> capture_fraction -> 0
# -> full raw_influx enters Ca_micro (CASCADE 4 acceleration).
capture_fraction = B_free / B_total
captured = raw_influx * capture_fraction
B_free = max(0.0, B_free - captured)
Ca_buffer_bound += captured
Ca_micro += (raw_influx - captured)
# -- 1C. VESICLE RELEASE --------------------------------------
# Deterministic: Hill Ca2+ sensor * NT suppression * N_RRP.
# Runs every ms that Ca_micro > 0 (release profile follows Ca2+
# transient, not locked to spike flag).
if N_RRP > 0 and Ca_micro > 0:
released_NT = deterministic_release(N_RRP, Ca_micro, NT_cleft)
released_NT = min(released_NT, N_RRP)
N_RRP -= released_NT
NT_cleft += released_NT
# FIX: accumulate for Loop 2 mGluR and IP3 signals.
# This is the only correct way to feed slow signals from fast
# events — snapshot of NT_cleft at Loop 2 time would be ~0
# because passive diffusion has already cleared it.
NT_released_this_window += released_NT
# Passive NT diffusion out of cleft each ms.
NT_cleft *= (1.0 - dt / tau_NT_decay)
NT_cleft = max(0.0, NT_cleft)
# -- 1D. PRESYNAPTIC Ca2+ CLEARANCE ---------------------------
# pump_scale: Hill(ATP_level) — bridges Loop 3 ATP to Loop 1 clearance.
# NCX is ATP-independent (floor); PMCA and SERCA are ATP-gated.
pump_scale = compute_pump_atp_factor(ATP_level, ATP_half)
cleared_PMCA = k_PMCA * Ca_micro * pump_scale
cleared_NCX = k_NCX * Ca_micro
cleared_SERCA = k_SERCA * Ca_micro * pump_scale
Ca_micro -= (cleared_PMCA + cleared_NCX + cleared_SERCA)
Ca_micro = max(0.0, Ca_micro)
Ca_ER += cleared_SERCA
ATP_demand += ATP_cost_PMCA * cleared_PMCA
ATP_demand += ATP_cost_SERCA * cleared_SERCA
# Buffer recharge: bound Ca2+ slowly re-releases back to cytosol.
# During pump failure this sustains Ca_micro elevation (CASCADE 4).
rebind_flux = Ca_buffer_bound * dt / tau_buffer_rebind
Ca_micro += rebind_flux
Ca_buffer_bound = max(0.0, Ca_buffer_bound - rebind_flux)
B_free = B_total - Ca_buffer_bound
# -- 1E. CDI — RISE (spike only) AND RECOVERY (every ms) ------
# RISE: Ca2+ entering through open channels inactivates them locally.
# Gated to spike window — requires channels to be open.
# (Running every ms was wrong: CDI needs Ca2+ flowing through
# the channel, not ambient cytosolic Ca2+.)
if V_pre == 1:
CDI_factor += k_CDI_rise * Ca_micro * dt_s
# RECOVERY: continuous, suppressed when Ca_micro is high.
# Self-locking: pump failure -> Ca_micro high -> recovery ~0
# -> CDI_factor -> 1 -> effective_conductance -> 0 (CASCADE 5-6).
CDI_recovery_rate = k_CDI_rec * (1.0 - Ca_micro / Ca_micro_saturation)
CDI_factor = np.clip(CDI_factor - CDI_recovery_rate * dt_s, 0.0, 1.0)
# -- 1F. CALCIUM TRACE ----------------------------------------
# Leaky integrator — integrates full Ca2+ waveform every ms
# including inter-spike clearance. Drives Loop 2 recruitment speed.
Tr_Ca = Tr_Ca + (Ca_micro - Tr_Ca / tau_Tr_Ca) * dt
# -- 1G. POSTSYNAPTIC: NT DETECTION & AMPA --------------------
# Desensitization reduces effective NT — sustained NT exposure
# progressively silences receptors (postsynaptic equivalent of CDI).
effective_NT = released_NT * (1.0 - Desensitization_level)
receptor_conductance += effective_NT * 0.05
receptor_conductance *= (1.0 - dt / tau_membrane)
V_post += compute_EPSP(receptor_conductance) - (V_post / tau_membrane) * dt
V_post = max(0.0, V_post)
Desensitization_level += NT_cleft * 0.001 * dt
Desensitization_level -= (Desensitization_level / tau_desensitization) * dt
Desensitization_level = np.clip(Desensitization_level, 0.0, 1.0)
V_post_history.append(V_post)
if len(V_post_history) > 5000:
V_post_history.pop(0)
# -- 1H. POSTSYNAPTIC: NMDA COINCIDENCE DETECTION -------------
# Ca_post enters only when BOTH conditions hold simultaneously:
# (1) NT_cleft > 0 — ligand gate (glutamate present)
# (2) V_post elevated — voltage gate (Mg2+ block lifted)
# V_bAP (from dendrite, generated by soma firing) adds to V_post,
# enabling full Mg block removal only on true pre+post coincidence.
# DEND: V_bAP replaces the old external bAP * 0.5 placeholder.
V_post_effective = V_post + V_bAP # AMPA drive + bAP boost
Mg_block_removal = V_post_effective / (V_post_effective + V_NMDA_half)
NMDA_Ca_influx = k_NMDA * NT_cleft * Mg_block_removal
Ca_post += NMDA_Ca_influx
# Postsynaptic NKA: membrane recharge cost proportional to V_post.
# [POST-ATP 1] Dominant postsynaptic ATP drain at high activity.
ATP_demand_post += NKA_cost_per_bAP_post * V_post * dt_s
# -- 1I. POSTSYNAPTIC: Ca_post CLEARANCE ----------------------
# pump_scale_post: Hill(ATP_level_post) — same structure as presynaptic.
# NCX is ATP-independent floor (enables auto-reset after ATP recovery).
# [POST-ATP 3] When pump_scale_post falls, Ca_post stays elevated ->
# eCB threshold crossed without genuine coincidence -> false retrograde.
pump_scale_post = compute_pump_atp_factor(ATP_level_post, ATP_half_post)
cleared_Ca_post_pump = k_Ca_post_clear * Ca_post * pump_scale_post
cleared_Ca_post_NCX = k_Ca_post_NCX * Ca_post
Ca_post -= (cleared_Ca_post_pump + cleared_Ca_post_NCX)
Ca_post = max(0.0, Ca_post)
# [POST-ATP 2] ATP cost of postsynaptic PMCA.
ATP_demand_post += ATP_cost_Ca_post_pump * cleared_Ca_post_pump
# -- 1J. DENDRITE: EPSP SUMMATION & bAP DISTRIBUTION ----------
# DEND: The dendritic branch collects the EPSP from this spine
# (receptor_conductance * AMPA_weight) and adds it to V_dend.
# V_dend then decays passively with tau_dend.
# No spine-neck attenuation in this simplified model —
# all spines contribute equally regardless of position.
V_dend += receptor_conductance * AMPA_weight
V_dend *= (1.0 - dt / tau_dend)
V_dend = max(0.0, V_dend)
# DEND: bAP distribution — set by soma firing (section 1K below).
# Decays each ms with tau_bAP. All spines receive the same amplitude
# (no distance attenuation in this simplified model).
V_bAP += (0.0 - V_bAP) * dt / tau_bAP
V_bAP = max(0.0, V_bAP)
# -- 1K. SOMA: INTEGRATION, AP KINETICS, REFRACTORY --------------
# SOMA: V_soma integrates V_dend as a leaky integrator.
# When V_soma crosses V_soma_threshold (and not refractory),
# an AP fires. The AP has a three-phase waveform:
# rising : Na+ channels open -> V_soma climbs to V_AP_peak
# falling : K+ channels open -> V_soma falls to V_AHP
# ahp : K+ channels close -> V_soma recovers toward rest
# After the waveform completes, the soma enters the refractory period.
# Absolute refractory: no firing possible (Na+ channels inactivated).
# Relative refractory: threshold is effectively elevated.
# Step 1: integrate dendritic input (only when not in AP waveform)
if AP_phase == 'rest':
V_soma += V_dend * soma_weight
V_soma *= (1.0 - dt / tau_soma)
V_soma = max(V_AHP, V_soma)
# Threshold check — blocked during refractory period.
# During relative refractory (0 < refractory_t <= t_refractory_rel):
# effective threshold is raised proportionally to remaining time.
abs_ref_remaining = refractory_t - (t_refractory_rel - t_refractory_abs)
in_absolute = abs_ref_remaining > 0
effective_threshold = V_soma_threshold
if refractory_t > 0 and not in_absolute:
# Linear threshold elevation during relative refractory
rel_fraction = refractory_t / t_refractory_rel
effective_threshold = V_soma_threshold * (1.0 + rel_fraction)
if V_soma >= effective_threshold and not in_absolute:
# AP fires: enter rising phase
AP_phase = 'rising'
AP_phase_t = 0.0
soma_fired = True
refractory_t = t_refractory_rel # start refractory countdown
# DEND: bAP generated — broadcast to all spines immediately
V_bAP = V_bAP_peak
# Step 2: AP waveform phases
elif AP_phase == 'rising':
AP_phase_t += dt
# V_soma rises exponentially toward V_AP_peak
V_soma += (V_AP_peak - V_soma) * dt / tau_AP_rise
if AP_phase_t >= tau_AP_rise * 3: # ~3 time constants = near peak
AP_phase = 'falling'
AP_phase_t = 0.0
elif AP_phase == 'falling':
AP_phase_t += dt
# V_soma falls exponentially toward V_AHP (after-hyperpolarisation)
V_soma += (V_AHP - V_soma) * dt / tau_AP_fall
if AP_phase_t >= tau_AP_fall * 3:
AP_phase = 'ahp'
AP_phase_t = 0.0
elif AP_phase == 'ahp':
AP_phase_t += dt
# V_soma recovers from AHP toward rest (V_soma_reset)
V_soma += (V_soma_reset - V_soma) * dt / tau_AHP
if AP_phase_t >= tau_AHP * 3:
AP_phase = 'rest'
AP_phase_t = 0.0
V_soma = V_soma_reset
# Step 3: refractory countdown (runs every ms regardless of phase)
if refractory_t > 0:
refractory_t = max(0.0, refractory_t - dt)
# -- RECORD ---------------------------------------------------
log["V_pre_state"].append(V_pre_state)
log["Ca_micro"].append(Ca_micro)
log["Ca_ER"].append(Ca_ER)
log["CDI_factor"].append(CDI_factor)
log["B_free"].append(B_free)
log["N_RRP"].append(N_RRP)
log["N_RP"].append(N_RP)
log["Tr_Ca"].append(Tr_Ca)
log["NT_cleft"].append(NT_cleft)
log["V_post"].append(V_post)
log["Ca_post"].append(Ca_post)
log["eCB_level"].append(eCB_level)
log["mGluR_activation"].append(mGluR_activation)
log["released_NT"].append(released_NT)
log["ATP_level"].append(ATP_level)
log["ATP_demand"].append(ATP_demand)
log["ATP_level_post"].append(ATP_level_post)
log["ATP_demand_post"].append(ATP_demand_post)
log["V_dend"].append(V_dend)
log["V_bAP"].append(V_bAP)
log["V_soma"].append(V_soma)
log["soma_fired"].append(float(soma_fired))
# ==============================================================
# LOOP 2 — SLOW / ASTROCYTE (dt_slow = 1 s)
# ==============================================================
if (step % High_Freq_Multiplier) == 0:
# Astrocyte EAAT clearance — active NT removal from cleft.
cleared_NT = NT_cleft * 0.3
NT_cleft = max(0.0, NT_cleft - cleared_NT)
# FIX: IP3 integrates NT_released_this_window (total release
# since last Loop 2), not the post-diffusion NT_cleft residual
# which is ~0 by the time Loop 2 runs.
IP3 += NT_released_this_window - (IP3 / tau_IP3) * dt_slow
IP3 = max(0.0, IP3)
if IP3 > IP3_threshold:
trigger_slow_astrocyte_calcium_wave()
# FIX: wave boosts conversion_efficiency in the next mins cycle.
# The astrocyte responds to heavy load by upregulating its
# recycling machinery — shipping more glutamine back to the
# presynapse. Boost decays over tau_wave_decay metabolic cycles.
wave_active = tau_wave_decay
# FIX: mGluR reads NT_released_this_window (accumulated release
# load), not NT_cleft snapshot. NT_cleft is ~0 at Loop 2 time
# due to diffusion; the accumulator correctly represents the
# burst load the autoreceptor has sensed during this window.
NT_window_norm = min(1.0, NT_released_this_window / NT_window_sat)
mGluR_target = NT_window_norm
mGluR_activation += (mGluR_target - mGluR_activation) * (dt_slow / tau_mGluR)
mGluR_activation = np.clip(mGluR_activation, 0.0, 1.0)
# FIX: reset accumulator for next window.
NT_released_this_window = 0.0
# eCB retrograde synthesis: now driven by Ca_post (spine Ca2+),
# not V_post_history. The actual eCB synthesis in the spine is
# triggered by Ca2+-dependent enzymes (DAGL, PLC), not voltage.
# Under normal conditions Ca_post only rises with coincidence.
# Under POST-ATP failure Ca_post stays elevated without genuine
# coincidence -> false retrograde signal (POST-ATP 4).
recent_Ca_post = (np.mean(log["Ca_post"][-2000:])
if len(log["Ca_post"]) >= 2000
else (np.mean(log["Ca_post"]) if log["Ca_post"] else 0.0))
eCB_signal = max(0.0, recent_Ca_post - eCB_threshold)
if eCB_signal > 0:
eCB_level += eCB_signal * (dt_slow / tau_eCB_rise)
else:
eCB_level -= eCB_level * (dt_slow / tau_eCB_decay)
eCB_level = np.clip(eCB_level, 0.0, 1.0)
# FIX: RP->RRP recruitment moved here from Loop 1.
# Biological timescale: vesicle docking and priming take seconds,
# not milliseconds. k_rec_fast/slow are /s; * dt_slow_s = 1.0 s
# gives dimensionless per-step fraction — no hidden unit scaling.
current_recruitment_rate = map_trace_to_speed(Tr_Ca) # /s
refill_amount = (current_recruitment_rate * dt_slow_s
* N_RP * (Max_RRP - N_RRP) / Max_RRP)
refill_amount = max(0.0, refill_amount)
refill_amount = min(refill_amount, N_RP)
N_RRP = min(N_RRP + refill_amount, Max_RRP)
N_RP = max(0.0, N_RP - refill_amount)
ATP_demand += ATP_cost_docking * refill_amount
# ==============================================================
# LOOP 3 — METABOLIC (dt_meta = 1 min)
# ==============================================================
if (step % Metabolic_Multiplier) == 0:
# Presynaptic ATP: glucose supply minus accumulated demand.
conversion_efficiency, ATP_level = compute_astrocyte_metabolic_health(
Glucose_level, ATP_demand
)
ATP_demand = 0.0
# FIX: wave boost applied to conversion_efficiency.
# Astrocyte calcium wave (triggered by high IP3) upregulates
# glutamine synthetase -> faster NT recycling -> more RP refill.
# Boost decays over tau_wave_decay cycles.
if wave_active > 0:
conversion_efficiency = min(1.0, conversion_efficiency + wave_boost)
wave_active -= 1
# Glutamine shuttle: astrocyte converts cleared NT to glutamine,
# presynapse repackages it into vesicles -> N_RP replenished.
refill_RP = Glutamine_pool * conversion_efficiency
N_RP = min(Max_RP, N_RP + refill_RP)
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)
# Postsynaptic ATP: same glucose budget, own demand accumulator.
# Both sides draw from Glucose_level -> shared metabolic vulnerability.
# Presynaptic silence reduces NT -> less NMDA -> less Ca_post ->
# less ATP_demand_post: presynaptic protection indirectly
# protects the postsynapse.
_, ATP_level_post = compute_astrocyte_metabolic_health(
Glucose_level, ATP_demand_post, ATP_demand_scale_post
)
ATP_demand_post = 0.0
return log
# -----------------------------------------------------------------------
# EXAMPLE USAGE
# -----------------------------------------------------------------------
if __name__ == "__main__":
import matplotlib.pyplot as plt
total_steps = 10_000 # 10 seconds
# Presynaptic 20 Hz burst for 2 s.
spike_train = list(range(0, 2000, 50))
# Soma firing emerges from V_soma threshold crossings — no external bAP_train.
results = run_simulation(spike_train, total_steps)
t = np.arange(total_steps) * dt
fig, axes = plt.subplots(8, 1, figsize=(12, 18), sharex=True)
fig.suptitle("Tripartite Synapse — Presynaptic + Postsynaptic", fontsize=13)
axes[0].plot(t, results["V_pre_state"], color="slateblue", lw=0.8)
axes[0].set_ylabel("V_pre")
axes[0].set_title("Presynaptic membrane (AP waveform)", fontsize=9, loc="left")
axes[1].plot(t, results["Ca_micro"], color="darkorange", lw=0.8)
axes[1].set_ylabel("[Ca2+] pre")
axes[1].set_title("CASCADE 4 — presynaptic Ca2+", fontsize=9, loc="left")
axes[2].plot(t, results["CDI_factor"], color="firebrick", lw=0.8, label="CDI")
axes[2].plot(t, results["B_free"], color="steelblue", lw=0.8, label="Buffer free")
axes[2].set_ylabel("CDI / Buffer")
axes[2].set_title("CASCADE 5 — CDI lock-out", fontsize=9, loc="left")
axes[2].legend(fontsize=8)
axes[3].plot(t, results["N_RRP"], color="teal", lw=0.8, label="RRP")
axes[3].plot(t, results["N_RP"], color="purple", lw=0.8, label="RP")
axes[3].set_ylabel("Vesicles")
axes[3].set_title("CASCADE 1 — vesicle depletion", fontsize=9, loc="left")
axes[3].legend(fontsize=8)
axes[4].plot(t, results["NT_cleft"], color="darkgreen", lw=0.8, label="NT cleft")
axes[4].plot(t, results["mGluR_activation"], color="saddlebrown", lw=0.8, label="mGluR")
axes[4].plot(t, results["eCB_level"], color="crimson", lw=0.8, label="eCB")
axes[4].set_ylabel("Cleft / Feedback")
axes[4].set_title("CASCADE 6 — three brakes on conductance", fontsize=9, loc="left")
axes[4].legend(fontsize=8)
axes[5].plot(t, results["V_post"], color="navy", lw=0.8, label="V_post")
axes[5].plot(t, results["Ca_post"], color="coral", lw=0.8, label="Ca_post (spine)")
axes[5].set_ylabel("Postsynaptic")
axes[5].set_title("Postsynaptic potential + NMDA spine Ca2+", fontsize=9, loc="left")
axes[5].legend(fontsize=8)
axes[6].plot(t, results["ATP_level"], color="goldenrod", lw=0.8, label="ATP pre")
axes[6].plot(t, results["ATP_level_post"], color="darkorange", lw=0.8, label="ATP post")
axes[6].set_ylabel("ATP level")
axes[6].set_title("CASCADE 2 / POST-ATP — presynaptic and postsynaptic ATP", fontsize=9, loc="left")
axes[6].legend(fontsize=8)
axes[7].plot(t, results["ATP_demand"], color="tomato", lw=0.8, label="demand pre")
axes[7].plot(t, results["ATP_demand_post"], color="orangered", lw=0.8, label="demand post")
axes[7].set_ylabel("ATP demand")
axes[7].set_title("Accumulated ATP demand (resets each min cycle)", fontsize=9, loc="left")
axes[7].set_xlabel("Time (ms)")
axes[7].legend(fontsize=8)
fig2, ax2 = plt.subplots(3, 1, figsize=(12, 8), sharex=True)
fig2.suptitle("Dendrite + Soma", fontsize=13)
ax2[0].plot(t, results["V_dend"], color="mediumblue", lw=0.8)
ax2[0].set_ylabel("V_dend")
ax2[0].set_title("DEND — summed EPSPs (leaky integrator)", fontsize=9, loc="left")
ax2[1].plot(t, results["V_soma"], color="darkgreen", lw=0.8)
ax2[1].axhline(V_soma_threshold, color="red", lw=0.5, ls="--", label="threshold")
ax2[1].set_ylabel("V_soma")
ax2[1].set_title("SOMA — membrane potential + threshold (dashed)", fontsize=9, loc="left")
ax2[1].legend(fontsize=8)
ax2[2].plot(t, results["V_bAP"], color="darkorchid", lw=0.8)
ax2[2].plot(t, results["soma_fired"], color="crimson", lw=0.5, alpha=0.5, label="fired")
ax2[2].set_ylabel("V_bAP / fired")
ax2[2].set_title("DEND — bAP distributed to spines on soma firing", fontsize=9, loc="left")
ax2[2].set_xlabel("Time (ms)")
ax2[2].legend(fontsize=8)
fig2.tight_layout()
fig2.savefig("./dendrite_soma.png", dpi=150)
plt.tight_layout()
plt.savefig("./synapse_simulation.png", dpi=150)
plt.close()
print("Done.")
+20 -19
View File
@@ -23,34 +23,35 @@ NEURON
type: comprehension type: comprehension
expansion: // expansion:
@AXON: EXPAND [ comprehension: AXON ] @AXON: EXPAND [ comprehension: AXON ]
@SOMA: EXPAND [ comprehension: SOMA ] @SOMA: EXPAND [ comprehension: SOMA ]
@D_BRANCH: EXPAND [ comprehension: D_BRANCH ] @D_BRANCH_001: EXPAND [ comprehension: D_BRANCH ]
@D_BRANCH_002: EXPAND [ comprehension: D_BRANCH ]
@D_BRANCH_003: EXPAND [ comprehension: D_BRANCH ]
intrication: // Intrication:
// Scope
# Scope !DAY: INTRICATION [ scope: &ORGANISM.!DAY ]
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ] !NIGHT: INTRICATION [ scope: &ORGANISM.!NIGHT ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Context // Context
*??: INTRICATION [ ref: &??.*?? ] *??: INTRICATION [ context: &??.*?? ]
# Tub // Tub
_??: INTRICATION [ ref: &??._?? ] _??: INTRICATION [ tub: &??._?? ]
instantiation: // Instantiation:
# Context // Context
*TunPossible: CONTEXT [] *TunPossible: INSTANTIATE [ context: local]
# Tub // Tub
_SpikeTrainTraces: TUB [ full: 60x, active: 30x, empty: 0x ] _SpikeTrainTraces: INSTANTIATE [ tub: local, full: 60x, active: 30x, empty: 0x ]
# Behaviour # Container
$: BEHAVIOUR [ behaviour: MAIN_NEURON ] void: INSTANTIATE [ container: MAIN_NEURON ]
``` ```
### MAIN_NEURON ### MAIN_NEURON
@@ -63,7 +64,7 @@ MAIN_NEURON
within_scope: !DAY within_scope: !DAY
snippet: snippet:
@: ACCUMULATOR [ snippet: TunPossibility, rf: active 12x ] void: ACCUMULATOR [ snippet: TunPossibility, rf: active 12x ]
``` ```
#### TunPossibility #### TunPossibility
+66 -47
View File
@@ -14,44 +14,51 @@ Expansions and modulations:
```Gen ```Gen
include:
post_ampa.md
POSTSYNAPSE POSTSYNAPSE
type: comprehension type: comprehension
expansion: include: post_ampa.md
_@PostAmpaAll: TUB [ comprehension: POST-AMPA, full: 10x, active: 5x, empty: 2x ]
intrication: // ########################## Intrication ##########################
# Scope
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Context
*bAP: INTRICATION [ ref: &SOMA.*bAP ]
*TunPossible: INTRICATION [ ref: &NEURON.*TunPossible ]
# Tub // Scope
_NT: INTRICATION [ ref: &ASTROSYNAPSE._NT ] !DAY: INTRICATE [ scope: &ORGANISM.!DAY ]
_Vpost: INTRICATION [ ref: ??._VPost ] !NIGHT: INTRICATE [ scope: &ORGANISM.!NIGHT ]
instantiation: // Context
# Context *bAP: INTRICATE [ context: &SOMA.*bAP ]
*TunPossible: INTRICATE [ context: &NEURON.*TunPossible ]
# Tub // Tub
_Ca2: TUB [ full: 60x, active: 30x, empty: 0x ] _NT: INTRICATE [ tub: &ASTROSYNAPSE._NT ]
_Na: TUB [ full: 60x, active: 30x, empty: 0x ] _Vpost: INTRICATE [ tub: ??._VPost ]
_Nox: TUB [ full: 100x, active: 20x, empty: 0x ] # Nitric Oxide (NO): A gas that diffuses freely.
_eCB: TUB [ full: 100x, active: 20x, empty: 0x ] # Endocannabinoids (e.g., 2-AG)
_posMod: TUB [ full: None, active: ??, empty: 0x) # riferimento a possible di BEH-PRE // ########################## Instantiation ##########################
_actMod: TUB [ full: None, active: ??, empty: ??) # riferimento a active di BEH-PRE
# Behaviour // Context
$: BEHAVIOUR [ behaviour: MAIN_POST ]
$: BEHAVIOUR [ behaviour: TUN-POST-AMPA ] // Tub
_Ca2: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_Na: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_Nox: INSTANTIATE [ tub: local, full: 100x, act: 20x, empty: 0x ] # Nitric Oxide (NO): A gas that diffuses freely.
_eCB: INSTANTIATE [ tub: local, full: 100x, act: 20x, empty: 0x ] # Endocannabinoids (e.g., 2-AG)
_posMod: INSTANTIATE [ tub: local, full: None, act: ??, empty: 0x) # riferimento a possible di BEH-PRE
_actMod: INSTANTIATE [ tub: local, full: None, act: ??, empty: ??) # riferimento a active di BEH-PRE
// Container
void: INSTANTIATE [ scope: !DAY, container: ACTION, context: *bAP ]
void: INSTANTIATE [ scope: !DAY, container: RECOVERY, context: NOT *bAP, *Spike_train ]
void: INSTANTIATE [ scope: !DAY, container: PREPARE, context: * NOT Spike_train ]
void: INSTANTIATE [ scope: !NIGHT, container: ACTION, context: *Not_rem_1 ]
void: INSTANTIATE [ scope: !NIGHT, container: RECOVERY, context: *Not_rem_2 ]
void: INSTANTIATE [ scope: !NIGHT, container: PREPARE, context: *Rem ]
// ########################## Expansion ##########################
_@PostAmpaAll: INSTANTIATE [ tub: EXPAND [ comprehension: POST-AMPA ], full: 10x, active: 5x, empty: 2x ]
``` ```
@@ -64,7 +71,9 @@ POSTSYNAPSE
- **_eCB**: - **_eCB**:
- **_Nox**:? - **_Nox**:?
### MAIN_POST: !DAY ## !DAY | ACTION | *bAP
//### MAIN_POST: !DAY
``` ```
MAIN_POST MAIN_POST
type: behaviour type: behaviour
@@ -89,12 +98,12 @@ MAIN_POST
``` ```
#### *bAP //#### *bAP
![post-ltp-ltd.png](.attachments/post-ltp-ltd.png) ![post-ltp-ltd.png](.attachments/post-ltp-ltd.png)
##### CaNDMAEnterMax //##### CaNDMAEnterMax
```Gen ```Gen
CaNDMAEnterMax CaNDMAEnterMax
@@ -108,7 +117,7 @@ CaNDMAEnterMax
trace: trace:
``` ```
##### CaNDMAEnterMed //##### CaNDMAEnterMed
```Gen ```Gen
CaNDMAEnterMed CaNDMAEnterMed
@@ -121,9 +130,10 @@ CaNDMAEnterMed
trace: trace:
``` ```
#### NOT *bAP ## !DAY | RECOVERY | NOT *bAP, *Spike_train
//#### NOT *bAP
##### CaNDMAEnterLow //##### CaNDMAEnterLow
```Gen ```Gen
CaNDMAEnterLow CaNDMAEnterLow
@@ -136,7 +146,7 @@ CaNDMAEnterLow
trace: trace:
``` ```
##### CaNDMAEnterMedNotBap //##### CaNDMAEnterMedNotBap
```Gen ```Gen
CaNDMAEnterMedNotBap CaNDMAEnterMedNotBap
@@ -149,7 +159,7 @@ CaNDMAEnterMedNotBap
trace: trace:
``` ```
##### CaClearance //##### CaClearance
```Gen ```Gen
CaClearance # Low CaClearance # Low
@@ -162,7 +172,7 @@ CaClearance # Low
trace: None trace: None
``` ```
##### VPostMax //##### VPostMax
```Gen ```Gen
VPostMa VPostMa
type: accumulator type: accumulator
@@ -174,7 +184,7 @@ VPostMa
trace: None trace: None
``` ```
##### VPostMed //##### VPostMed
```Gen ```Gen
VPostMed VPostMed
type: accumulator type: accumulator
@@ -186,7 +196,7 @@ VPostMed
trace: None trace: None
``` ```
##### VPostMin //##### VPostMin
```Gen ```Gen
VPostMin VPostMin
type: accumulator type: accumulator
@@ -199,7 +209,7 @@ VPostMin
``` ```
Il VPost clearance lo facciamo qui nel container dove creaiamo anche i VPost, perche' altrimenti, se lo facessimo in DB, perderemmo l'aspetto temporale della contribuzione dei singoli POST. Il VPost clearance lo facciamo qui nel container dove creaiamo anche i VPost, perche' altrimenti, se lo facessimo in DB, perderemmo l'aspetto temporale della contribuzione dei singoli POST.
##### VPostClearance //##### VPostClearance
```Gen ```Gen
VPostClearance VPostClearance
type: accumulator type: accumulator
@@ -213,7 +223,7 @@ VPostClearance
Il NA clearance lo mettiamo qui come sniplet, perche' gli AMPA creano, e questi pompano fuori. Qui non e' un problema di perdere l'integrazione temporale, perche' gli AMPA sono tutti uguali nel loro behavior. Abbiamo messo gli AMPA come container perche' cosi' possiamo modularne la numerosita'. Il NA clearance lo mettiamo qui come sniplet, perche' gli AMPA creano, e questi pompano fuori. Qui non e' un problema di perdere l'integrazione temporale, perche' gli AMPA sono tutti uguali nel loro behavior. Abbiamo messo gli AMPA come container perche' cosi' possiamo modularne la numerosita'.
##### NaClearanceHigh //##### NaClearanceHigh
```Gen ```Gen
NaClearanceHigh NaClearanceHigh
type: accumulator type: accumulator
@@ -225,7 +235,7 @@ NaClearanceHigh
trace: None trace: None
``` ```
##### NaClearanceLow //##### NaClearanceLow
```Gen ```Gen
NaClearanceLow NaClearanceLow
type: accumulator type: accumulator
@@ -237,7 +247,7 @@ NaClearanceLow
trace: None trace: None
``` ```
### TUN-POST-AMPA: !DAY //### TUN-POST-AMPA: !DAY
```Gen ```Gen
TUN-POST-AMPA TUN-POST-AMPA
type: behaviour type: behaviour
@@ -256,9 +266,9 @@ TUN-POST-AMPA
``` ```
#### *TunPossible //#### *TunPossible
##### CheckTunPostAmpa //##### CheckTunPostAmpa
```Gen ```Gen
CheckTunPostAmpa CheckTunPostAmpa
type: contextor type: contextor
@@ -271,7 +281,7 @@ CheckTunPostAmpa
out_context: *TryTunDownPostAmpa out_context: *TryTunDownPostAmpa
``` ```
##### PossibleUpPostAmpaTun //##### PossibleUpPostAmpaTun
```Gen ```Gen
PossibleUpPostAmpaTun: ( active: 10x ) PossibleUpPostAmpaTun: ( active: 10x )
type: accumulator type: accumulator
@@ -282,7 +292,7 @@ PossibleUpPostAmpaTun: ( active: 10x )
trace: trace:
``` ```
##### PossibleDownPostAmpaTun //##### PossibleDownPostAmpaTun
```Gen ```Gen
PossibleDownPostAmpaTun PossibleDownPostAmpaTun
type: accumulator type: accumulator
@@ -292,3 +302,12 @@ PossibleDownPostAmpaTun
action: action:
trace: trace:
``` ```
## !DAY | PREPARE | NOT *Spike_train
## !NIGHT | ACTION | *Not_rem_1
## !NIGHT | RECOVERY | *Not_rem_2
## !NIGHT | PREPARE | *Rem
+1 -1
View File
@@ -31,7 +31,7 @@ PRE_VGCC
instantiation: instantiation:
# Behaviour # Behaviour
@: BEHAVIOUR [ behaviour: VGCC_PRE_BEH ] @: BEHAVIOUR [ behaviour: MAIN_VGCC_PRE ]
``` ```
### MAIN_VGCC_PRE: !DAY ### MAIN_VGCC_PRE: !DAY
+226 -453
View File
@@ -2,551 +2,324 @@
include_toc: true include_toc: true
--- ---
# presynapse.md // presynapse.md
## PRESYNAPSE **Expansions and modulations**:
Expansions and modulations:
- is expanded and developed by: [AXON](axon.md) - is expanded and developed by: [AXON](axon.md)
- is tuned by: [ORGANISM](../../organism.md), organs, modules - is tuned by: [ORGANISM](../../organism.md), organs, modules
- expands and tunes: [PRE_VGG](pre_vgcc.md) - expands and tunes: [PRE_VGG](pre_vgcc.md)
- develops _Ca2, _Rrp - develops _Ca2, _Rrp
```Gen **Introduction**:
include: The presynaptic bouton releases neurotransmitter and gathers evidence about whether that release was worth strengthening and worth sustaining. Its behavior unfolds across two DAY contexts and the NIGHT scope.
pre_vgcc.md
During DAY, during AP — the bouton releases neurotransmitter. The amount released depends on:
- residual calcium from recent spikes (the fast trace), which sets the release drive;
- the two retrograde messages from the postsynapse — retro_eCB brakes the drive (the postsynapse is over-driven), retro_NO will later confirm that release reached a responsive target;
- the availability of both fuel and vesicles — release proceeds only if budget covers the cost and the readily-releasable pool is non-empty. These two shortfalls are read differently: a fuel shortfall on a succeeding release is evidence the bouton needs more endurance; an empty pool with fuel to spare is ordinary short-term depression.
During DAY, during NOT_AP — the bouton consolidates and recovers. With no spike to release, it:
- receives what arrived — latches the retrograde messages, refills its budget from astrocytic lactate and arrived axonal shipment (contested supply);
- maintains its traces — accumulates eligibility toward a tag, and stabilizes that tag if dopamine has arrived (the bridge toward strength);
- recovers its readily-releasable pool from the private reserve, between spikes (which is why high-frequency firing depletes faster than it recovers);
- lets its traces decay, closing the eligibility, endurance, and tagging windows.
During NIGHT — the bouton's ceilings are rewritten. Acting on the evidence gathered across the day, NIGHT raises the bouton's structure (active-zone capacity) where a validated tag accumulated, and its budget capacity (mitochondrial endurance) where fuel repeatedly interrupted a succeeding release. Both draw on the same finite material and energy shipped down the axon, so the bouton's two kinds of growth compete — and whatever is not maintained drifts back down.
# PRESYNAPSE
```Gen
PRESYNAPSE PRESYNAPSE
type: comprehension type: comprehension
expansion: include: pre_vgcc.md
_@pre_vgcc: TUB [ comprehension: PRE_VGCC, full: 10x, active: 5x, empty: 2x ] // ########################## Intrication ##########################
# il tub serve al tuning
intrication: // Scope
!DAY: INTRICATE [ scope: &ORGANISM.!DAY ]
!NIGHT: INTRICATE [ scope: &ORGANISM.!NIGHT ]
# Scope // Context
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ] *AP: INTRICATE [ context: &SOMA.*AP ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ] *Spike_train: INTRICATE [ context: &NEURON.*Spike_train ]
# Context *Rem: INTRICATE [ context: &HYPOTHALAMUS.*Rem ]
*AP: INTRICATION [ ref: &SOMA.*AP ] *Not_rem_1: INTRICATE [ context: &HYPOTHALAMUS.*Not_rem_1 ]
*TunePossible: INTRICATION [ ref: &NEURON.*TunePossible ] *Not_rem_2: INTRICATE [ context: &HYPOTHALAMUS.*Not_rem_2 ]
# Tub // Tub
_NT: INTRICATION [ ref: &ASTROSYNAPSE._NT ] _NT: INTRICATE [ tub: &ASTROSYNAPSE._NT ]
_ATP: INTRICATION [ ref: &ASTROCYTE._ATP ] _pre_budget: INTRICATE [ tub: &ASTROCYTE._pre_budget ]
_eCB: INTRICATION [ ref: &POSTSYNAPSE._eCB ] _eCB: INTRICATE [ tub: &POSTSYNAPSE._eCB ]
instantiation: // ########################## Instantiation ##########################
# Context // Context
*VcggPreActiveIncrease: CONTEXT []
*VcggPreActiveDecrease: CONTEXT []
*Ca2PrePreActiveDecrease: CONTEXT []
*Ca2PreActiveDecrease: CONTEXT []
*RrpPreActiveDecrease: CONTEXT []
*RrpPreActiveDecrease: CONTEXT []
# Tub // Tub
_Ca2: TUB [ full: 60x, active: 30x, empty: 0x ] _Ca2: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_Rrp: TUB [ full: 30x, active: 15x, empty: 0x ] _Rrp: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_Rp: TUB [ full: 30x, active: 15x, empty: 0x ] _Rp: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_CaTracesHigh: TUB [ full: 50x, active: 0x, empty: 0x ] _CaTracesHigh: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_CaTracesMedium: TUB [ full: 50x, active: 0x, empty: 0x ] _CaTracesMedium: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_CaTracesLow: TUB [ full: 50x, active: 0x, empty: 0x ] _CaTracesLow: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_Ca2FullDev: TUB [ full: 100x, active: _Ca2.full, empty: 40x ] _Ca2FullDev: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ]
_RrpFullDev: TUB [ full: 100x, active: _Rrp.full, empty: 40x ] _RrpFullDev: INSTANTIATE [ tub: local, full: 60x, act: 30x, empty: 0x ] // serve al DEV
# serve al DEV
// Container
void: INSTANTIATE [ scope: !DAY, container: ACTION, context: *AP ]
void: INSTANTIATE [ scope: !DAY, container: RECOVERY, context: NOT *AP, *Spike_train ]
void: INSTANTIATE [ scope: !DAY, container: PREPARE, context: * NOT Spike_train ]
void: INSTANTIATE [ scope: !NIGHT, container: ACTION, context: *Not_rem_1 ]
void: INSTANTIATE [ scope: !NIGHT, container: RECOVERY, context: *Not_rem_2 ]
void: INSTANTIATE [ scope: !NIGHT, container: PREPARE, context: *Rem ]
// ########################## Expansion ##########################
_@pre_vgcc: INSTANTIATE [ tub: EXPAND [ comprehension: PRE_VGCC ], full: 10x, active: 5x, empty: 2x ] // PRE_VGCC, il tub _@pre_vgcc serve al tuning
# Behaviour
$: BEHAVIOUR [ behaviour: MAIN_PRE ]
$: BEHAVIOUR [ behaviour: TUNE_PRE_VGCC ]
$: BEHAVIOUR [ behaviour: DEV_PRE_TUBS ]
``` ```
### MAIN_PRE: !DAY ## !DAY | ACTION | *AP
```Gen ```Gen
MAIN_PRE
type: behaviour ACTION
within_scope: !DAY type: container
snippet: // ########################## NTRelease | Fast (mss) ##########################
# *AP
@: ACCUMULATOR [ snippet: NTreleaseLow, rf: active 12x ]
@: ACCUMULATOR [ snippet: NTreleaseMedium, rf: active 9x ]
@: ACCUMULATOR [ snippet: NTreleaseHigh, rf: active 6x ]
@: ACCUMULATOR [ snippet: TracesAccLow, rf: active 3x ] // Devo aggiungere la limitazione dovuta al Glutamate Spillover GluR e retro_eCB !!!!
@: ACCUMULATOR [ snippet: TracesAccMedium, rf: active 6x ]
@: ACCUMULATOR [ snippet: TracesAccHigh, rf: active 10x ]
# NOT *AP NTreleaseLow: INSTANTIATE [ snippet: accumulator, event: 12x ] {
@: ACCUMULATOR [ snippet: eCBClearenceMedium, rf: active 24x ] hypothesis: _Ca2 mediumness AND _Rrp mediumness AND NOT _pre_budget empty
@: ACCUMULATOR [ snippet: eCBClearenceLow, rf: active 48x ] action: [ _Rrp decrease, _NT increase ]
cost: [ _pre_budget decrease 3x ]
else: None
}
@: ACCUMULATOR [ snippet: RPShuttleLow, rf: active 24x ] NTreleaseMedium: INSTANTIATE [ snippet: accumulator, event: 9x ] {
@: ACCUMULATOR [ snippet: RPShuttleMedium, rf: active 48x ] hypothesis: ( _Ca2 fullness AND _Rrp mediumness ) OR ( _Ca2 mediumness AND _Rrp fullness ) AND NOT _pre_budget empty
action: [ _Rrp decrease, _NT increase ]
cost: [ _pre_budget decrease 3x ]
else: None
}
@: ACCUMULATOR [ snippet: RefillGlutamine, rf: active 24x ] NTreleaseHigh: INSTANTIATE [ snippet: accumulator, event: 6x ] {
hypothesis: _Ca2 fullness AND _Rrp fullness AND NOT _pre_budget empty
action: [ _Rrp decrease, _NT increase ]
cost: [ _pre_budget decrease 3x ]
else: None
}
// ########################## Endurance | Fast (mss) ##########################
// Tag se manca pre_budget, ma il rilascio di NT sarebbe stato di beneficio
Endourance_tag: INSTANTIATE [ snippet: accumulator, event: 9x ] {
hypothesis: _pre_budget empty AND NOT deve esserci la possibilita di spikare e altri segnali come NO
action: [ _pre_endurance_tag increase ]
cost: None
else: None
}
@: ACCUMULATOR [ snippet: TracesClearance, rf: active 30x ]
``` ```
**Tubs:** ## !DAY | RECOVERY | NOT *AP, *Spike_train
- **\_Ca2**: Calcium Ion entering the Presynapse when VCGG open that influence NT release. Normally returns to ~0 between spikes; stays elevated when pumps fail. They are key to check the concentration, release NT and modulation
- **\_Rrp**: Readily Releasable Pool: The Readily Releasable Pool consists of the vesicles that are "docked" and "primed" at the active zone of the synapse. This pool is very small (usually only about 0.5% to 5% of total vesicles) and can be exhausted quickly during high-frequency firing, leading to "short-term depression" of the signal. Here we consider them as NT ready to be released.
- **\_Rp**: Reserve Pool: The bulk of the vesicles held further back in the terminal, often tethered by a protein called synapsin. These are only mobilized during intense, prolonged stimulation. This makes up the vast majority of the vesicles (up to 80% or 90%). Here we consider them NT in reserve that can be transfered to RRP and created using Glutamine from Astorcyte.
- **\_NT**: Neuro Transmitter, released in the synapse by the vescicles. The release increses NT and decreases RRP
- **\_CaTracesXXX**: sono le tracce di permanenza della concentrazione di Ca2. Servono alla modulazione (TUN)
- **\_eCB**: retrograde signal updates from postsynapsis (postsynaptic input)
#### *AP
Il rilascio di NT lo facciamo nel contesto di AP. Biologicamente dovrebbe avvenire solo in base alle concentrazioni, quindi anche al difuori degli AP.
RF di interacting deve essere MOLTO piu' basso di un RF di AP. In maniera da essere attivo varie volte nel contesto di un episodio di AP. Il che ha senso perche' un AP e' SOMA ad un tempo piu' alto che i comportamenti di PRE. Questo poi per permettere la diversa contestualizzazione degli episodi di NTrelease, a piu' o meno alta velocita'.
![nt-release.png](.attachments/nt-release.png)
Non consideriamo le vesicles come liberate, ma direttamente gli NT. Questo permette di gestire la quantita' rilasciata di NT, invece di gestire un numero di vescicles. Nella realta' ciascuna vesicle contiene migliaia di NT. Qui mettiamo un floor a questo tipo di comprensione.
Ci sono 4 casi che dipendono da RRP, Ca2 e indirettamente da concentrazione di NT nella SYN che diventa mGLur che limita in VGCC l'entrata di Ca2. L'idea e' che la quantita' di RRP sia il driver principale. Gli NT liberati sono di piu' al crescere di RRP e Ca2 e di meno (indirettamente) al crescere della concentrazione di NT gia' liberati nella SYN. Gli NT nella sinapsi fanno da moderazione alla ulteriore liberazione di NT, ma non bloccano mai totalmente. NT suppression only matters when everything else is already at maximum, which is exactly the biological purpose: it prevents runaway release during peak activity, not during moderate activity.
---
NT empty. Qui siamo contestualizzati se Ca2 full, il che dovrebbe significare indirettamente che non ci sono NT nella SYN.
In tutti i casi di NT
##### NTreleaseLow
```Gen ```Gen
NTreleaseLow
type: accumulator
in_context: *AP RECOVERY
hypothesis: _Ca2 mediumness AND _Rrp mediumness AND NOT _ATP empty type: container
action: [ _Rrp decrease, _NT increase, _ATP decrease ]
trace: None
```
##### NTreleaseMedium // ########################## _Ca2 level | Fast (mss) ##########################
```Gen
NTreleaseMedium
type: accumulator
in_context: *AP
hypothesis: ( _Ca2 fullness AND _Rrp mediumness ) OR
( _Ca2 mediumness AND _Rrp fullness ) AND
NOT _ATP empty
action: [ _Rrp decrease, _NT increase, _ATP decrease ]
trace: None
```
##### NTreleaseHigh
```Gen
NTreleaseHigh
type: accumulator
in_context: *AP
hypothesis: _Ca2 fullness AND _Rrp fullness AND
NOT _ATP empty
action: [ _Rrp decrease, NT increase, _ATP decrease ]
trace: None
```
##### Ca2TracesAccLow
Serve a:
- fare il tuning dei VGCC
- dare la velocita' al trasporto di vesicles da RP a RRP, anche se non avendo ancora compreso \_ATP, la velocita' non cambia molto la sostanza.
- le tracce vengono eliminate quando il neurone e' in pausa, lontano da uno spike train, *TunePossible
- Abbiamo 3 tracce, high, medium and low. Andiamo a verificare una combinazione di queste per fare la modulazione
- RF e' a 10, questo dovrebbe essere un RF di campionamento durante *AP context che dovremmo assicurarci sia tipo 100. Il che implicherebbe 10 campionamenti.
- The biological meaning is that a synapse that has just been through a burst is primed for fast recovery — the molecular machinery for vesicle docking is already engaged, calcium-dependent priming factors are still elevated, and the system is in a ready state. A synapse that has been silent for several seconds has cooled down and replenishes slowly.
- So after one second of silence CaTrace has fallen to ~37% of its peak value, after two seconds to ~14%, after three seconds to ~5%. It asymptotes toward zero but never exactly reaches it. Between spikes, Ca2 falls toward zero as the pumps clear it. The result is that CaTrace encodes not the instantaneous calcium level but the recent history of calcium activity — a smoothed, time-averaged measure of how active the synapse has been over the past one to two seconds.
```Gen
Ca2TracesAccuLow
type: accumulator
in_context: *AP
TracesAccLow: INSTANTIATE [ snippet: accumulator, event: 3x ] {
hypothesis: _Ca2 emptiness hypothesis: _Ca2 emptiness
action: [ _CaTraceLow increase ] action: [ _CaTraceLow increase ]
trace: None cost: None
``` else: None
}
##### Ca2TracesAccMedium
```Gen
Ca2TracesAccMedium
type: accumulator
in_context: *AP
TracesAccMedium: INSTANTIATE [ snippet: accumulator, event: 6x ] {
hypothesis: _Ca2 mediumness hypothesis: _Ca2 mediumness
action: [ _CaTraceMed increase ] action: [ _CaTraceMed increase ]
trace: None cost: None
``` else: None
}
##### Ca2TracesAccHigh
```Gen
Ca2TracesAccumulationHigh
type: accumulator
in_context: *AP
TracesAccHigh: INSTANTIATE [ snippet: accumulator, event: 10x ] {
hypothesis: _Ca2 fullness hypothesis: _Ca2 fullness
action: [ _CaTraceHigh increase ] action: [ _CaTraceHigh increase ]
trace: None cost: None
``` else: None
}
#### NOT *AP // ########################## TracesClearance | Fast (mss) ##########################
##### eCBClearance TracesClearance: INSTANTIATE [ snippet: accumulator, event: 30x] {
eCB dipende da POST. Tende a modulare l'entrata di Ca2 degli VGCC. hypothesis: NOT _CaTraceHigh empty
action: [ _CaTRaceHigh decrease ]
cost: None
else: None
Qui non facciamo un flush di eCB, riduciamo ogni mezzo secondo (context) di un RF di questo episodio. hypothesis: NOT _CaTraceMedium empty
action: [ _CaTRaceMedium decrease ]
cost: None
else: None
```Gen hypothesis: NOT _CaTraceLow empty
eCBClearance: ( active: 24x ) # Slow action: [ _CaTRaceLow decrease ]
type: accumulator cost: None
else: None
in_context: NOT *AP }
hypothesis: NOT _eCB empty // ########################## Rp Shuttle | Fast (mss) ##########################
action: [ _eCB decrease ]
trace: None
```
##### RPShuttleLow // The "Hard Bottleneck" State. Recruitment is throttled by a lack of signal, a lack of supply, or a lack of space.
// If even one of these "Near-Stop" conditions is met, the rate cannot exceed "Slow," regardless of the other two conditions.
// Rate: 0.00 0.25
This happens in the seconds loop, once per second. RPShuttleLow: INSTANTIATE [ snippet: accumulator, event: 24x ] {
hypothesis: _CaTraceLow fullness OR _RP emptiness OR _Rrp fullness
The "Hard Bottleneck" State. Recruitment is throttled by a lack of signal, a lack of supply, or a lack of space. If even one of these "Near-Stop" conditions is met, the rate cannot exceed "Slow," regardless of the other two conditions.
Rate: 0.00 0.25
```Gen
RPShuttleLow
type: accumulator
in_context: NOT *AP
hypothesis: _CaTraceLow fullness OR
_RP emptiness OR
_Rrp fullness
action: [ _RP decrease, _Rrp increase ] action: [ _RP decrease, _Rrp increase ]
trace: None cost:
``` else: None
}
##### RPShuttleMedium // The "Sub-Optimal" State. The machinery is working, but it's held back by partial limitations.
// This covers cases where the signal is steady but the "piston" isn't firing at full speed,
The "Sub-Optimal" State. The machinery is working, but it's held back by partial limitations. This covers cases where the signal is steady but the "piston" isn't firing at full speed, or where a high vacancy in the RRP (emptiness) forces a low signal to work a bit harder. // or where a high vacancy in the RRP (emptiness) forces a low signal to work a bit harder. Rate: 0.50 0.97
Rate: 0.50 0.97
```Gen
RPShuttleMedium
type: accumulator
in_context: *AP
RPShuttleMedium: INSTANTIATE [ snippet: accumulator, event: 48x ] {
hypothesis: ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp mediumness ) OR hypothesis: ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp mediumness ) OR
( _CaTraceHigh fullness AND _RP mediumness AND _Rrp mediumness ) OR # signal boost ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp mediumness ) OR # signal boost
( _CaTraceMedium fullness AND _RP fullness AND _Rrp mediumness ) OR # supply boost ( _CaTraceMedium fullness AND _RP fullness AND _Rrp mediumness ) OR # supply boost
( _CaTraceMedium fullness AND _RP mediumness AND _Rrp emptiness ) # vacancy boost ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp emptiness ) # vacancy boost
action: [ _RP decrease, _Rrp increase ] action: [ _RP decrease, _Rrp increase ]
trace: None cost:
else: None
}
``` ```
##### RPShuttleHigh ## !DAY | PREPARE | NOT *Spike_train
The "High Performance" State. Multiple systems are optimized, but one is still at a "mediumness" level. This represents an active synapse that hasn't reached its absolute peak because either the supply is only 50% or the \_Rrp isn't empty enough to create that "maximal vacuum" pull.
Rate: 1.25 1.94
```Gen ```Gen
RPShuttleHigh
type: accumulator
in_context: *AP PREPARE
type: container
// ########################## PRE_VGCC Tun | Medium (smin) ##########################
// qui stiamo attivando e disattivando PRE_VGCC. Fra un massimo full e minimo empty (empty puo' non essere 0)
VgccTun: INSTANTIATE [ snippet: accumulator, event: 60x ] {
condition: _CaTraceHigh fullness
hypothesis:
action:
cost: [ _pre_budget decrease 3x ]
else:
condition: _CaTraceLow fullness
hypothesis:
action:
cost: [ _pre_budget increase 3x ]
else:
}
// ########################## RefillGlutamine | Medium (smin) ##########################
// The "High Performance" State. Multiple systems are optimized, but one is still at a "mediumness" level.
// This represents an active synapse that hasn't reached its absolute peak because either the supply is only 50%
// or the \_Rrp isn't empty enough to create that "maximal vacuum" pull. Rate: 1.25 1.94
RefillGlutamine: INSTANTIATE [ snippet: accumulator, event: 24x ] {
hypothesis: ( _CaTraceHigh fullness AND _RP fullness AND _Rrp mediumness ) OR # signal + supply hypothesis: ( _CaTraceHigh fullness AND _RP fullness AND _Rrp mediumness ) OR # signal + supply
( _CaTraceHigh fullness AND _RP mediumness AND _Rrp emptiness ) OR # signal + vacancy ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp emptiness ) OR # signal + vacancy
( _CaTraceMedium fullness AND _RP fullness AND _Rrp emptiness ) # supply + vacancy ( _CaTraceMedium fullness AND _RP fullness AND _Rrp emptiness ) # supply + vacancy
action: [ _RP decrease, _Rrp increase ] action: [ _RP decrease, _Rrp increase ]
trace: None cost:
else: None
}
// ########################## eCBClearance | Medium (smin) ##########################
eCBClearenceMedium: INSTANTIATE [ snippet: accumulator, event: 24x ] {
hypothesis: NOT _eCB empty
action: [ _eCB decrease ]
cost:
else: None
}
eCBClearenceLow: INSTANTIATE [ snippet: accumulator, event: 48x] {
hypothesis: NOT _eCB empty
action: [ _eCB decrease ]
cost:
else: None
}
``` ```
##### RefillRPGlutamine ## !NIGHT | ACTION | *Not_rem_1
This happens in the minutes loop, once per minute, via the glutamine shuttle from the astrocyte. It is a two-step process across two cells.
Step 1 — astrocyte side
The astrocyte has been accumulating cleared glutamate from the cleft since the last minutes-loop execution. Its glutamine synthetase enzyme converts that glutamate into glutamine, filling the Glutamine_pool. The fraction successfully converted per cycle is conversion_efficiency, which is set by glucose availability and boosted temporarily if the astrocyte calcium wave fired during the preceding seconds:
refill_RP = Glutamine_pool * conversion_efficiency
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)
Step 2 — presynapse side
The glutamine crosses into the presynapse, where glutaminase converts it back into glutamate. That glutamate is immediately repackaged into vesicles and added to N_RP:
**The asymmetry that makes depletion possible**:
The chain reveals why sustained high-frequency firing eventually depletes the synapse even with all replenishment mechanisms running.
The RRP holds at most `Max_RRP = 20` vesicles. At 20 Hz with strong Ca2, release can draw 2-4 vesicles per spike — potentially exhausting the RRP in under a second. The seconds loop can move vesicles from RP to RRP at a maximum rate of `k_rec_fast = 5 /s`, meaning at most 5 vesicles per second under ideal conditions. Release outpaces recruitment by roughly an order of magnitude during a burst.
The RP holds up to `Max_RP = 200` vesicles — ten times the RRP. At sustained 20 Hz the RP can sustain firing for tens of seconds even after the RRP is repeatedly emptied, as long as recruitment keeps pace. But the minutes loop only refills N_RP once per minute at a rate limited by `Glutamine_pool * conversion_efficiency`. If glucose is low or the astrocyte wave has not fired, this replenishment may add only a fraction of what was consumed.
The result is a three-tier buffer with mismatched timescales:
RRP — depletes in seconds, refilled in seconds (fast but shallow)
RP — depletes in minutes, refilled in minutes (deep but slow)
Gln — depletes over bursts, refilled by glucose (slowest, astrocyte-dependent)
Each tier buys time for the one below it to respond. When all three are depleted simultaneously — which only happens under prolonged high-frequency firing with insufficient glucose — the synapse has no remaining buffer and goes silent until the minutes loop restores the Glutamine_pool.
##### Ca2TracesClearance
Qui facciamo un flush di CaTraceX. Deve essere fatto a valle del tuning.
```Gen
Ca2TracesClearance
type: accumulator
in_context: NOT *TunePossible
hypothesis: NOT _CaTraceHigh empty
action: [ _CaTRaceHigh decrease ]
trace: None
hypothesis: NOT _CaTraceMedium empty
action: [ _CaTRaceMedium decrease ]
trace: None
hypothesis: NOT _CaTraceLow empty
action: [ _CaTRaceLow decrease ]
trace: None
```
### TUNE_PRE_VGCC: !DAY
```Gen ```Gen
TUNE_PRE_VGCC DEVELOP
type: behaviour
# qui stiamo attivando e disattivando PRE_VGCC. Fra un massimo full e minimo empty (empty puo' non essere 0)
activity_scope: !DAY type: container
snippet: // !NIGHT | ???
# *TunePossible // ########################## CaFull | ??? ##########################
@: CONTEXTOR [ snippet: VgccPreTunCheck, rf: active 60x ]
# *VcggPreActiveIncrease Ca2Check: INSTANTIATE [ snippet: accumulator, event: 60x ] {
@: ACCUMULATOR [ snippet: VcggPreActiveIncrease, rf:active 10x ]
# *VcggPreActiveDecrease condition: ( empty ) // CaFullDecrease
@: ACCUMULATOR [ snippet: VcggPreActiveDecrease, rf:active 10x ] hypothesis: NOT ( full ) AND NOT ( empty )
``` action: [ increase, decrease]
cost:
else: None
#### *TunePossible condition: ( full) // Ca2FullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
cost:
else: None
}
##### VgccPreTunCheck // ########################## RRPFull | ??? ##########################
Qui controlliamo che ci siano le condizioni per aumentare o diminuire l'attivazione di VGCC RrpCheck: INSTANTIATE [ snippet: accumulator, event: 60x ]
```Gen condition: ( empty ) // RrpFullDecrease
VgccPreTunCheck hypothesis: NOT ( full ) AND NOT ( empty )
type contextor action: [ increase, decrease]
cost:
else: None
in_context: *TunePossible condition: ( full) // RrpFullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
condition: _CaTraceHigh fullness action: [ increase, decrease]
out_context: *VcggPreActiveIncrease cost:
else: None
condition: _CaTraceLow fullness }
out_context: *VcggPreActiveDecrease
```
#### *VcggPreActiveIncrease
##### VcggPreActiveIncrease
```Gen
VcggPreActiveIncrease
type: accumulator
in_context: *VcggPreActiveIncrease
hypothesis:
action:
trace:
```
#### *VcggPreActiveDecrease
##### VcggPreActiveDecrease
```Gen
VcggPreActiveDecrease
type: accumulator
in_context: *VcggPreActiveDecrease
hypothesis:
action:
trace:
```
### DEV_PRE_TUBS: !NIGHT
```Gen
DEV_PRE_TUBS
type: behaviour
activity_scope: !NIGHT
snippet:
# *fixed
@: CONTEXTOR [ snippet: Ca2PreDevCheck, rf: active 60x ]
*Ca2PreFullDecrease
@: ACCUMULATOR [ snippet: Ca2PreFullDecrease, rf: active 10x ]
*Ca2PreFullIncrease
@: ACCUMULATOR [ snippet: Ca2PreFullIncrease, rf: active 10x ]
# *fixed
@: CONTEXTOR [ snippet: RrpPreDevCheck, rf: active 60x ]
*RrpPreFullDecrease
@: ACCUMULATOR [ snippet: RrpPreFullDecrease, rf: active 10x ]
*IncreaseRrpFull
@: ACCUMULATOR [ snippet: IncreaseRrpFull, rf: active 10x ]
``` ```
#### *fixed ## !NIGHT | RECOVERY | *Not_rem_2
##### Ca2PreDevCheck ## !NIGHT | PREPARE | *Rem
***Tens Milliseconds Time Scale***
```Gen
Ca2PreDevCheck
type: contextor
in_context: *fixed
condition: ( empty )
out_context: *Ca2PreFullDecrease
condition: ( full)
out_context: *Ca2PreFullIncrease
```
##### *Ca2PreFullDecrease
###### Ca2PreFullDecrease
```Gen
DecreasePreCa2Full
type: accumulator
in_context: *Ca2PreFullDecrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
##### *Ca2PreFullIncrease
###### Ca2PreFullIncrease
```Gen
IncreasePreCa2Full
type: accumulator
in_context: *Ca2PreFullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
#### *fixed
##### RrpPreDevCheck
***Tens Milliseconds Time Scale***
```Gen
RrpPreDevCheck
type: contextor
in_context: *fixed
condition: ( empty )
out_context: *RrpPreFullDecrease
condition: ( full)
out_context: *IncreaseRrpFull
```
##### *RrpPreFullDecrease
###### RrpPreFullDecrease
```Gen
DecreasePreRrpFull
type: accumulator
in_context: *RrpPreFullDecrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
##### *RrpPreFullIncrease
###### RrpPreFullIncrease
```Gen
RrpPreFullIncrease
type: accumulator
in_context: *RrpPreFullIncrease
hypothesis: NOT ( full ) AND NOT ( empty )
action: [ increase, decrease]
trace: None
```
+149 -108
View File
@@ -8,80 +8,93 @@ include_toc: true
Expansions and modulations: Expansions and modulations:
- is expanded by: [NEURON](neuron.md) - is expanded by: [NEURON](neuron.md)
- expands: SOMA_VGSC - expands: VGCC_SOMA
```Gen ```Gen
SOMA SOMA
type: comprehension type: comprehension
expansion: expansion:
_@SOMA_VGSC-H: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ] _@VGCC_SOMA: TUB [ comprehension: VGCC_SOMA, full: 50x, active: 20x, empty: 10x ]
_@SOMA_VGSC-M: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ]
_@SOMA_VGSC-L: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ]
instantiation: intrication:
# Scope
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Tub
_SpikeTrainTraces: INTRICATION [ ref: &NEURON._SpikeTrainTraces ]
instantiation:
# Context
*AP: CONTEXT []
*bAP: CONTEXT []
*VDBMax: CONTEXT []
*VDBMedium: CONTEXT []
*VDBLow: CONTEXT []
*NaSpill: CONTEXT []
# Tub
_VDB: TUB [ full: 60x, active: 30x, empty: 0x ]
_Na: TUB [ full: 60x, active: 30x, empty: 0x ]
_Ca2: TUB [ full: 60x, active: 30x, empty: 0x ]
_SomaRefractory: TUB [ full: 60x, active: 30x, empty: 0x ]
# Behaviour # Behaviour
$: BEHAVIOUR [ behaviour: MAIN-SOMA ] $: BEHAVIOUR [ behaviour: MAIN-SOMA ]
$: BEHAVIOUR [ behaviour: SOMA_VGSC_H_TUN ] $: BEHAVIOUR [ behaviour: VGCC_SOMA_TUN ]
SOMA_VGSC_M_TUN [pass: &SOMA_VGSC_M]
SOMA_VGSC_L_TUN [pass: &SOMA_VGSC_L]
``` ```
**Tubs:** **Tubs:**
- **_VDB**: dendrites deliver current
- **VDB**: dendrites deliver current - **_Na**: are a proxy for the Coulombs of charge building up on the somatic membrane. They are used to check threshold, but also to mimic Na+ and K+ pumping
- **_Ca2**: Medium term traces to guide tuning and Night development. It is a local trace, ATP is a global (Astrocyte)
- **Na**: are a proxy for the Coulombs of charge building up on the somatic membrane. They are used to check threshold, but also to mimic Na+ and K+ pumping - **_SpikeTrainTraces**: sono le tracce che consentono al neurone di far partire il Tuning neuronale, quando e' lontano da uno spike-train, ovvero e' in riposo.
- **_SomaRefractory**: tracce di refractory
- **Ca2+**: Medium term traces to guide tuning and Night development. It is a local trace, ATP is a global (Astrocyte)
- **SpikeTrainTraces**: sono le tracce che consentono al neurone di far partire il Tuning neuronale, quando e' lontano da uno spike-train, ovvero e' in riposo.
- **SomaRefractory**: tracce di refractory
### MAIN-SOMA: Container ### MAIN-SOMA: Container
```Gen ```Gen
MAIN-SOMA MAIN-SOMA
type: container type: behaviour
activity_scope: !DAY
tub_local: within_scope: !DAY
- VDB
- Na
- Ca2+
- SomaRefractory
tub_intricated: snippet:
- SpikeTrainTraces ( contained_in: DAY-N ) # *Fixed
@: CONTEXTOR [ snippet: SomaSpike, rf: active 30x ]
@: ACCUMULATOR [ snippet: SomaRefractorySpill, rf: active 16x ]
@: ACCUMULATOR [ snippet: NASpill, rf: active 20x ]
# *AP
@: ACCUMULATOR [ snippet: ActiveAP, rf: active 8x ]
@: ACCUMULATOR [ snippet: ActiveAP, rf: active 8x ]
``` ```
#### any #### *Fixed
##### SOMA-Status: ( active: 60x ) contextor ##### SOMA-Status: ( active: 60x ) contextor
As dendrites deliver current (VDB), the soma acts like a capacitor. It "stores" this charge in the form of membrane potential. This contextualizes SOMA_VGSC to open ion channels that let Na+ ions in. As dendrites deliver current (VDB), the soma acts like a capacitor. It "stores" this charge in the form of membrane potential. This contextualizes VGCC_SOMA to open ion channels that let Na+ ions in.
This only applies if not ApCtx, or in other words, SOMA is not in refractory period. This only applies if not ApCtx, or in other words, SOMA is not in refractory period.
```Gen ```Gen
SOMA-Status: ( active: 60x ) SOMA-Status:
type: contextor type: contextor
contained_by: MAIN-SOMA
in_context: any in_context: any
condition: ( VDB fullness ) AND NOT AP_ctx condition: _VDB fullness AND NOT AP_ctx
out_context: VDBMax_Ctx out_context: *VDBMax
condition: ( VDB mediumness ) AND NOT AP_ctx condition: ( VDB mediumness ) AND NOT AP_ctx
out_context: VDBMedium_ctx out_context: *VDBMedium
condition: ( VDB emptiness ) AND NOT Ap_ctx condition: _VDB emptiness AND NOT _Ap
out_context: VDBLow_ctx out_context: *VDBLow
condition: NOT ( Na empty ) condition: NOT _Na empty
out_context: NaSpill_ctx out_context: *NaSpill
``` ```
##### SomaSpike: ( active: 30x ) contextor ##### SomaSpike
Il fatto che mettiamo il check di AP separato dal check del Soma-Status, e' perche' vogliamo poter avere un RF specifico per AP, eventualmente tunabile. Il fatto che mettiamo il check di AP separato dal check del Soma-Status, e' perche' vogliamo poter avere un RF specifico per AP, eventualmente tunabile.
@@ -90,95 +103,122 @@ Qui siamo nella fase effettiva di spike, non refractory che viene dopo. Fa da co
La fullness di Na rappresenta il threshold e puo' essere modificato. La fullness di SomaRefractory rappresenta la lunghezza del refractory. La fullness di Na rappresenta il threshold e puo' essere modificato. La fullness di SomaRefractory rappresenta la lunghezza del refractory.
```Gen ```Gen
SomaSpike: ( active: 30x ) SomaSpike
type: contextor type: contextor
contained_by: MAIN-SOMA
in_context: any in_context: *Fixed
condition: ( Na fullness ) AND ( SomaRefractory emptiness ) condition: _Na fullness AND _SomaRefractory emptiness
out_context: AP_ctx out_context: *AP
out_context: bAp_ctx out_context: *bAp
``` ```
#### SomaRefractorySpill: ( active: 16x ) accumulator ##### SomaRefractorySpill
Lo spill deve essere piu' lento dell'increase che avviene in ActiveAP Lo spill deve essere piu' lento dell'increase che avviene in ActiveAP
```Gen ```Gen
SomaRefractorySpill: ( active: 16x ) SomaRefractorySpill
type: accumulator type: accumulator
contained_by: MAIN-SOMA
in_context: any in_context: *Fixed
hypothesis: NOT ( SomaRefractory empty ) hypothesis: NOT _SomaRefractory empty
action: [ decrease SomaRefractory ] action: [ decrease _SomaRefractory ]
trace: trace:
``` ```
#### Ap_ctx ##### NaSpill
##### ActiveAP: ( active: 8x ) accumulator ```Gen
NaSpill
type: accumulator
in_context: *Fixed
hypothesis: NOT _Na empty
action: [ decrease _Na ]
trace:
```
#### *Ap
##### ActiveAP
Durante la fase effettiva di spike: Durante la fase effettiva di spike:
- eliminiamo Na accumulati. Qui ad un RF molto maggiore che con NaSpill. In teoria qui dovremmo eliminare tutti gli Na e NaSpill potrebbe non servire. - eliminiamo Na accumulati. Qui ad un RF molto maggiore che con NaSpill. In teoria qui dovremmo eliminare tutti gli Na e NaSpill potrebbe non servire.
- riempiamo SomaRefractory per fase di refractory - riempiamo SomaRefractory per fase di refractory
- riempiamo Ca2+ per le tracce medio termine di potenziamento/depotenziamento. - riempiamo _Ca2 per le tracce medio termine di potenziamento/depotenziamento.
```Gen ```Gen
ActiveAP: ( active: 8x ) ActiveAP
type: accumulator type: accumulator
contained_by: MAIN-SOMA
in_context: Ap_ctx in_context: *AP
hypothesis: NOT Na empty hypothesis: NOT _Na empty
action: [ decrease Na ] action: [ decrease _Na ] ## This is addition to the _NASpill
trace: trace:
hypothesis: NOT _SomaRefractory full
hypothesis: NOT SomaRefractory full
action: [ increase SomaRefractory ] action: [ increase SomaRefractory ]
trace: trace:
hypothesis: NOT _Ca2 full
hypothesis: NOT Ca2+ full action: [ increase _Ca2 ]
action: [ increase Ca2+ ]
trace: trace:
``` ```
#### NaSpill_ctx
##### NaSpill: ( active: 8x ) accumulator ## VGCC_SOMA
Questo potrebbe non servire se eliminiamo tutti Na durante ActiveAP.
```Gen
NaSpill: ( active: 8x )
type: accumulator
contained_by: MAIN-SOMA
in_context: NaSpill_ctx
hypothesis: NOT ( Na emptiness )
action: [ decrease Na ]
trace:
```
## SOMA_VGSC: Comprehension
Voltage Gated Sodium Channel: difficult to open (High) Voltage Gated Sodium Channel: difficult to open (High)
```Gen ```Gen
container: SOMA_VGSC-H VGCC_SOMA
type: comprehension
tub_local: expansion:
VGSCRefractoryH ( full: 60x, active: 30x, empty: 0x )
tub_intricated: intrication:
Na ( contained_in: SOMA)
context_intricated: # Scope
VDBMaxCtx ( contained_by: SOMA ) !DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Context
# Tub
_Na: INTRICATION [ ref: &SOMA._Na ]
instantiation:
# Context
*VDBMaxCtx: CONTEXT []
*VDBMediumCtx: CONTEXT []
*VDBMLowCtx: CONTEXT []
# Tub
_VGSCRefractoryH: TUB [ full: 60x, active: 30x, empty: 0x )
_VGSCRefractoryM: TUB [ full: 60x, active: 30x, empty: 0x )
_VGSCRefractoryL: TUB [ full: 60x, active: 30x, empty: 0x )
# Behaviour
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_H]
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_M]
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_L]
```
### VGCC_SOMA_BEH_H: !DAY
```Gen
VGCC_SOMA_BEH_H
type: behaviour
within_scope: !DAY
snippets:
@: CONTEXTOR [ snippet: VGSC-H_Status, rf: active 60x ]
@: ACCUMULATOR [ snippet: NaEnterH, rf: active 1x ]
@: ACCUMULATOR [ snippet: VGSCRefractoryHSpill, rf: active 1x ]
``` ```
### sec: SOMA_VGSC-H ### sec: VGCC_SOMA-H
#### VGSC-H_Status: ( active: 60x ) contextor #### VGSC-H_Status: ( active: 60x ) contextor
@@ -187,7 +227,6 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen ```Gen
VGSC-H_Status: ( active: 60x ) VGSC-H_Status: ( active: 60x )
type: contextor type: contextor
contained_by: SOMA_VGSC-H
in_context: any in_context: any
condition: VDBMaxCtx AND ( VGSCRefractoryH emptiness ) condition: VDBMaxCtx AND ( VGSCRefractoryH emptiness )
@@ -205,7 +244,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen ```Gen
NaEnterH: ( active: 1x ) NaEnterH: ( active: 1x )
type: accumulator type: accumulator
contained_by: SOMA_VGSC-H contained_by: VGCC_SOMA-H
in_context: NaEnterH_ctx in_context: NaEnterH_ctx
hypothesis: ( NOT Na full ) hypothesis: ( NOT Na full )
@@ -224,7 +263,7 @@ Lo Spill deve avere un rf maggiore dell'interacting che incrementa VGSCRefractor
```Gen ```Gen
VGSCRefractoryHSpill: ( active: 1x ) VGSCRefractoryHSpill: ( active: 1x )
type: accumulator type: accumulator
contained_by: SOMA_VGSC-H contained_by: VGCC_SOMA-H
in_context: VGSCRefractoryHSpill_ctx in_context: VGSCRefractoryHSpill_ctx
hypothesis: NOT ( VGSCRefractoryH empty ) hypothesis: NOT ( VGSCRefractoryH empty )
@@ -232,12 +271,14 @@ VGSCRefractoryHSpill: ( active: 1x )
trace: None trace: None
``` ```
## SOMA_VGSC-M: container
## VGCC_SOMA-M: container
Voltage Gated Sodium Channel: less difficult to open (Medium) Voltage Gated Sodium Channel: less difficult to open (Medium)
```Gen ```Gen
container: SOMA_VGSC-M container: VGCC_SOMA-M
tub_local: tub_local:
VGSCRefractoryM ( full: 60x, active: 30x, empty: 0x ) VGSCRefractoryM ( full: 60x, active: 30x, empty: 0x )
@@ -249,7 +290,7 @@ container: SOMA_VGSC-M
VDBMedCtx ( contained_by: SOMA ) VDBMedCtx ( contained_by: SOMA )
``` ```
### sec: SOMA_VGSC-M ### sec: VGCC_SOMA-M
#### VGSC-M_TPC: ( active: 60x ) contextor #### VGSC-M_TPC: ( active: 60x ) contextor
@@ -258,7 +299,7 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen ```Gen
VGSC-M_Status: ( active: 60x ) VGSC-M_Status: ( active: 60x )
type: contextor type: contextor
contained_by: SOMA_VGSC-M contained_by: VGCC_SOMA-M
in_context: VDBMediumCtx OR VDBMaxCtx in_context: VDBMediumCtx OR VDBMaxCtx
condition: ( VGSCRefractoryH emptiness ) condition: ( VGSCRefractoryH emptiness )
@@ -273,7 +314,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen ```Gen
NaEnterM: ( active: 1x ) NaEnterM: ( active: 1x )
type: accumulator type: accumulator
contained_by: SOMA_VGSC-M contained_by: VGCC_SOMA-M
in_context: NaEnterM_ctx in_context: NaEnterM_ctx
hypothesis: ( NOT Na full ) hypothesis: ( NOT Na full )
@@ -292,7 +333,7 @@ Lo Spill deve avere un rf maggiore dell'interacting che incrementa VGSCRefractor
```Gen ```Gen
VGSCRefractoryMSpill: ( active: 1x ) VGSCRefractoryMSpill: ( active: 1x )
type: accumulator type: accumulator
contained_by: SOMA_VGSC-M contained_by: VGCC_SOMA-M
in_context: any in_context: any
hypothesis: NOT ( VGSCRefractoryM empty ) hypothesis: NOT ( VGSCRefractoryM empty )
@@ -300,12 +341,12 @@ VGSCRefractoryMSpill: ( active: 1x )
trace: None trace: None
``` ```
## SOMA_VGSC_L: container ## VGCC_SOMA_L: container
Voltage Gated Sodium Channel: easy to open (Low) Voltage Gated Sodium Channel: easy to open (Low)
```Gen ```Gen
container: SOMA_VGSC_L container: VGCC_SOMA_L
tub_local: tub_local:
VGSCRefractoryL ( full: 60x, active: 30x, empty: 0x ) VGSCRefractoryL ( full: 60x, active: 30x, empty: 0x )
@@ -317,7 +358,7 @@ container: SOMA_VGSC_L
VDBLowCtx ( contained_by: SOMA ) VDBLowCtx ( contained_by: SOMA )
``` ```
### sec: SOMA_VGSC_L ### sec: VGCC_SOMA_L
#### VGSC-L_TPC: ( active: 60x ) contextor #### VGSC-L_TPC: ( active: 60x ) contextor
@@ -326,7 +367,7 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen ```Gen
VGSC-L_Status: ( active: 60x ) VGSC-L_Status: ( active: 60x )
type: contextor type: contextor
contained_by: SOMA_VGSC_L contained_by: VGCC_SOMA_L
in_context: VDBLowCtx OR VDBMediumCtx OR VDBMaxCtx in_context: VDBLowCtx OR VDBMediumCtx OR VDBMaxCtx
condition: ( VGSCRefractoryH emptiness ) condition: ( VGSCRefractoryH emptiness )
@@ -341,7 +382,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen ```Gen
NaEnterL: ( active: 1x ) NaEnterL: ( active: 1x )
type: accumulator type: accumulator
contained_by: SOMA_VGSC_L contained_by: VGCC_SOMA_L
in_context: NaEnterL_ctx in_context: NaEnterL_ctx
hypothesis: ( NOT Na full ) hypothesis: ( NOT Na full )
@@ -370,14 +411,14 @@ VGSCRefractoryLSpill: ( active: 1x )
``` ```
## SOMA_VGSC_TUN: Tuner ## VGCC_SOMA_TUN: Tuner
```Gen ```Gen
SOMA_VGSC_TUN VGCC_SOMA_TUN
type: tuner type: tuner
contained_by: SOMA contained_by: SOMA
tunes: SOMA/expansion/SOMA_VGSC tunes: SOMA/expansion/VGCC_SOMA
context_intricated: context_intricated:
- TunPossible ( contained_by: DAY-N ) - TunPossible ( contained_by: DAY-N )
@@ -392,7 +433,7 @@ SOMA_VGSC_TUN
```Gen ```Gen
check_tpc: ( active: 60x ) check_tpc: ( active: 60x )
type: contextor type: contextor
contained_by: SOMA_VGSC-TUN contained_by: VGCC_SOMA-TUN
in_context: TunPossible in_context: TunPossible
condition: ?? condition: ??
+21 -30
View File
@@ -23,39 +23,32 @@ include:
type: comprehension type: comprehension
expansion: // Expansion
@NEU_005: EXPAND [ comprehension: NEURON ] @NEU_005: EXPAND [ comprehension: NEURON ]
@NEU_006: EXPAND [ comprehension: NEURON ] @NEU_006: EXPAND [ comprehension: NEURON ]
instantiation: // Intrication
// Scope
!NIGHT: INTRICATE [ scope: &ORGANISM.!NIGHT]
# Scope // Container Instantiation
!NIGHT: SCOPE [ reference: &ORGANISM.!NIGHT]
# Behaviour // external
## external $OUT-EXCI-001: INSTANTIATE [ container: OUT_EXCITATION, argument: COLLECTION [
pre: ( @NEU_001.@AXO_001._presynapse, @NEU_002.@AXO_001._presynapse ) ] ]
@OUT-EXCI-001: BEHAVIOUR [ behaviour: OUT_EXCITATION, collection: COLLECTION [ $IN-EXCI-001: INSTANTIATE [ container: IN_EXCITATION, argument: COLLECTION [
pre: ( @NEU_001.@AXO_001._presynapse, post: ( @NEU_001.@D_BRANCH_002._postsynapse, @NEU_002.@D_BRANCH_002._postsynapse )
@NEU_002.@AXO_001._presynapse ) ] ]
@IN-EXCI-001: BEHAVIOUR [ behaviour: IN_EXCITATION, collection: COLLECTION [
post: ( @NEU_001.@D_BRANCH_002._postsynapse,
@NEU_002.@D_BRANCH_002._postsynapse )
astro: &ASTROCYTE._astrosynapse ] ] astro: &ASTROCYTE._astrosynapse ] ]
@IN-INHI-001: BEHAVIOUR [ behaviour: IN_INHIBITION, collection: COLLECTION [ $IN-INHI-001: INSTANTIATE [ container: IN_INHIBITION, argument: COLLECTION [
post: ( @NEU_001.@SOMA_001._somasynapse, post: ( @NEU_001.@SOMA_001._somasynapse, @NEU_002.@SOMA_001._somasynapse )
@NEU_002.@SOMA_001._somasynapse )
astro: &ASTROCYTE._astrosynapse ] ] astro: &ASTROCYTE._astrosynapse ] ]
## internal // internal Area xxx
### Area xxx void: INSTANTIATE [ container: EXCITATION, argument: COLLECTION [
@: BEHAVIOUR [ behaviour: EXCITATION, collection: COLLECTION [
pre: @NEU_001.@AXON-001._presynapse, pre: @NEU_001.@AXON-001._presynapse,
post: @NEU_001.@D_BRANCH_001._postsynapse, post: @NEU_001.@D_BRANCH_001._postsynapse,
astro: &ASTROCYTE._astrosynapse ] ] astro: &ASTROCYTE._astrosynapse ] ]
@@ -70,17 +63,15 @@ EXCITATION
activity_scope: !NIGHT activity_scope: !NIGHT
snippet: // snippet: *Fixed
void: INCLUDE [ contextor: ExcitationPossible, event: act 12x ]
# *Fixed // snippet: *ActivateAstroPostPre
@: CONTEXTOR [snip: ExcitationPossible, RF: active 60x] void: INCLUDE [ binder: ExcitationBind, event: act 12x, cost: act 3x ]
void: INCLUDE [ accumulator: ClearTraces, event: act 12x, cost: act 3x ]
# *ActivateAstroPostPre // snippet: *DeActivateAstroPost
@: BINDER [snippet: ExcitationBind, RF: active 6x] void: INCLUDE [ binder: ExcitationUnbind, event: act 12x, cost: act 3x ]
@: ACCUMULATOR [snippet: ClearTraces, RF: active 6x]
*DeActivateAstroPost
@: BINDER [snippet: ExcitationUnbind, RF: active 6x]
``` ```
#### *Fixed #### *Fixed
View File
+79
View File
@@ -0,0 +1,79 @@
---
include_toc: true
---
# vta.md
Expansions and modulations:
- is expanded by: [ORGANISM](../../organism.md)
Qui comprendiamo Hypothalamus. E' l'organo che si occupa di far inniettare dopamine.
## VTA
```Gen
VTA
type: comprehension
expansion:
intrication:
# Scope
!ALWAYS: INTRICATION [ ref: &ORGANISM.!ALWAYS]
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Context
*??: INTRICATION [ ref: &??.*?? ]
# Tub
??: INTRICATION [ ref: &??._?? ]
instantiation:
# Context
*??: CONTEXT []
# Tub
_Dopamine: TUB [ full: 60x, active: 30x, empty: 0x ]
# Behaviour
$: BEHAVIOUR [ behaviour: MAIN ]
```
### !ALWAYS | MAIN:
```Gen
MAIN
type: container
activity_scope: !ALWAYS
snippets:
# *AP
@: ACCUMULATOR [ snippet: ??, rf: active 12x ]
```
#### *Fixed
##### ??
```Gen
??: ( active: 60x )
type: contextor
in_context: *Fixed
condition: NOT ( ?? fullness )
activate_scope:
!DAY
condition: ( ?? fullness )
activate_scope:
!NIGHT
```