Input · intent
Give it business intent
It searches a promoted corpus of compiler-validated Daml patterns, returning high-confidence, sourced patterns — or an honest not covered.
The safety layer between LLM drafts and ledger code.
Input · intent
It searches a promoted corpus of compiler-validated Daml patterns, returning high-confidence, sourced patterns — or an honest not covered.
Input · intent + code
It returns a definitive verdict on the draft: not acceptable yet, aligned enough to compile, or verified against a clean client build.
It tells your agent when to proceed, when to revise, and when to stop.
The developer maintains complete build ownership
Generation stays inside your editor. Daml Reason never writes your templates for you.
daml build runs on your machine or in CI. The server consumes your result; it never produces one.
Daml Reason is a safety layer for Daml and Canton developers that helps ensure sound builds. AI agents draft code quickly, but ledger logic demands strict soundness.
Agents in Cursor and automated jobs in CI share the exact same daml_reason protocol. Generation stays inside your editor; the server evaluates drafts against a promoted bundle and refuses weak recall.
Phase A
Send businessIntent. Cross-encoder retrieval returns up to five pinned canonical patterns with complete provenance.
suggest_patternsHigh-confidence matches from corpus_v2 (similarity floor 0.68, margin 0.04).propose_search_queryTransparent query rewrite when intent needs sharper calibration. You must acknowledge proposedSearchQuery or refuse it.delegateIntent is ambiguous or out of scope. The tool abstains honestly rather than hallucinating patterns.Phase B
Submit damlCode alongside local compilationResult from your machine or CI pipeline. The server never compiles code for you — it uses your client build results as a ground-truth signal.
failCode misaligns with pattern standards or logic breaks. Returns remediation patterns.ready_to_compileSemantic alignment meets the threshold. Prompts the agent to run local build validation.passGranted strictly after a clean client build and gate verification. Every response includes an explicit alignmentScore.Not one-shot generation. Orient on intent, draft, gate, revise from strong patterns, compile on the client, then submit diagnostics for the final verdict. The human owns ship.
Query businessIntent via Phase A.
Agent generates initial damlCode.
Run Phase B iteratively until reaching ready_to_compile.
Run daml build locally on the client machine.
Submit compile diagnostics back through Phase B for the final verdict.
// request (shape)
{
"businessIntent": "Batch settlement for two asset legs",
"damlCode": "...",
"compilationResult": {
"succeeded": false,
"exitCode": 1
}
}
// response (excerpt)
{
"outcome": "fail",
"alignmentScore": 0.52,
"patterns": [ "... strong corpus hits ..." ]
}
pass is forbidden without a successful client compile signal.Daml Reason operates strictly read-only against immutable release bundles (manifest + chroma_db + slices + oracles). Active production target: corpus_v2 (fingerprint 2563231711cd048f).
Pinned source
Interfaces, instruments, lifecycling, settlement flows, and holding rules.
634 patterns
Pinned source
Amulet token standards, wallet implementations, and DSO governance mechanics.
479 patterns
Pinned source
Reference tutorials and Daml Script workflows.
348 patterns
Release criteria
daml build pass rate.decision.yaml.Fix the corpus once; every downstream agent session inherits sound practice
Retrieval benchmarks
Evaluated against 37 golden queries on corpus_v2. Retrieval metrics track bundle health across releases, not individual user prompt scores.
delegateRetrieval requires bge-reranker-v2-m3 cross-encoders at serve time. If coverage is missing, the corpus is improved and re-promoted. The retrieval gates are never artificially lowered.
Run it locally in your development environment, or point your editor at the authenticated hosted service. Same daml_reason contract either way.
Sign in with email (magic link) and issue a Bearer API key for your account.
Add the server entry to ~/.cursor/mcp.json.
Call Phase A with a businessIntent to warm the cross-encoder.
For hosted endpoints, authenticate using an account Bearer token. Usage is tracked against monthly allowances with explicit quota resets — when an allowance is spent the tool returns over_quota as a normal result, not a dropped connection.
{
"mcpServers": {
"daml-reason": {
"url": "https://<hosted-endpoint>/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
{
"mcpServers": {
"daml-reason": {
"url": "http://127.0.0.1:7286/mcp",
"headers": {
"Authorization": "Bearer YOUR_LOCAL_KEY"
}
}
}
}
Most Daml coding sessions lack verified reference material. If your team maintains production templates, reference libraries, or audited Canton protocols, bring them into the promoted corpus.
01 You provide
Pinned repositories, Daml Script test oracles, and audited templates.
02 Corpus gates run
Automated parsing, compilation checks, and golden-query evals.
03 Agents receive
Semantic routing directly to your canonical pattern slices — or honest refusal when an ask falls outside your framework.
This is for teams who already ship Canton and Daml material others should copy. Matching intent routes to your artifacts, with path and provenance, not a model guess.
Daml Reason is a shared checkpoint on a promoted canton-corpus bundle: retrieve, gate, and say whether to continue. When the corpus is wrong or thin, you improve the corpus once. We take precautions, not shortcuts.