brainx-skill 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +17 -1
  2. package/manifest.json +1 -1
  3. package/mcp-servers/codex/skills.json +1 -1
  4. package/package.json +1 -1
  5. package/skills/bio-neuro-lit/SKILL.md +4 -2
  6. package/skills/bio-neuro-lit/references/required-supplements.md +27 -0
  7. package/skills/brainx-acceleration/SKILL.md +30 -437
  8. package/skills/brainx-acceleration/references/audit-and-rewrite-patterns.md +326 -0
  9. package/skills/brainx-general-guard/SKILL.md +24 -8
  10. package/skills/brainx-install/SKILL.md +3 -3
  11. package/skills/brainx-install/references/compatibility-and-release-matching.md +28 -20
  12. package/skills/brainx-install/references/uninstall-and-cleanup.md +11 -4
  13. package/skills/brainx-modeling-loop/SKILL.md +117 -36
  14. package/skills/brainx-modeling-loop/agents/openai.yaml +2 -2
  15. package/skills/brainx-modeling-loop/references/mechanism-comparison.md +62 -0
  16. package/skills/brainx-modeling-loop/references/multiscale-coupling.md +16 -0
  17. package/skills/brainx-modeling-loop/references/paper-reproduction.md +42 -0
  18. package/skills/brainx-modeling-loop/references/parameter-fitting-workflow.md +14 -14
  19. package/skills/brainx-modeling-loop/references/run-experiment.md +1 -1
  20. package/skills/brainx-modeling-loop/references/training-workflow.md +10 -8
  21. package/skills/brainx-visualization/SKILL.md +6 -2
  22. package/skills/brainx-visualization/references/neural-data-visualization.md +1 -1
  23. package/skills/brainx-visualization/references/statistical-and-model-visualization.md +1 -1
  24. package/skills/package-skills/braincell/SKILL.md +23 -14
  25. package/skills/package-skills/braincell/references/braintools/input-current.md +1 -1
  26. package/skills/package-skills/braincell/references/braintools/metric.md +72 -46
  27. package/skills/package-skills/braincell/references/mixions-for-adaptation.md +1 -1
  28. package/skills/package-skills/braincell/references/multicompartment/braincell-manual-morphology-construction.md +1 -1
  29. package/skills/package-skills/braincell/references/multicompartment/cv-policy-reference.md +1 -1
  30. package/skills/package-skills/braincell/references/multicompartment/filter-function-library.md +3 -3
  31. package/skills/package-skills/braincell/references/multicompartment/morphology-io-loading-validation.md +1 -1
  32. package/skills/package-skills/braincell/references/multicompartment/multicompartment-cell-workflow.md +31 -43
  33. package/skills/package-skills/braincell/references/multicompartment/network-workflow.md +49 -0
  34. package/skills/package-skills/braincell/references/multicompartment/probe-reference.md +26 -114
  35. package/skills/package-skills/braincell/references/multicompartment/topology-building-and-visualization.md +40 -28
  36. package/skills/package-skills/braincell/references/scripts/cell_multicompartment_reference.py +13 -17
  37. package/skills/package-skills/brainevent/SKILL.md +0 -3
  38. package/skills/package-skills/brainevent/references/synaptic-plasticity.md +1 -1
  39. package/skills/package-skills/brainmass/SKILL.md +5 -3
  40. package/skills/package-skills/brainmass/references/brainstate/parameter-constraints-regularization.md +9 -7
  41. package/skills/package-skills/brainmass/references/brainstate/parameter-transforms-regularizers-catalog.md +4 -4
  42. package/skills/package-skills/brainmass/references/braintools/data-preprocessing.md +15 -7
  43. package/skills/package-skills/brainmass/references/braintools/metric.md +72 -46
  44. package/skills/package-skills/brainmass/references/coupling-network-api.md +3 -1
  45. package/skills/package-skills/brainmass/references/fitting-with-objectives-api.md +6 -6
  46. package/skills/package-skills/brainmass/references/horn-task-training.md +9 -9
  47. package/skills/package-skills/brainmass/references/modellibrary.md +12 -10
  48. package/skills/package-skills/brainmass/references/scripts/resting-state-meg-whole-brain-pipeline.py +5 -3
  49. package/skills/package-skills/brainmass/references/scripts/wilson-cowan-ei-dynamics.py +10 -6
  50. package/skills/package-skills/brainmass/references/simulator-input-monitor-api.md +3 -1
  51. package/skills/package-skills/brainmass/references/visualization-analysis-api.md +17 -9
  52. package/skills/package-skills/brainspike/SKILL.md +201 -0
  53. package/skills/package-skills/brainspike/references/braintools/connectivity.md +40 -0
  54. package/skills/package-skills/brainspike/references/braintools/data-preprocessing.md +39 -0
  55. package/skills/package-skills/brainspike/references/braintools/input-current.md +55 -0
  56. package/skills/package-skills/brainspike/references/braintools/metric.md +36 -0
  57. package/skills/package-skills/brainspike/references/braintools/optimizer.md +50 -0
  58. package/skills/package-skills/brainspike/references/braintools/parameter-initializer.md +43 -0
  59. package/skills/package-skills/brainspike/references/braintools/surrogate.md +40 -0
  60. package/skills/package-skills/brainspike/references/migration-boundary.md +38 -0
  61. package/skills/package-skills/brainspike/references/model-and-readout-selection.md +41 -0
  62. package/skills/package-skills/brainspike/references/multirate-coupling.md +31 -0
  63. package/skills/package-skills/brainspike/references/multiscale-composition.md +28 -0
  64. package/skills/package-skills/brainspike/references/native-composition.md +52 -0
  65. package/skills/package-skills/brainspike/references/native-delays.md +34 -0
  66. package/skills/package-skills/brainspike/references/native-projections.md +43 -0
  67. package/skills/package-skills/brainspike/references/native-training.md +36 -0
  68. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/devices.md +33 -33
  69. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/divergence-and-parity.md +15 -15
  70. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/integration-categories.md +1 -1
  71. package/skills/package-skills/brainspike/references/nest-compatible/model-library.md +200 -0
  72. package/skills/package-skills/brainspike/references/nest-compatible/network-building.md +276 -0
  73. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brette_et_al_2007.py +23 -26
  74. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brunel_alpha.py +18 -21
  75. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brunel_delta.py +16 -19
  76. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/clopath_synapse_spike_pairing.py +11 -12
  77. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/evaluate_tsodyks2_synapse.py +10 -11
  78. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/spatial_gaussex.py +18 -18
  79. package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/synapsecollection.py +26 -29
  80. package/skills/package-skills/brainspike/references/nest-compatible/synapse-and-connectivity.md +166 -0
  81. package/skills/package-skills/brainspike/references/nest-delay-boundaries.md +31 -0
  82. package/skills/package-skills/brainspike/references/nonlinear-state-sharing.md +26 -0
  83. package/skills/package-skills/{brainpy-state → brainspike}/references/perturbation-experiment-validity.md +2 -2
  84. package/skills/package-skills/brainspike/references/simulator-training.md +61 -0
  85. package/skills/package-skills/brainspike/references/temporal-task-training.md +36 -0
  86. package/skills/package-skills/brainspike/scripts/advanced_native_patterns.py +76 -0
  87. package/skills/package-skills/brainspike/scripts/delay_workflow.py +44 -0
  88. package/skills/package-skills/brainspike/scripts/delayed_cue_training.py +78 -0
  89. package/skills/package-skills/brainspike/scripts/lif_smoke.py +31 -0
  90. package/skills/package-skills/brainspike/scripts/multiscale_workflow.py +35 -0
  91. package/skills/package-skills/brainspike/scripts/native_ei_network.py +47 -0
  92. package/skills/package-skills/brainspike/scripts/native_workflows.py +77 -0
  93. package/skills/package-skills/brainspike/scripts/nest_boundary_workflows.py +108 -0
  94. package/skills/package-skills/brainspike/scripts/train_native_snn.py +65 -0
  95. package/skills/package-skills/brainspike/scripts/train_nest_simulator.py +69 -0
  96. package/skills/package-skills/brainspike/scripts/train_nest_simulator_two_weights.py +220 -0
  97. package/skills/package-skills/brainstate/SKILL.md +16 -21
  98. package/skills/package-skills/brainstate/references/brainstate/brainstate-control-flow-patterns.md +1 -138
  99. package/skills/package-skills/brainstate/references/brainstate/brainstate-transformed-diagnostics.md +1 -1
  100. package/skills/package-skills/brainstate/references/brainstate/delay-buffers.md +45 -0
  101. package/skills/package-skills/brainstate/references/brainstate/parameter-constraints-regularization.md +9 -7
  102. package/skills/package-skills/brainstate/references/brainstate/parameter-transforms-regularizers-catalog.md +4 -4
  103. package/skills/package-skills/brainstate/references/brainstate/randomness-and-reproducibility.md +6 -4
  104. package/skills/package-skills/brainstate/references/brainstate/transformation-grad-expansion.md +4 -4
  105. package/skills/package-skills/brainstate/references/brainstate/transformation-vmap-expansion.md +1 -1
  106. package/skills/package-skills/brainstate/references/braintools-optimizer-reference.md +16 -0
  107. package/skills/package-skills/brainstate/references/libraries/prebuilt-layer-library.md +1 -1
  108. package/skills/package-skills/brainstate/references/simulation-environment.md +5 -5
  109. package/skills/package-skills/braintrace/SKILL.md +17 -38
  110. package/skills/package-skills/braintrace/references/Drtrl.md +9 -26
  111. package/skills/package-skills/braintrace/references/algorithm selection.md +7 -12
  112. package/skills/package-skills/braintrace/references/batching.md +15 -35
  113. package/skills/package-skills/braintrace/references/compiler_internal.md +1 -1
  114. package/skills/package-skills/braintrace/references/custom algorithms.md +1 -2
  115. package/skills/package-skills/braintrace/references/customizing_primitive_transforms.md +26 -15
  116. package/skills/package-skills/braintrace/references/pp_pprop workflow.md +5 -139
  117. package/skills/package-skills/brainunit/SKILL.md +7 -2
  118. package/skills/package-skills/brainunit/references/array-mechanics/functional-structural-api.md +1 -1
  119. package/skills/package-skills/brainunit/references/math-function-library.md +2 -2
  120. package/skills/package-skills/brainunit/references/typing-and-runtime-validation.md +5 -2
  121. package/skills/package-skills/brainevent/references/scripts/102_EI_net_1996.py +0 -107
  122. package/skills/package-skills/brainevent/references/scripts/204_joglekar_2018_propagation.py +0 -168
  123. package/skills/package-skills/brainevent/references/scripts/coba_ei_teaching.py +0 -356
  124. package/skills/package-skills/brainpy-state/SKILL.md +0 -247
  125. package/skills/package-skills/brainpy-state/references/array-creation.md +0 -158
  126. package/skills/package-skills/brainpy-state/references/brain-dynamics-delay-protocol.md +0 -147
  127. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/analysis.md +0 -150
  128. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/brainpy legacy workflow.md +0 -373
  129. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/built-in dynamic neuron model.md +0 -150
  130. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/connecting neurons.md +0 -175
  131. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/customize neuron and synpase.md +0 -286
  132. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Input generation.md +0 -111
  133. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/More about simulation.md +0 -163
  134. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Multi-device array sharding.md +0 -113
  135. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Parallel experiment execution.md +0 -136
  136. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/array creation and mechanics.md +0 -222
  137. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/brainpy math environment setting.md +0 -123
  138. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/delays.md +0 -107
  139. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/object oriented transformations and control flows.md +0 -185
  140. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/integrators.md +0 -181
  141. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/route activity through connectivity.md +0 -102
  142. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/synaptic projections.md +0 -147
  143. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/synpase properties.md +0 -159
  144. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/loss library.md +0 -127
  145. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/optimizers.md +0 -167
  146. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/parameter initializers.md +0 -107
  147. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/prebuilt neural network layers.md +0 -186
  148. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/surrogate gradients.md +0 -104
  149. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/trainer library.md +0 -89
  150. package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/trainingworkflows.md +0 -253
  151. package/skills/package-skills/brainpy-state/references/braintools/brainstate-control-flow-patterns.md +0 -334
  152. package/skills/package-skills/brainpy-state/references/braintools/connectivity.md +0 -206
  153. package/skills/package-skills/brainpy-state/references/braintools/data-preprocessing.md +0 -79
  154. package/skills/package-skills/brainpy-state/references/braintools/input-current.md +0 -199
  155. package/skills/package-skills/brainpy-state/references/braintools/metric.md +0 -152
  156. package/skills/package-skills/brainpy-state/references/braintools/optimizer.md +0 -179
  157. package/skills/package-skills/brainpy-state/references/braintools/parameter-initializer.md +0 -183
  158. package/skills/package-skills/brainpy-state/references/braintools/surrogate.md +0 -147
  159. package/skills/package-skills/brainpy-state/references/component-selection.md +0 -288
  160. package/skills/package-skills/brainpy-state/references/nest-compatible/model-library.md +0 -200
  161. package/skills/package-skills/brainpy-state/references/nest-compatible/nest-workflow.md +0 -156
  162. package/skills/package-skills/brainpy-state/references/nest-compatible/network-building.md +0 -264
  163. package/skills/package-skills/brainpy-state/references/nest-compatible/synapse-and-connectivity.md +0 -153
  164. package/skills/package-skills/brainpy-state/references/projection-patterns.md +0 -127
  165. package/skills/package-skills/brainpy-state/references/scripts/103_COBA_2005.py +0 -86
  166. package/skills/package-skills/brainpy-state/references/scripts/106_COBA_HH_2007.py +0 -181
  167. package/skills/package-skills/brainpy-state/references/scripts/107_gamma_oscillation_1996.py +0 -156
  168. package/skills/package-skills/brainpy-state/references/scripts/109_fast_global_oscillation.py +0 -111
  169. package/skills/package-skills/brainpy-state/references/scripts/201_surrogate_grad_lif_fashion_mnist.py +0 -221
  170. package/skills/package-skills/brainpy-state/references/scripts/sound_localization.py +0 -240
  171. package/skills/package-skills/brainpy-state/references/scripts/training-snn.py +0 -119
@@ -1,21 +1,48 @@
1
1
  ---
2
2
  name: brainx-modeling-loop
3
- description: Use first for an end-to-end BrainX modeling project. Start fresh or resume from brainmodeling-memory.md, write a compact NeuroSpecification.md, optionally research unknown, unverified, or controversial scientific mechanisms, study the relevant BrainX skills deeply, implement and accelerate the model, run experiments, send code and results to Codex through MCP, restudy the affected BrainX skills when review refuses, and visualize only after review passes.
3
+ description: "Use for any end-to-end BrainX modeling project: a new or changed model, mechanism comparison, simulation or fitting study, experiment-derived prediction, or scientific result report. After brainx-general-guard routes the request here, start fresh or resume from brainmodeling-memory.md, resolve consequential missing decisions through an interactive clarification gate before implementation, write a compact NeuroSpecification.md, optionally research unknown, unverified, or controversial scientific mechanisms, study the relevant BrainX skills deeply, implement and accelerate the model, run experiments, send code and results to Codex through MCP, preserve a status report on every terminal path, restudy the affected BrainX skills when review refuses, and use diagnostic visualization for unaccepted evidence and final visualization only after review passes."
4
4
  ---
5
5
 
6
6
  # BrainX modeling loop
7
7
 
8
+ ## Activation boundary
9
+
10
+ Open this workflow when the request combines a scientific question with a new or changed model, a mechanism comparison, simulation or fitting, experiment-derived predictions, or a scientific result report. `brainx-general-guard` remains the first cross-cutting guard, then this workflow must run step 0 before any package-specific modeling skill is opened. A request that asks whether modeling can distinguish competing mechanisms is an end-to-end modeling project even when it does not name a BrainX package.
11
+
12
+ ## Output invariant
13
+
14
+ Create or update `<project-root>/report.md` when the project starts and complete its specification fields when step 0 locks `NeuroSpecification.md`, before advancing to step 1. Keep this file current on every pause, block, refusal, and completion; a review refusal or missing environment must never leave a modeling project without a report. Keep three fields separate: `Report status` (`draft`, `blocked`, or `final`) describes document lifecycle; `Scientific outcome` (`pending`, `supported`, `partially_supported`, `refuted`, `inconclusive`, or `invalid`) describes the evidence-backed conclusion; `Review outcome` (`pending`, `PASS`, `REFUSE`, or workflow-local `BLOCKED`) describes the Codex gate. A non-final report must label all claims as provisional and link the relevant review, run, test, and result artifacts.
15
+
16
+ Use this minimum report header as soon as the project starts, then expand it as evidence arrives:
17
+
18
+ ```markdown
19
+ # <research title>
20
+ - Report status: draft | blocked | final
21
+ - Scientific outcome: pending | supported | partially_supported | refuted | inconclusive | invalid
22
+ - Review outcome: pending | PASS | REFUSE | BLOCKED
23
+ - Research question: <original question>
24
+ - Evidence available: <artifact paths or none>
25
+ - Missing evidence: <blocker or none>
26
+ - Current conclusion: <provisional statement>
27
+ - Next action: <exact loop step>
28
+ ```
29
+
30
+ Use diagnostic closure before returning with unaccepted or incomplete work. Enter final visualization only after a step-5 `PASS`.
31
+
8
32
  ## Get started
9
33
 
10
34
  Read `brainmodeling-memory.md` first when it exists, then choose exactly one entry case.
11
35
 
12
36
  | Entry case | Use when | Action |
13
37
  |---|---|---|
14
- | `fresh-new` | `brainmodeling-memory.md` does not exist and no prior loop work must be preserved. | Create the memory file, set the current position to step 0, and start the specification. |
15
- | `resume` | `brainmodeling-memory.md` or prior loop artifacts exist. | Read the recorded step, verify its referenced artifacts, and continue from the first unfinished action in that step. |
38
+ | `fresh-new` | `brainmodeling-memory.md` does not exist and no prior loop work must be preserved. | Create the memory file and a draft `report.md`, set the current position to step 0, and start the specification. |
39
+ | `resume` | `brainmodeling-memory.md` or prior loop artifacts exist. | Verify the latest checkpoint's artifacts and continue from its `Resume at` target. |
40
+
16
41
 
17
42
  Do not create another entry case. Recover missing or inconsistent state inside `resume` by using existing artifacts to locate the earliest unfinished step. Do not repeat a completed experiment or Codex review merely because terminal context was lost.
18
43
 
44
+ On `resume`, if a locked `NeuroSpecification.md` exists but `report.md` is missing, create the draft report before continuing. A missing report is an incomplete artifact state to repair, not a reason to skip the reporting closure.
45
+
19
46
  Use this complete append-only memory contract:
20
47
 
21
48
  ```markdown
@@ -24,6 +51,7 @@ Use this complete append-only memory contract:
24
51
  ## Checkpoint
25
52
  - Iteration: <integer>
26
53
  - Step: 0 | 1 | 2 | 3 | 4 | 5 | 6
54
+ - Resume at: <iteration>/<step> | complete
27
55
 
28
56
  ### Artifacts
29
57
  - `<path or stable identifier>`: <contents and status>
@@ -40,21 +68,27 @@ Use this complete append-only memory contract:
40
68
 
41
69
  For `fresh-new`, create the file with its title, start iteration 1 at step 0, and
42
70
  append the first checkpoint after step 0 finishes or blocks. After every step,
43
- including a blocked step, append a new `## Checkpoint` block. `Iteration` and `Step` are metadata identifying
44
- the step whose artifacts and milestones the block records; `Artifacts` and
45
- `Important milestones` are the checkpoint content.
71
+ including a blocked step, append a new `## Checkpoint` block. `Iteration` and
72
+ `Step` identify the work recorded. `Resume at` identifies the next action's
73
+ iteration and step. Use `1/0` while iteration 1 awaits a step-0 answer, `1/6`
74
+ after its review passes, `2/1` after its review refuses, and `complete` after
75
+ final reporting. Record any pending prerequisite beside the target.
46
76
 
47
77
  Never overwrite an earlier checkpoint. Append corrections as a new checkpoint
48
78
  with the same iteration and step and state which earlier record it supersedes.
49
- For `resume`, read the checkpoints in order, verify the latest artifact pointers,
50
- and continue from the first unfinished action after the latest valid checkpoint.
79
+ For `resume`, read the checkpoints in order and verify the latest artifact
80
+ pointers. For older checkpoints without `Resume at`, infer the target from
81
+ the recorded milestone and existing artifacts. Preserve the old block and use
82
+ the new field in the next checkpoint.
51
83
 
52
84
  ```text
53
- fresh-new -> step 0 -> optional literature gate -> step 1 -> step 2 -> step 3 -> step 4 -> step 5
54
- ^ |
55
- |--------- REFUSE ---------|
85
+ fresh-new -> step 0 [clarify + lock] -> optional literature gate -> step 1 -> step 2 -> step 3 -> step 4 -> step 5
86
+ ^ |
87
+ |----- pending answer --|
56
88
 
57
- step 5 PASS -> step 6 -> complete
89
+ step 5 REFUSE -> diagnostic closure -> step 1 -> ... -> step 5
90
+ step 5 BLOCKED -> diagnostic closure -> paused
91
+ step 5 PASS -> step 6 -> complete
58
92
  ```
59
93
 
60
94
  Each checkpoint contains the artifacts created or updated by that step and the
@@ -63,9 +97,47 @@ reviews in their owning artifacts and point to them from the checkpoint.
63
97
 
64
98
  The `bio-neuro-lit` skill may append repeatable `## Literature evidence` blocks when selected papers materially affect the model. Treat these blocks as evidence records, not checkpoints: they do not change the current iteration or step. Read them before step 0 specification decisions and during step 1 study, and preserve their source identifiers, evidence depth, publication version, modeling implications, and limitations.
65
99
 
66
- ## Step 0: Write the specification
100
+ ## Step 0: Clarify and write the specification
101
+
102
+ Turn the researcher's request and inspected data into a short `NeuroSpecification.md`. Step 0 contains a mandatory clarification gate before any implementation study or model construction. Use the request and supplied artifacts to identify consequential decisions that remain open. Scope questions by the type of unresolved decision described below.
103
+
104
+ ### Clarification gate
105
+
106
+ Inspect the request, repository, supplied data, and referenced specifications first. Then build the decision frontier: every unanswered choice that can change the model equations or represented scale, parameter values or units, initial or boundary conditions, connectivity, input or intervention protocol, observation mapping, data interpretation, reproducibility, validation, or acceptance boundary.
107
+
108
+ Apply this gate before opening step-1 package skills. **Hard stop:** if the frontier contains a consequential choice and the researcher has not explicitly fixed it or delegated it, ask the researcher and wait for the answer in the current conversation. Do not invoke step 1, write model or experiment code, run experiments, or silently lock the specification while an answer is pending. The initial request is not approval of choices it leaves open.
109
+
110
+ Ask one question at a time, ordered by dependency: settle a parent choice before asking decisions that depend on it. Each question must use the researcher's terminology and state why the answer changes the model or the interpretation. Give a recommended answer when a defensible default exists, show the relevant alternatives, and allow the researcher to say `choose for me`, `use the recommended default`, or `I don't know`. Treat the first two replies as explicit delegation or confirmation and record the resulting choice. Treat `I don't know` as unresolved: do not guess or advance; offer a small exploratory branch only when the researcher authorizes it. If a question can be answered by reading the repository or data, inspect them instead of asking.
67
111
 
68
- Turn the researcher's request and inspected data into a short `NeuroSpecification.md`. Ask the researcher only for missing decisions that would change the model, data interpretation, or acceptance boundary. Do not infer them.
112
+ Draft `NeuroSpecification.md` even when no consequential choice is open. Record each pending decision, question, and proposed default under `Open decisions and handling`, with `Researcher approval: pending`. Lock only after every consequential choice is resolved or explicitly delegated and the researcher authorizes proceeding with the specification. Use existing authorization when it covers the specification. Otherwise show the draft, ask for approval, and preserve the pending state until the researcher responds. Once authorized, set `Status: locked`, record the approval evidence, update `report.md` with `Report status: draft`, and evaluate the literature gate.
113
+
114
+ Use a compact prompt shape:
115
+
116
+ ```text
117
+ Before I lock the BrainX specification, I need one decision:
118
+
119
+ <question in the user's terms>
120
+
121
+ Why it matters: <specific effect on model, data interpretation, or acceptance>
122
+ Recommended: <choice and brief reason>
123
+ Options: <A> | <B> | choose for me | I don't know
124
+ ```
125
+
126
+ While an answer or authorization is pending, append a step-0 checkpoint and set its resume target to step 0 of the same iteration. Resolve the recorded prerequisite before advancing.
127
+
128
+ | Open decision type | Clarification and design response |
129
+ |---|---|
130
+ | Consequential computational setting missing from a specified model or method | Engage in technical clarification. Ask about omitted parameter values or units, initial conditions, connectivity, or input protocols when they materially change the requested model, interpretation, or reproducibility. Use the supplied terminology and explain why each missing setting matters. |
131
+ | Experimental fact missing from a phenomena-only request | Ask only about observations and experimental conditions that affect model choice or interpretation: measured readouts, compared samples, intervention strength or timing, and relevant controls. Choose and justify the abstraction, parameters, solver, and checks without asking the researcher to supply computational settings. Experimental measurements with numbers alone do not imply a request for technical design discussion. |
132
+ | Computational and experimental decisions both remain open | Apply both approaches to the relevant parts of the request: clarify consequential experimental facts and omitted computational settings while preserving the supplied design. |
133
+
134
+ Honor explicit collaboration directions: if the user says to choose the remaining parameters, do so; if they ask to discuss the design, collaborate. Inspect supplied files and referenced specifications before asking for missing settings. Ask only for missing decisions that would change the model, data interpretation, or acceptance boundary. A proposed default does not close a consequential question until the researcher confirms it or explicitly delegates the choice. Distinguish a proposed default from a user-confirmed value or a delegated choice.
135
+
136
+ Distinguish experimental measurements, user-specified modeling assumptions, literature context, and agent choices. A supplied parameter is not automatically an experimental estimate. Keep unanswered experimental facts as conditional interpretations and unanswered computational questions as pending, with any proposed defaults marked provisional. While waiting, perform only read-only inspection that helps resolve the pending question; do not present assumed settings as the user's specified design or an exact reproduction. Do not wait on technical choices the user has explicitly delegated.
137
+
138
+ When explaining an experimental phenomenon, comparing mechanisms, or deciding whether modeling can distinguish them, open `references/mechanism-comparison.md` before selecting the implementation. It defines causal chains, measurement mapping, distinguishable predictions, and which unmeasured assumptions to test first.
139
+
140
+ For paper or author-code reproduction, open `references/paper-reproduction.md` before locking the specification, for source reconciliation, exact analysis contracts, claim boundaries, and later source-informed reanalysis.
69
141
 
