Skip to content

docs(adr-047): permit WASM-for-shared-compute (amend ADR-007)#18

Merged
Rubentxu merged 1 commit into
mainfrom
docs/adr-047-wasm-amendment
Jun 24, 2026
Merged

docs(adr-047): permit WASM-for-shared-compute (amend ADR-007)#18
Rubentxu merged 1 commit into
mainfrom
docs/adr-047-wasm-amendment

Conversation

@Rubentxu

Copy link
Copy Markdown
Owner

Summary

  • ADR-007 (amended): añade §2 distinguiendo WASM-for-rendering (rejected) de WASM-for-shared-compute (permitted)
  • ADR-047 (NEW): rationale y reglas operacionales para WASM compartido

Context

ADR-007 (jun-12) prohibió categóricamente WASM en browser para evitar duplicación backend↔frontend. Esto bloqueaba el roadmap item "WASM graph transforms" (PageRank, SCC, community detection en browser sin round-trip al backend).

Decision

Permitir WASM-for-shared-compute bajo cuatro reglas estrictas:

  1. Single source: mismo código Rust compila a native + wasm32
  2. No replacement: WASM no reemplaza frontend existente (cytoscape + elkjs stay)
  3. Feature-gated: opt-in con fallback graceful al backend
  4. Connascence audit: algoritmos deben desacoplarse de CallGraph domain type vía GraphLike trait

Affected ADRs

  • ADR-007: state → ACCEPTED (amended); §2 añadida
  • ADR-041: no change (consistente: ambos feature-gated)
  • ADR-031: no change (PageRank es pure-compute, compatible)
  • ADR-048: pending — architecture del nuevo cognicode-graph-algos crate

Validation

  • ADR-048 (WASM graph transforms architecture) propuesto y aceptado (siguiente ciclo)
  • POC: PageRank compilado a wasm32 ejecutable desde browser
  • Build matrix: native + wasm32
  • Tests duales: cargo test + wasm-pack test
  • Bundle size: <500KB gzipped
  • Frontend: feature-gated, fallback graceful

Closes blocker para sddk/wasm-graph-transforms explore (engram obs-f39132b17f6be1e6).

Tag plan: v0.12.16 PATCH (docs)

ADR-007 (jun-12) prohibited all WASM in browser to prevent logic
duplication between backend and frontend. This amendment adds §2
distinguishing WASM-for-rendering (still rejected) from
WASM-for-shared-compute (now permitted under strict rules).

ADR-047 specifies:
- Single source rule: same Rust code compiles to native + wasm32
- No WASM to replace existing frontend (cytoscape + elkjs stay)
- Feature-gated, opt-in with graceful backend fallback
- Connascence audit: algorithms must decouple from CallGraph domain
  type via GraphLike trait before WASM compilation

This unblocks the WASM graph transforms roadmap item. 10 pure-compute
algorithms (PageRank, SCC, god_nodes, community detection, etc.) are
now eligible for browser-side execution without duplicating backend logic.

Changes:
- docs/adr/ADR-007-no-wasm-in-browser.md: state → ACCEPTED (amended),
  add §2 referencing ADR-047
- docs/adr/ADR-047-wasm-shared-compute-amendment.md: NEW ADR

Tag: v0.12.16 PATCH (docs)
@Rubentxu Rubentxu merged commit 2bc849e into main Jun 24, 2026
1 of 5 checks passed
Rubentxu added a commit that referenced this pull request Jun 24, 2026
Updates ARCHITECTURE-DEEPENING-2026 §4 ADRs table:
- ADR-007: state → ACCEPTED (amended by ADR-047)
- ADR-047: NEW entry, ACCEPTED

Tag: v0.12.16 PATCH (docs)
PR: #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant