marinaedutlan 0.6.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Manuel Fernando Caro Piñeres | Cristian Miguel Peñata Andrades
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,505 @@
1
+ <div align="center">
2
+ <img width="1200" height="475" alt="Marina Banner" src="./assets/marina.png" />
3
+ </div>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/marina"><img src="https://img.shields.io/npm/v/marina?color=teal&label=npm" alt="npm version"></a>
7
+ <a href="https://pypi.org/project/marina"><img src="https://img.shields.io/pypi/v/marina?color=teal&label=pypi" alt="PyPI version"></a>
8
+ <a href="https://github.com/cristianmi24/Marina/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
9
+ <a href="https://github.com/cristianmi24/Marina"><img src="https://img.shields.io/github/stars/cristianmi24/Marina?style=social" alt="GitHub stars"></a>
10
+ </p>
11
+
12
+ # Marina
13
+
14
+ **A unified, extensible metacognitive system — downloadable via npm and pip, scriptable, and ready for research.**
15
+
16
+ > **v0.5.0 (Beta)** — Marina implements key elements of the CARINA 12 bio-inspired metacognitive cognitive architecture (BIMCA). It provides a single integrated core (`MarinaAgent`) combining:
17
+ > - **DMA** (Dendritic Metacognitive Architecture): biophysical stability-plasticity primitives.
18
+ > - **Meta-DNA**: regulatory "genome" with Model of the Self, pathways, epigenetic traces (χ), and Algorithm 1 approximation with overhead and modulation.
19
+ > - **MCP** (Metacognitive Control Plane): decision-theoretic executive with rich actions.
20
+ > - **Pluggable Task Substrate**: Working Memory (multi-buffer with load and focus modulation), Episodic Memory (with DMA engrams), Semantic Memory (activation + spreading simulation), Procedural Memory (utilities + conflict resolution). Retrieval bias is pre-computed and influences action selection from the first step.
21
+
22
+ Marina is designed for researchers to **run, inspect, reproduce, and extend** experiments with memory-modulated decisions, regulatory overhead, and custom environments. The TypeScript core is the reference implementation for paper fidelity; the Python package provides convenient parity for scripting and teaching.
23
+
24
+ **One install. One core. Multiple interfaces (CLI, Python, JS, full web lab from source).**
25
+
26
+ ---
27
+
28
+ ## 1. Qué es Marina / What is Marina
29
+
30
+ Marina is **not** a collection of independent tabs or demos.
31
+
32
+ It is one downloadable system whose heart is `MarinaAgent`:
33
+
34
+ - **DMA** (Dendritic Metacognitive Architecture): biophysically-grounded stability-plasticity via apical HCN channels. Real reversal recovery dynamics (<10 steps in paper-aligned regimes).
35
+ - **Meta-DNA**: GRN-inspired regulatory layer. Model of the Self (u,l,p,e,z), transcription factors, meta-genes, co-expressed pathways, and persistent epigenetic traces (χ) — the "cognitive development" mechanism.
36
+ - **MCP** (Metacognitive Control Plane): 1-step lookahead EU with 5+ meta-actions, risk/uncertainty/cost calibration.
37
+
38
+ Cross-layer effects are real (active pathways modulate DMA tauM and MCP risk; DMA deltas feed MoS uncertainty). The UI tabs are high-fidelity scientific visualizations that can be driven from the single unified core (see "Sync to Tabs").
39
+
40
+ **Goal for 1.0**: professional CLI + excellent onboarding + unmistakable "I am using one system" feeling.
41
+
42
+ ---
43
+
44
+ ## Installation
45
+
46
+ ### npm (recommended for research fidelity and full features)
47
+
48
+ The npm package provides the canonical TypeScript implementation (reference for paper fidelity, full biophysical dynamics, and complete cross-layer modulation).
49
+
50
+ ```bash
51
+ # Global install (recommended for CLI)
52
+ npm install -g marina
53
+
54
+ # Or local / one-off
55
+ npx marina
56
+ ```
57
+
58
+ **Requirements**: Node.js >= 18.
59
+
60
+ After installation, `marina` (or `npx marina`) launches a professional welcome banner, runs a quick 40-step integrated episode using the unified `MarinaAgent`, and displays a boxed summary with key metrics (uncertainty, performance, active pathways, DMA/MCP state, substrate metrics, last retrieval bias, etc.).
61
+
62
+ ### PyPI (Python package — convenient scripting and teaching)
63
+
64
+ The Python package (`pip install marina`) provides a usable implementation of the same `MarinaAgent` core, including the pluggable Task substrate, pre-computed retrieval bias, `evaluate`/`runOnTask`, self-audit, and exposure of internal state (`lastRetrievalBias`, `lastProposedAction`, etc.). It is ideal for quick experiments, teaching, and environments where Node is not preferred.
65
+
66
+ ```bash
67
+ pip install marina
68
+
69
+ # Run a 100-step episode
70
+ marina
71
+
72
+ # Or programmatic
73
+ python -c "
74
+ from marina.core import MarinaAgent
75
+ agent = MarinaAgent()
76
+ agent.run_episode(100)
77
+ print(agent.get_summary())
78
+ "
79
+ ```
80
+
81
+ **Requirements**: Python >= 3.9 + `click`.
82
+
83
+ **Fidelity note**: Both the npm and PyPI packages now deliver a high-fidelity implementation of the same unified `MarinaAgent` (DMA + Meta-DNA + MCP + rich cognitive substrate with pre-computed retrieval bias, Algorithm 1 regulation, pluggable Task, and persistence). The TypeScript version is the primary reference for the most precise biophysical constants and paper-aligned numbers. The Python version provides full practical parity for experiments, custom Tasks, profiles, and research use.
84
+
85
+ ### Full scientific web laboratory (from source)
86
+
87
+ For the complete interactive lab (high-fidelity layer visualizations, "Sync to Tabs", paper browser, Gemini Mirror Test, episode results with rich metrics):
88
+
89
+ ```bash
90
+ git clone https://github.com/cristianmi24/Marina.git
91
+ cd Marina
92
+ npm install
93
+ npm run dev
94
+ ```
95
+
96
+ The published packages intentionally ship only the lightweight core + CLI (no heavy UI assets) to keep distribution small and focused on the unified agent.
97
+
98
+ **Optional**: `GEMINI_API_KEY` for live Mirror Test queries in the full lab.
99
+
100
+ ---
101
+
102
+ ## Quick Start
103
+
104
+ ### CLI (immediate value)
105
+
106
+ ```bash
107
+ marina
108
+ # or
109
+ marina run --steps 120
110
+ marina run --steps 80 --json
111
+ ```
112
+
113
+ You will see a professional banner, a real integrated episode using `MarinaAgent`, and a clean summary including:
114
+ - Core states (uncertainty, performance, satisfaction, active pathways)
115
+ - DMA (gHCN, tauM, beta)
116
+ - MCP (quality, risk)
117
+ - Substrate metrics (WM load, episodic engrams, semantic activation, procedural productions)
118
+ - **lastRetrievalBias** and **lastProposedAction** (how memory influenced the decision)
119
+ - Self-audit problems and epistemic utility
120
+
121
+ ### Programmatic Usage
122
+
123
+ **Python**
124
+
125
+ ```python
126
+ from marina.core import MarinaAgent
127
+
128
+ agent = MarinaAgent(backend="Planner")
129
+ agent.run_episode(150)
130
+ print(agent.get_summary())
131
+ # Includes: taskType, lastRetrievalBias, lastProposedAction, semanticAvgActivation, etc.
132
+ ```
133
+
134
+ **JavaScript / TypeScript (canonical reference)**
135
+
136
+ ```js
137
+ import { MarinaAgent } from "marina/core";
138
+
139
+ const agent = new MarinaAgent("Planner");
140
+ agent.runEpisode(150);
141
+ console.log(agent.getSummary());
142
+ ```
143
+
144
+ Headless/scripting use is recommended for research and reproducible experiments.
145
+
146
+ ---
147
+
148
+ ## Features (aligned with CARINA 12 vision)
149
+
150
+ Marina provides a **runnable, extensible seed** of a bio-inspired metacognitive cognitive architecture:
151
+
152
+ - **Unified Core** (`MarinaAgent`): DMA + Meta-DNA (Model of the Self, pathways, epigenetic traces χ, Algorithm 1 approximation with overhead and direct modulation of WM/productions) + MCP.
153
+ - **Pluggable Task Substrate**:
154
+ - Working Memory: multi-buffer (Goal/Retrieval/Perceptual/Motor/Imaginal) with load signals and pathway-driven focus modulation.
155
+ - Episodic Memory: DMA engrams + retrieval/use/consolidate + metamemory.
156
+ - Semantic Memory: activation + spreading simulation (outcome/delta similarity + recency).
157
+ - Procedural Memory: utilities, conflict resolution, firing with effects, Meta-DNA modulation.
158
+ - **Memory-influenced decisions**: Retrieval bias is **pre-computed at the beginning of each step** from semantic and episodic memory and directly biases the action proposed to the Task (exposed as `lastRetrievalBias` and `lastProposedAction`).
159
+ - **Experimentation tools**: `evaluate(task, steps, options)` and `runOnTask(task, steps)` return rich results including self-audit, substrate snapshots, and history.
160
+ - **Self-monitoring**: Enriched IM-Onto-style self-audit (KTP/DRFP/ADTP) and epistemic utility signals.
161
+ - **Persistence**: Epigenetic state (χ traces) for cross-episode "cognitive development".
162
+
163
+ The TypeScript core is the reference implementation for paper fidelity. The Python package provides convenient parity on the extensible features (Task, bias, evaluate, runOnTask, last* fields).
164
+
165
+ ## Academic Context
166
+
167
+ This work follows the **CARINA 12 — Bio-Inspired Metacognitive Cognitive Architecture** plan and related papers on Dendritic Metacognition (DMA) and Meta-DNA regulatory genomes (see `papers/` folder).
168
+
169
+ It demonstrates:
170
+ - A unified substrate + regulatory genome + executive plane.
171
+ - Pre-computed retrieval bias influencing action selection (memory-first decisions).
172
+ - Algorithm 1-style regulation with measurable overhead and modulation of working memory and procedural utilities.
173
+ - Easy custom-task experimentation so researchers can study how memory and regulation affect behavior in their own environments.
174
+
175
+ **Current status (transparent)**: Core architectural elements and practical extensibility are implemented and well integrated. Full classical CA substrate details (rich spreading activation, complete procedural compilation), exact paper Algorithm 1, and comprehensive P1–P4 ablation harnesses remain areas of ongoing/future work.
176
+
177
+ ## Advanced Usage — Custom Tasks & Experiments
178
+
179
+ The pluggable `Task` system is one of Marina’s most powerful practical features.
180
+
181
+ **JavaScript / TypeScript**
182
+
183
+ ```js
184
+ import { MarinaAgent } from "marina/core";
185
+
186
+ const myTask = {
187
+ getOutcome(ctx) {
188
+ // ctx: step, retrievalBias, proposedAction, dmaState, ...
189
+ const base = (ctx.step % 4 === 0 ? 0.75 : 0.35);
190
+ return { reward: base + (ctx.retrievalBias || 0) * 0.9 };
191
+ }
192
+ };
193
+
194
+ const agent = new MarinaAgent("Planner", myTask);
195
+ const result = agent.evaluate(null, 50, { includeHistory: true });
196
+
197
+ console.log("avgOutcome:", result.avgOutcome);
198
+ console.log("lastRetrievalBias:", result.finalSummary.lastRetrievalBias);
199
+ console.log("lastProposedAction:", result.finalSummary.lastProposedAction);
200
+ ```
201
+
202
+ **Python**
203
+
204
+ ```python
205
+ from marina.core import MarinaAgent
206
+
207
+ def my_task(ctx):
208
+ base = 0.75 if ctx["step"] % 4 == 0 else 0.35
209
+ return {"reward": base + ctx.get("retrievalBias", 0) * 0.9}
210
+
211
+ agent = MarinaAgent(task=my_task)
212
+ result = agent.evaluate(steps=50)
213
+
214
+ print(result["avgOutcome"], result["lastRetrievalBias"])
215
+ ```
216
+
217
+ You can also use `agent.runOnTask(my_task, steps=30)` (runs without permanently replacing the agent's task) or `agent.proposeAction()` to query the current procedural recommendation.
218
+
219
+ **Inspecting state**
220
+
221
+ ```python
222
+ s = agent.get_summary()
223
+ print(s["lastRetrievalBias"], s["lastProposedAction"], s["workingMemoryLoad"])
224
+ ```
225
+
226
+ This design makes it straightforward to study how memory pressure, semantic activation, and regulatory overhead shape behavior in your own tasks.
227
+
228
+ ## Limitations (transparent)
229
+
230
+ - Both packages now deliver a high-fidelity implementation of the integrated `MarinaAgent` (full substrate with WM/Episodic/Semantic/Procedural, pre-computed retrieval bias, Algorithm 1 regulation with overhead and modulations, rich MCP dispatch). The TypeScript reference remains the gold standard for the most precise paper constants and edge-case biophysical behavior.
231
+ - Some advanced classical CA details (full production compilation, extremely rich spreading activation in all scenarios) are implemented at a high practical level but remain areas of ongoing refinement per the CARINA12 plan.
232
+ - The full interactive scientific laboratory (Sync to Tabs, advanced visualizations, paper explorer) is available when running from source. The published packages focus on the professional unified core + CLI for easy distribution and experimentation.
233
+ - For the absolute latest research-grade numbers from the papers, the TS core (npm) is recommended; Python provides excellent practical parity for most research, teaching, and custom-task work.
234
+
235
+ ## Building from Source (Full Web Laboratory)
236
+
237
+ ```bash
238
+ git clone https://github.com/cristianmi24/Marina.git
239
+ cd Marina
240
+ npm install
241
+ npm run dev # launches the full web lab
242
+ # or
243
+ npm run build:core # only the distributable core
244
+ ```
245
+
246
+ ## References
247
+
248
+ - CARINA12_IMPLEMENTATION_PLAN.md and related documents in `/papers/`
249
+ - Dendritic Metacognition (DMA) paper
250
+ - Meta-DNA regulatory genome work (BICA)
251
+ - IJCAI MCP / CARINA 11 papers
252
+
253
+ ## Publicación (Publish)
254
+
255
+ ### npm (paquete principal / implementación canónica)
256
+
257
+ ```bash
258
+ # 1. Asegúrate de estar autenticado
259
+ npm login
260
+
261
+ # 2. (Recomendado) Ejecuta el flujo completo de preparación y verificación
262
+ npm run prepublishOnly
263
+
264
+ # 3. Publica
265
+ npm publish
266
+ ```
267
+
268
+ El script `prepublishOnly` se ejecuta automáticamente con `npm publish`, pero es buena práctica ejecutarlo manualmente antes. Realiza:
269
+ - Construcción del core (`build:core`)
270
+ - Limpieza de mapas y pycache
271
+ - Ejecución de todos los tests (Node + Python)
272
+ - Verificación del contenido del paquete (`verify:pack`)
273
+
274
+ ### PyPI (paquete Python)
275
+
276
+ ```bash
277
+ # 1. Instala las herramientas (una sola vez)
278
+ pip install build twine
279
+
280
+ # 2. Construye los artefactos de distribución (wheel + sdist)
281
+ python -m build
282
+
283
+ # 3. (Muy recomendado) Verifica los paquetes localmente
284
+ twine check dist/*
285
+
286
+ # 4. Sube a PyPI (producción)
287
+ twine upload dist/*
288
+
289
+ # Para probar primero en TestPyPI (altamente recomendado la primera vez):
290
+ # twine upload --repository testpypi dist/*
291
+ ```
292
+
293
+ **Notas importantes:**
294
+
295
+ - Actualiza la versión tanto en `package.json` como en `pyproject.toml` **antes** de publicar.
296
+ - `npm publish` dispara automáticamente `prepublishOnly`.
297
+ - Para PyPI se recomienda usar un **API Token** (nunca tu contraseña de cuenta). Configúralo en `~/.pypirc` o con la variable de entorno `TWINE_PASSWORD`.
298
+ - Orden recomendado:
299
+ 1. Publica primero el paquete npm (es la implementación de referencia con mayor fidelidad a los papers).
300
+ 2. Publica después el paquete Python (capa de conveniencia).
301
+
302
+ **Verificación post-publicación:**
303
+
304
+ ```bash
305
+ # npm
306
+ npm view marina version
307
+ npx marina@latest doctor
308
+
309
+ # PyPI
310
+ pip index versions marina
311
+ pip install --upgrade marina
312
+ marina doctor
313
+ ```
314
+
315
+ ## License
316
+
317
+ MIT (see LICENSE). Research use, contributions, and citations of the CARINA line are welcome.
318
+
319
+ For the complete interactive lab:
320
+
321
+ ```bash
322
+ git clone https://github.com/cristianmi24/Marina.git
323
+ cd Marina && npm install && npm run dev
324
+ ```
325
+
326
+ Inside the lab you get the beautiful landing, paper explorer, and the powerful "Unified Core" panel with "Run 100-step Integrated Episode" + "Sync to Tabs" that proves everything is one system.
327
+
328
+ All paths (CLI, Python, JS `import ... from "marina/core"`, and the web lab) execute the **same** MarinaAgent.
329
+
330
+ ---
331
+
332
+ ## 5. CLI
333
+
334
+ ```bash
335
+ marina # rich integrated UI (the full scientific experience)
336
+ marina ui
337
+ marina run 120 # headless 120-step episode on the unified core
338
+ marina run --steps 50 --json
339
+ marina doctor # health checks (Node, core load, GEMINI key)
340
+ marina examples # paper-aligned scenarios + expected behaviors
341
+ marina --help
342
+ ```
343
+
344
+ The CLI (`marina`, `marina run`, `doctor`, `examples`) is the primary professional entry point for the published package. It is lightweight, fast, and scriptable.
345
+
346
+ `marina run` and the Python equivalent exercise the exact same `MarinaAgent` core that powers the JS API and the (source-only) web lab.
347
+
348
+ ### Quick reference
349
+
350
+ | Command | Effect |
351
+ |--------------------------------|---------------------------------------------|
352
+ | `marina` | Full scientific UI + unified core panel |
353
+ | `marina run 120` | Headless 120-step episode (pretty output) |
354
+ | `marina run --steps 50 --json` | Machine-readable (pipelines / notebooks) |
355
+ | `marina doctor` | Health + version + core load checks |
356
+ | `marina examples` | Paper scenarios + expected behaviors |
357
+ | `marina --version` / `-v` | Print version |
358
+ | `python -m marina.cli --doctor`| Same for the pip package |
359
+
360
+ **Troubleshooting (common)**
361
+ - No `marina` command after `npm install -g` → restart terminal / check global bin path.
362
+ - Core load fails in `run` → run `npm run build && npm run build:core` (dev) or reinstall the published package.
363
+ - Mirror Test real queries fail → export `GEMINI_API_KEY=...`
364
+ - Want the absolute latest research visuals? Always prefer the npm package + UI.
365
+
366
+ ---
367
+
368
+ ## 6. API Python
369
+
370
+ ```python
371
+ from marina import MarinaAgent
372
+
373
+ agent = MarinaAgent()
374
+ for _ in range(200):
375
+ agent.step() # or agent.run_episode(200)
376
+
377
+ summary = agent.get_summary()
378
+ state = agent.get_combined_state() # if exposed in your version
379
+ agent.reset()
380
+ ```
381
+
382
+ See `marina/core.py` for the dataclass states (DMAState, MetaDNAState, MCPState) — they mirror the paper models.
383
+
384
+ ---
385
+
386
+ ## 7. API JavaScript / TypeScript
387
+
388
+ ```ts
389
+ import { MarinaAgent } from "marina/core";
390
+
391
+ const agent = new MarinaAgent("Planner");
392
+ agent.step({ dmaManualRegime: 1 });
393
+ const summary = agent.getSummary();
394
+ const full = agent.getCombinedState();
395
+ const snap = agent.serialize(); // epigenetic traces etc.
396
+ agent.deserialize(snap);
397
+ ```
398
+
399
+ The published `dist/core/MarinaAgent.js` is bundled and has no external runtime deps beyond what the simulators need.
400
+
401
+ ---
402
+
403
+ ## 8. Casos de uso / Use Cases
404
+
405
+ - **Research**: Reproduce qualitative claims from the DMA, Meta-DNA (BICA), MCP (IJCAI/CARINA-11), IM-Onto and CMT papers inside one executable system.
406
+ - **Agent engineering**: Add a real metacognitive regulator to LLM wrappers, robotics controllers, or non-stationary bandits.
407
+ - **Education**: Students explore stability-plasticity, gene-regulatory metacognition, and meta-reasoning in one afternoon.
408
+ - **Ablation & reproducibility**: `marina run --json` + seeds in scripts for Monte-Carlo campaigns.
409
+ - **Future (1.0+)**: Epigenetic profiles persisted across sessions, full experiment harness, Mirror Test campaigns against the integrated agent.
410
+
411
+ ---
412
+
413
+ ## 9. Arquitectura / Architecture
414
+
415
+ ```
416
+ User / Script / Notebook
417
+
418
+
419
+ ┌─────────────────────────────────────────────────────────────┐
420
+ │ Interfaces (all point to the same core) │
421
+ │ • CLI (bin/marina.js + Python click) │
422
+ │ • Python: from marina import MarinaAgent │
423
+ │ • JS: import { MarinaAgent } from "marina/core" │
424
+ │ • Web UI (React + the same TS MarinaAgent + visual layers) │
425
+ └─────────────────────────────────────────────────────────────┘
426
+
427
+
428
+ ┌──────────────────────────────────────────────────────────────────┐
429
+ │ MarinaAgent (THE single system heart) │
430
+ │ • step() / runEpisode() / getSummary() / serialize() │
431
+ │ • Composes three high-fidelity layers from the papers: │
432
+ │ 1. DMA (dma_simulator.ts) — HCN, gHCN, tauM, beta, Vb │
433
+ │ 2. MetaDNA (meta_dna_simulator.ts) — MoS 5D, TFs, genes, │
434
+ │ pathways, epigenetic χ traces (persistent "development") │
435
+ │ 3. MCP (mcp_simulator.ts) — EU, 5 meta-actions, Planner/RAG │
436
+ │ • Early cross-layer modulation already active (p_EpistemicVal │
437
+ │ reduces risk; p_TimeMgmt narrows tauM; DMA delta → MoS u) │
438
+ └──────────────────────────────────────────────────────────────────┘
439
+ ▲ rich signals (load, Δq, confidence, gene E(t), gHCN)
440
+
441
+ (future substrate: WM / Episodic with DMA engrams / Procedural)
442
+ ```
443
+
444
+ The old "five independent simulators" are now **views**. The unified episode runner and `Sync to Tabs` button make the "one system" concrete.
445
+
446
+ See:
447
+ - `src/core/MarinaAgent.ts` (reference)
448
+ - `marina/core.py` (Python port)
449
+ - Individual `*_simulator.ts` for exact paper equations.
450
+
451
+ ---
452
+
453
+ ## Current status & limitations (0.5 beta)
454
+
455
+ **What you get today (professional quality for research & education):**
456
+ - One downloadable, scriptable, importable unified core (`MarinaAgent`) with explicit cross-layer modulation (Meta-DNA pathways → DMA/MCP, MCP decisions → regulator) and a minimal substrate seed (episodic traces carrying DMA snapshots).
457
+ - Excellent CLI (`marina run`, `doctor`, `examples`, `--json`, `--save-profile`/`--load-profile`, version) on both npm and pip.
458
+ - Rich web lab with integrated episode runner + automatic sync into layer inspectors. The tabs remain high-fidelity independent inspectors for the individual paper models (valuable for scientific debugging).
459
+ - High paper fidelity on the three layers + honest substrate start. Both packages now provide high-fidelity implementations of the unified core (Python has full practical parity for substrate, bias, regulation and Task extensibility).
460
+
461
+ **Known limitations (being addressed on the path to 1.0):**
462
+ - Cognitive substrate is a strong, usable implementation (full WM buffers, Episodic with DMA engrams, Semantic with spreading, Procedural with modulation). Some deeper classical CA details remain per the CARINA-12 plan.
463
+ - Cross-layer is now structured (explicit applyMetaDNAModulations + MCP feedback) but still lighter than the full regulatory loops described in the BICA/Meta-DNA and CARINA papers.
464
+ - Epigenetic + substrate persistence via serialize/deserialize and new `--save-profile` / `--load-profile` in CLI; full "cognitive development dashboard" UX pending.
465
+ - No built-in campaign/ablation harness yet (scriptable via --json + the core).
466
+ - Python provides a high-fidelity port with the same public API and integrated behavior as the TS reference (see marina/core.py). Use the TS core when you need the most precise paper constants.
467
+ - Ontology explorer and Mirror Test (CMT) remain valuable but architecturally separate tools (not yet driven by the unified core).
468
+ - Some advanced Mirror Test scenarios require a `GEMINI_API_KEY`.
469
+
470
+ We are transparent: 0.5 is the point where a researcher or student can install once and feel they are using **a real unified system**, not a demo collection.
471
+
472
+ **Paper fidelity notes**
473
+ All numeric constants, update rules, and qualitative behaviors (reversal recovery <10 steps for DMA, pathway co-expression logic for Meta-DNA, EU + 5 meta-actions for MCP) are taken directly from the source papers. The `MarinaAgent.step()` / `runEpisode()` loop is the single place where cross-layer modulation happens.
474
+
475
+ ---
476
+
477
+ ## 10. Contribución / Contributing
478
+
479
+ We welcome contributions that increase fidelity, cohesion or professional DX:
480
+
481
+ 1. Fork + branch from `main`.
482
+ 2. Keep paper constants and algorithm structure intact (DMA HCN kinetics, Meta-DNA Algorithm-1 style, MCP 1-step EU).
483
+ 3. Add or improve cross-layer effects only when they have a traceable justification in one of the source papers.
484
+ 4. For UI: new visualizations must be able to consume `MarinaAgent.getCombinedState()`.
485
+ 5. CLI / packaging changes must keep `npm install -g marina && marina` and `pip install marina` working cleanly.
486
+ 6. Run `npm run lint` (and Python equivalent) before PR.
487
+ 7. Update this README and the architecture section when the unified contract changes.
488
+
489
+ **Current status (0.5.0)**: Core unification + professional packaging + CLI + onboarding are the focus. Full cognitive substrate (WM + LTM + DMA engrams), persistence, and large-scale experiment harness are planned for the path to 1.0.
490
+
491
+ Repository: https://github.com/cristianmi24/Marina
492
+
493
+ ---
494
+
495
+ ## License
496
+
497
+ MIT
498
+
499
+ ---
500
+
501
+ **Ready to publish as 0.5.0 beta with good professional quality.**
502
+ The user who does `npm install -g marina && marina` or `pip install marina` now receives a cohesive system, not an assembly of research components.
503
+
504
+ See `MARINA_UNIFIED_IMPLEMENTATION_PLAN.md` for the longer-term roadmap (Phases 2–5: substrate, persistence, reproducibility harness, 1.0 release criteria).
505
+ ```