Skip to content

MESH-NRP Implementation Status

monad.ai v2.2.0 — current local implementation status


What Is Implemented

The current NRP work is no longer only an HTTP resolver. It is a mesh-aware runtime path with optional Total Monad Synthesis (MONAD_SYNTHESIS_ENABLED=1):

Single-forward (default, Phase 1–9):

  1. Parse me://namespace:read/path
  2. Discover monads that claim the namespace
  3. Filter by optional selector constraints
  4. Score eligible monads
  5. Forward to the selected endpoint
  6. Learn from the request outcome
  7. Explain and optionally log the decision

Synthesis path (Phase 10, opt-in):

  1. Parse me://namespace:read/path
  2. Discover and score all eligible claimants
  3. Select top-N candidates (MONAD_SYNTHESIS_MAX_CANDIDATES, default 3)
  4. Forward in parallel to all N candidates
  5. Synthesize: quorum → public, no quorum → contested, all fail → closed
  6. Log synthesis decision with divergence metadata and reward signal
  7. Expose _synthesis on the wire for audit
txt
request
  → parseBridgeTarget
  → MONAD_SYNTHESIS_ENABLED?
      no  → selectMeshClaimant → forward → correlateOutcome
      yes → selectMeshClaimants (top-N)
          → forwardAll (parallel)
          → synthesize()
          → correlateSynthesisOutcome
          → _synthesis in response

Phase Summary

PhaseStatusResult
Phase 1doneNamespace reads/writes and claim/open lifecycle
Phase 2doneSelf mapping, monad identity, __surface, disclosure envelopes
Phase 3doneMesh index, /.mesh/monads, /.mesh/resolve, bridge forwarding
Phase 4doneSelector-aware mesh routing ([device:macbook], [host:edge])
Phase 5doneProduction scoring engine with open .me claim metadata
Phase 5.5doneScore introspection, runner-up tracking, margin logging
Phase 5.6doneDecision log, biased sampling, offline analyzer
Phase 6doneContinuous reward and epsilon-greedy exploration for fragile choices
Phase 7doneGlobal adaptive weights and live /.mesh/weights observability
Phase 8donePatch bay: controlled feature composition with learned weights
Phase 9doneNamespace-local weights with maturity blending and global background learning
Phase 10doneTotal Monad Synthesis: multi-candidate parallel forward, quorum/contested/closed, synthesis decision log

Current Runtime Surfaces

EndpointPurpose
GET /<path>Read a path in the namespace selected by Host
POST /Write/claim/open depending on body operation
GET /__surfaceSelf description and monad continuity proof
GET /.mesh/monadsList locally known and CLI-known monads
GET /.mesh/resolve?namespace=...Discover monads claiming a namespace
GET /.mesh/resolve?monad=frankDiscover a monad by name/id
GET /.mesh/resolve/multi?namespace=...Scored candidate list for synthesis (Phase 10 observability)
GET /.mesh/weightsInspect global adaptive scorer weights
GET /.mesh/weights?namespace=...Inspect namespace-local weights and blended request weights
GET /resolve?target=me://ns:read/pathBridge a canonical NRP target (single or synthesis depending on flag)

Current Selection Model

The selector is not part of the semantic path. It constrains execution.

txt
me://frank.local[device:macbook]:read/profile

Resolution:

  1. semantic namespace: frank.local
  2. semantic path: profile
  3. execution constraint: device:macbook
  4. winner: highest scored eligible monad, unless low-margin exploration fires

Current Learning Model

The fast index remains simple:

ts
claimed_namespaces: string[]
tags: string[]
type: "desktop" | "mobile" | "server" | "browser-tab" | "node"

The open .me subtree holds rich learned metadata:

ts
_.mesh.monads.<id>.claimed.<namespace> = {
  resonance: 42,
  effectiveResonance: 31.5,
  avgLatencyMs: 85,
  forwardCount: 100,
  failureCount: 4,
  geopoliticalZone: "mx-east",
  energyProfile: "low-power"
}

The index answers: who could answer?

The scoring engine answers: who should answer?

Adaptive weights now use two layers:

txt
_.mesh.adaptiveWeights          global prior
_.mesh.nsWeights.<namespace>    namespace-local posterior

Reads blend them by namespace maturity:

ts
maturity = min(1, sampleCount / 200)
weights = global * (1 - maturity) + namespace * maturity

Writes split the same reward gradient:

ts
globalShare = max(0.05, 1 - maturity)
nsShare = maturity

The global prior remains alive at full namespace maturity, so cross-namespace trends still propagate.


Operational Flags

Env varDefaultEffect
MONAD_MESH_STALE_MS300000Exclude stale monads from mesh claim selection
MONAD_DEBUG_SCORINGunsetLog every scoring decision when set to 1
MONAD_SCORE_SAMPLE_RATE0Randomly log a fraction of scoring decisions
MONAD_SCORE_MARGIN_THRESHOLD0.05Always log fragile low-margin decisions
MONAD_EXPLORATION_RATE0Route some fragile decisions to runner-up
MONAD_DECISION_LOGunsetJSONL path for correlated decision outcomes (single + synthesis)
MONAD_LEARNING_QUALITY_WEIGHT0.7Quality/latency split in reward
MONAD_DEBUG_WEIGHTSunsetLog adaptive weight changes after every forward
MONAD_SYNTHESIS_ENABLED0Enable Phase 10 Total Monad Synthesis path (1 to activate)
MONAD_SYNTHESIS_MAX_CANDIDATES3Max claimants queried in parallel during synthesis
MONAD_SYNTHESIS_QUORUM_THRESHOLD0.5Fraction required for quorum (strict majority — tie = contested)
MONAD_SYNTHESIS_MIN_RELATIVE_SCORE0.8Min score relative to winner to qualify as synthesis candidate

Verification

Current regression suite:

txt
31 test files
391 tests

Primary commands:

bash
npm run build
npm test
npm run docs:api

Decision analysis:

bash
MONAD_DECISION_LOG=~/.monad/decisions.jsonl npm run dev
tsx scripts/analyze-decisions.ts ~/.monad/decisions.jsonl

Not Yet Implemented

These remain design targets, not production guarantees:

  • multi-hop mesh traversal
  • distributed cross-machine monad index sync
  • .me-defined scoring pipeline
  • auto-tuning of weights from reward history
  • durable decision log beyond JSONL
  • challenge/nonce validation for stronger monad proof freshness
  • synthesis policy selection via me:// path metadata (namespace-declared quorum rules)
  • contested response UI surface (currently wire-only, no GUI component)