Mesh and NRP

Picks which monad answers a namespace (fresh, not itself, best score), agrees one value across several, and learns its scoring weights from outcomes.

360 tests in 17 files. Source: Typescript/tests/NRP/

meshSelect.test.ts40 tests

Picks one claimant for a namespace: skips itself, stale and pending entries, prefers the best score, honors name and tag selectors, can try a runner-up, and falls back to the root space.

meshSelectMulti.test.ts15 tests

The same selection returning a ranked, capped list of candidates.

meshResolveMulti.test.ts22 tests

/.mesh/resolve/multi returns scored candidates, sorted, with max, min_score and staleness limits, and leaves out itself.

meshAnnounce.test.ts21 tests

POST /.mesh/announce: validation, throttling, signed versus pending entries, namespace squatting, first-key-wins, and the trusted-key allowlist.

monadIndex.test.ts16 tests

The index of known monads: read and write, order by last seen, lookups by namespace or name, the root identity hash.

scoring.test.ts38 tests

A claimant's score: fresher, more resonant and faster scores higher; always finite and in [0, 1]; deterministic; shifts with forward results.

patchBay.test.ts25 tests

Custom scorers registered at runtime (patches): storage, operations, and their effect on scores.

adaptiveWeights.test.ts20 tests

Scorer weights start at defaults, move with rewards, and never fall below a floor.

learningLoop.test.ts37 tests

The learning step end to end: exact weight update, weight floor, reward formula, convergence over many requests.

weightHealth.test.ts19 tests

Health signals on learned weights: stable, dominant scorer, dead scorer, oscillation, no learning.

decisionLog.test.ts16 tests

Each routing decision is recorded and its outcome becomes a reward (a fast success scores near 1), written as JSONL.

decisionLogSynthesis.test.ts23 tests

The same decision log and reward for synthesis decisions, and how they feed weight updates.

synthesis.test.ts31 tests

Combining answers from several sources: all agree, a minority winner, or contested; failures, divergence and disclosure.

bridgeSynthesis.test.ts9 tests

Asks several monads and returns one public value on quorum, or a contested null; never forwards to pending entries or the cloud metadata address.

bridge.parse.test.ts16 tests

Parses a bridge target (namespace:op/path) and the monad[frank] path syntax.

nrpHandler.test.ts5 tests

/nrp never sends 'stealth' on the wire: a namespace the kernel does not confirm resolves to 'closed'.

nrpDeclaredRoot.test.ts7 tests

/nrp serves reads under a declared root and refuses a single label nobody declared.