Reduce both examples to under 500 lines per CLAUDE.md guidelines.
Preserve all functionality: graph cut segmentation, RVF integration,
witness chains, evaluation metrics, and cancer driver gene detection.
https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
Key improvements to the exomoon detection pipeline:
PSPL Fitting:
- Extract pspl_chi2_at() helper for reuse
- Add fine refinement pass (±1 unit, 0.2 step) around coarse grid best
- Better parameter recovery for all geometric parameters
Lambda Computation:
- Three complementary statistics: excess chi2, runs test coherence, Gaussian bump fit
- Excess chi2 normalized against event's global reduced chi2 (not theoretical)
- Differential lambda: compare each window to its tau-neighbors, producing
z-scores that are ~0 for uniform fit quality and positive for localized anomalies
- This key change prevents the cut from labeling entire peak regions as moon
Detection Criteria:
- J-score from lambda_sum with per-window penalty (replacing BIC formalism)
- Fragility bootstrap for support stability
- Support fraction bounded (2-50%) for localization
Embeddings:
- Fixed residual computation to use fitted F_s * A(u) + F_b model
- Injection bank labels based on positive local evidence (not just geometry)
- Bank size increased to 60 events for better prior calibration
Current metrics: P=25%, R=25%, F1=0.25 on 30 synthetic events.
Detection quality is limited by the perturbative Chang-Refsdal
approximation — production requires a full polynomial lens solver,
as noted in the user's formulation.
https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
Review fixes:
- Fix XSS vulnerability in PlanetDashboard.ts (sanitize innerHTML with API data)
- Fix SNR variance calculation in planet_detection.rs (use out-of-transit only)
- Fix sort comparator for string columns in PlanetDashboard.ts
- Fix material/texture memory leaks in PlanetSystem3D.ts (dispose on clearSystem/destroy)
- Fix camera auto-rotate drift by storing intended radius
- Use Kepler's third law for semi-major axis calculation
- Seed orbit eccentricity/inclination from candidate ID for reproducibility
- Add metadata field constants (replace magic numbers)
- Document synthetic embedding limitation
- Fix ADR-040 typo ("two-machinevisu" → "two-machine")
New feature:
- Add microlensing_detection.rs example with M0-M3 pipeline for rogue planet
and exomoon candidate detection using synthetic OGLE/MOA-style light curves
with Paczynski PSPL fitting, residual anomaly detection, and coherence gating
https://claude.ai/code/session_01UWE22wnsZRSHKhT4h4Axby
- Run cargo fmt across entire workspace
- Create README.md files for all 9 EXO-AI crates
- Convert path dependencies to crates.io version dependencies for publishing
- Add [patch.crates-io] to exo workspace for local development
Co-Authored-By: claude-flow <ruv@ruv.net>
- ExoTransferOrchestrator.package_as_rvf(): serializes all TransferPriors,
PolicyKernels, and CostCurves into a 64-byte-aligned RVF byte stream
- ExoTransferOrchestrator.save_rvf(path): convenience write-to-file method
- Enable ruvector-domain-expansion rvf feature in exo-backend-classical
- 3 new RVF tests: empty packager, post-cycle magic verification, save-to-file
- substrate.rs: fill pattern field from returned search vector (r.vector.map(Pattern::new))
- README: document 5-phase transfer pipeline, RVF packaging, updated
architecture diagram, 4 new Key Discoveries, 3 new Practical Applications
All 0 failures across full workspace test suite.
https://claude.ai/code/session_019Lt11HYsW1265X7jB7haoC
- vector.rs: convert exo_core::Filter Equal conditions to ruvector HashMap
filter; store and round-trip _pattern_id in metadata
- substrate.rs: implement BettiNumbers, PersistentHomology, SheafConsistency
for hypergraph_query using VectorDB stats
- anticipation.rs: implement TemporalCycle pre-fetching via sinusoidal
phase encoding
- crdt.rs: add T: Display bound to reconcile_crdt; look up score from
ranking_map by format!("{}", result)
- thermodynamics.rs: rust,ignore → rust,no_run
- ExoTransferOrchestrator: new cross-phase wiring module in
exo-backend-classical that runs all 5 integration phases in a single
run_cycle() call (bridge → manifold → timeline → CRDT → emergence)
- transfer_pipeline_test.rs: 5 end-to-end integration tests covering the
full pipeline (single cycle, multi-cycle, emergence, manifold, CRDT)
All 0 failures across full workspace test suite.
https://claude.ai/code/session_019Lt11HYsW1265X7jB7haoC
Phase 2 — exo-manifold/src/transfer_store.rs
TransferManifold stores (src, dst) transfer priors as 64-dim deformable
patterns via ManifoldEngine::deform. Sinusoidal domain-ID hashing gives
meaningful cosine distances for retrieve_similar.
Phase 3 — exo-temporal/src/transfer_timeline.rs
TransferTimeline records transfer events in the temporal causal graph.
Each event is linked to its predecessor so the system can trace full
transfer trajectories. anticipate_next() returns CausalChain +
SequentialPattern hints.
Phase 4 — exo-federation/src/transfer_crdt.rs
TransferCrdt propagates transfer priors across the federation using
LWW-Map (cycle = timestamp) + G-Set for domain discovery. Merges are
idempotent and commutative. promote_via_consensus runs PBFT Byzantine
commit before accepting a prior.
Phase 5 — exo-exotic/src/domain_transfer.rs
StrangeLoopDomain implements the Domain trait: self-referential tasks
whose solutions are scored by meta-cognitive keyword density.
CollectiveDomainTransfer couples CollectiveConsciousness with
DomainExpansionEngine — arm rewards flow into the substrate and
collective Φ serves as the cycle quality metric.
EmergentTransferDetector wraps EmergenceDetector to surface non-linear
capability gains from cross-domain transfer.
All 4 crates gain the ruvector-domain-expansion path dep. 36 new tests,
all green alongside the existing suite.
https://claude.ai/code/session_019Lt11HYsW1265X7jB7haoC
- Fix all 35 compiler warnings across 23 files (unused imports, dead code,
unused vars, unnecessary parens) — build is now warning-clean
- Optimize NeuromorphicBackend::kuramoto_step O(n²)→O(n):
use sin/cos sum identity so coupling_i = (K/N)[cos(φ_i)·ΣsinΦ - sin(φ_i)·ΣcosΦ],
eliminates inner loop for 1000-neuron network (1M→1K ops per tick)
- Optimize k_wta: full sort O(n log n) → select_nth_unstable O(n avg)
using Rust's pdqselect partial sort
- Add #[inline] to hot paths: kuramoto_step, k_wta, hd_encode, lif_tick
- Fix federation: correctly swap unused FederationError (crdt.rs) and
unused HashMap (consensus.rs) — both in opposite files from first guess
https://claude.ai/code/session_019Lt11HYsW1265X7jB7haoC
- Fix fragile persistence assertion: compare against post-delete baseline
instead of pre-delete `all` which could include the deleted twitter vector
- Extract segment type magic numbers into named constants (SEG_VEC, etc.)
- Add comments for raw AGI container flag bitmasks (bits 4 and 10)
- Add seed non-overlap comment for vector generation
- Improve hex() to use pre-allocated String with fmt::Write
Co-Authored-By: claude-flow <ruv@ruv.net>
Update all references from 17 SNPs to 20 SNPs reflecting the
addition of LPA rs10455872/rs3798220 and PCSK9 rs11591147.
Document new gene-biomarker correlations (LPA→Lp(a), PCSK9→LDL)
in synthetic population section. Update module table line counts.
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
Add PCSK9 R46L loss-of-function variant (NEJM 2006: OR 0.77 CHD,
0.40 MI) as a protective cardiovascular SNP with negative weights.
Include PCSK9→LDL-C biomarker correlation (15-21% lower LDL in
carriers). Refactor gene-biomarker correlations from match to
additive if-chain so multiple gene effects can stack on the same
biomarker (e.g., APOE raises LDL while PCSK9 R46L lowers it).
Panel expanded to 20 SNPs.
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
Add rs10455872 (OR 1.6-1.75/allele CHD) and rs3798220 (OR 1.49-1.54/allele)
from 2024 LPA meta-analyses. Include Lp(a) biomarker reference (0-75 nmol/L)
and gene-biomarker correlation in population model. Separate NUM_ONEHOT_SNPS
(17) from NUM_SNPS (19) to preserve 64-dim vector layout with LPA encoded
in summary dimension 63.
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
Structural improvements from deep code review:
- Consolidate 5 parallel arrays (SNP_WEIGHTS, HOM_REF, HOM_ALT, HET,
ALLELE_FREQS) into single SnpDef struct array — eliminates entire class
of parallel-array misalignment bugs
- Cache category_meta() with LazyLock — avoids per-call Vec allocation
(critical in generate_synthetic_population hot path)
- Hoist Normal::new out of inner loop in generate_readings — pre-compute
distributions per biomarker instead of per-step*per-biomarker
- Add clinically meaningful lower bounds: LDL normal_low 0→50 mg/dL
(critical_low 25), Triglycerides normal_low 0→35 mg/dL (critical_low 20)
- Optimize RingBuffer::clear from O(capacity) to O(1) — head/len reset
is sufficient since push overwrites before read
- Use NUM_SNPS const for vector encoding bounds instead of magic number 51
All 172 tests pass, zero clippy warnings for rvdna.
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
- Add Health Biomarker Engine section to rvDNA README with usage examples
for composite risk scoring, streaming processing, and synthetic populations
- Add biomarker.rs and biomarker_stream.rs to Modules table
- Update test count from 102 to 172 (added biomarker tests)
- Add biomarker benchmark results to Speed table
- Add Welford, CUSUM, and PRS to Published Algorithms table
- Update root README Genomics & Health capabilities (49 → 51 features)
- Add health biomarker engine and streaming biomarkers to root feature table
- Update rvDNA details section with risk scoring and streaming capabilities
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
Evidence-based refinements from peer-reviewed clinical research:
- TP53 rs1042522 (Pro72Arg): hom_ref 0.10→0.00 — CC/Pro/Pro is not
independently risk-associated; prior non-zero baseline was unjustified
- BRCA2 rs11571833 (K3326X): het 0.25→0.20 — aligned with iCOGS
meta-analysis OR 1.28 for breast cancer (Meeks et al., JNCI 2016,
76,637 cases / 83,796 controls)
- NQO1 rs1800566 (Pro187Ser): het 0.20→0.15, hom_alt 0.45→0.30 —
aligned with comprehensive meta-analysis OR 1.18 for TT vs CC
(Lajin & Alachkar, Br J Cancer 2013, 92 studies, 21,178 cases);
larger 2022 meta-analysis (43,736 cases) found no overall association
Validated unchanged weights against SOTA evidence:
- APOE rs429358: OR 3-4x het, 8-15x hom (Belloy JAMA Neurology 2023)
- SLCO1B1 rs4363657: OR 4.5/allele, 16.9 hom (SEARCH/NEJM; CPIC 2022)
- COMT×OPRM1 interaction: confirmed p=0.037 (orthopedic trauma study)
All 48 tests pass (33 unit + 15 integration).
https://claude.ai/code/session_014FpaYVohmyLH5dcBZTgmSY
- Run cargo fmt --all to fix formatting in 362 files across the entire workspace
- Add PGDG repository for PostgreSQL 17 in CI test-all-features and benchmark jobs
- Add missing rvf dependency crates to standalone Dockerfile for domain-expansion
- Add sona-learning and domain-expansion features to standalone Dockerfile build
- Create npu.rs stub for ruvector-sparse-inference (fixes rustfmt resolution error)
Co-Authored-By: claude-flow <ruv@ruv.net>