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
20 changes: 10 additions & 10 deletions .github/workflows/verify-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on:
push:
branches: [ main, master, 'claude/**' ]
paths:
- 'v1/src/core/**'
- 'v1/src/hardware/**'
- 'v1/data/proof/**'
- 'archive/v1/src/core/**'
- 'archive/v1/src/hardware/**'
- 'archive/v1/data/proof/**'
- '.github/workflows/verify-pipeline.yml'
pull_request:
branches: [ main, master ]
paths:
- 'v1/src/core/**'
- 'v1/src/hardware/**'
- 'v1/data/proof/**'
- 'archive/v1/src/core/**'
- 'archive/v1/src/hardware/**'
- 'archive/v1/data/proof/**'
- '.github/workflows/verify-pipeline.yml'
workflow_dispatch:

Expand All @@ -37,19 +37,19 @@ jobs:
- name: Install pinned dependencies
run: |
python -m pip install --upgrade pip
pip install -r v1/requirements-lock.txt
pip install -r archive/v1/requirements-lock.txt

- name: Verify reference signal is reproducible
run: |
echo "=== Regenerating reference signal ==="
python v1/data/proof/generate_reference_signal.py
python archive/v1/data/proof/generate_reference_signal.py
echo ""
echo "=== Checking data file matches committed version ==="
# The regenerated file should be identical to the committed one
# (We compare the metadata file since data file is large)
python -c "
import json, hashlib
with open('v1/data/proof/sample_csi_meta.json') as f:
with open('archive/v1/data/proof/sample_csi_meta.json') as f:
meta = json.load(f)
assert meta['is_synthetic'] == True, 'Metadata must mark signal as synthetic'
assert meta['numpy_seed'] == 42, 'Seed must be 42'
Expand All @@ -76,7 +76,7 @@ jobs:
echo "=== Scanning for unseeded np.random usage in production code ==="
# Search for np.random calls without a seed in production code
# Exclude test files, proof data generators, and known parser placeholders
VIOLATIONS=$(grep -rn "np\.random\." v1/src/ \
VIOLATIONS=$(grep -rn "np\.random\." archive/v1/src/ \
--include="*.py" \
--exclude-dir="__pycache__" \
| grep -v "np\.random\.RandomState" \
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,15 @@ Major release: complete Rust sensing server, full DensePose training pipeline, R
- `PresenceClassifier` — rule-based 3-state classification (ABSENT / PRESENT_STILL / ACTIVE)
- Cross-receiver agreement scoring for multi-AP confidence boosting
- WebSocket sensing server (`ws_server.py`) broadcasting JSON at 2 Hz
- Deterministic CSI proof bundles for reproducible verification (`v1/data/proof/`)
- Deterministic CSI proof bundles for reproducible verification (`archive/v1/data/proof/`)
- Commodity sensing unit tests (`b391638`)

### Changed
- Rust hardware adapters now return explicit errors instead of silent empty data (`6e0e539`)

### Fixed
- Review fixes for end-to-end training pipeline (`45f0304`)
- Dockerfile paths updated from `src/` to `v1/src/` (`7872987`)
- Dockerfile paths updated from `src/` to `archive/v1/src/` (`7872987`)
- IoT profile installer instructions updated for aggregator CLI (`f460097`)
- `process.env` reference removed from browser ES module (`e320bc9`)

Expand Down
22 changes: 11 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ cargo test --workspace --no-default-features
cargo check -p wifi-densepose-train --no-default-features

# Python — deterministic proof verification (SHA-256)
python v1/data/proof/verify.py
python archive/v1/data/proof/verify.py

# Python — test suite
cd v1 && python -m pytest tests/ -x -q
cd archive/v1 && python -m pytest tests/ -x -q
```

### ESP32 Firmware Build (Windows — Python subprocess required)
Expand Down Expand Up @@ -156,7 +156,7 @@ cargo test --workspace --no-default-features

# 2. Python proof — must print VERDICT: PASS
cd ..
python v1/data/proof/verify.py
python archive/v1/data/proof/verify.py

# 3. Generate witness bundle (includes both above + firmware hashes)
bash scripts/generate-witness-bundle.sh
Expand All @@ -169,8 +169,8 @@ bash VERIFY.sh
**If the Python proof hash changes** (e.g., numpy/scipy version update):
```bash
# Regenerate the expected hash, then verify it passes
python v1/data/proof/verify.py --generate-hash
python v1/data/proof/verify.py
python archive/v1/data/proof/verify.py --generate-hash
python archive/v1/data/proof/verify.py
```

**Witness bundle contents** (`dist/witness-bundle-ADR028-<sha>.tar.gz`):
Expand All @@ -183,9 +183,9 @@ python v1/data/proof/verify.py
- `VERIFY.sh` — One-command self-verification for recipients

**Key proof artifacts:**
- `v1/data/proof/verify.py` — Trust Kill Switch: feeds reference signal through production pipeline, hashes output
- `v1/data/proof/expected_features.sha256` — Published expected hash
- `v1/data/proof/sample_csi_data.json` — 1,000 synthetic CSI frames (seed=42)
- `archive/v1/data/proof/verify.py` — Trust Kill Switch: feeds reference signal through production pipeline, hashes output
- `archive/v1/data/proof/expected_features.sha256` — Published expected hash
- `archive/v1/data/proof/sample_csi_data.json` — 1,000 synthetic CSI frames (seed=42)
- `docs/WITNESS-LOG-028.md` — 11-step reproducible verification procedure
- `docs/adr/ADR-028-esp32-capability-audit.md` — Complete audit record

Expand Down Expand Up @@ -216,8 +216,8 @@ Active feature branch: `ruvsense-full-implementation` (PR #77)
- `v2/crates/wifi-densepose-ruvector/src/viewpoint/` — Cross-viewpoint fusion (5 files)
- `v2/crates/wifi-densepose-hardware/src/esp32/` — ESP32 TDM protocol
- `firmware/esp32-csi-node/main/` — ESP32 C firmware (channel hopping, NVS config, TDM)
- `v1/src/` — Python source (core, hardware, services, api)
- `v1/data/proof/` — Deterministic CSI proof bundles
- `archive/v1/src/` — Python source (core, hardware, services, api)
- `archive/v1/data/proof/` — Deterministic CSI proof bundles
- `.claude-flow/` — Claude Flow coordination state (committed for team sharing)
- `.claude/` — Claude Code settings, agents, memory (committed for team sharing)

Expand All @@ -243,7 +243,7 @@ Active feature branch: `ruvsense-full-implementation` (PR #77)
Before merging any PR, verify each item applies and is addressed:

1. **Rust tests pass** — `cargo test --workspace --no-default-features` (1,031+ passed, 0 failed)
2. **Python proof passes** — `python v1/data/proof/verify.py` (VERDICT: PASS)
2. **Python proof passes** — `python archive/v1/data/proof/verify.py` (VERDICT: PASS)
3. **README.md** — Update platform tables, crate descriptions, hardware tables, feature summaries if scope changed
4. **CLAUDE.md** — Update crate table, ADR list, module tables, version if scope changed
5. **CHANGELOG.md** — Add entry under `[Unreleased]` with what was added/fixed/changed
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ node scripts/mincut-person-counter.js --port 5006 # Correct person counting
> | **Research NIC** | Intel 5300 / Atheros AR9580 | ~$50-100 | Yes | Full CSI with 3x3 MIMO |
> | **Any WiFi** | Windows, macOS, or Linux laptop | $0 | No | RSSI-only: coarse presence and motion |
>
> No hardware? Verify the signal processing pipeline with the deterministic reference signal: `python v1/data/proof/verify.py`
> No hardware? Verify the signal processing pipeline with the deterministic reference signal: `python archive/v1/data/proof/verify.py`
>
---

Expand Down Expand Up @@ -1171,7 +1171,7 @@ Bundle verify: 7/7 checks PASS
cd v2 && cargo test --workspace --no-default-features

# Run the deterministic proof
python v1/data/proof/verify.py
python archive/v1/data/proof/verify.py

# Generate + verify the witness bundle
bash scripts/generate-witness-bundle.sh
Expand Down Expand Up @@ -2164,7 +2164,7 @@ cargo test -p wifi-densepose-sensing-server
./target/release/sensing-server --benchmark

# Python tests
python -m pytest v1/tests/ -v
python -m pytest archive/v1/tests/ -v

# Pipeline verification (no hardware needed)
./verify
Expand Down
74 changes: 74 additions & 0 deletions archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Archive

Frozen, no-longer-active components of RuView preserved for historical
reference, reproducibility, and load-bearing legacy paths the active
codebase still depends on.

## What lives here

| Path | What it is | Why it's archived | Still load-bearing? |
|------|------------|-------------------|---------------------|
| `v1/` | Original Python implementation of RuView (CSI processing, hardware adapters, services, FastAPI) | Superseded by the Rust workspace at `v2/`; ~810× slower in benchmarks. Kept rather than deleted because the deterministic proof bundle (`v1/data/proof/`) is part of the pre-merge witness verification process per ADR-011 / ADR-028. | **Yes — for the proof bundle only.** Active code lives in `v2/`. |

## What "archived" means

- **Do not add new features here.** New work goes in `v2/`.
- **Do not refactor or modernize the archived code beyond what is
strictly necessary** to keep the load-bearing paths working. The
Python proof bundle is intentionally frozen so that its SHA-256
reproducibility holds across releases (per ADR-028's witness
verification requirement).
- **Bug fixes inside archived code are allowed** when the bug affects a
still-load-bearing path (currently: only the Python proof). All
other "bugs" in archived code are out-of-scope — they are part of
the historical record and any fix would unnecessarily churn the
witness hashes.
- **CI continues to verify the load-bearing paths.**
`.github/workflows/verify-pipeline.yml` runs the Python proof on
every push and PR; if you change anything inside `archive/v1/src/`
or `archive/v1/data/proof/`, expect the determinism check to flag
it.

## Quick reference for the load-bearing paths

```bash
# Run the deterministic Python proof (must print VERDICT: PASS)
python archive/v1/data/proof/verify.py

# Regenerate the expected hash (only if numpy/scipy version legitimately changed)
python archive/v1/data/proof/verify.py --generate-hash

# Run the full Python test suite (legacy, still maintained)
cd archive/v1&& python -m pytest tests/ -x -q
```

## Why we keep `v1/` rather than delete it

1. **Trust kill-switch.** The proof at `v1/data/proof/verify.py` feeds
a known reference signal through the full pipeline and hashes the
output. If the active code's behavior drifts, the hash changes and
CI fails. This is what stops accidental regression in the science
layer of the codebase.

2. **Witness verification.** ADR-028's witness-bundle process bundles
the proof, the rust workspace test results, and firmware hashes
into a tarball recipients can self-verify. Removing v1 would break
that chain.

3. **Historical reference.** ADR-011 documents the "no mocks in
production code" decision; the original violations and their fixes
live in this Python codebase. The ADRs reference these paths.

If the time comes to retire the proof bundle (e.g., a Rust port of
the proof exists and the Python version is no longer canonical), the
right move is a single follow-up that simultaneously: ports the
witness-bundle process, updates `verify-pipeline.yml`, and either
deletes `archive/v1/` or moves it to a separate read-only repository.
That decision belongs in its own ADR.

## See also

- `docs/adr/ADR-011-python-proof-of-reality-mock-elimination.md`
- `docs/adr/ADR-028-esp32-capability-audit.md`
- `archive/v1/data/proof/README.md` (if present)
- `docs/WITNESS-LOG-028.md`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/Dockerfile.python
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY v1/requirements-lock.txt /app/requirements.txt
COPY archive/v1/requirements-lock.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir websockets uvicorn fastapi

# Copy application code
COPY v1/ /app/v1/
COPY archive/v1/ /app/v1/
COPY ui/ /app/ui/

# Copy sensing modules
COPY v1/src/sensing/ /app/v1/src/sensing/
COPY archive/v1/src/sensing/ /app/v1/src/sensing/

EXPOSE 8765
EXPOSE 8080
Expand Down
2 changes: 1 addition & 1 deletion docs/WITNESS-LOG-028.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ cargo test -p wifi-densepose-train --no-default-features
### Step 9: Verify Python Proof System

```bash
python v1/data/proof/verify.py
python archive/v1/data/proof/verify.py
```

**Expected:** PASS (hash `8c0680d7...` matches `expected_features.sha256`).
Expand Down
Loading
Loading