Skip to content

Scope FinalSpark integration + M0 smoke test - #2

Open
m9h wants to merge 1 commit into
mainfrom
feature/finalspark-scope
Open

Scope FinalSpark integration + M0 smoke test#2
m9h wants to merge 1 commit into
mainfrom
feature/finalspark-scope

Conversation

@m9h

@m9h m9h commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Scopes connecting BL-1's closed-loop machinery to live FinalSpark Neuroplatform organoids, and ships the first runnable milestone (M0).

What's here

  • docs/design/finalspark_integration.md — full design/scope.
  • experiments/finalspark_smoke.py — M0, read-only & safe: connect, list electrodes, pull recent spike counts/events, save raster + per-electrode plots. Run inside FinalSpark's env with FINALSPARK_TOKEN.
  • pyproject — optional [finalspark] extra (public np-utils; core neuroplatform is environment-provided).

Key design points

  • Unifying abstraction = rate-coded tick so SimBackend (digital twin) and FinalSparkBackend are interchangeable behind a NeuralBackend Protocol.
  • Three hard constraints drive everything: send_stimparam() is a ~10 s upload → sensory encoding pre-discretized into ≤16 triggers; ~1 Hz polling loop (Trigger.send → 200 ms → read_count()); count-based decoding + mandatory charge balancing.
  • Digital-twin strategy: calibrate the sim to the organoid's baseline and dry-run experiments before booking scarce wetware.
  • Decision: single-organoid (8 electrodes) first; electrode map parameterized for a full MEA later.

CI

Experiment scripts live outside src/bl1 and tests/, so lint/test/quality scope is unaffected (verified locally: ruff + format clean on src/bl1).

Open question for FinalSpark (blocks M1)

Max safe stimulation amplitude/current is unspecified in the docs — must be confirmed before any stimulation milestone.

Milestones M0–M4 tracked in linked issues.

🤖 Generated with Claude Code

Adds the design/scope doc and the first runnable milestone (M0) for
driving BL-1's closed-loop experiments against live FinalSpark organoids,
reusing the existing encode/decode/game/feedback machinery with the
simulator as a dry-run digital twin.

- docs/design/finalspark_integration.md: architecture (NeuralBackend
  Protocol unifying SimBackend + FinalSparkBackend on a rate-coded tick),
  the three hard constraints (10 s stim re-upload -> <=16 trigger bank;
  ~1 Hz polling loop; count-based decoding + charge-balancing safety),
  digital-twin strategy, single-organoid-first decision, milestones M0-M4,
  and risks.
- experiments/finalspark_smoke.py: read-only M0 — connect via
  Experiment(token), list electrodes, pull recent spike counts/events from
  the Spike DB, save raster + per-electrode-count plots. Token via
  FINALSPARK_TOKEN env var; runs inside FinalSpark's environment.
- pyproject: optional [finalspark] extra (public np-utils helpers; core
  neuroplatform is environment-provided, documented inline).

Experiment scripts live outside src/bl1 and tests, so lint/test/quality
CI scope is unaffected (verified locally).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants