Complete Tools, Libraries & API Reference

Every Selûne surface in one filterable index: all 20 MoonBit 1.0 RC1 libraries, all 17 agentic CLI commands, all 20 Stateless MCP 2026-07-28 tools (including 3 read-only agentic_wiki_* tools), 4 agent/IDE/Wasm plugins, and 9 formal, MARS 1.0, llm-wiki/ & governance tools. Press / to search across names, problems, and commands.

No matching entries

Clear your search query or select All Surfaces to view all 70 Selûne tools and libraries.

libs/toolchain

Tier 1 Core hoskinson/agentic_toolchain Commit Path Source

Pinned MoonBit 1.0 RC1 lockfile parser, reproducible SHA-256 ToolchainDigest, and golden output parsers for moon check/test/info/prove and all 9 moon ide subcommands.

Problem Solved
Unpinned compilers, locale drift, and brittle text scraping make agent verification non-reproducible across machines.
How It Works
Hashes canonical toolchain.lock into tc:sha256:<hex>, forces LC_ALL=C TZ=UTC NO_COLOR=1 and --frozen offline execution, and parses compiler/IDE JSON outputs behind golden regression tests.
cd libs/toolchain && moon check --frozen --deny-warn && moon test --frozen && python3 runner/moon_runner.py --cwd . m0-repro --runs 3

libs/syntax

Tier 1 Core hoskinson/agentic_syntax Commit Path Source

Pinned Tree-sitter MoonBit C bridge (mbt-ts-bridge) and pure MoonBit syntax extractor for .mbt, .mbti, moon.pkg, and .mbtp predicate files.

Problem Solved
Regex text surgery corrupts comments, string literals, and nested scopes, while upstream grammar drift breaks unpinned parsers.
How It Works
Wraps pinned tree-sitter-moonbit behind a bounded C bridge returning moonbit-syntax-extract/1 JSON with structural Decl/Name/Signature/Body anchors and protected obligation discovery.
cd libs/syntax && moon test --frozen && ./bridge/mbt-ts-bridge beta-app/ledgerflow/packages/auth/auth.mbt

libs/identity

Tier 1 Core hoskinson/agentic_identity Commit Path Source

Unison-inspired content-addressed identity: LogicalDefId, InterfaceDigest, alpha-normalized BodyDigest, ClosureDigest, and change invalidation planner.

Problem Solved
File-level hashing forces full transitive rebuilds and re-testing on every comment, formatting tweak, or private body edit.
How It Works
Hashes .mbti signatures and package trait coherence sets into InterfaceDigest, canonicalizes function bodies (ignoring whitespace, comments, and local alpha-renaming) into BodyDigest, and computes minimal invalidation plans.
cd libs/identity && moon test --frozen && moon run cli -- pkg-interface-digest ../../beta-app/ledgerflow/packages/auth/pkg.generated.mbti

libs/facts

Tier 1 Core hoskinson/agentic_facts Commit Path Source

Authoritative moonbit-source-facts/1 ontology (13 entities, 12 relationships, 8 non-merged provenance classes), concurrency-safe SQLite fact store, sharded object store, and Draft 2020-12 codecs.

Problem Solved
Ad-hoc tool vocabularies, cross-revision edges, merged confidence scores, and Git-committed graph churn break multi-agent code intelligence.
How It Works
Stores immutable per-package shards in shards/<sha256>.json via atomic private-tempfile fsync+replace and BEGIN IMMEDIATE SQLite transactions, reusing untouched package shards across revisions and expiring abandoned candidate overlays.
cd libs/facts && moon test --frozen && python3 tools/index_workspace.py --repo ../../beta-app/ledgerflow --store /tmp/selune-store

libs/export

Tier 2 Optional hoskinson/agentic_export Optional Overlay Source

Generated OGS 1.1.0 YAML ontology validator, disposable Neo4j Cypher projection generator, and SCIP JSON + pure MoonBit Proto3 .scip binary exporter.

Problem Solved
External IDE and graph tools expect OGS 1.1.0 or SCIP standards, yet coupling the commit path to a live graph database adds latency and failure modes.
How It Works
Generates OGS 1.1.0 YAML directly from authoritative moonbit-source-facts/1 types (0 schema errors against official Neo4j OGS 1.1.0 JSON Schema), emits disposable Cypher MERGE projections, and encodes scip.proto indexes filtering out llm_inferred edges.
cd libs/export && moon test --frozen && moon run cmd/emit_ogs > /tmp/moonbit-agentic.ogs.yaml

libs/edit

Tier 1 Core hoskinson/agentic_edit Commit Path Source

Typed 7-variant EditOp plans, ReadEntry read sets, OperationLog with transitive rename composition, and deterministic semantic ReplayEngine.

Problem Solved
Raw git unified diffs conflict across concurrent agent PRs whenever nearby lines shift or symbols are renamed.
How It Works
Records semantic intent (Rename, ReplaceBody, ChangeSignature, ExtractFunction, Add/RemoveDependency, ReplaceFileRegion) against LogicalDefId read sets; replays stale plans onto moved heads via compiler-resolved moon ide rename and scoped anchors.
cd libs/edit && moon test --frozen && python3 tools/run_m2_gate.py

libs/evidence

Tier 1 Core hoskinson/agentic_evidence Commit Path Source

Immutable moonbit-evidence/1 records, exact 10-state non-upgradable verdict vocabulary, DSSE in-toto/SLSA HMAC-SHA256 envelopes, and SARIF 2.1.0 emitters.

Problem Solved
Unscoped pass claims let timeouts masquerade as passes, allow stale verdicts to bless mutated candidates, and lack cryptographic provenance.
How It Works
Binds every content-addressed EvidenceId to candidate, closure_digest, obligation, specification_digest, method, and toolchain_digest, prohibiting all status upgrades and marking reverted evidence superseded without deletion.
cd libs/evidence && moon check --frozen --deny-warn && moon test --frozen

libs/cache

Tier 2 Core hoskinson/agentic_cache Commit Path Source

Content-addressed evidence cache keyed by (obligation, method, specification_digest, closure_digest, toolchain_digest, policy) with >=1% seeded drift verification.

Problem Solved
Re-running identical checks across thousands of agents wastes compute, while a poisoned or drifted cache causes silent false acceptance.
How It Works
Never serves timeout, tool-error, cancelled, or quarantined flaky entries; re-executes at least 1% of cache hits deterministically and fails closed with CacheDriftError on any verdict discrepancy.
cd libs/cache && moon check --frozen --deny-warn && moon test --frozen

libs/validate

Tier 2 Core hoskinson/agentic_validate Commit Path Source

Hermetic Bubblewrap (bwrap --unshare-all --unshare-net) validation worker executing moon check, moon test, and moon prove with strict memory/time caps.

Problem Solved
Agent-authored tests and build scripts are untrusted code that can exfiltrate host credentials, reach the network, or mutate host files.
How It Works
Runs every candidate inside isolated PID/mount/network namespaces with read-only toolchain mounts, cleared env, hard cgroup/timeout limits, and supervisor-provisioned attestation signing.
cd libs/validate && moon test --frozen && python3 runner/test_sandbox_escape.py

libs/runtime

Tier 1 Core hoskinson/agentic_runtime Commit Path Source

Effect v4-inspired structured concurrency runtime: Outcome[A, E], flat multi-reason Cause[E], exit-aware Scope, TxRef STM, TestClock, Schedule, Pool, and isolated async_rt.

Problem Solved
MoonBit core/async TaskGroup::add_defer overwrites prior errors during cleanup and E4188 prohibits combining raise? with async.
How It Works
Keeps Layer 1 pure and synchronous (preserving error polymorphism and deterministic 1M-schedule testing), accumulates every failure and cleanup defect in flat Cause[E], and isolates core/async into async_rt with cancellation-shielded LIFO/parallel finalizers.
cd libs/runtime && moon check --frozen --deny-warn && moon test --frozen --target native

libs/queue

Tier 2 Core hoskinson/agentic_queue Commit Path Source

Read-set merge queue with speculative batching (A / A+B / A+B+C), binary bisection, hotspot leases, seam-aware scheduling, Why3/Z3 proved kernel helpers, and Git CAS convergence.

Problem Solved
Naive serial CI stalls at high agent concurrency, while uncoordinated parallel merges break main or silently lose accepted commits.
How It Works
Checks candidate read sets against HEAD, replays stale edits, batches compatible candidates via object-store git merge-tree --write-tree, bisects failing batches, and advances HEAD via atomic CAS git update-ref only on verified trees.
cd libs/queue && moon test --frozen --target native && moon prove proofs

libs/cells

Tier 2 Core hoskinson/agentic_cells Commit Path Source

Isolated agent worktree cells: bare hub, locked detached worktrees, private GIT_OBJECT_DIRECTORY, btrfs CoW _build seeding, CAS lease registry, and 6-phase lunar mark-and-sweep GC.

Problem Solved
Thousands of ad-hoc worktrees leak disk space, corrupt shared branches, or let rogue agents mutate accepted Git objects and refs.
How It Works
Enforces a 6-state lunar lifecycle (Created -> Running -> Submitted|Abandoned -> Sealed -> Reclaimed), fences single-collector reclamation against supervisor lease renewals, salvages unsubmitted edits, and lands candidates with zero live worktrees.
cd libs/cells && moon test --frozen && python3 runner/verify_gates.py

libs/sim

Tier 2 Experimental hoskinson/agentic_sim Experimental Source

Deterministic simulation testing (DST) harness driving 1,000,000 seeded commit-queue schedules, Quint ITF trace conformance replay, and virtual-clock fleet load scenarios.

Problem Solved
Rare races across speculative batching, cancellation, cache misses, and lease timeouts cannot be caught by unit tests alone.
How It Works
Drives libs/queue directly under deterministic PRNG seeds and TestClock with injected faults, verifying all 5 global commit invariants on 1M schedules and checking 1:1 state projections against Quint ITF traces.
cd libs/sim && moon test --frozen --target native && moon run --target native cmd -- dst --schedules 100000

libs/policy

Tier 2 Core hoskinson/agentic_policy Commit Path Source

Anti-cheat integrity gates: protected obligation inventory, test/spec weakening blocker, sandboxed mutation gate, and supervisor-provisioned independent reviewer tokens.