70
142
  Use only this core structure:
71
143
 
@@ -73,7 +145,8 @@ Use only this core structure:
73
145
  # NeuroSpecification
74
146
 
75
147
  - Status: draft | locked
76
- - Researcher approval:
148
+ - Clarification gate: pending | complete
149
+ - Researcher approval: <existing authorization or pending decision>
77
150
 
78
151
  ## Researcher request
79
152
  - Brain-modeling question or behavior:
@@ -81,6 +154,7 @@ Use only this core structure:
81
154
  - Execution mode: forward-simulation | task-training | parameter-fitting | hybrid
82
155
  - Required outputs:
83
156
  - Constraints:
157
+ - Open decisions and handling: <pending clarification, delegated, or proposed default>
84
158
 
85
159
  ## Inspected data contract
86
160
  - Data sources and inspected contents:
@@ -88,15 +162,17 @@ Use only this core structure:
88
162
  - Required preprocessing and the subset used to fit each transform:
89
163
  - Mapping from data to model inputs, targets, and observables:
90
164
  - Known data limitations or unresolved mismatches:
165
+ - Conditional interpretations of unanswered experimental questions:
91
166
 
92
167
  ## Acceptance boundary
93
168
  - Evidence required for success, failure, or an inconclusive result:
94
169
  - Required baselines and controls:
95
170
  - Invalid-result conditions:
96
171
  - Allowed claims and explicit non-claims:
172
+ - Model/comparison rationale and decisive assumption checks: <brief rationale or artifact path>
97
173
  ```
98
174
 
99
- Inspect supplied data before completing its contract. Keep raw data read-only, preserve units and axis meaning, and prevent preprocessing leakage. Obtain researcher approval for the initial specification, then evaluate the literature gate before proceeding to step 1.
175
+ Inspect supplied data before completing its contract. Keep raw data read-only, preserve units and axis meaning, and prevent preprocessing leakage. Obtain explicit researcher approval or delegation for every consequential open choice, lock the initial specification, then evaluate the literature gate before proceeding to step 1.
100
176
 
101
177
  ### Optional literature gate after the NeuroSpecification
102
178
 
@@ -124,7 +200,7 @@ When the gate triggers:
124
200
 
125
201
  When the gate does not trigger, record the skip and its reason as a step-0 milestone. Do not perform a broad background review merely to make the study record look comprehensive.
126
202
 
127
- **Step result:** a locked or evidence-reconciled `NeuroSpecification.md`, a resolved or explicitly skipped literature gate, and a memory checkpoint pointing to step 1.
203
+ **Step result:** a locked or evidence-reconciled `NeuroSpecification.md`, a resolved or explicitly skipped literature gate, an initial `report.md`, and a memory checkpoint pointing to step 1.
128
204
 
129
205
  ## Step 1: Study the relevant BrainX modeling skills
130
206
 
@@ -132,8 +208,8 @@ Study before implementing. Understand the selected BrainX abstractions, exact AP
132
208
 
133
209
  1. Open `brainx-general-guard` and identify every biological scale explicitly represented by `NeuroSpecification.md`.
134
210
  2. Read each selected modeling skill completely:
135
- - `braincell` for ions, channels, compartments, or morphology;
136
- - `brainpy-state` for point neurons, synapses, or spiking networks;
211
+ - `braincell` for ions, channels, compartments, morphology, or detailed-cell networks with spatially placed synapses;
212
+ - `brainspike` for all point-neuron tasks; check its migration boundary before custom dynamics, training, or multiscale coupling;
137
213
  - `brainmass` for aggregate populations, regions, or whole-brain dynamics.
138
214
  3. Open supporting package skills only when the model requires them:
139
215
  - `brainunit` for physical quantities and unit-aware boundaries;
@@ -141,15 +217,16 @@ Study before implementing. Understand the selected BrainX abstractions, exact AP
141
217
  - `brainevent` for event data, connectivity, and event-driven plasticity;
142
218
  - `braintrace` only for temporal training limited by BPTT memory.
143
219
  4. Follow every selected skill's routing instructions. Read all references and canonical scripts likely to affect this model.
220
+ Open `references/multiscale-coupling.md` when represented scales exchange signals. Use it to specify the exchanged observables, units, clocks, and causal update order.
144
221
  5. Trace construction, initialization, State and data flow, update order, execution, outputs, and validation through the relevant examples.
145
222
  6. Verify unfamiliar API names and signatures in the owning skill or its routed documentation. Do not inspect installed package source for modeling knowledge.
146
223
  7. Save the study record as an artifact and record its completion and selected training/fitting coverage as important milestones.
147
224
 
148
225
  Do not write the implementation during step 1. Finish the study record first.
149
226
 
150
- When step 5 returns `REFUSE`, increment the iteration and return here before changing code. Map every reviewer finding to the owning BrainX package or workflow skill, reopen `brainx-general-guard`, and restudy every affected package skill, routed reference, and canonical script that can change the correction. Recheck high-level BrainX and BrainTools APIs before retaining custom or external infrastructure. Open the active training or fitting reference during this restudy when a finding concerns its objective, architecture, optimizer, input, metric, recovery, or evidence contract.
227
+ After a step-5 `REFUSE`, resume step 1 at the iteration recorded in `Resume at` before changing code. Map every reviewer finding to the owning BrainX package or workflow skill, reopen `brainx-general-guard`, and restudy every affected package skill, routed reference, and canonical script that can change the correction. Recheck high-level BrainX and BrainTools APIs before retaining custom or external infrastructure. Open the active training or fitting reference during this restudy when a finding concerns its objective, architecture, optimizer, input, metric, recovery, or evidence contract.
151
228
 
152
- Preserve the original study artifact. For iteration 1, use `brainx-study-record.md`; after a refusal, write `brainx-study-record-iteration-<N>.md` with the reviewer-finding map, newly studied sources, changed or reaffirmed API decisions, and the resulting implementation design. Append a step-1 memory checkpoint pointing to the new artifact. Do not begin step 2 until this iteration-specific restudy is complete.
229
+ Preserve the original study artifact. For iteration 1, use `brainx-study-record.md`. After a refusal, write `brainx-study-record-iteration-<iteration>.md` using the iteration recorded in `Resume at`. Include the reviewer-finding map, newly studied sources, changed or reaffirmed API decisions, and the resulting implementation design. Append a step-1 memory checkpoint pointing to the new artifact. Do not begin step 2 until this iteration-specific restudy is complete.
153
230
 
154
231
  **Step result:** a complete BrainX study record and an implementation design grounded in the selected skills, then a memory checkpoint pointing to step 2.
155
232
 
@@ -214,10 +291,8 @@ result assessment, claim-evidence matrix, proposed next action, and all evidence
214
291
  required by active training/fitting coverage. The returned `content` is the
215
292
  reviewer's Markdown report in the calling agent's current turn. Before
216
293
  classifying it, save it verbatim as `reviews/iteration-<N>.md`; do not reformat,
217
- summarize, or mix the main agent's analysis into that file. Then read its verdict,
218
- update the loop checkpoint with the report path, and report or act on it without
219
- asking the researcher to open another context. Preserve the returned `threadId`
220
- in the checkpoint for reviewer follow-up; it is not needed to read the report.
294
+ summarize, or mix the main agent's analysis into that file. Read its verdict and
295
+ follow the transition below in the current conversation.
221
296
 
222
297
  Before calling, verify that every listed path exists. Set the MCP call's working
223
298
  directory to the project root when the tool exposes a working-directory argument,
@@ -275,8 +350,7 @@ scientific outcome.
275
350
 
276
351
  Do not start an iteration review with `mcp__codex__codex-reply`; only a fresh
277
352
  `codex` call receives the injected system prompt. If the configured MCP server is
278
- unavailable, record step 5 as blocked in `brainmodeling-memory.md` and preserve
279
- all completed experiment artifacts.
353
+ unavailable, take the `BLOCKED` transition below.
280
354
 
281
355
  For a non-interactive Codex host, configure the MCP registration with
282
356
  `default_tools_approval_mode = "approve"`; otherwise the host cannot present an
@@ -285,23 +359,30 @@ call`. Also set `tool_timeout_sec = 1800`, or another explicit budget longer tha
285
359
  the largest expected review. When no `threadId` or response is returned, verify
