decision-table
Decision Table
Decision Table 是面向 AI 代理的确定性决策与约束原语。它将有界的业务判断从模型推理中移出,放入一个严格、可版本化、可执行的 IR 中。
产品名称以及稳定的包、CLI、插件、Skill 和 MCP 标识符记录在 docs/PRODUCT_IDENTITY.md 中。
首个版本提供:
decision.evaluate:使用first、unique、collect或priority命中策略评估事实;decision.validate:验证模型,并在支持的情况下保守地证明重复、重叠或遮蔽规则;constraint.check:检查提议的候选结果,并返回违规项、缺失输入以及配置的修复提示;constraint.check_approved:当由宿主配置时,针对调用方无法替换或回填日期的精确已批准规则集执行只读检查;一个共享的 TypeScript 核心、一个 JSON CLI,以及一个 MCP 服务器和 Codex 插件。
在 Codex 中安装
codex plugin marketplace add tetracoralla/decision-table --ref main
codex plugin add decision-table@decision-table安装后启动一个新的 Codex 任务,以便从已安装的插件中加载 Skill 和 MCP 工具。无需 npm 账户、npm 包或源码构建;该插件包含一个预构建的 MCP 服务器,只需要 PATH 上有 Node.js 20.19 或更高版本。
仓库根目录是 marketplace,plugins/decision-table 是可安装的插件。有关更新、移除和验证,请参阅 docs/INSTALLATION.md。
使用普通请求,例如:
“在我使用之前验证这个决策规则集。”
“用这些事实评估这个规则集。”
“检查这个提议的操作是否满足这些约束。”
Decision Table 作为 Codex 插件从 GitHub 分发。本仓库中的 Node 包是私有的,仅用于构建、测试和本地库开发;它不会发布到 npm。
从源码开发
npm install
npm run check对于本地插件开发,将此仓库目录本身添加为 marketplace,并使用 npm run check:plugin 验证源码插件。
CLI
npm run cli -- validate examples/payment-approval.decision.json
npm run cli -- evaluate examples/payment-approval.decision.json \
--facts examples/payment-approval.facts.json \
--expected-version 1.0.0
npm run cli -- check examples/email-marketing.constraint.json \
--candidate examples/email-marketing.candidate.json \
--facts examples/email-marketing.facts.json所有输出均为 JSON。使用 - 代替输入路径,以从 stdin 读取该单个文档。所选命令未定义的选项会被拒绝。规则集、事实和候选文档共享一个累计 256 KiB 的限制。
对于精确内容固定,同时传递 --expected-version 和 --expected-fingerprint <sha256>。
已批准检查与宿主强制
内联的 constraint.check 是建议性的,因为其调用者提供规则集。对于使用宿主批准策略的只读分析,请在启动 MCP 服务器之前绑定规则集:
import {
createApprovedConstraintChecker,
createConstraintExecutionGuard,
fingerprintRuleset,
} from "@openadam/decision-table";
const expected = {
id: approvedRuleset.id,
version: approvedRuleset.version,
fingerprint: fingerprintRuleset(approvedRuleset),
};
const checker = createApprovedConstraintChecker({ ruleset: approvedRuleset, expected });捆绑的 stdio 服务器在其宿主将 DECISION_TABLE_APPROVED_CONSTRAINT_JSON 设置为相同的严格绑定对象时,暴露 constraint.check_approved。Agent 无法替换策略或回填检查日期,但它仍然提供候选和事实,因此此只读 MCP 工具不是执行边界。
对于受治理的副作用,将候选构建、可信事实加载、检查和执行保持在宿主拥有的上下文中:
const guard = createConstraintExecutionGuard(checker, async (action, run) =>
database.transaction(async (transaction) =>
run({
candidate: candidateFromActualAction(action),
facts: await loadTrustedFacts(transaction, action),
execute: (sameActionSnapshot) =>
executeActualAction(transaction, sameActionSnapshot),
}),
),
);
const outcome = await guard.execute(actualToolArguments);守卫对实际动作进行快照,除非约束返回有效,否则阻止执行器,并将相同的冻结快照传递给执行。宿主拥有的上下文是事务或锁必须保持易变事实在副作用期间有效的地方。守卫是一个库边界,并且有意不作为 Agent 可调用的 MCP 工具。
规则集形状
条件是标记数据,绝不是可执行字符串:
{
"op": "compare",
"left": { "kind": "fact", "path": "amount" },
"comparator": "gte",
"right": { "kind": "literal", "value": "10000" }
}十进制输入是字符串。缺失路径产生 UNKNOWN;它们不会被强制转换为 false。日期时间要求真实的 ISO 日历值、显式偏移、秒,并且精度不超过毫秒。参见 examples/ 和 docs/PRODUCT_MODEL.md 以了解完整的产品边界。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.
Hosted MCP for creating, checking, deploying, and hosting static sites for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tetracoralla/decision-table'
If you have feedback or need assistance with the MCP directory API, please join our Discord server