Problem Solved
Coding agents can pass CI trivially by deleting failing tests, weakening QuickCheck counts, loosening proof predicates, or editing held-out suites.
How It Works
Binds execution to an approved compiler-resolved test inventory, blocks weakening diffs with 100% recall on seeded attack corpora, runs scoped mutation testing inside bwrap (classifying tool-error separately from killed), and requires independent reviewer approval for protected changes.
cd libs/policy && moon test --frozen && python3 bridge/policy_engine.py --help

libs/context

Tier 2 Core hoskinson/agentic_context Commit Path Source

Deterministic, cache-aware moonbit-context-pack/1 builder with staged retrieval, unified total token budget, held-out isolation, and prompt-injection/secret quarantine.

Problem Solved
Dumping raw files wastes fleet tokens and exposes agents to prompt-injection instructions or leaked secrets inside comments and docs.
How It Works
Places stable fleet-shared toolchain and interface prefixes first for prompt-cache reuse, excludes held_out_tests, quarantines injection/secret canaries with grants_permissions=false, and emits deterministic expansion handles for honest gaps.
cd libs/context && moon test --frozen && python3 bridge/context_engine.py --help

libs/knowledge

Tier 2 Optional hoskinson/agentic_knowledge Optional Overlay Source

Opt-in fail-open knowledge overlays: Graphify 0.9.121 non-code doc/ADR links (llm_inferred) plus wiki.mbt compiled llm-wiki/ + SIM reader (provenance=llm_wiki_compiled, source_wins=true, commit_path_affected=false).

Problem Solved
Design rationales and recurring root-cause audits live outside source code, yet letting derived knowledge override compiler facts or block commits compromises soundness.
How It Works
Rejects .mbt files from Graphify extraction, parses llm-wiki/ frontmatter/[[wikilink]] graphs and SIM entries with deterministic BM25-style ranking in wiki.mbt, and fails open whenever overlays are unavailable, stale, or corrupt.
cd libs/knowledge && moon test --frozen && ./bin/selune wiki status

libs/telemetry

Tier 2 Optional hoskinson/agentic_telemetry Optional Overlay Source

W3C traceparent OpenTelemetry span propagator, JSONL trace exporter, and fleet metrics collector (commits/hr, abort/retry rates, wasted compute, queue p50/p95, cache hit rate).

Problem Solved
Without unified end-to-end tracing across CLI, MCP, sandbox workers, and queue landings, fleet waste and latency bottlenecks stay invisible.
How It Works
Propagates a single traceparent ID from agent request through validation and CAS landing, aggregating immutable JSONL span metrics.
cd libs/telemetry && moon check --frozen --deny-warn && moon test --frozen

libs/cli

Tier 3 Gateway hoskinson/agentic_cli Commit Path Source

Executable agentic CLI (libs/cli/bin/agentic) and MoonBit command core exposing all 16 deterministic JSON operations from Architecture Sec 17.

Problem Solved
Agents need a single deterministic, idempotent, schema-validated command surface instead of stitching ad-hoc git and shell scripts.
How It Works
Orchestrates lock, publish, find, deps/dependents/impact, context build/expand, propose, sandboxed validate, status, CAS commit/revert, export-ogs/scip, and metrics with Draft 2020-12 JSON output.
./libs/cli/bin/agentic --repo beta-app/ledgerflow find --name verify

libs/mcp

Tier 3 Gateway hoskinson/agentic_mcp Commit Path Source

Thin stateless MCP 2026-07-28 server (libs/mcp/bin/agentic-mcp.mjs) over stdio and Streamable HTTP with zero session affinity, Origin validation, bearer auth, async polling tasks, and 20 sorted tools (including 3 read-only agentic_wiki_* tools).

Problem Solved
Stateful MCP servers break under horizontal scaling and retry storms when thousands of agents share load-balanced replicas.
How It Works
Holds zero in-memory session state between requests, persists task handles in the backing store so any replica can poll or cancel, enforces strict Origin/MCP-Protocol-Version/repo-root allowlists, and exposes all 20 agentic tools.
node libs/mcp/bin/agentic-mcp.mjs --transport http --port 8787 --allow-repo ./beta-app/ledgerflow

libs/crypto_ffi

Tier 1 Optional hoskinson/agentic_crypto_ffi Optional Overlay Source

Optional C-ABI v1 keyed HMAC-SHA256 library (mbcrypto.h/c) with generation-counted opaque handles, volatile zeroize, cancellation-safe refcounting, and MoonBit native FFI binding.

Problem Solved
Passing raw secret key bytes through GC-managed memory risks lingering key copies, use-after-free races, or unwind crashes across FFI.
How It Works
Encapsulates keys behind 32-bit slot + 32-bit generation handles verified against 2,145 C assertions and 368 RFC 4231 / OpenSSL differential vectors, explicitly zeroizing key buffers on release and rejecting stale handles.
make -B -C libs/crypto_ffi/csrc test CC=clang && (cd libs/crypto_ffi && moon test --frozen --target native)

agentic lock

CLI Command Commit Path Source

Verify or emit canonical toolchain.lock and compute its SHA-256 ToolchainDigest.

Problem Solved
Prevents silent compiler, solver, or grammar drift between agent workspaces and validation workers.
How It Works
Reads pinned versions from toolchain.lock, hashes the canonical lock representation, and returns deterministic JSON with tc:sha256:<hex>.
./libs/cli/bin/agentic --repo <repo> lock

agentic publish

CLI Command Commit Path Source