286
360
  approval first and timeout second before treating it as researcher cancellation.
287
361
 
288
- Record the verbatim Markdown report path, `threadId`, and one of two outcomes:
362
+ Collect the records for the applicable outcome, then append a new step-5 checkpoint for iteration `N` before advancing or pausing. Include the verbatim report path and `threadId` when available. Diagnostic closure updates the project report and figure manifest while preserving the evidence-backed scientific outcome.
289
363
 
290
364
  | Outcome | Transition |
291
365
  |---|---|
292
- | `REFUSE` | Record every finding and required correction, increment the iteration, set the current step to 1, restudy the affected BrainX package and workflow skills, and repeat steps 1-5 with the same optional coverage. |
293
- | `PASS` | Record the accepted code/result scope and set the current step to 6. |
366
+ | `REFUSE` | Run diagnostic closure, record the findings and required corrections, and set `Resume at` to step 1 of iteration `N+1`. Repeat steps 1-5 with the same optional coverage. |
367
+ | `BLOCKED` | Preserve all artifacts, run diagnostic closure, and set `Report status: blocked` and `Review outcome: BLOCKED`. Record the blocker and available call evidence, set `Resume at` to `N/5`, and pause until the blocker changes. |
368
+ | `PASS` | Record the accepted code/result scope and set `Resume at` to `N/6`. |
294
369
 
295
370
  Do not argue with a refusal inside step 5 and do not substitute self-review for the MCP Codex call. The next Codex call occurs only after the refusal has passed through package restudy, revised implementation, acceleration, and experiment execution.
296
371
 
297
- **Step result:** a preserved `reviews/iteration-<N>.md` report and either a return to step 1 or a memory checkpoint pointing to step 6.
372
+ **Step result:** a new step-5 checkpoint with its outcome and resume target, a current `report.md`, and a preserved `reviews/iteration-<N>.md` when the reviewer returned a report.
373
+
374
+ ## Diagnostic closure for incomplete iterations
375
+
376
+ Run this closure before returning with unaccepted or incomplete evidence, including a refusal, missing dependency, unavailable reviewer, failed run, or absent raw result. Open `brainx-visualization` → `SKILL.md` and use `diagnostic` mode when the artifacts support a meaningful figure. Update `report.md` with the lifecycle status, scientific outcome, review outcome or blocker, evidence paths, permitted claims, missing evidence, and exact next action. Keep the scientific outcome `pending` until the evidence supports a bounded conclusion. For reportable numeric or event data, render and inspect at least one diagnostic figure, write `FIGURE_MANIFEST.md`, and label the figures as unaccepted. If no plot-worthy data exist, record `Figure status: unavailable` and the failed prerequisite in both files. Never substitute a schematic, invented trace, or placeholder for missing experiment evidence. Record both paths and the closure outcome in the new checkpoint for the step that just finished or paused.
377
+
378
+ ## Step 6: Visualize and explain the accepted result
298
379
 
299
- ## Step 6: Visualize the accepted result
380
+ Open `brainx-visualization` → `SKILL.md` with the review-passed specification, code, run artifacts, results, and accepted scope.
300
381
 
301
- Hand the review-passed specification, code, run artifacts, results, and accepted scope to the BrainX visualization workflow.
382
+ Finalize the existing `report.md` and set `Report status: final`. Preserve the evidence-backed `Scientific outcome` separately. Answer the original research question using the accepted results, distinguish experimental evidence, assumptions, model-derived conclusions, and predictions, and state the remaining limitations. For mechanism comparisons, explain which mechanisms remain compatible and which measurement could distinguish them.
302
383
 
303
- The planned route is `references/visualization-workflow.md`. That instruction will be authored later; do not embed or invent it here. Until it exists, preserve the accepted artifacts and record step 6 as blocked in `brainmodeling-memory.md`.
384
+ Embed or link each figure beside its corresponding result and write its explanation directly in the report, following the visualization skill's figure-explanation requirements. Link the supporting run artifacts so the reader can trace the plotted evidence.
304
385
 
305
- After visualization completes, record the figure paths as artifacts and loop completion as an important milestone, then report the accepted result and remaining limitations.
386
+ After visualization, figure-manifest verification, and the report are complete, record their paths as artifacts and loop completion as an important milestone, then report the accepted result and remaining limitations.
306
387
 
