Commit graph

33 commits

Author SHA1 Message Date
475f6319ea chore(repo): push local 768-commit branch state onto clean remote baseline
This squashes all local history (768 commits) onto the scrubbed PR #90
baseline. Individual commits were lost during filter-repo corruption;
the working tree content is preserved intact.

Build: N/A (working tree state only)
2026-06-15 22:46:50 -05:00
Devin AI
0639eae30a chore(consolidation): integrate E8Sidon stack (PRs #79 #80 #81 #89) into one PR
Squash the four overlapping feature branches into a single change set against
main, eliminating cross-PR merge conflicts and the duplicated CI-fix scripts.

What this brings in (merge order #79 -> #80 -> #81 -> #89):
- #79 refactor(infra): shared utilities (4-Infrastructure/lib/*: q16, hashing,
  jsonl, fraction_utils) + the scripts/math-first/* validators that the
  math-check CI requires.
- #80 feat(lean): Semantics.E8Sidon (1025 lines) -- Eisenstein coefficient
  identity E4^2 = E8 and the Sidon framework. E4_sq_eq_E8_coeff is fully proved
  (all Fourier-coefficient extraction machine-checked); the single residual gap
  is pinned to E4_sq_eq_E8_qExpansion (Mathlib lacks the valence formula /
  dim M8 = 1). 4 sorries + 1 axiom (e8_additive_completeness), all TODO(lean-port).
- #81 refactor(lean): Float-free FixedPoint core (integer-only sqrt/log2/expNeg).
  E8Sidon.lean kept at #80's final 1025-line version (the #81 intermediate
  438-line copy was overridden by merge order).
- #89 feat(lean): Semantics.RRC.PolyFactorIdentity -- short-sleeve polynomial
  detection at the zerocopy limb boundary; now imports Semantics.E8Sidon for
  sigma3/sigma7/convolutionLHS (single source of truth) instead of inlining them.

Conflict resolution:
- flake.nix -> canonical rs-surface removal (Garnix shutdown).
- scripts/math-first/* -> byte-identical across branches, clean.
- .cursorrules / AGENTS.md -> unified; baselines + sorry inventory refreshed.

Verification:
- lake build (default aggregator): 3573 jobs, 0 errors.
- lake build Semantics.RRC.PolyFactorIdentity (E8Sidon + FixedPoint + PolyFactor):
  3655 jobs, 0 errors. Witnesses verified (sigma7 4 = 16513, convolutionLHS 6 = 2350).
- Python tests: 68/68 pass.

Note: the "Workers Builds: researchstack" check is a preexisting external
Cloudflare build unrelated to this change (no branch touches 4-Infrastructure/cloudflare/).

Build: 3573 jobs (default), 3655 jobs (narrow), 0 errors
Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>
2026-06-16 02:01:31 +00:00
devin-ai-integration[bot]
43d5b2cdf6 fix(security): remove hardcoded secrets, patch command injection, tighten CORS and Cypher guard (#76)
* fix(security): remove hardcoded secrets, patch command injection, tighten CORS and Cypher guard

- run_import_workflow.py, run_multi_import.py: replace hardcoded budget
  password with BUDGET_PASSWORD env-var (fail-fast if unset)
- server.js /ingest: replace shell-interpolated exec() with execFile()
  so user-controlled title/body cannot inject shell commands
- authentik-values.yaml: blank out bootstrap_password and bootstrap_token
  so they must be supplied at deploy time via --set or sealed-secret
- cluster-dashboard main.py: restrict CORS from allow_origins=["*"] to
  env-configurable whitelist (default: dashboard.researchstack.info),
  methods to GET, headers to Authorization+Content-Type
- neo4j_obsidian_connector_router.js (both copies): replace permissive
  prefix-only readOnly regex with a deny-list that blocks
  CREATE/MERGE/DELETE/DETACH/SET/REMOVE/DROP anywhere in the query, and
  route readOnly queries through session.readTransaction()

Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>

* fix(security): add CALL procedure allowlist for Cypher readOnly, add OPTIONS to CORS

- Cypher guard: restore positive allowlist for CALL targets (only db.* and
  apoc.meta.* allowed in readOnly mode). Extract cypherReadOnlyViolation()
  helper for clarity. Both copies updated.
- CORS: add OPTIONS to allow_methods so preflight requests succeed.

Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>

* fix(security): use negative lookahead for CALL allowlist, remove dead CALL\s*\{ branch

- Replace two-regex CALL check with single negative-lookahead
  CYPHER_CALL_DISALLOWED_RE = /\bCALL\s+(?!db\.|apoc\.meta\.)/i
  This correctly blocks queries containing ANY disallowed CALL target,
  even when bundled alongside an allowed CALL db.* or CALL apoc.meta.*.
- Remove dead CALL\s*\{ alternative from CYPHER_WRITE_RE — the trailing
  \b never matched because { is a non-word character.
- Both copies updated identically.

Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>
2026-06-14 20:42:14 -05:00
devin-ai-integration[bot]
471e8f21e8 fix(scripts): replace bare except clauses with specific exception types (#77)
Replace 30+ bare `except:` and `except: pass` patterns across 17 files
with specific exception types (OSError, ValueError, etc.) and add
logging so errors are no longer silently swallowed.

Changes by category:

Infrastructure (surface/main.py):
- GPU/process probes now catch FileNotFoundError | SubprocessError

Application scripts:
- API fetchers (finalize_database, final_push, bulk_10x) now catch
  URLError | JSONDecodeError | KeyError | OSError and print to stderr
- Hardware probes (unified_hardware_surface, swarm_transport_layer)
  catch OSError | ValueError for /proc/meminfo reads
- Backend availability checks (prover_backend_interface, hot_swap_manager)
  catch requests.RequestException and log at debug/warning
- Code inspector (swarm_system_inspector) catches OSError | UnicodeDecodeError
  for file reads
- Model fallback (map_all_equations) now logs the intermediate error
- Minor: gpu_pist_compress → RuntimeError | ZeroDivisionError,
  mathlib_to_parquet → ValueError, moe_utils → OSError,
  quandela_remote → OSError | IndexError, topology inline scripts
  → ImportError, consolidate_language_databases → UnicodeDecodeError

All touched files pass py_compile.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>
2026-06-14 19:30:28 -05:00
Brandon Schneider
aba1fba7ad fix(adversarial-review): resolve 35 critical coding bugs across 8 subsystems
Security & correctness fixes from full adversarial review:

Lean (7 fixes):
- FixedPoint.lean: guard false theorem with n > 0 precondition
- QFactor.lean: remove double-scaling error in energy decrease
- AVMIsa/Step.lean: implement addSatQ16/subSatQ16 primitives
- BraidEigensolid.lean: fix crossStep second output argument swap
- SSMS.lean: complete ACI preservation proof (with rounding caveat)
- HouseholderQR.lean: add n > 0 precondition to spectral theorem

Verilog (7 fixes):
- q16_lut_core.v: fix multiply shift (16 → 32 bits)
- q16_lut_top.v: fix valid bit (0 → 1)
- cff_accelerator.v: fix SHA-256 padding (len < 448 check)
- research_stack_top.v: fix trigger aliasing (unique counters)
- Blitter6502OISC_small.v: fix address width (15 → 16 bits)
- spatial_hash_bram.v: add OOB write guard
- tmr_oepi_safety_fsm.v: fix double-increment race

WGSL (6 fixes):
- shaders.wgsl: atomicAdd for concurrent writes
- frustration_qubo.wgsl: double-buffer + CAS loop
- braid_fft.wgsl: workgroupBarrier synchronization
- burgers_scar_filter.wgsl: atomic E_bins array

Rust (9 fixes):
- thermodynamic.rs: Arc::from_raw → Arc::clone (double-free)
- thermodynamic.rs: Box::into_raw → Box (leak)
- tools/src/lib.rs: shell injection → shlex.quote
- ene-node/src/lib.rs: LRU caps, constant-time HMAC, peer caps

Python (6 fixes):
- similarity/__init__.py: pickle.load → RestrictedUnpickler
- AI-Feynman: torch.load → weights_only=True (14 calls)
- fetch_arxiv.py, fetch_s2.py: eval → ast.literal_eval
- topology.py: os.system → shutil.copy2
- SSH pipe: os.system → base64 pipe

Build: lake build 3572 jobs, 0 errors
2026-05-31 23:38:03 -05:00
Brandon Schneider
9c5fe97dc1 feat(infra): SPIR-V packet generator and WGSL scar filter shader
Add spirv_packet_generator.py: reads SPIR-V assembly, applies copy-if
optimization (OpPhi→OpSelect transform), and emits JSON packet descriptors
with the 5 OpPhi-derived fields (type_id, cond_id, true_val_id,
false_val_id, result_id) that fully specify the packet layout.

Add burgers_scar_filter.wgsl: 291-line WGSL compute shader for spectral
scar filtering in 2D Burgers RG solver. Uses three copy-if patterns:
  1. scar_pressure > threshold → apply hyperviscosity damping
  2. |kx| > k_cut || |ky| > k_cut → zero (dealiasing)
  3. factor < 0.999 → multiply velocity components

Also fix spirv_copy_if_optimizer.py: OpSelect now uses phi_instr.args[0]
(type operand) as its type, instead of compute_instr.result_id. This
produces structurally correct SPIR-V where the result type matches the
OpSelect opcode layout.

Build: 3313 jobs, 0 errors (lake build)
Tools: glslang, spirv-as, spirv-dis (native); tint from nixpkgs for WGSL
2026-05-30 16:40:58 -05:00
Brandon Schneider
1d91183d1b fix: reed_solomon_vcn decode_rs return type (tuple → bytes extraction) 2026-05-28 17:35:55 -05:00
Brandon Schneider
53e38e4c71 feat: 12 math enhancements — Q16 LUT, braid VCN encoder, FPGA Verilog, FFT, crypto
Pipeline:
- q16_lut_vcn.py: Q16_16 LUT generation + VCN frame encoding (8 ops)
- braid_vcn_encoder.py: Delta+RLE → RS ECC → ChaCha20 → VCN → MKV
- braid_search.py: Sidon set slots, soliton search, QUBO optimization
- test_braid_pipeline.py: 67 tests covering full round-trip

WebGPU/Scripts:
- braid_fft.wgsl: Cooley-Tukey radix-2 FFT on phase vectors
- reed_solomon_vcn.py: Reed-Solomon ECC for VCN frame data
- chacha20_braid.py: ChaCha20 encryption + key derivation
- polynomial_commitment.py: KZG scheme for receipt verification

Lean:
- BraidBitwiseODE.lean: XOR crossing, O(1) integration, 2 proved theorems

FPGA (Tang Nano 9K):
- q16_lut_core.v: 8-op arithmetic, 2-stage pipeline, BRAM reciprocal
- braid_crossing_core.v: 4-stage crossing residual, 7 Q16 instances
- Testbenches with edge cases + VCD dumps
2026-05-28 14:49:26 -05:00
Brandon Schneider
6679908f7b fix(arch): enforce Lean-first hierarchy across project — remove all secondary-Lean language
Project-wide sweep to find and fix every place Lean was treated as secondary,
optional, or subordinate to Python/Rust. The invariant: Lean is the source of
truth. Python and Rust are extraction targets only; they contain no logic, no
invariant checks, no decisions.

Changes:

1-Distributed-Systems/ene/src/lib.rs
  - CRITICAL: Remove 'Rust is the canonical implementation language for
    operational components' — replace with correct extraction-target framing

1-Distributed-Systems/agents/claw/README.md
  - Remove 'canonical implementation lives in rust/' and 'source of truth is
    ultraworkers/claw-code' blanket claims — scope to CLI binary only;
    add Research Stack domain-logic note (Lean is source of truth per AGENTS.md)
  - 'canonical Rust workspace' → 'Rust workspace (I/O extraction target)'

1-Distributed-Systems/agents/claw/src/Tool.py
  - 'Python-first porting summary' → 'Lean-to-Python extraction summary'

1-Distributed-Systems/agents/claw/src/projectOnboardingState.py
  - python_first: bool = True → lean_first: bool = True (Lean always leads)

6-Documentation/docs/specs/ENE_MEMORY_ATLAS_SPEC.md
  - CRITICAL: 'Python first (reference) ... Lean-formal next' → correct order:
    Lean specification first, Python extraction shim, Verilog hardware extraction

6-Documentation/docs/recovered/geocognition_equation_types_map.mmd
  - 'Lean owns logic; Rust owns boundary' → 'Lean owns all logic and decisions;
    Rust is boundary shim only'

6-Documentation/docs/semantics/HYPER_DIMENSIONAL_PHYSICS_INTRO.md
  - 'Python implementation ... Lean formalization' → 'Lean specification (source
    of truth) ... Python extraction shim'

6-Documentation/docs/geometry/GEOMETRY_TAXONOMY_FOR_NLOCAL_ADAPTATION.md
  - 'reference specification for the Python implementation' → 'source of truth;
    Python is an extraction shim against this spec'

6-Documentation/docs/protocols/TM_MCP_SPECIFICATION.md
  - 'Python reference implementation' → 'Python extraction shim' (×2)

5-Applications/scripts/snn/README.md
  - 'deterministic Python reference' → 'Python extraction shim / golden-vector
    harness'; add TODO(lean-port) note; RTL must match 'Python shim (pending
    Lean golden vector)' not 'Python reference'

6-Documentation/docs/METAPROBE_APPROACH.md
  - 'DeltaGCLCompression.lean — Lean implementation / scripts/delta_gcl_encoder.py
    — Python reference implementation' → Lean is source of truth / Python is
    extraction shim

Generated with Devin (https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:40:03 -05:00
Allaun Silverfox
5579ffa046 chore(pending): quarantine python Notion+Linear MCP server (Lean-first unification) 2026-05-26 17:59:19 -05:00
Allaun Silverfox
f9778f3fb3 chore(pending): quarantine python MCP server (Lean-first unification) 2026-05-26 17:56:25 -05:00
Allaun Silverfox
ceb6a91d97 cleanup(ene): load node list from nodes.yaml instead of hardcoded hostnames 2026-05-26 17:16:02 -05:00
Allaun Silverfox
a5a10723ab cleanup(ene): use nodes.yaml inventory instead of hardcoded host resource map 2026-05-26 17:15:50 -05:00
Allaun Silverfox
87e5eb33a7 cleanup(ene): make obsidian shim provenance configurable and schema-complete 2026-05-26 16:54:12 -05:00
Allaun Silverfox
e36cff917b cleanup(ene): make provenance node/tailscale configurable via env vars and CLI arg 2026-05-26 16:42:03 -05:00
Allaun Silverfox
1181849cea cleanup(ene): make provenance node/tailscale configurable via env vars and CLI arg 2026-05-26 16:40:35 -05:00
Brandon Schneider
d4180194d7 archive: remove experimental tools-scripts, scripts, and shim probes
- Move 38 experimental tools-scripts directories to archive/ (famm, ptos, crypto, market, geoweird, cognitive, carrier, tsm, semi_jack, hachimoji, chemistry, bt20, optimization, gpgpu, hardware, infrastructure, defense, security, connectome, encoding, formula_optimization, manifold, metafoam, model, verifier, substrate, audio, ingestion, literature, domain, crossbreed, external, physics, pipeline, design, classification, database, dashboard, monitor, braid, compression, waveprobe, data, ingested, demo, publish, blockchain, regret, simulation, build)
- Move 386 one-shot scripts to archive/ (ask_swarm*, execute*, swarm_* probes, test_* scripts, computational controllers, topology experiments, shell scripts)
- Move 2124 experimental shim probe files to archive/ (research probes, prior*, metaprobe*, erdos*, blockchain*, hutter*, tang9k*, stellar_gas*, enwiki*, quandela* probes, experimental shell scripts, ffmpeg-plugins, erdos_surface_orchestrator, codebase-memory, receipts, data files, MCP bus probes)
2026-05-25 18:14:31 -05:00
Brandon Schneider
073a70eb86 WIP: accumulated changes 2026-05-25 16:24:21 -05:00
Brandon Schneider
a4a5a4027c feat(ene): replace legacy Python mesh with Rust crates 2026-05-20 18:46:18 -05:00
Brandon Schneider
c5b6a31a8b feat: add RDS probe tool, credential server, and Notion/Linear ingestion pipeline
New infrastructure components:
- rds_probe: Rust database inspection tool with IAM auth
- credential_server.py: REST credential provider server
- credential_provider.py: credential resolution chain
- ene_rds_fractal_fold.py / ene_rds_wiki_layer.py: RDS-backed ENE layers
- import_dumps_to_rds.py / export_linear_from_rds.py: ingestion pipeline
- recover_credential_server.sh: deployment script (sanitized)

Sanitize hardcoded secrets across codebase:
- Strip API keys from recover_credential_server.sh → env var lookups
- Replace hardcoded Wolfram appid (HYJE3R3R63) → env var in 5 scripts
- Strip fallback key values from config/index.js
- Add .claude/ and optimized_basis_v3.bin to .gitignore

Ingested 2,685 records into RDS: 2,421 Linear issues + 264 wiki pages
2026-05-18 00:31:44 -05:00
Brandon Schneider
5a763468c9 integrate infrastructure config, axiom cleanup, and documentation updates
- cupfox-config.nix: add Open WebUI container with chat.researchstack.info proxy,
  gather-metrics service/timer, rclone, and tmpfiles for persistent storage
- Lean semantics: reduce axiom count from 109 to 18 across 10 files;
  FixedPoint now 0 axioms, 0 sorries with 12 theorems
- Documentation: update AGENTS.md with current axiom/sorry counts and
  FixedPoint status; refine bind signature
- Add topology scripts, CGA/FAMM/GeneticOptimizer/MMRFAMM Lean modules,
  devcontainer config, MEMORY.md, and Modelfile
2026-05-17 12:03:19 -05:00
Brandon Schneider
a6311ed940 chore: preserve working tree before secure wipe
- Update .gitignore with **/target/ for Rust build artifacts
- Add eval receipts to UniversalBridge.lean (compile-time verification comments)
- Add PCIe Idle-Cycle Compute Harvester to ROADMAP.md
- Clean up deprecated scripts, generated Verilog, and old tools (23 deletions)
- Stage new infrastructure: Xen/Alpine embedded surface, QFOX topology manager
- Stage new probes: boundary activation field, holographic carving
- Stage new applications: finance manager, script roots
- Stage new research spec: PCIe idle-cycle substrate
2026-05-13 17:36:02 -05:00
Brandon Schneider
d14d6b4b25 Refactor provenance sources for open witness backends 2026-05-12 05:57:04 -05:00
Brandon Schneider
a99e839bab Track remaining source and documentation inventory 2026-05-11 22:18:31 -05:00
Brandon Schneider
1225404b72 Point ENE scripts at shared data 2026-05-11 22:10:55 -05:00
Brandon Schneider
cabf709253 Ignore generated run outputs and scrub API key scripts 2026-05-11 22:06:39 -05:00
Brandon Schneider
c8ba00190e Add NUVMAP scan scheduling receipts 2026-05-11 14:49:17 -05:00
Brandon Schneider
7e3858d88d ingest: Hypercube → Hyper-Rhomboid composition theory
Orthogonal tensor (hypercube) assumes independent axes.
Shear into parallelotope (hyper-rhomboid) models entangled dimensions.
The shear angle encodes correlation strength; the Gram matrix
of the shear IS the compression dictionary.

6 stack mappings:
- PIST n-D: Cartesian → Bundle → Radial = hypercube → rhomboid → collapsed
- Topological state machine: transition = shear on state tensor
- N-D Gene Hypothesis: gene = n-D rhomboid, 3D structure = projection shadow
- FAMM: preshaped delay = sheared time-domain rhomboid
- OAC: latent cavity in sheared rhomboid space
- Waveprobe: curvature = local shear angle of coordinate basis

3 compression interpretations + information gravity metric tensor
2026-05-07 02:04:03 -05:00
Brandon Schneider
bc940273b8 wiki: add Q-Fox primary development machine specifications
AMD Ryzen 5 9600X (6C/12T, AVX-512), 31GiB DDR5, 1.8TB NVMe,
Radeon iGPU, CachyOS 7.0.3. Mapped 8 capabilities to stack use.
2026-05-07 00:54:47 -05:00
Brandon Schneider
cfcdd5e7e7 ingest: Observer-Admissible Cavities theory — radius-ratio → Pidgen-hole → S3C/Spherion → OAC
6 key concepts formalized:
- Radius-ratio rule → admissible motif classifier (CN3-8 thresholds)
- Pidgen-hole theory → typed hole + residual codec
- S3C shell coordinates → n=k²+a with throat/mirror/mass
- Spherion shaping → pyramid protrusions/voids as compression teeth
- S_n(n^n) → Matryoshka shell with latent combinatorial interior
- Observer-Admissible Cavities → touch-manifesting lazy holes

7 cross-references to existing modules, 4 new primitives identified.
7 keeper phrases preserved.
2026-05-07 00:47:10 -05:00
Brandon Schneider
0cf775c80e collapse: prover orchestration layers, FAMM verilator harness, swarm topological prober, spec sheets, virtual FPGA system tests, merge conflict resolution
- Prover-Integrated Orchestration Layers (L0-L3): Goedel-Prover-V2 watchdog, BFS-Prover-V2 swarm consensus, bf4prover topology adaptation
- FAMM Verilator benchmark: uniform vs preshaped delay comparison (4.4x speedup)
- Swarm topological device prober: 11 agents probing traces, caps, delays, errors, vias, PDN
- Spec sheet puller: 10 components with key params and topological relevance
- Virtual FPGA system tests: 6/6 passed, 134K ops/s throughput
- Fixed merge conflicts in AI-Newton test_experiment.ipynb
2026-05-06 23:42:01 -05:00
Brandon Schneider
0709b298b3 Consolidate research stack updates 2026-05-05 21:09:48 -05:00
Brandon Schneider
5f88abf618 initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00