Index an immutable Git revision into content-addressed moonbit-source-facts/1 shards and publish a signed moonbit-graph-manifest/1.

Problem Solved
Agents querying live dirty worktrees see inconsistent symbols from wrong revisions.
How It Works
Materializes the exact requested Git commit tree, refreshes compiler facts, writes per-package shards with structural sharing, and indexes (revision, toolchain_digest) -> manifest_digest.
./libs/cli/bin/agentic --repo <repo> publish --revision HEAD

agentic context build

CLI Command Commit Path Source

Assemble a bounded, cache-aware, injection-hardened moonbit-context-pack/1 for a task and revision.

Problem Solved
Unbounded file reads blow up context budgets and expose agents to untrusted comments and held-out tests.
How It Works
Runs staged compiler-fact retrieval within max_depth, max_entities, and token_budget, redacts/quarantines secrets and injections, and returns deterministic expansion handles.
./libs/cli/bin/agentic --repo <repo> context build --task "Add clock parameter to auth.verify" --revision HEAD

agentic context expand

CLI Command Commit Path Source

Expand specific opaque handles from an existing context pack under the same redaction and budget rules.

Problem Solved
Agents need progressive disclosure of omitted bodies or callers without re-fetching an entire repository.
How It Works
Resolves pack-bound expansion handles against the immutable revision store, enforcing held-out exclusion and unified redaction on every returned payload.
./libs/cli/bin/agentic --repo <repo> context expand --pack ctx:sha256:<hex> --handles exp:body:verify

agentic find

CLI Command Commit Path Source

Search compiler-resolved definitions in a revision by symbol name or type signature.

Problem Solved
Text grep conflates comments, string literals, and identically named functions across packages.
How It Works
Queries the revision-scoped SQLite fact store for LogicalDefinition and DefinitionVersion records matching --name or --type.
./libs/cli/bin/agentic --repo <repo> find --name verify --revision HEAD

agentic deps

CLI Command Commit Path Source

List bounded outbound dependencies of a definition within one revision.

Problem Solved
Understanding what a function relies on without pulling unrelated transitive packages.
How It Works
Performs bounded BFS over single-revision DEPENDS_ON and CALLS edges while keeping provenance classes strictly distinct.
./libs/cli/bin/agentic --repo <repo> deps --def def:packages/api/fn/handle --depth 2

agentic dependents

CLI Command Commit Path Source

List bounded inbound callers and dependents of a definition within one revision.

Problem Solved
Signature changes break callers silently if any cross-package dependent is missed.
How It Works
Traverses incoming single-revision CALLS and DEPENDS_ON edges up to --depth from the target LogicalDefId.
./libs/cli/bin/agentic --repo <repo> dependents --def def:packages/auth/fn/verify --depth 3

agentic impact

CLI Command Commit Path Source

Compute blast radius and required revalidation obligations for editing a definition.

Problem Solved
Agents need to know which packages, tests, and proofs an interface vs body edit invalidates.
How It Works
Combines inbound dependent closures with protected ProofObligation records to list exact affected definitions and obligations.
./libs/cli/bin/agentic --repo <repo> impact --def def:packages/auth/fn/verify --depth 3

agentic evidence

CLI Command Commit Path Source

Inspect immutable moonbit-evidence/1 verification verdicts bound to a candidate or definition subject.

Problem Solved
Auditors and agents need exact proof of what ran, under which toolchain, and whether it was superseded.
How It Works
Queries immutable evidence records and supersession events filtered by --subject, preserving the exact 10-value verdict status.
./libs/cli/bin/agentic --repo <repo> evidence --subject cand:<id>

agentic propose

CLI Command Commit Path Source

Create an isolated edit candidate from a base revision and a typed EditPlan JSON file.

Problem Solved
Direct edits in a shared working directory collide across concurrent agents.
How It Works
Materializes an isolated candidate worktree from --base, applies typed EditOps (via scoped AST/compiler rename), captures the read set, and returns a deterministic candidate_id.
./libs/cli/bin/agentic --repo <repo> propose --base rev:<sha> --plan edit_plan.json

agentic validate

CLI Command Commit Path Source

Execute hermetic Bubblewrap integrity gates, moon check, moon test, and moon prove against a candidate.

Problem Solved
Unverified or host-executed candidate code compromises security and soundness.
How It Works
Runs the candidate tree in bwrap --unshare-all --unshare-net with evidence cache lookup, emits immutable Draft 2020-12 evidence records, and returns an idempotent polling handle.
./libs/cli/bin/agentic --repo <repo> validate --candidate cand:<id>

agentic status

CLI Command Commit Path Source

Poll deterministic state of an asynchronous validation, publish, or queue handle.

Problem Solved
Long-running proofs and builds require stateless polling across retries and MCP replicas.
How It Works
Reads immutable status metadata keyed by --handle without requiring server-side session state.
./libs/cli/bin/agentic --repo <repo> status --handle hnd:val:<hex>

agentic commit

CLI Command Commit Path Source

Land a verified candidate atomically via read-set check, semantic replay on moved head, and Git CAS update-ref.

Problem Solved
Landing stale or partially validated changes breaks main or silently drops concurrent edits.
How It Works
Verifies complete active evidence for the exact candidate tree, replays stale EditPlans onto moved HEAD when needed, and publishes the verified tree via git commit-tree + atomic CAS git update-ref.
./libs/cli/bin/agentic --repo <repo> commit --candidate cand:<id>