307
- **Step result:** visualization linked to review-passed evidence and a completed memory checkpoint.
388
+ **Step result:** a final `report.md` containing inspected figures and their explanations, a `FIGURE_MANIFEST.md`, links to review-passed evidence, and a completed memory checkpoint.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "BrainX Modeling Loop"
3
- short_description: "Run rigorous iterative BrainX modeling projects"
4
- default_prompt: "Use $brainx-modeling-loop to start or resume my iterative BrainX model, with training or fitting coverage when required."
3
+ short_description: "Clarify, then run rigorous iterative BrainX models"
4
+ default_prompt: "Use $brainx-modeling-loop to clarify consequential decisions, then start or resume my iterative BrainX model with training or fitting coverage when required."
@@ -0,0 +1,62 @@
1
+ # From experimental observations to mechanism comparisons
2
+
3
+ ## Purpose and boundary
4
+
5
+ Open this reference during step 0 when an observation has competing explanations or the researcher asks whether modeling can distinguish them. Use it to choose the scientific comparison before package selection and implementation. For a fixed model implementation or reproduction, use the specified design. If that design cannot answer part of the question, report the unsupported inference and propose the smallest adaptation under step 0's authorization rule; do not substitute another model or retune fixed parameters.
6
+
7
+ ## Separate the observation from its interpretation
8
+
9
+ Write the reported contrast as a measured quantity, comparison unit, intervention, and observation window. Keep within-sample contrasts distinct from comparisons across independent samples. Distinguish latent neural activity from the instrument's output and the biological outcome the researcher wants explained.
10
+
11
+ Ask for missing experimental facts that could change that interpretation, using the user's terminology. For example, ask whether “more active” means more recorded spikes or a larger reporter signal, and whether the comparison uses neighbors in one sample or means across samples. Readouts in a related paper do not establish the user's assay. If unanswered, retain the alternatives and state which results apply to each. When the request also supplies a computational design, apply step 0's technical-clarification and delegation rules to its consequential missing settings.
12
+
13
+ ## Choose the comparison before the model
14
+
15
+ Express each credible explanation as `intervention -> affected process -> circuit or cellular consequence -> measured readout`. Mark each unsupported link as an assumption. Use the literature gate for evidence that could change these links; do not simulate every imaginable mechanism.
16
+
17
+ Record the comparison under `Acceptance boundary` in `NeuroSpecification.md`; use a linked `mechanism-comparison.md` artifact when the table would make the specification too long:
18
+
19
+ | Explanation and causal chain | Distinguishing measurement or intervention | Smallest model that preserves the distinction | Decisive unmeasured assumption and check |
20
+ |---|---|---|---|
21
+ | Reduced presynaptic recruitment -> fewer spikes -> weaker postsynaptic response | Restore the presynaptic spike train and measure transmission | Separate spike generation from efficacy per spike | Recovery of transmission when spikes are restored; test a direct efficacy loss alternative |
22
+ | Reduced transmission per spike -> weaker postsynaptic response | Impose the same presynaptic spike train and measure transmission | Represent efficacy independently from spike generation | Preserved imposed spikes with reduced transmission; allow mixed mechanisms |
23
+
24
+ The example establishes a decision boundary, not a required synaptic model. Choose states, inputs, coupling, and observation mapping that preserve the differences needed for this question. Add biological detail only when omitting it collapses a relevant prediction or invalidates the readout. Keep multiple mechanisms compatible when the evidence permits their coexistence.
25
+
26
+ If no available measurement separates the candidates, state the non-identifiability and identify a new measurement that could. Modeling may still establish conditional sufficiency or a falsifiable prediction; do not promise mechanism identification from indistinguishable observations.
27
+
28
+ ## Check structural distinguishability before large simulations
29
+
30
+ Compare the effective equations, initial State, inputs, parameter changes, and observation mappings for the conditions the experiment distinguishes. If two interventions become identical in all those respects, their predicted distributions are identical by construction. Independent seeds do not restore biological distinguishability.
31
+
32
+ Decide whether that equivalence is the hypothesis being tested or an artifact of the abstraction. If it is intentional, state the limited hypothesis and its conditional prediction; a small witness or analytic argument can suffice. If the original comparison depends on a difference discarded by the agent's design, restore that difference before production. If the difference is excluded by a user-fixed design, report the resulting limit and the adaptation needed to test it. Do not reject a broader mechanism family because one collapsed representation fails a negative control.
33
+
34
+ Use separate regions, cell types, pathways, or kinetics only when they carry a required difference. A prescribed external input can test input withdrawal, but cannot establish the omitted source's dynamics, feedback, or event initiation.
35
+
36
+ ## Test the assumptions that can change the answer
37
+
38
+ Rank unmeasured assumptions by whether a plausible alternative could reverse the headline result or change which mechanism appears supported. Prioritize observation mapping, operating regime, effective intervention strength, and omitted causal routes when they control the comparison; do not give every parameter an equal sweep by default.
39
+
40
+ Use free parameters and controls permitted by the request for these checks. If a decisive assumption is fixed by the user and variation is not authorized, preserve it and state the conditional inference; proposing a sensitivity comparison does not authorize changing the requested run.
41
+
42
+ For each decisive assumption:
43
+
44
+ 1. State the conclusion it enables and a defensible alternative or range. Ground the range in supplied data or literature when available; label an unsupported range exploratory.
45
+
46
+ 2. Choose the smallest informative comparison: change the observation mapping, match effective perturbation, remove a pathway, restore a mediator, or vary the relevant parameter while preserving matched controls.
47
+
48
+ 3. Determine whether the conclusion survives, reverses, or becomes undecidable. Keep failed and unfavorable settings with the tested boundaries.
49
+
50
+ 4. Translate the dependence into a conditional claim and a measurement the researcher could make to resolve it.
51
+
52
+ Use additional seeds for stochastic repeatability and solver checks for numerical reliability. Neither establishes robustness to an untested measurement model or biological assumption. An effect found only near complete functional loss supports a conditional existence claim; it does not establish that a modest experimental perturbation has that effect.
53
+
54
+ For regional or cell-type comparisons, separate differences in circuit response from differences in delivered perturbation. Match measured functional effects when available; otherwise compare both explanations conditionally. Equal nominal dose, construct, or fluorescence does not by itself fix the effective intervention.
55
+
56
+ ## Carry the answer boundary through review and delivery
57
+
58
+ Map each part of the original question to its modeled observable, decisive evidence, substitutions, and unresolved assumptions in the result assessment. Preserve a proxy's name throughout: a reporter change is not automatically a firing change, and population oscillations do not establish a behavioral phenotype.
59
+
60
+ For the leading remaining alternatives, propose a feasible discriminating experiment and state what each plausible outcome would support, weaken, or leave unresolved, including mixed or null results. Prefer a measurement that separates mechanisms over one that repeats their shared prediction. A rescue shared by several causal routes is not, by itself, proof of one route.
61
+
62
+ Keep the comparison, required controls, assumption checks, and conditional claim boundaries in or linked from `NeuroSpecification.md`. Use step 1 for BrainX package/API choices and steps 2-4 for implementation and evidence; include the comparison and its result assessment in step 5.
@@ -0,0 +1,16 @@
1
+ # Couple represented scales
2
+
3
+ Use this reference when separate modeling scales exchange signals during the experiment. Each package owns its model dynamics. The exchange contract defines what crosses the boundary, when it becomes available, and which model consumes it.
4
+
5
+ | Decision | What to record |
6
+ |---|---|
7
+ | Source and target | Name the source observable, target input, physical units, and the model or view owning each State. Record the source-to-target index mapping and preserve independent trial axes. |
8
+ | Clock | Name each integration step, observation window, sampling time, and delay. On different clocks, define the exchange grid, aggregation or hold rule, and the timestamp of the first step that can consume a sample. |
9
+ | Causal order | Specify which input each model reads before it advances and when each model publishes its output. Initialize boundary values explicitly. Keep any simultaneous coupling required by the equations in a joint integration contract. |
10
+ | Execution | Use owning-package orchestration where it supports the exchange. If the two models require an explicit joint step, use BrainState time control flow and keep the boundary State and axes visible. |
11
+
12
+ For a point-neuron population driving a neural mass, count spikes per trial in a declared window and divide by the number of represented neurons and the window duration to get Hz per neuron. Apply the model's input scaling and units to that rate. If the mass feeds back, map the mass observable to the point neurons' declared drive, such as a calibrated current or event rate. A completed window can drive only updates at or after its declared availability time. Match the exchange and hold rules to the scientific delay.
13
+
14
+ Check a small, deterministic input through the full exchange. A known spike count should produce the expected rate and arrive on the first permitted target step. Check the zero-coupling limit against independent models, preserve independent trial State, and compare baseline and intervention under identical clocks and recording windows. Repeat at a finer integration or exchange interval when the inference could depend on discretization.
15
+
16
+ Open `brainspike` → `references/multiscale-composition.md` for the Docker-verified common-clock native point/HH-cell/Hopf-region wrapper, its zero-coupling check, and one-step source-to-target availability. BrainCell 0.2.0 retains a transitive BrainPy runtime dependency; this example replaces application-level APIs, not that dependency.
@@ -0,0 +1,42 @@
1
+ # Paper and author-code reproduction
2
+
3
+ Open during step 0 when a requested result depends on a paper, supplement or author implementation. A reproduction contract binds the scientific protocol and analysis to identified source passages; matching a curve's appearance does not establish that contract.
4
+
5
+ ## Reconcile the sources
6
+
7
+ Inspect the requested publication version, relevant supplement and named author code before treating their settings as interchangeable. Use `bio-neuro-lit` → `references/required-supplements.md` when a required original artifact is missing from the default reader.
8
+
9
+ Record only scientific fields that affect the requested result:
10
+
11
+ | Field | Record |
12
+ |---|---|
13
+ | Model and protocol | Equations, units, parameter distributions, interventions, initial conditions and time averaging, with source page/equation or code location. |
14
+ | Observable | Measured activity, feedforward proxy, transformed signal or analytic prediction; retain the actual observable's name. |
15
+ | Analysis | Formula, bins, windows, reductions, normalization and exclusions, with the authoritative definition. |
16
+ | Control | The exact manipulated quantities and unchanged matched quantities; distinguish a different mechanism from a nearby parameter value. |
17
+ | Conflict or omission | Each source's value, any figure-specific override, the user's authority preference and the remaining interpretation limit. |
18
+
19
+ Honor an explicit user choice of author code or publication as authority. Apply a panel-specific setting within that panel's scope; do not silently substitute a generic Methods default. If unresolved source conflicts affect the answer, use step 0's existing clarification/delegation rule or narrow the claim. Do not combine favorable settings from different sources and call the mixture the original protocol. A stated range does not identify its sampling distribution.
20
+
21
+ ## Lock the analysis contract
22
+
23
+ Before inspecting intervention results, include these details in or link them from `NeuroSpecification.md`:
24
+
25
+ | Decision | Required distinction |
26
+ |---|---|
27
+ | Samples and axes | Directed versus undirected pairs, self-exclusion, trial/subject/seed identity and the independent replication unit. |
28
+ | Binning and windows | Edges, centers, endpoint inclusion, correlation/feature windows versus temporal windows, and minimum occupancy. |
29
+ | Reductions and regression | Mean of bin means versus pooled-sample mean; regression inputs, intercept and weights. |
30
+ | Normalization | Formula, full comparison-set membership, seed/method pooling, denominator scope and degenerate-denominator handling. |
31
+ | Missingness | Invalid samples, empty bins, unavailable components, propagation into scores and any declared imputation. |
32
+ | Claims and acceptance | Published continuous score, each component needed by the claim, and the separate user-defined acceptance predicate, if any. |
33
+
34
+ Label implementation conventions not fixed by the source. Resolve consequential scientific omissions under step 0 rather than attributing agent choices to the paper. Preserve raw observations, counts, component values and normalization denominators so the analysis can be checked independently. Use a small known-input witness for non-obvious bin, axis, reduction or sign behavior.
35
+
36
+ A favorable composite score can coexist with an unfavorable component. Report the components required by the claimed phenomenon; do not infer their signs from the sum or invent an acceptance threshold. Keep a source-incomplete proxy separately named and restrict its conclusions instead of presenting it as the published metric.
37
+
38
+ ## Handle later source corrections
39
+
40
+ Preserve the original specification, outputs, criterion and verdict. Record newly verified source passages before choosing follow-up work. If saved raw observations support the corrected analysis, freeze a separate offline protocol and reanalyze the complete relevant condition set before resimulating; keep outputs and claim scope distinct from the original run.
41
+
42
+ Report old/new differences, including reversals and unavailable results, without selecting a new window, comparison set, seed or parameter from the outcomes. Previously examined evaluation data is not freshly blinded evidence for a revised protocol. New dynamics or missing controls require a separately declared experiment under the existing authorization rule; offline reanalysis does not supply them or authorize a new simulation.
@@ -23,12 +23,12 @@ Parameter recovery represents the interpretation gate. A fitted value may suppor
23
23
  | Need | Required route |
24
24
  |---|---|
