Decisiontrail

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 7, 2026

Local decision memory for coding agents: record decisions with limits, search precedents, supersede.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

面向编码代理的本地决策记忆:记录带约束的决策、检索先例,并显式取代旧决策。

可以做什么
  • 记录决策:提交带约束和领域的普通决策,或用约束、证据和结论生成一条经过验证的决策记录。
  • 查找先例:在做新决策前获取旧决策的简短线索,或在已验证记录中搜索完整先例。
  • 读取与修订:按决策 ID 展开完整记录,或用新记录取代旧决策并双向关联。
  • 查看整体情况:按领域查看活跃决策线索、命名空间与计数、能力画像,以及重复或过时的候选记录。
适用场景
适合编码代理反复做出架构或工具选型决定(数据库、缓存、发布节奏)的场景,让后续会话能找到此前的理由而不是重新决策,并以显式修订代替直接改写。
运行要求
通过 npx 或 Docker 镜像在本地运行,无需账号、登录或网络访问。决策保存在单个 JSON 文件中,路径由 DECISIONTRAIL_DB 指定,默认为 ~/.decisiontrail/decisions.json。DECISIONTRAIL_AGENT 和 DECISIONTRAIL_PROJECT 用于命名命名空间,默认均为 local。使用 Docker 时需挂载卷到存储目录才能持久保存。
安装前请注意
该服务器会写入本地 JSON 文件:提交、记录验证决策和取代操作都会改动已存数据,取代会把旧记录标记为已取代。存储文件以明文保存项目的决策历史,应按敏感数据处理。原服务器的联网团队工具未包含在内,因此没有共享工作区。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Decisiontrail,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

decisiontrail

decisiontrail is a local decision memory for coding agents. When an agent makes a call — which database, which cache, which release cadence — decisiontrail records the decision together with the limits it was made under, so a later session can find the precedent instead of re-deciding from scratch, and can revise it explicitly when the call changes.

Everything is local: decisions live in one JSON file on your machine. There is no account, no login, and no network access. Records can be plain commits or validated decision records (constraints, evidence and an answer); validated records are the ones precedent search draws on. Old decisions are never edited in place — a revision creates a new record and marks the old one superseded, linked in both directions.

This package is a clean-room rebuild of the local surface of the "elen" MCP server (10 of its 12 tools). The original's two connected-mode beta tools, elen_incoming and elen_team_search, need a hosted workspace, a login and an API key, and are not included.

Install

bash
npx @reneturcios/decisiontrail elen_status

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/decisiontrail

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead. If you run the container, mount a volume over the store directory if you want decisions to persist.

Where decisions live

  • Store path: the DECISIONTRAIL_DB environment variable, or ~/.decisiontrail/decisions.json by default.
  • The file is a single JSON document. A missing file starts empty; writes are atomic (temp file, then rename), so a crash mid-write cannot truncate the store.
  • DECISIONTRAIL_AGENT and DECISIONTRAIL_PROJECT name the namespace reported by elen_status; both default to local.

Decision IDs are sequential: d-1, d-2, … in creation order.

CLI

One bin serves both faces. Each tool is a subcommand taking a single JSON argument (optional for the no-argument tools); results print as JSON.

bash
# Check the namespace before committingdecisiontrail elen_status
# Commit a decision with its limitsdecisiontrail elen_commit '{"text":"Use Postgres for sessions","constraints":["must be durable"],"domain":"storage"}'
# Record a validated decisiondecisiontrail elen_log_decision '{"constraints":["latency under 100ms"],"evidence":["benchmark run 42"],"answer":"Adopt the in-process cache","domain":"performance"}'
# Before a new decision, ask for pointers; then search validated precedentsdecisiontrail elen_suggest '{"query":"session storage"}'decisiontrail elen_search_precedents '{"query":"session storage"}'
# Read one record in full, revise one, survey the storedecisiontrail elen_expand '{"id":"d-1"}'decisiontrail elen_supersede '{"id":"d-1","text":"Use Redis for sessions with Postgres fallback"}'decisiontrail elen_get_contextdecisiontrail elen_get_competencydecisiontrail elen_consolidate
decisiontrail --version

Exit codes: 0 on success, 1 for a domain error (for example an unknown decision ID — the error names the ID), 2 for usage errors and invalid arguments.

MCP server

bash
npx -y @reneturcios/decisiontrail mcp

MCP client configuration:

json
{  "mcpServers": {    "decisiontrail": {      "command": "npx",      "args": ["-y", "@reneturcios/decisiontrail", "mcp"]    }  }}

Tools

ToolInputWhat it returns
elen_committext (required), constraints (string array), domainThe new unvalidated decision record.
elen_log_decisionconstraints, evidence, answer (all required), text, domainA validated decision record built from those inputs.
elen_expandid (required)The full record for that decision ID.
elen_suggestquery (required), limit (default 5)Short pointers (id, first 120 chars of text, domain, validated, status) to prior decisions matching the query, best match first. Considers all records.
elen_search_precedentsquery (required), limit (default 5)Full records matching the query, validated records only.
elen_supersedeid, text (both required), constraints, domainThe new successor record; the old record is marked superseded and the two are linked both ways.
elen_get_context—Active decision threads grouped by domain, with per-domain counts and the latest text, plus totals.
elen_status—Agent, project, database path, and counts (total / active / superseded / validated).
elen_get_competency—Validated-record counts per domain and the validated share (coverage) of all records, derived from validated history only.
elen_consolidate—Duplicate pairs (same domain, token Jaccard at least 0.6), the clusters they form, and stale candidates (active records older than 90 days). Changes nothing.

How matching works

elen_suggest and elen_search_precedents rank by case-insensitive token overlap between the query and a record's text plus constraints: the score is the number of distinct query tokens present. Records with no overlap are omitted; ties are broken by recency, newest first.

A record counts as validated only when it was created with elen_log_decision. A committed decision that is later superseded keeps its history: supersedes / superseded_by link the chain and the old record's status becomes superseded.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, temp dirs, no networknpm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

来源:README.md,提交 6169cda

工具

10

elen_commit

Commits a new decision to the graph, with its constraints as a plain-text list.

输入参数text必填domainconstraints

elen_log_decision

Creates a validated Decision Record from constraints, evidence and an answer.

输入参数textanswer必填domainevidence必填constraints必填

elen_expand

Expands a decision ID into its full constraints and text.

输入参数id必填

elen_suggest

Retrieves short pointers to prior decisions before you make a new one.

输入参数limitquery必填

elen_search_precedents

Searches validated decisions for precedents.

输入参数limitquery必填

elen_supersede

Revises an older decision and marks it superseded by a new one.

输入参数id必填text必填domainconstraints

elen_get_context

Gives an overview of active decision threads grouped by domain, for the start of a session.

无需输入参数。

elen_status

Returns the agent, project, database path and counts, to check the namespace before committing.

无需输入参数。

elen_get_competency

Shows the competency profile for this agent, built from its validated decision history.

无需输入参数。

elen_consolidate

Suggests clusters and duplicate or stale candidates without changing the graph.

无需输入参数。

版本历史

1
  1. v0.1.0最新Nov 4, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分