agentic revert

CLI Command Commit Path Source

Propose a validated inverse commit through the normal merge queue and mark reverted evidence superseded after landing.

Problem Solved
Ad-hoc git reset --hard destroys audit history and can reintroduce broken code.
How It Works
Materializes the inverse tree before validation, routes it through normal validate + commit gates, and appends an immutable supersession event only after CAS landing succeeds.
./libs/cli/bin/agentic --repo <repo> revert --revision rev:<sha>

agentic export-ogs

CLI Command Optional Overlay Source

Export the validated OGS 1.1.0 YAML ontology and optional disposable Neo4j Cypher projection.

Problem Solved
Teams using Neo4j need a schema-valid ontology synchronized with moonbit-source-facts/1 without drifting by hand.
How It Works
Delegates to schemas/moonbit-agentic.ogs.yaml and libs/export/tools/exporters.py to emit OGS 1.1.0 YAML and single-revision Cypher scripts.
./libs/cli/bin/agentic --repo <repo> export-ogs --revision HEAD --output /tmp/out.cypher

agentic export-scip

CLI Command Optional Overlay Source

Export a scip.proto-compliant SCIP code intelligence index (JSON + Proto3 binary .scip).

Problem Solved
Code navigation platforms like Sourcegraph and LSP bridges consume SCIP rather than custom SQLite schemas.
How It Works
Projects authoritative compiler/parser facts (excluding llm_inferred guesses) into SCIP symbols, occurrences, ranges, and streaming Proto3 wire bytes.
./libs/cli/bin/agentic --repo <repo> export-scip --revision HEAD --output /tmp/index.scip

agentic metrics

CLI Command Optional Overlay Source

Emit OpenTelemetry fleet metrics (commits/hr, abort/retry rates, cache hit rate, queue latency p50/p95).

Problem Solved
Operating an agent fleet without quantitative telemetry hides retry storms and cache regressions.
How It Works
Aggregates recorded trace spans from libs/telemetry into deterministic JSON summary statistics.
./libs/cli/bin/agentic --repo <repo> metrics

agentic_lock

MCP Tool Commit Path Source

Stateless MCP tool returning pinned toolchain.lock contents and canonical ToolchainDigest.

Problem Solved
Remote coding agents need deterministic compiler identity before generating edits.
How It Works
Dispatches to agentic lock over stdio or authenticated Streamable HTTP with zero sticky state.
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"agentic_lock","arguments":{"repo":"./beta-app/ledgerflow"}}}

agentic_publish

MCP Tool Commit Path Source

Stateless MCP tool indexing a Git revision into sharded facts and a signed graph manifest.

Problem Solved
Allows CI or remote agents to warm the content-addressed fact store for an exact commit.
How It Works
Validates repo allowlist and Origin header, then executes immutable revision publishing.
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"agentic_publish","arguments":{"repo":"./beta-app/ledgerflow","revision":"HEAD"}}}

agentic_context_build

MCP Tool Commit Path Source

Stateless MCP tool assembling a budget-bounded, injection-quarantined moonbit-context-pack/1.

Problem Solved
Replaces unbounded repo file crawling with deterministic compiler-backed context packs over MCP.
How It Works
Returns a content-addressed pack_id, authoritative signatures, and expansion handles validated against Draft 2020-12.
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"agentic_context_build","arguments":{"repo":"./beta-app/ledgerflow","task":"Migrate auth.verify","revision":"HEAD"}}}

agentic_context_expand

MCP Tool Commit Path Source

Stateless MCP tool expanding specific handles from a previously built context pack on any replica.

Problem Solved
Multi-replica HTTP deployments must serve follow-up pack expansions without sticky routing.
How It Works
Looks up the persisted pack by pack_id and applies unified redaction and total-budget bounds.
{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"agentic_context_expand","arguments":{"repo":"./beta-app/ledgerflow","pack":"ctx:sha256:...","handles":["exp:body:verify"]}}}

agentic_find

MCP Tool Commit Path Source

Stateless MCP tool querying compiler-resolved symbol definitions by name or type.

Problem Solved
Gives IDE and remote agents accurate LogicalDefId resolution without local compiler setup.
How It Works
Queries the revision-scoped SQLite fact store and returns typed definition records.
{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"agentic_find","arguments":{"repo":"./beta-app/ledgerflow","name":"verify"}}}

agentic_deps

MCP Tool Commit Path Source

Stateless MCP tool traversing bounded outbound dependencies of a LogicalDefId.

Problem Solved
Lets agents inspect exact dependency closures without loading entire files.
How It Works
Returns single-revision outbound CALLS and DEPENDS_ON edges with explicit provenance tags.
{"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"agentic_deps","arguments":{"repo":"./beta-app/ledgerflow","def":"def:packages/api/fn/handle","depth":2}}}

agentic_dependents

MCP Tool Commit Path Source

Stateless MCP tool traversing bounded inbound callers/dependents of a LogicalDefId.

Problem Solved
Surfaces all callers impacted by a signature refactor across packages.
How It Works
Runs bounded inbound BFS in the revision fact store and returns structured caller edges.
{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"agentic_dependents","arguments":{"repo":"./beta-app/ledgerflow","def":"def:packages/auth/fn/verify","depth":3}}}

