AI Initiative logoAI Initiative
Reading room / Manthan

Manthan Runtime Demo (Phase 2)

Manthan Runtime Demo (Phase 2). Covers What this demonstrates; Run; Compose with the trace bundler; What this is and isn't.

Project explanation / technical method
This is the retained source text, not a new validation of its claims. Numerical results and comparative claims require the accompanying source review before public reuse.

Read the connected case study or article →

Not explicitly stated in source · Date not established

Provenance, authorship and editorial notes

Manthan Runtime Demo (Phase 2)

Id

manthan-herald-protocol-demo-manthan-runtime-readme

Project

Manthan

Source path

manthan/herald-protocol/demo/manthan-runtime/README.md

Source sha256

fd7051cabf8f69cf23f3d6c13df21124e4d9e945b008399dadc9a78cd90db48f

Local copy sha256

fd7051cabf8f69cf23f3d6c13df21124e4d9e945b008399dadc9a78cd90db48f

Repo head

3a94084024a3434cef331fecac91c2c3b43f0313

Date
Not recorded
Date basis

Original publication date not established; Git revision date retained separately.

Author

Not explicitly stated in source

Author basis

Unknown; Git committer not substituted for document author.

Last source commit

8b75d1b0157c20a0a463f0e31008ef9f73099beb

Last source commit date

2026-06-08T07:40:14Z

Document status

Project explanation / technical method

Summary

Manthan Runtime Demo (Phase 2). Covers What this demonstrates; Run; Compose with the trace bundler; What this is and isn't.

Topics
  • Exploration architecture and selection
  • What this demonstrates
  • Run
  • Compose with the trace bundler
Theme

Exploration architecture and selection

Priority

deep

Related ids
  • manthan-readme
  • manthan-docs-architecture
  • manthan-docs-business-overview
  • manthan-docs-demo-walkthrough
  • manthan-docs-principles
  • manthan-docs-qd-measurement-direction-plan
  • manthan-docs-swarm-evolution-integration
Evidence concerns
  • Recovered source text is preserved verbatim. Assertions, comparisons, commands and results belong to its original context; they were not re-executed or externally re-verified during this corpus review.
Word count

669

Bytes

5164

Source relative

herald-protocol/demo/manthan-runtime/README.md

Remote mirror

manthan/herald-protocol/demo/manthan-runtime/README.md

Full text preserved

True

Manthan Runtime Demo (Phase 2)

Phase 2 deliverable per the Manthan platform tracker §8: a long-running node composed from existing HERALD services and libraries, using scoped session signatures and a durable local ledger.

What this demonstrates

Two long-running Manthan agents (Alice and Bob) running in one Node process:

1. Each agent has a persistent SQLite ledger (per G-010 schema; WAL mode, idempotent state machine).
2. Each agent issues a session-key grant under tool_sandbox scope at startup (per G-002 — not an ephemeral molt).
3. Alice sends Bob a periodic ping (one envelope every 5 seconds).
4. Bob replies with a typed handoff_receipt per G-007.
5. Both agents persist all envelopes through the ledger state machine (seen → verified).
6. The runtime exits cleanly after 25 seconds (or stays alive with MANTHAN_RUN_FOREVER=1).
7. Re-running the demo against the same data/ directory resumes from prior state (the ledger holds it; this proves G-010 §4 crash-recovery contract works).

This is the wedge between "MVP one-shot demo" (Phase 1) and "real always-on agent" (Phase 4).

Run

cd demo/manthan-runtime
node --experimental-strip-types src/runtime.ts

By default the demo reuses data/ so restart behavior is observable. To start from a clean ledger:

MANTHAN_RESET_DATA=1 node --experimental-strip-types src/runtime.ts

To write demo ledgers outside the repo:

MANTHAN_DATA_DIR=/tmp/manthan-runtime node --experimental-strip-types src/runtime.ts

Output:

=== Manthan Runtime Demo (Phase 2) ===
Alice  sigil:...
Bob    sigil:...

[grant] Alice session pubkey: ...
[grant] Bob   session pubkey: ...

[tick   1] Alice→Bob ping id=...  Bob→Alice ack id=...
[tick   2] ...
...

=== ledger state ===
Alice  seen:5 verified:6 queued_for_ct:0 submitted:0 inclusion_proven:0 gossiped:0 quarantined:0
Bob    seen:5 verified:6 queued_for_ct:0 submitted:0 inclusion_proven:0 gossiped:0 quarantined:0

The "verified:6" includes 5 outbound envelopes (pings or acks) plus 1 session_key_grant.

Compose with the trace bundler

After running the demo, dump a trace bundle from Alice's ledger:

LEAF=$(node --experimental-strip-types -e '
  import("./lib/manthan-ledger/src/ledger.ts").then(({ ManthanLedger }) => {
    const l = new ManthanLedger({ path: "demo/manthan-runtime/data/alice.sqlite" });
    console.log(l.byState("verified", 100).pop()?.id);
    l.close();
  });
')
node --experimental-strip-types tools/trace-bundler.ts \
  --from-ledger demo/manthan-runtime/data/alice.sqlite "$LEAF" \
  --out /tmp/manthan-trace.json

The output bundle is consumed by herald verify (extending the Phase-1 verifier).

What this is and isn't

This is:

This is NOT:

Phase 2 deliverables — checklist

What unlocks next

Cross-references

Continue exploring