mirror of
https://github.com/ruvnet/RuView
synced 2026-06-09 10:13:17 +00:00
81cc241b9e
The Rust port at v2/ has been the primary codebase since the rename in #427. The Python implementation at v1/ is no longer the active target; the only load-bearing path is the deterministic proof bundle at v1/data/proof/ (per ADR-011 / ADR-028 witness verification). Move the whole Python tree into archive/v1/ and document the policy in archive/README.md: no new features, bug fixes only when they affect a still-load-bearing path (currently just the proof), CI continues to verify the proof on every push and PR. Path references updated in 26 files via path-pattern sed (only matches v1/<known-child> patterns, never bare v1 or API URLs like /api/v1/). Two double-prefix typos (archive/archive/v1/) caught and hand-fixed in verify-pipeline.yml and ADR-011. Validated: - Python proof verify.py imports cleanly at archive/v1/data/proof/ (numpy/scipy still required; CI installs requirements-lock.txt from archive/v1/ now) - cargo test --workspace --no-default-features → 1,539 passed, 0 failed, 8 ignored (unaffected by Python tree relocation) - ESP32-S3 on COM7 untouched (no firmware paths changed) After-merge: contributors should re-run any local `python v1/...` commands as `python archive/v1/...` (CLAUDE.md and CHANGELOG already updated).
106 lines
3.9 KiB
YAML
106 lines
3.9 KiB
YAML
name: Verify Pipeline Determinism
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, 'claude/**' ]
|
|
paths:
|
|
- 'archive/v1/src/core/**'
|
|
- 'archive/v1/src/hardware/**'
|
|
- 'archive/v1/data/proof/**'
|
|
- '.github/workflows/verify-pipeline.yml'
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
paths:
|
|
- 'archive/v1/src/core/**'
|
|
- 'archive/v1/src/hardware/**'
|
|
- 'archive/v1/data/proof/**'
|
|
- '.github/workflows/verify-pipeline.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
verify-determinism:
|
|
name: Verify Pipeline Determinism
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.11']
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install pinned dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r archive/v1/requirements-lock.txt
|
|
|
|
- name: Verify reference signal is reproducible
|
|
run: |
|
|
echo "=== Regenerating reference signal ==="
|
|
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('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'
|
|
print('Reference signal metadata validated.')
|
|
"
|
|
|
|
- name: Run pipeline verification
|
|
working-directory: v1
|
|
run: |
|
|
echo "=== Running pipeline verification ==="
|
|
python data/proof/verify.py
|
|
echo ""
|
|
echo "Pipeline verification PASSED."
|
|
|
|
- name: Run verification twice to confirm determinism
|
|
working-directory: v1
|
|
run: |
|
|
echo "=== Second run for determinism confirmation ==="
|
|
python data/proof/verify.py
|
|
echo "Determinism confirmed across multiple runs."
|
|
|
|
- name: Check for unseeded np.random in production code
|
|
run: |
|
|
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\." archive/v1/src/ \
|
|
--include="*.py" \
|
|
--exclude-dir="__pycache__" \
|
|
| grep -v "np\.random\.RandomState" \
|
|
| grep -v "np\.random\.seed" \
|
|
| grep -v "np\.random\.default_rng" \
|
|
| grep -v "# placeholder" \
|
|
| grep -v "# mock" \
|
|
| grep -v "# test" \
|
|
|| true)
|
|
|
|
if [ -n "$VIOLATIONS" ]; then
|
|
echo ""
|
|
echo "WARNING: Found potential unseeded np.random usage in production code:"
|
|
echo "$VIOLATIONS"
|
|
echo ""
|
|
echo "Each np.random call should either:"
|
|
echo " 1. Use np.random.RandomState(seed) or np.random.default_rng(seed)"
|
|
echo " 2. Be in a test/mock context (add '# placeholder' comment)"
|
|
echo ""
|
|
# Note: This is a warning, not a failure, because some existing
|
|
# placeholder code in parsers uses np.random for mock data.
|
|
# Once hardware integration is complete, these should be removed.
|
|
echo "WARNING: Review the above usages. Existing parser placeholders are expected."
|
|
else
|
|
echo "No unseeded np.random usage found in production code."
|
|
fi
|