agentic_impact

MCP Tool Commit Path Source

Stateless MCP tool reporting affected definitions, tests, and proof obligations for a target change.

Problem Solved
Helps agents plan minimal edits and estimate validation scope up front.
How It Works
Joins inbound dependent closures with protected obligations in the revision snapshot.
{"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"name":"agentic_impact","arguments":{"repo":"./beta-app/ledgerflow","def":"def:packages/auth/fn/verify","depth":3}}}

agentic_evidence

MCP Tool Commit Path Source

Stateless MCP tool retrieving immutable moonbit-evidence/1 records for any subject.

Problem Solved
Enables independent audit agents to inspect cryptographic validation receipts remotely.
How It Works
Returns verified Draft 2020-12 evidence JSON along with supersession state.
{"jsonrpc":"2.0","id":9,"method":"tools/call","params":{"name":"agentic_evidence","arguments":{"repo":"./beta-app/ledgerflow","subject":"cand:..."}}}

agentic_propose

MCP Tool Commit Path Source

Stateless MCP tool proposing a structured EditPlan against a base revision.

Problem Solved
Allows remote agents to submit typed semantic refactors cleanly without shell access.
How It Works
Writes inline plan JSON into a private writable temp directory and creates an isolated candidate worktree.
{"jsonrpc":"2.0","id":10,"method":"tools/call","params":{"name":"agentic_propose","arguments":{"repo":"./beta-app/ledgerflow","base":"rev:<sha>","plan":{...}}}}

agentic_validate

MCP Tool Commit Path Source

Stateless MCP tool launching hermetic sandbox validation with MCP 2026-07-28 async task handles.

Problem Solved
Validation exceeds single HTTP timeouts and must survive replica restarts and polling across nodes.
How It Works
Returns a deterministic task handle pollable via tasks/get and cancellable via tasks/update on any replica.
{"jsonrpc":"2.0","id":11,"method":"tools/call","params":{"name":"agentic_validate","arguments":{"repo":"./beta-app/ledgerflow","candidate":"cand:..."}}}

agentic_status

MCP Tool Commit Path Source

Stateless MCP tool polling handle status across horizontally scaled replicas.

Problem Solved
Clients retrying after transient network drops need idempotent status retrieval from any server instance.
How It Works
Reads persisted task and validation state directly from the shared store.
{"jsonrpc":"2.0","id":12,"method":"tools/call","params":{"name":"agentic_status","arguments":{"repo":"./beta-app/ledgerflow","handle":"hnd:val:..."}}}

agentic_commit

MCP Tool Commit Path Source

Stateless MCP tool landing a validated candidate through semantic replay and atomic Git CAS.

Problem Solved
Prevents concurrent MCP clients from racing on refs/heads/master or skipping evidence checks.
How It Works
Requires active valid evidence for the exact tree and executes single-writer CAS publication.
{"jsonrpc":"2.0","id":13,"method":"tools/call","params":{"name":"agentic_commit","arguments":{"repo":"./beta-app/ledgerflow","candidate":"cand:..."}}}

agentic_revert

MCP Tool Commit Path Source

Stateless MCP tool queuing a validated rollback commit and post-landing evidence supersession.

Problem Solved
Provides safe, auditable recovery from an accepted regression over MCP.
How It Works
Proposes the inverse change, validates the inverse tree, and marks prior evidence superseded after landing.
{"jsonrpc":"2.0","id":14,"method":"tools/call","params":{"name":"agentic_revert","arguments":{"repo":"./beta-app/ledgerflow","revision":"rev:<sha>"}}}

agentic_export_ogs

MCP Tool Optional Overlay Source

Stateless MCP tool exporting validated OGS 1.1.0 YAML and optional Neo4j Cypher projections.

Problem Solved
Lets external graph consumers fetch disposable ontology projections on demand.
How It Works
Generates OGS 1.1.0 and single-revision Cypher outside the commit path.
{"jsonrpc":"2.0","id":15,"method":"tools/call","params":{"name":"agentic_export_ogs","arguments":{"repo":"./beta-app/ledgerflow","revision":"HEAD"}}}

agentic_export_scip

MCP Tool Optional Overlay Source

Stateless MCP tool exporting SCIP JSON and binary .scip indexes for code intelligence platforms.

Problem Solved
Integrates Selûne's compiler facts with SCIP-compatible search and IDE hosts.
How It Works
Streams authoritative symbols and occurrences conforming to scip.proto.
{"jsonrpc":"2.0","id":16,"method":"tools/call","params":{"name":"agentic_export_scip","arguments":{"repo":"./beta-app/ledgerflow","revision":"HEAD"}}}

agentic_metrics

MCP Tool Optional Overlay Source

Stateless MCP tool returning fleet OpenTelemetry counters, cache hit rates, and latency percentiles.

Problem Solved
Exposes fleet health metrics to monitoring agents and dashboards over MCP.
How It Works
Summarizes persisted telemetry spans into structured JSON.
{"jsonrpc":"2.0","id":17,"method":"tools/call","params":{"name":"agentic_metrics","arguments":{"repo":"./beta-app/ledgerflow"}}}

agentic_wiki_index

MCP Tool Optional Overlay Source

Read-only fail-open MCP tool returning the compiled llm-wiki/ index (29 compiled pages across 12 sources, 7 entities, 7 concepts, 3 syntheses), recent log entries, and 4 SIM root-cause entries.

Problem Solved
Agents need fast orientation across architectural summaries and past workflow root causes without crawling raw docs or risking commit-path coupling.
How It Works
Reads repo-confined llm-wiki/ metadata strictly outside the commit path (commit_path_affected=false, source_wins=true) and fails open if absent.
{"jsonrpc":"2.0","id":18,"method":"tools/call","params":{"name":"agentic_wiki_index","arguments":{"repo":"."}}}

agentic_wiki_lint

MCP Tool Optional Overlay Source

Read-only fail-open MCP tool auditing llm-wiki/ links, orphan pages, frontmatter, and SIM schema integrity without mutating the repository.

Problem Solved
Derived knowledge bases silently accumulate broken wikilinks or orphaned pages unless continuously linted.
How It Works
Invokes repo-confined read-only lint checks matching llm-wiki/tools/lint.py (0 failures, 0 orphans) while remaining strictly off the commit path.
{"jsonrpc":"2.0","id":19,"method":"tools/call","params":{"name":"agentic_wiki_lint","arguments":{"repo":"."}}}

agentic_wiki_query

MCP Tool Optional Overlay Source

Read-only fail-open MCP tool running deterministic BM25-style search over llm-wiki/ compiled pages, [[wikilink]] neighborhoods, and SIM root-cause records.

Problem Solved
Agents need relevant design synthesis and past failure-mode lessons before editing workflows without relying on ad-hoc grep.
How It Works
Scores repo-confined llm-wiki/ pages and SIM entries deterministically with provenance=llm_wiki_compiled, returning fail-open empty results if the wiki is unavailable.
{"jsonrpc":"2.0","id":20,"method":"tools/call","params":{"name":"agentic_wiki_query","arguments":{"repo":".","query":"MARS"}}}

moonbit-agentic-skill

Agent Skill Optional Overlay Source

Production SKILL.md teaching Claude, Antigravity, Codex, and Grok agents the full Selûne workflow.

Problem Solved
General-purpose coding agents default to raw text diffs and bypass context packs and integrity gates.
How It Works
Encodes the canonical context build -> find/impact -> propose -> validate -> status -> commit/revert loop alongside MoonBit 1.0 RC1 moon ide best practices.
cat plugins/moonbit-agentic-skill/SKILL.md

mcp-plugin

MCP Integration Optional Overlay Source

Portable stateless MCP server manifests for Antigravity, Claude Code, Codex, and VS Code.

Problem Solved
Hardcoded absolute host paths break plugin installs across workstations and CI.
How It Works
Provides portable ${SELUNE_ROOT}-parameterized stdio and HTTP MCP configs wired to libs/mcp/bin/agentic-mcp.mjs.
ls plugins/mcp-plugin/

wasm-component-guest

Wasm WIT Guest Experimental Source

wit-bindgen MoonBit Wasm Component Model guest template (world.wit + analyzer bindings + JSON escaping).

Problem Solved
Embedding custom MoonBit analyzers inside polyglot hosts requires a typed, sandboxed component ABI.
How It Works
Defines a clean WIT world for semantic analysis and diagnostic emission compiled to Wasm with properly escaped JSON payloads.
cd plugins/wasm-component-guest && ls -la

editor-ide-plugin

IDE Extension Optional Overlay Source

VS Code / LSP thin bridge surfacing Selûne semantic facts, SCIP export, and SARIF 2.1.0 diagnostics.

Problem Solved
Human reviewers need IDE-native visibility into candidate blast radius, evidence status, and SARIF findings.
How It Works
Activates commands backed by agentic CLI JSON and SARIF outputs with zero duplicated compiler logic.
ls plugins/editor-ide-plugin/

moon prove (Why3 + Z3/CVC5)

Formal Prover Commit Path Source

Native MoonBit 1.0 RC1 formal verification for pure kernels via .mbtp predicates, proof_ensure clauses, Why3 1.7.2, Z3 5.3.3, and CVC5 1.4.2.

Problem Solved
Unit tests sample finite cases and cannot exhaustively guarantee invariants like double-entry conservation or overflow safety.
How It Works
Compiles proof_enabled packages to Why3 verification conditions discharged automatically by Z3/CVC5, recording exact named goal counts without upgrading missing-solver errors.
cd libs/queue && moon prove proofs

Quint 0.35 + Veil 2.0 + Lean 4.35

Formal Model & Proof Governance Source

Executable protocol models (commit_queue.qnt, cell_lifecycle.qnt) checked across 11,437,544 bounded finite-instance Veil 2.0 states (0 violations; Level 1 evidence) and 18/18 Lean 4.35.0 protocol-model proofs (0 sorry; code refinement open in QueueImplementation).

Problem Solved
Distributed protocol races in commit queues and worktree reclamation resist manual review and bounded testing.
How It Works
Embeds Quint specs into Lean 4 via quint_module (trusted translation), proves unbounded parametric inductive model invariants (0 sorry, 3 standard axioms), and runs bounded finite-instance Veil MC and ITF conformance traces.
quint verify spec/commit_queue.qnt --backend veil --proofs spec/commit_queue_proofs.lean

IOG DrWatt EARS (requirements.json)

Requirements Harness Governance Source

External IOG requirements harness binding 18 structured EARS behavioral requirements (SEL-001..SEL-012 + SC-001..SC-006) to executable checks.

Problem Solved
Natural-language PRDs drift from implementation and hide untested claims.
How It Works
Expresses every requirement in EARS syntax (When/While/If/Where ... shall) linked directly to a specification file and executable verification command, hashed by MARS 1.0.
python3 -c 'import json; d=json.load(open("requirements.json")); print(len(d["requirements"]), "EARS requirements")'

OpenSpec (specifications/)

Behavioral Specs Governance Source

Structured Markdown specifications (selune-platform.md, selunecraft-e2e.md) and change deltas traced to DrWatt requirements and MARS obligations.

Problem Solved
Architectural intent scattered across chat logs and issues cannot be audited mechanically.
How It Works
Assigns stable requirement IDs (SEL-001..012, SC-001..006) cross-referenced by requirements.json and MARS ledgers.
ls -la specifications/

Pre-1.0 Platform Ledger (spec/SELUNE.mars)

Assurance Ledger (Pre-1.0) Governance Source

Pre-1.0 (v0.1) platform obligation ledger listing 18/18 platform IDs and TCB statements; distinct from the MARS 1.0 commit-queue module (1/18 coverage in mars-next/examples/selune_commit_queue/).

Problem Solved
Formal claims lose credibility when trusted computing base assumptions or unproved gaps are left implicit.
How It Works
Declares assumed trust boundaries alongside pre-1.0 obligation entries; new projects and strict CI freshness checks use MARS 1.0 (mars-next/).
head -n 45 spec/SELUNE.mars

MARS 1.0 Language, Schemas & Case Studies (mars-next/)

Formal Specification Governance Docs Source

Standalone, project-agnostic MARS 1.0 grammar (8 block kinds + OpenSpec deltas), Draft 2020-12 schemas, 3-level Quint/Veil/Lean separation, and worked examples checked by the pure MoonBit libs/mars compiler.

Problem Solved
Natural-language EARS requirements, finite model checks, and unbounded Lean proofs silently drift unless bound in one content-addressed graph.
How It Works
Enforces typed USES/subject composition, non-vacuity witness/drop checks, hash-pinned DrWatt EARS digests, and OpenSpec ruling-authorized deltas across token_escrow (10/10 checklist) and selune_commit_queue (1/18 requirement slice, 7/7 model proofs).
./bin/selune mars check mars-next/examples/token_escrow/obligations.mars --fresh

libs/mars — Native MoonBit 1.0 RC1 MARS Compiler

MoonBit Compiler hoskinson/agentic_mars Pure MoonBit Docs Source

Canonical pure MoonBit 1.0 RC1 implementation of MARS 1.0: stateful lexer/parser, canonical UTF-8 SHA-256 row hashing, semantic/delta checker, Draft 2020-12 structural schema validator, live Quint/Veil/Lean 4.35.0 auditing, and built-in self-test & checklist runner.

Problem Solved
Provides a zero-Python, multi-target (wasm, native, js) MARS 1.0 toolchain embeddable directly inside Selûne libraries and agent sandboxes.
How It Works
Splits syntax, checker, emit (with pure MoonBit schema_check.mbt), and cmd packages cleanly against MARS-MBT-CONTRACT.md; passes multi-target MoonBit tests, mars1 self-test, and mars1 verify-checklist with zero Python dependency.
./bin/selune mars self-test && ./bin/selune mars verify-checklist mars-next/examples/token_escrow/checklist.toml

MarsAudit.lean — Independent Lean 4.35 Proof Auditor

Kernel Auditor Governance Docs Source

Independent Lean 4.35.0 proof and trust-budget auditor verifying rigid universe equality, transitive axioms, compiler-hook attributes, non-vacuity, and typed OWED obligations.

Problem Solved
Proof authors can accidentally introduce sorryAx, custom axioms, native_decide boundaries, or tautological True codomains that defeat assurance claims.
How It Works
Imports candidate proofs against independently generated expectations with loadExts=false, audits extern/implemented_by/unsafe/partial hooks against trust catalogs, and enforces #mars_depends, #mars_signature, and #mars_literals.
./bin/selune mars audit mars-next/examples/token_escrow/obligations.mars

llm-wiki/ & SIM — Knowledge Base & Self-Improvement Memory

Knowledge & SIM Governance Optional Overlay Docs Source

Fail-open repo-local LLM knowledge base (29 compiled pages across 12 sources, 7 entities, 7 concepts, 3 syntheses) + 4 typed SIM root-cause entries, audited by llm-wiki/tools/{lint,sim}.py and accessible via ./bin/selune wiki and agentic_wiki_* MCP tools.

Problem Solved
Repeated workflow regressions (manifest syntax, state explosion, contrast drift, stale metrics) recur across agent sessions unless root causes and verified fixes live in a linted, queryable ledger.
How It Works
Compiles pointers from raw/SOURCES.tsv into cross-linked wiki pages, tracks root-cause edits and observed outcomes in llm-wiki/SIM.md, and stays strictly off the commit path (source_wins=true, commit_path_affected=false).
./bin/selune wiki lint && ./bin/selune wiki sim && ./bin/selune wiki query "MARS"