Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- name: Checkout
Expand Down Expand Up @@ -39,8 +39,18 @@ jobs:
run: |
pytest -q --cov=synapdrive_ai --cov-report=term-missing --cov-report=xml --cov-fail-under=50

- name: Run release validation
run: |
python -m scripts.run_v1_validation --out validation.json

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-xml-py${{ matrix.python-version }}
path: coverage.xml

- name: Upload validation artifact
uses: actions/upload-artifact@v4
with:
name: validation-py${{ matrix.python-version }}
path: validation.json
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ build/
*.egg-info/
.ruff_cache/
.pre-commit-cache/
.coverage
coverage.xml
validation*.json
*.pem
*.key
*.p12
*.pfx
.env
*.evidence.jsonl
*.signature.json
runs.jsonl
18 changes: 18 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Code of Conduct

SynapDrive-AI discussions should remain professional, technical, and respectful.

## Expected behavior

- Critique ideas, evidence, code, and claims rather than people.
- Keep technical disagreements specific and reproducible when possible.
- Respect privacy and do not publish personal, participant, credential, or device data without authorization.
- Correct inaccurate claims when evidence changes.

## Unacceptable behavior

Harassment, discrimination, threats, doxxing, personal attacks, or sustained disruption are not acceptable.

## Enforcement

Project maintainers may remove content or restrict participation when behavior violates this policy.
83 changes: 28 additions & 55 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,44 @@
# Contributing to SynapDrive-AI

Thanks for your interest.

## Project stance
SynapDrive-AI is **simulation-first**. We accept contributions that improve:
- reproducibility (install/run/test)
- safety gating behavior
- telemetry/logging consistency
- modular adapters (optional integrations that do not break the core demo)
- documentation accuracy

We do **not** accept medical/clinical claims.
SynapDrive-AI is simulation-first research software. Contributions are expected to preserve the repository's claim boundaries and fail-closed behavior.

## Development setup

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pre-commit install
pytest -q

Pull Request checklist

Tests pass locally (pytest -q)

Lint passes (ruff check .)

Type check passes (pyright)
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
```

README/docs updated if behavior changes
Run the local quality surface:

No new hard dependencies without discussion

Reporting issues

Please include:

OS + Python version

exact command you ran

traceback/logs
```bash
python -m compileall -q synapdrive_ai core scripts
python -m pytest -q
python -m scripts.run_v1_validation
ruff check .
pyright
```

expected vs actual behavior
## Pull request requirements

- Tests cover every behavioral change, including a negative control when a failure mode matters.
- Unknown, malformed, unqualified, or analysis-only inputs fail closed.
- New decoders do not receive authority merely because they produce a class label.
- Synthetic fixtures are labeled as synthetic and are never described as participant performance.
- Hardware acquisition paths do not invent intent when no decoder is configured.
- Documentation states what is executed and what remains unvalidated.
- No private keys, participant data, device credentials, or generated build artifacts are committed.

---
## Scientific and safety claims

## 2) `CODE_OF_CONDUCT.md` (NEW)
```markdown
# Code of Conduct
Do not submit claims of clinical validity, medical-device safety, participant generalization, safe physical actuation, or real-world BCI performance unless the corresponding external evidence actually exists and is cited separately from repository tests.

We are committed to providing a welcoming, professional environment.
Software tests establish software behavior only.

## Expected behavior
- Be respectful and constructive
- Assume good intent
- Focus on technical issues, not people
- Keep discussions on-topic
## Reporting a defect

## Unacceptable behavior
- Harassment, insults, or personal attacks
- Discrimination or hate speech
- Doxxing or sharing private information
- Sustained disruption of discussions
Include the operating system, Python version, exact command, traceback or logs, expected behavior, actual behavior, and the smallest reproducible input that can be shared safely.

## Enforcement
Project maintainers may remove content, lock threads, or restrict participation
when behavior violates this policy.
For security-sensitive reports, follow `SECURITY.md` rather than opening a public issue with exploit details.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile
# SynapDrive-AI — simulation-first, reproducible runtime container.
# SynapDrive-AI: simulation-first, reproducible runtime container.

FROM python:3.12-slim

Expand All @@ -23,11 +23,12 @@ ARG INSTALL_DEV=false
RUN pip install -r requirements.txt && \
if [ "$INSTALL_DEV" = "true" ]; then pip install -r requirements-dev.txt; fi

# Copy the rest of the repo
# Copy the rest of the repo and install the package so console entry points are available.
COPY . /app
RUN pip install --no-deps .

# Default port used by the web dashboard
EXPOSE 5055

# Default command = show CLI help (safe default)
CMD ["python", "-m", "synapdrive_ai", "-h"]
CMD ["synapdrive-ai", "-h"]
62 changes: 37 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# Makefile — fast, repeatable commands for SynapDrive-AI
# Makefile: repeatable SynapDrive-AI validation and research commands.

PY ?= python

.PHONY: help install install-dev run run-signal dashboard test lint typecheck record replay \
docker-build docker-build-dev docker-run docker-dashboard docker-test
.PHONY: help install install-dev run run-signal dashboard benchmark stress evidence-test \
test test-core lint typecheck quality record replay docker-build docker-build-dev \
docker-run docker-dashboard docker-test

help:
@echo ""
@echo "Targets:"
@echo " make install Install runtime deps"
@echo " make install-dev Install dev deps (ruff/pyright/pytest/pre-commit)"
@echo " make run Run one CLI cycle (text example)"
@echo " make run-signal Run one CLI cycle (signal example)"
@echo " make dashboard Run the Flask dashboard (localhost:5055)"
@echo " make test Run pytest"
@echo "Core:"
@echo " make install Install runtime dependencies"
@echo " make install-dev Install development dependencies"
@echo " make run Run a governed text cycle"
@echo " make run-signal Run an explicit synthetic fixture cycle"
@echo " make dashboard Run the local WSGI dashboard"
@echo " make test Run the complete pytest suite"
@echo " make test-core Run the core test subset"
@echo " make quality Compile + test + validation smoke"
@echo " make lint Run ruff"
@echo " make typecheck Run pyright"
@echo " make record Record a run to runs.jsonl (no-delay)"
@echo " make replay Replay runs.jsonl"
@echo ""
@echo "Docker:"
@echo " make docker-build Build runtime image"
@echo " make docker-build-dev Build dev image (includes dev deps)"
@echo " make docker-run Run CLI in container (text example)"
@echo " make docker-dashboard Run dashboard in container (localhost:5055)"
@echo " make docker-test Run pytest in container"
@echo "Research tools:"
@echo " synapdrive-benchmark DATASET.npz"
@echo " synapdrive-stress --runs 100 --seed 7"
@echo " synapdrive-evidence verify-chain evidence.jsonl"
@echo ""

install:
Expand All @@ -36,41 +35,54 @@ install-dev:
$(PY) -m pip install -e ".[dev]"

run:
$(PY) -m synapdrive_ai --text "move left" --image road
$(PY) -m synapdrive_ai --text "move left" --image road --no-delay

run-signal:
$(PY) -m synapdrive_ai --signal walk
$(PY) -m synapdrive_ai --signal walk --no-delay

dashboard:
$(PY) -m synapdrive_ai.interface.web_dashboard

benchmark:
@echo "Usage: synapdrive-benchmark DATASET.npz [--decoder ensemble]"

stress:
$(PY) -m synapdrive_ai.stress.cli --runs 25 --seed 7

evidence-test:
@echo "Usage: synapdrive-evidence verify-chain evidence.jsonl"

test:
$(PY) -m pytest -q

test-core:
$(PY) -m pytest -q synapdrive_ai/tests --ignore=synapdrive_ai/tests/test_web_dashboard.py

lint:
$(PY) -m ruff check .

typecheck:
$(PY) -m pyright

quality:
$(PY) -m compileall -q synapdrive_ai core scripts
$(PY) -m pytest -q
$(PY) -m scripts.run_v1_validation

record:
$(PY) -m synapdrive_ai --text "move left" --image road --record runs.jsonl --no-delay

replay:
$(PY) -m synapdrive_ai --replay runs.jsonl

# -----------------------
# Docker targets
# -----------------------

docker-build:
docker build -t synapdrive-ai:latest .

docker-build-dev:
docker build --build-arg INSTALL_DEV=true -t synapdrive-ai:dev .

docker-run: docker-build
docker run --rm synapdrive-ai:latest python -m synapdrive_ai --text "move left" --image road
docker run --rm synapdrive-ai:latest python -m synapdrive_ai --text "move left" --no-delay

docker-dashboard: docker-build
docker run --rm -p 5055:5055 synapdrive-ai:latest python -m synapdrive_ai.interface.web_dashboard
Expand Down
Loading
Loading