Decision Ledger

approved

by Dinesh S

Bind decisions to the code they govern and see when that code drifts. - This plugin has not been manually reviewed by Obsidian staff.

46 downloadsUpdated 1mo agoMIT

Decision Ledger

Keep your design notes honest. This plugin renders the live code a decision governs, right inside the note that explains it — and tells you when that code has drifted away from what the note claims.

Requires a separate CLI and is desktop-only. The plugin is a front end for ledger, a small Go binary that does the git work. Install that first — see Requirements.

The problem

You write down why you made a decision. Months later the code has moved, been refactored, or deleted, and the note still confidently describes something that no longer exists. Nobody notices, because nothing ever checks.

What this does

Put a ledger block in any note:

```ledger
id: jitter-backoff
```

It renders the code that decision governs, fetched from your repository at read time, with a status:

StatusMeaning
trackedThe anchor still matches its code
drifted 67%Relocated by similarity — the code changed since you wrote this
code goneThe governed code no longer exists, so the decision is probably stale

There is also a sidebar listing every decision in the repository, worst first, so you can see at a glance which of your notes have rotted.

The id can come from the note's frontmatter instead:

---
ledger-id: jitter-backoff
---

Requirements

The plugin shells out to the ledger binary, which reads your git history.

go install github.com/Din-es/Ledger_c/cmd/ledger@latest

Or download a binary for Windows, macOS or Linux from Releases.

Because it runs a local process, this plugin is desktop only — it cannot work on Obsidian mobile.

Setup

  1. Install the plugin.
  2. In its settings, set:
    • Ledger binary — the full path to ledger (or just ledger if it is on your PATH)
    • Repository path — the full path to the git repository the decisions live in
  3. In that repository, run ledger init, then anchor your first decision:
ledger bind src/auth/retry.go:11-14 --note jitter-backoff --title "Jittered backoff"
  1. Back in settings, press Check the engine. It runs the binary and reports the version that answered, so a wrong path fails there rather than as a silently empty sidebar.

Tip: the cleanest setup is keeping your notes inside the repository, so vault paths and repo paths are the same thing. A separate vault works, but you will be mapping paths by hand.

Where this plugin fits

This is the authoring surface, and on its own it reports drift without ever preventing it. There are two others, and you want all three:

SurfaceDirectionWhat it gives you
Obsidian — this pluginnote → codeWrite down why, and see the live code a decision governs while you read the note
VS CodeDecision Anchorscode → noteReading unfamiliar code, ask which decision governs this line
gitledger verify in CIenforcementA pull request that changes governed code without revisiting its note fails the build

Only the CI gate actually prevents rot — the other two make it visible. If you set up one more thing after this plugin, make it the gate; ledger init scaffolds the workflow for you.

The VS Code extension is listed as Decision Anchors rather than Decision Ledger because Marketplace extension names are globally unique and that one was taken. Same project.

Commands

CommandWhat it does
Open decision ledgerThe staleness sidebar, worst decisions first
Resolve all decisionsRe-check every decision against the current code
Show stale decisionsNotice listing anything not currently tracked

Troubleshooting

spawn ledger ENOENT — the plugin cannot find the binary. Put its full path in settings, or add it to your PATH.

Nothing renders / settings seem ignored — check the plugin's data.json is valid JSON. On Windows, use forward slashes in paths (C:/Users/you/ledger.exe) to avoid escaping mistakes.

Everything says "code gone" right after cloning — the resolver needs real git history; a shallow clone has nothing to compare against.

Development

npm install
npm run dev     # watch mode
npm run build   # typecheck + bundle to main.js

Copy main.js, manifest.json and styles.css into <vault>/.obsidian/plugins/decision-ledger/.

Links

MIT licensed.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.