25
25
  | Ion, channel, compartment, morphology, or conductance fitting | Open `braincell` for the model and `brainstate` for custom State-aware differentiation. Recreate or reset all cell runtime State for every independent candidate. |
26
- | Point-neuron, synapse, or spiking-network fitting | Open `brainpy-state`. Route custom gradients through `brainstate`; open the BrainPy-State surrogate reference only when gradients must cross a discrete spike operation. |
26
+ | Point-neuron, synapse, or spiking-network fitting | Open `brainspike` → `references/migration-boundary.md`; verify the candidate-reset and parameter-application path. Require gradient evidence before selecting a gradient backend. |
27
27
  | Aggregate population, region, or whole-brain fitting | Open `brainmass`. Prefer `brainmass.Fitter` and its routed fitting reference before building a custom optimizer loop. |
28
28
  | Physical parameters or observations | Open `brainunit`. Preserve quantities through parameter application, simulation, observation, and unit-compatible comparison. |
29
29
  | Constrained parameters or regularization | Open the active package's BrainState parameter reference. Record both the unconstrained optimizer value and constrained physical value. |
30
- | BrainCell input, objective, or optimizer selection | Open `braincell/references/braintools/input-current.md`, `metric.md`, or `optimizer.md` for the operation being selected. |
31
- | BrainPy-State or BrainMass objective or optimizer selection | Open the active package's routed Braintools metric or optimizer reference. Prefer package-owned BrainMass objectives when they express the scientific comparison. |
30
+ | BrainCell input, objective, or optimizer selection | Open `braincell` → `references/braintools/input-current.md`, `braincell` → `references/braintools/metric.md`, or `braincell` → `references/braintools/optimizer.md` for the operation being selected. |
31
+ | BrainSpike or BrainMass objective or optimizer selection | Open the active package's routed Braintools metric or optimizer reference. Prefer package-owned BrainMass objectives when they express the scientific comparison. |
32
32
 
33
33
  Study the selected package skills and their fitting-related examples before implementing. Trace construction, initialization, parameter application, runtime State reset, protocol execution, observation, and reduction end to end.
34
34
 
@@ -74,7 +74,7 @@ Use raw SciPy or another generic optimizer only when no routed BrainTools backen
74
74
  | Route | Pattern to preserve |
75
75
  |---|---|
76
76
  | BrainCell | The HH fitting example constructs and initializes one cell rollout for each unit-bearing conductance and capacitance candidate, evaluates time-major current protocols, scores voltage with Braintools metrics, and batches derivative-free candidates. Preserve candidate independence and unit-bounded search; open the BrainCell Braintools input, metric, and optimizer references and reconcile exact channel and State APIs before adapting it. |
77
- | BrainPy-State | The training examples initialize runtime State at each independent sequence, differentiate only the selected `ParamState` collection, transform the complete loss step, and update parameters outside the temporal loop. Reuse that lifecycle for an inverse objective; task loss itself is not parameter fitting. |
77
+ | BrainSpike | For native graphs, reuse the reset-differentiate-update lifecycle in `brainspike` → `references/native-training.md` and validate the inverse objective. For NEST Simulator candidates, open `brainspike` → `references/simulator-training.md` for the verified continuous-voltage fitting objective, independent initialization, and finite-difference validation. |
78
78
  | BrainMass | The fitting examples prefer `Fitter`, mark fitted values with `brainstate.nn.Param(..., fit=True)`, and fit phase-appropriate observations such as settled amplitude rather than an unaligned oscillatory waveform. Use gradient fitting first and change backends only when the objective requires it. |
79
79
  | Braintools | Gradient optimizers register trainable State and consume matching gradient trees. `ScipyOptimizer` and `NevergradOptimizer` instead own a complete objective and do not use the register/update lifecycle; Nevergrad requires one loss per candidate. |
80
80
 
@@ -239,15 +239,15 @@ Fit observed data only after recovery passes the locked parameter-specific crite
239
239
  | Route | Open when |
240
240
  |---|---|
241
241
  | `parameter-fitting-workflow/scripts/fitting_hh_neuron.py` | Studying the official complete BrainCell HH derivative-free fitting composition: custom channels, unit-bearing bounds, per-candidate cell initialization, time-major rollout, voltage loss, candidate `vmap`, and Nevergrad. Also open the three BrainCell Braintools references below; supply the upstream trace CSVs and reconcile source-version APIs before adapting it. |
242
- | `braincell` -> `references/braintools/input-current.md` | Generating timed current sections, pulses, waveforms, or stochastic stimulation for a cellular fit. |
243
- | `braincell` -> `references/braintools/metric.md` | Selecting standard waveform losses or neuroscience metrics while separating custom observation features. |
244
- | `braincell` -> `references/braintools/optimizer.md` | Selecting gradient optimizers, `ScipyOptimizer`, or `NevergradOptimizer` and checking their lifecycle, unit, and dependency boundaries. |
245
- | `brainmass` -> `references/fitting-with-objectives-api.md` | Selecting `Fitter` interfaces, objectives, callbacks, `FitResult` fields, or gradient versus gradient-free backends. |
246
- | `brainmass` -> `references/scripts/eeg-fitting-with-gradients.py` | Studying a complete phase-insensitive EEG fitting and synthetic-recovery example. |
247
- | `brainmass` -> `references/scripts/gradient-free-fitting.py` | A bounded non-differentiable or black-box BrainMass objective requires Nevergrad or SciPy. |
248
- | `brainstate` -> gradient and parameter references | Differentiating custom BrainCell or BrainPy-State rollouts, selecting parameter State, or applying constraints and regularization. |
249
- | Active model package -> Braintools optimizer reference | Selecting gradient optimizers, schedules, SciPy, Nevergrad, or their distinct lifecycle and unit contracts. |
250
- | Active model package -> Braintools metric reference | Selecting regression, spike-train, spectral, synchronization, FC, or other observation-space metrics. |
242
+ | `braincell` → `references/braintools/input-current.md` | Generating timed current sections, pulses, waveforms, or stochastic stimulation for a cellular fit. |
243
+ | `braincell` → `references/braintools/metric.md` | Selecting standard waveform losses or neuroscience metrics while separating custom observation features. |
244
+ | `braincell` → `references/braintools/optimizer.md` | Selecting gradient optimizers, `ScipyOptimizer`, or `NevergradOptimizer` and checking their lifecycle, unit, and dependency boundaries. |
245
+ | `brainmass` → `references/fitting-with-objectives-api.md` | Selecting `Fitter` interfaces, objectives, callbacks, `FitResult` fields, or gradient versus gradient-free backends. |
246
+ | `brainmass` → `references/scripts/eeg-fitting-with-gradients.py` | Studying a complete phase-insensitive EEG fitting and synthetic-recovery example. |
247
+ | `brainmass` → `references/scripts/gradient-free-fitting.py` | A bounded non-differentiable or black-box BrainMass objective requires Nevergrad or SciPy. |
248
+ | `brainstate` → gradient and parameter references | Differentiating custom BrainCell or BrainSpike rollouts, selecting parameter State, or applying constraints and regularization. |
249
+ | Active model package → Braintools optimizer reference | Selecting gradient optimizers, schedules, SciPy, Nevergrad, or their distinct lifecycle and unit contracts. |
250
+ | Active model package → Braintools metric reference | Selecting regression, spike-train, spectral, synchronization, FC, or other observation-space metrics. |
251
251
 
252
252
  ## Boundaries and common failures
253
253
 
@@ -267,6 +267,6 @@ Fit observed data only after recovery passes the locked parameter-specific crite
267
267
  ## BrainX source patterns
268
268
 
269
269
  - BrainCell HH fitting: `parameter-fitting-workflow/scripts/fitting_hh_neuron.py`, mirrored from `https://github.com/chaobrain/braincell/blob/main/examples/single_compartment/SC01_fitting_a_hh_neuron.py`
270
- - BrainPy-State SNN training lifecycle: `https://brainx.chaobrain.com/brainpy-state/brainpy-style/tutorials/04-train-an-snn.html`
270
+ - Historical BrainPy-State source for the generic training lifecycle (not BrainSpike integration evidence): `https://brainx.chaobrain.com/brainpy-state/brainpy-style/tutorials/04-train-an-snn.html`
271
271
  - BrainMass gradient fitting: `https://brainx.chaobrain.com/brainmass/tutorials/06_fitting_with_gradients.html`
272
272
  - BrainMass gradient-free fitting: `https://brainx.chaobrain.com/brainmass/tutorials/07_gradient_free_fitting.html`
@@ -162,7 +162,7 @@ Use the GPU environment from the preceding section for a CUDA run. Do not rewrit
162
162
 
163
163
  After launch, open `monitor-experiment.md` for liveness, progress, resource health, stopping, retry, collection, and reporting. Pass the run directory and recorded process/scheduler handle. Process completion remains mechanical evidence and never implies scientific acceptance.
