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 分