Skip to content

ddse-foundation/acm

Repository files navigation

ACM Framework

ACM Spec Release License: MIT Runtime pnpm

An industry-grade reference implementation of the Agentic Contract Model (ACM) v0.5 - A Spec‑First Contract Layer and Open Reference Runtime for Agentic Systems, delivering contract-first planning, deterministic execution, and replayable decision memory across AI agent stacks. This monorepo hosts the canonical Node.js implementation, specification artifacts, and cross-language architecture guidance.

πŸ“’ ACM v0.5 introduces fully typed capability maps, resumable execution, nucleus-governed LLM usage, and replay bundles engineered for regulated environments.


Table of Contents


Why ACM?

Traditional agent stacks mix stochastic planning with imperative code, making audits and safety reviews brittle. ACM adds a contract layer that binds plans, tools, tasks, and policies into versioned artifacts so you can:

  • βœ… Prove compliance β€” Ship append-only ledgers, guard evaluations, and replay bundles for every run.
  • βœ… Control tool access β€” Curate capabilities and tool envelopes planners may target.
  • βœ… Standardize planning β€” Preserve planner alternatives, rationale, and prompt hashes for reproducibility.
  • βœ… Resume safely β€” Checkpoint deterministic runtime progress and restart mid-plan.
  • βœ… Integrate anywhere β€” Bridge ACM contracts to LangGraph, Microsoft Agent Framework, MCP servers, or custom runtimes with minimal glue.

The framework follows the ACM specification, treating Goal, Context Packet, Plan, Capability, Task, Tool, Policy, and Ledger as first-class artifacts.


Feature Highlights

Pillar What You Get Key Packages
Contract-First SDK Typed contracts for tools, tasks, capabilities, ledger entries, guard expressions, policy hooks, and verification adapters. @ddse/acm-sdk
Structured Planning Multi-plan generation with rationale, prompt digests, tool-call envelopes, and deterministic selectors. @ddse/acm-planner
Deterministic Runtime Guard evaluation, policy gates, retries/backoff, checkpointing, streaming sinks, and ledger emission. @ddse/acm-runtime
High-Level Orchestrator Single-call helper that wires planner, runtime, nucleus, context providers, and adapters. @ddse/acm-framework
Adapters & Integrations LangGraph / Microsoft Agent Framework bridges plus Model Context Protocol tooling. @ddse/acm-adapters, @ddse/acm-mcp
Replay & Analysis Export/import replay bundles with ledger verification and tool-call inspection. @ddse/acm-replay
Reference Experiences Deterministic demos and a production-style AI coding assistant with budgeting and streaming UX. @ddse/acm-examples, @ddse/acm-aicoder

Documentation Index


Monorepo at a Glance

acm/
β”œβ”€β”€ README.md                 # This document
β”œβ”€β”€ LICENSE                   # MIT license for the project
β”œβ”€β”€ spec/                     # ACM specifications and rationale
β”œβ”€β”€ framework/
β”‚   β”œβ”€β”€ architecture.md       # Cross-language architecture blueprint
β”‚   β”œβ”€β”€ node/                 # Node.js reference implementation (pnpm workspace)
β”‚   └── java/, python/        # Language ports (under active development)
└── WHITEPAPER.md             # Strategic positioning and vision

Package Matrix

Package Description Status
@ddse/acm-sdk Base contracts, registries, policy/verification interfaces, ledger types. βœ… Stable @ v0.5.0
@ddse/acm-runtime Deterministic runtime, checkpointing, resumable execution, guard evaluation. βœ… Stable @ v0.5.0
@ddse/acm-planner Structured LLM planner with plan alternatives, prompt hashing, tool envelopes. βœ… Stable @ v0.5.0
@ddse/acm-framework High-level faΓ§ade combining planner + runtime + nucleus wiring. βœ… Stable @ v0.5.0
@ddse/acm-llm OpenAI-compatible clients for Ollama, vLLM, and custom providers. βœ… Stable @ v0.5.0
@ddse/acm-adapters LangGraph/MSAF adapters preserving ACM contracts. βœ… Stable @ v0.5.0
@ddse/acm-mcp Model Context Protocol tooling and registries. βœ… Stable @ v0.5.0
@ddse/acm-replay Replay bundle export/import, ledger validation utilities. βœ… Stable @ v0.5.0
@ddse/acm-examples CLI demos, refund/issue flows, replay bundle samples. βœ… Stable @ v0.5.0
@ddse/acm-aicoder Developer assistant with streaming TUI and budgeting. βœ… Stable @ v0.5.0

Language Ports: Python and Java bindings follow the same specification and architecture; see framework/python/ and framework/java/ for progress trackers.


Quick Start

Prerequisites

  • Node.js β‰₯ 18
  • pnpm β‰₯ 8
  • Optional: Ollama or vLLM for local LLM experiments

Install & Build

git clone https://github.com/ddse-foundation/acm.git
cd acm/framework/node
pnpm install
pnpm build