164
164
 
165
- Open `skills/package-skills/brainstate/references/simulation-environment.md` only when exact `dt`, `fit`, precision, platform, or isolated-environment behavior needs verification. Open `brainx-install` when the environment is incompatible, and `brainx-acceleration` when OOM, precision, sharding, batching, or performance changes would alter execution semantics.
165
+ Open `brainstate` → `references/simulation-environment.md` only when exact `dt`, `fit`, precision, platform, or isolated-environment behavior needs verification. Open `brainx-install` when the environment is incompatible, and `brainx-acceleration` when OOM, precision, sharding, batching, or performance changes would alter execution semantics.
166
166
 
167
167
  ## Boundaries and common failures
168
168
 
@@ -12,6 +12,8 @@ scientific model parameters against observations. In `hybrid`, keep the two
12
12
  objectives, trainable State collections, data partitions, checkpoints, and
13
13
  reported evidence distinct.
14
14
 
15
+ For point-neuron training, open `brainspike` → `references/native-training.md` for the verified native BPTT or pp-prop path. For NEST continuous-voltage objectives, open `brainspike` → `references/simulator-training.md`; keep its host-side builder and hard-spike-loss limits distinct from native recurrent training.
16
+
15
17
  ## Underlying training principle
16
18
 
17
19
  Training reuses the scientific forward model: reset runtime State at the
@@ -256,15 +258,15 @@ training contract, gates, experiment discipline, and evidence.
256
258
 
257
259
  | Need | Required route |
258
260
  |---|---|
259
- | Large temporal workloads limited by sequence-length-dependent BPTT activation memory | First open the active package's checkpointed-control-flow reference. When ordinary BPTT remains memory-limited and an online eligibility-trace estimator is scientifically acceptable, open `skills/package-skills/braintrace/SKILL.md` and use BrainTrace as the memory-efficient alternative. Its memory is constant only in sequence length and still scales with batch size, participating parameters, hidden dimensions, and estimator choice. |
261
+ | Large temporal workloads limited by sequence-length-dependent BPTT activation memory | First open the active package's checkpointed-control-flow reference. When ordinary BPTT remains memory-limited and an online eligibility-trace estimator is scientifically acceptable, open `braintrace` → `SKILL.md` and use BrainTrace as the memory-efficient alternative. Its memory is constant only in sequence length and still scales with batch size, participating parameters, hidden dimensions, and estimator choice. |
260
262
 
261
263
  ### Choose Braintools training components
262
264
 
263
- | Decision | BrainPy-State route | BrainMass route |
265
+ | Decision | BrainSpike route | BrainMass route |
264
266
  |---|---|---|
265
- | Loss or neuroscience metric | `skills/package-skills/brainpy-state/references/braintools/metric.md` | `skills/package-skills/brainmass/references/braintools/metric.md` |
266
- | Optimizer, scheduler, clipping, or update lifecycle | `skills/package-skills/brainpy-state/references/braintools/optimizer.md` | `skills/package-skills/brainmass/references/braintools/optimizer.md` |
267
- | Parameter initialization | `skills/package-skills/brainpy-state/references/braintools/parameter-initializer.md` | `skills/package-skills/brainmass/references/braintools/parameter-initializer.md` |
268
- | Input encoding | `skills/package-skills/brainpy-state/references/braintools/data-preprocessing.md` | `skills/package-skills/brainmass/references/braintools/data-preprocessing.md` |
269
- | Hard-spike backward derivative | `skills/package-skills/brainpy-state/references/braintools/surrogate.md` | `skills/package-skills/brainmass/references/braintools/surrogate.md` |
270
- | Phase-structured cognitive trials | Open the shared `skills/package-skills/brainmass/references/braintools/cogtask.md`, then preserve the BrainPy-State model's time-major input contract. | `skills/package-skills/brainmass/references/braintools/cogtask.md` |
267
+ | Loss or neuroscience metric | `brainspike` → `references/braintools/metric.md` | `brainmass` → `references/braintools/metric.md` |
268
+ | Optimizer, scheduler, clipping, or update lifecycle | `brainspike` → `references/braintools/optimizer.md` | `brainmass` → `references/braintools/optimizer.md` |
269
+ | Parameter initialization | `brainspike` → `references/braintools/parameter-initializer.md` | `brainmass` → `references/braintools/parameter-initializer.md` |
270
+ | Input encoding | `brainspike` → `references/braintools/data-preprocessing.md` | `brainmass` → `references/braintools/data-preprocessing.md` |
271
+ | Hard-spike backward derivative | `brainspike` → `references/braintools/surrogate.md` | `brainmass` → `references/braintools/surrogate.md` |
272
+ | Phase-structured cognitive trials | Open the shared `brainmass` → `references/braintools/cogtask.md`, then preserve the BrainSpike model's time-major input contract. | `brainmass` → `references/braintools/cogtask.md` |
@@ -132,6 +132,10 @@ Create or update `FIGURE_MANIFEST.md` with one entry per figure:
132
132
  - Render and source-value checks:
133
133
  ```
134
134
 
135
+ ## Explain the figures
136
+
137
+ Write each figure's explanation beside the figure in the research report, or in the accompanying response for a standalone visualization request. Name the plotted quantity, axes and units, compared conditions, and meaning of uncertainty; explain the main pattern and the conclusion it supports. State transformations such as normalization or smoothing when they affect interpretation. Distinguish observed data from model predictions, retain the name of any proxy, and state the assumptions or unresolved alternatives that limit interpretation. Adapt technical detail to the researcher's prompt.
138
+
135
139
  ## Reference routing
136
140
 
137
141
  | Route | Open when | Contains |
@@ -139,8 +143,8 @@ Create or update `FIGURE_MANIFEST.md` with one entry per figure:
139
143
  | `references/neural-data-visualization.md` | Selecting neural event, activity, connectivity, dynamical, topology, tuning, spatial, or general 3D figures. | Data contracts, family selection, concrete BrainTools helpers, 3D boundaries, workflows, and comparison rules. |
140
144
  | `references/statistical-and-model-visualization.md` | Inspecting distributions or assumptions, comparing groups, diagnosing regression, or evaluating classification and learning behavior. | Statistical helper selection, raw-data and uncertainty rules, residual diagnostics, ROC-versus-precision-recall decisions, and learning-curve interpretation. |
141
145
  | `references/interactive-and-visualization-styling.md` | Adding interactive exploration, dashboards, styles, palettes, colormaps, export, or animation. | Plotly return behavior, stable encodings, scoped Matplotlib styles, output decisions, animation data contracts, and performance boundaries. |
142
- | `skills/package-skills/braincell/references/multicompartment/topology-building-and-visualization.md` | Visualizing BrainCell morphology branches, CVs, runtime nodes, selector placement, topology layouts, or node and mechanism values. | Branch/CV/node decisions, initialization, physical-versus-topological views, selector coverage, value coloring, and canonical compositions. |
143
- | `skills/package-skills/brainmass/references/visualization-analysis-api.md` | Computing or plotting BrainMass trajectories, phase portraits, connectivity, FC/FCD, or spectra. | `brainmass.viz`, BrainTools metric selection, time-major and sampling rules, unit boundaries, canonical analysis, and failures. |
146
+ | `braincell` → `references/multicompartment/topology-building-and-visualization.md` | Visualizing BrainCell morphology branches, CVs, runtime nodes, selector placement, topology layouts, or node and mechanism values. | Branch/CV/node decisions, initialization, physical-versus-topological views, selector coverage, value coloring, and canonical compositions. |
147
+ | `brainmass` → `references/visualization-analysis-api.md` | Computing or plotting BrainMass trajectories, phase portraits, connectivity, FC/FCD, or spectra. | `brainmass.viz`, BrainTools metric selection, time-major and sampling rules, unit boundaries, canonical analysis, and failures. |
144
148
 
145
149
  ## Boundaries and common failures
146
150
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Use this reference for general neural events, activity, connectivity, low-dimensional dynamics, stimulus response, topology, and spatial 3D data. Preserve the active BrainX package's variable meanings, units, ordering, and recording interval.
6
6
 
7
- Route BrainCell morphology, compartments, runtime nodes, selector placement, or mechanism values directly to `skills/package-skills/braincell/references/multicompartment/topology-building-and-visualization.md`. Route BrainMass-owned trajectories, phase portraits, connectivity, FC/FCD, or spectra directly to `skills/package-skills/brainmass/references/visualization-analysis-api.md`.
7
+ Route BrainCell morphology, compartments, runtime nodes, selector placement, or mechanism values directly to `braincell` → `references/multicompartment/topology-building-and-visualization.md`. Route BrainMass-owned trajectories, phase portraits, connectivity, FC/FCD, or spectra directly to `brainmass` → `references/visualization-analysis-api.md`.
8
8
 
9
9
  ## Choose the neural family
10
10