Run Reference Demo

# Refund workflow demo with vLLM (tested with Qwen)
pnpm --filter @ddse/acm-examples demo -- --provider vllm --model Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8 --base-url http://localhost:8001/v1 --goal refund

# Export a replay bundle while running the issue-resolution flow
pnpm --filter @ddse/acm-examples demo -- --goal issues --save-bundle --checkpoint-dir ./checkpoints

Launch the AI Coder Experience

pnpm --filter @ddse/acm-aicoder demo \
  --provider vllm \
  --model Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8 \
  --base-url http://localhost:8001/v1 \
  --workspace $PWD/../../

Build Your First Plan Programmatically

import { ACMFramework, ExecutionEngine } from '@ddse/acm-framework';
import { SimpleCapabilityRegistry, SimpleToolRegistry } from '@ddse/acm-examples/registries';
import { createVLLMClient } from '@ddse/acm-llm';
import { MemoryLedger } from '@ddse/acm-runtime';

const registry = new SimpleCapabilityRegistry();
const tools = new SimpleToolRegistry();
const llm = createVLLMClient('Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8', 'http://localhost:8001/v1');

const framework = ACMFramework.create({
  capabilityRegistry: registry,
  toolRegistry: tools,
  nucleus: {
    call: llm.generateWithTools!,
    llmConfig: {
      provider: llm.name(),
      model: 'Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8',
      temperature: 0.1,
      baseUrl: 'http://localhost:8001/v1',
    },
    allowedTools: tools.listNames(),
  },
  planner: { planCount: 2 },
  execution: { engine: ExecutionEngine.ACM, checkpointInterval: 1 },
});

const ledger = new MemoryLedger();
const run = await framework.execute({
  goal: 'Resolve a priority refund ticket for order 1234.',
  context: { facts: { orderId: '1234', severity: 'P1' } },
  ledger,
});

console.log(run.plan.id);
console.log(run.execution.outputsByTask);

Plan β†’ Execute β†’ Replay Flow

  1. Normalize Goal & Context β€” IDs, provenance, and scope metadata are enforced before planning.
  2. Structured Planning β€” @ddse/acm-planner generates multiple plan candidates with rationale, tool envelopes, and prompt hashes recorded in the ledger.
  3. Policy-Aware Execution β€” @ddse/acm-runtime executes the selected plan, evaluates guards, invokes policy and verification hooks, and checkpoints progress.
  4. Ledger & Replay β€” Every planner and runtime decision streams into the MemoryLedger, enabling replay bundle export via @ddse/acm-replay for audits, testing, or regression harnesses.
  5. Adapters & Integrations β€” Optional hooks route execution through LangGraph/MSAF engines or hydrate context via MCP tools without breaking ACM contracts.

Architecture Overview

  • Three-Layer Intent: Planner (reasoning), Framework (coordination), Runtime (deterministic execution) β€” see framework/architecture.md.
  • Nucleus Gateway: Centralized LLM governance with prompt hashing, deterministic tool allow-lists, and streaming support.
  • External Context Provider Adapter: Bridges nucleus context directives (request_context_retrieval) to developer-owned retrieval tools.
  • Decision Memory: Append-only ledger + checkpoints produce tamper-evident replay bundles for compliance and analytics.
  • Interoperability: Adapters maintain parity with popular agent ecosystems while preserving ACM guarantees.

Refer to the sequence diagrams in framework/architecture.md for deep dives.


Governance & Compliance

  • Policy Engine Hooks β€” Connect Open Policy Agent (OPA/Rego) or custom evaluators via PolicyEngine interfaces.
  • Verification Grammar β€” Enforce acceptance criteria separate from task logic through VerificationEngine adapters.
  • Tool & Capability Certification β€” Registry-driven capability maps ensure planners only target approved execution paths.
  • Replay Bundles β€” Capture planner outputs, runtime telemetry, policies, and checkpoints in one exportable artifact.
  • Audit Trails β€” Ledger entries include plan IDs, guard outcomes, retries, verification results, and tool-call digests.

Runbook for resumable execution lives in framework/node/docs/tdr/RUNBOOK_RESUMABLE.md.


Roadmap

  • βœ… v0.5.0 (Current) β€” Contract-complete Node implementation, resumable runtime, replay bundles, MCP integration, AI Coder experience.
  • 🚧 Python Port β€” Tracking in framework/python/ with parity milestones.
  • 🚧 Java Port β€” Tracking in framework/java/ aligned to the same spec artifacts.
  • 🧭 Future β€” Unified CLI (@ddse/acm-cli), extended verification grammars, hosted replay dashboards.

Detailed plans live in:


Contributing

We welcome contributions across contracts, runtime, adapters, and language ports.

Before submitting a PR, run pnpm build from framework/node/ to ensure cross-package builds succeed.


Resources & Support


License

This project is licensed under the MIT License.


Author: Mahmudur R. Manna β€” Founder & Principal Architect, DDSE Foundation (Dhaka, Bangladesh)