A personal financial document knowledge management system for dual AU/US citizens with businesses in both countries principally targeting Claude cowork on windows (.mcpb distribution)
JavaScript
0
380 commits
updated Sep 7, 2026
Note on naming: This project uses multiple names (
l3dg3rr,ledgerr-mcp,ledgrrr,ledg3rr) depending on context. See POLYSEME-MAP.md for the mapping.
l3dg3rr is a general-purpose, git-versioned systems modeling and action/decision registry: a strongly typed, ontologically linked graph of scriptable, visual-first workflows, where Rust owns structural invariants, Rhai owns editable classification and workflow rules, and AI/LLM agents drive supervised ETL through MCP tools without taking custody of credentials or approval authority. Local-first bookkeeping — turning financial documents into an accountant-usable, CPA-auditable source of truth — is the first dogfood vertical proving out that substrate, not the project's purpose. Requirements (ReqIF), schema/data modeling (LinkML), and a decision+cost ledger are newer verticals sitting on the same substrate: the ontology graph, the evidence chain, Rhai policy, and KerML/OWL2 metamodel work.
Read the live book: https://promptexecution.github.io/ledgrrr/
Bookkeeping vertical's primary outcome: ingest raw historical statements, classify and reconcile transactions, preserve evidence and mutation history, then export a CPA-reviewable Excel workbook without requiring private data to leave the local machine.
The project is intentionally not just a PDF parser, a rules folder, or a visualization experiment. Those are subsystems of one general process/action control plane, expressed here through its original bookkeeping vertical:
fn source_documents() -> typed_document_graph
fn typed_document_graph() -> extraction_and_normalization
fn extraction_and_normalization() -> transaction_classification
fn transaction_classification() -> validation_and_legal_checks
fn validation_and_legal_checks() -> reconciliation
fn reconciliation() -> workbook_export
fn workbook_export() -> cpa_review
fn cpa_review() -> audit_history
The workbook remains that vertical's human and accounting interface. The graph, sidecar state, Rhai rules, MCP tools, and visualization layers exist to make it reproducible, explainable, and agent-accessible — and the same typed-state machine now also governs non-bookkeeping verticals (requirements, decisions, costs) and agent capability discovery/skill lifecycle, not just financial documents.
l3dg3rr resolves recurring product contradictions by separating concerns instead of adding one-off glue:
| Contradiction | Resolution |
|---|---|
| Accountant-readable vs machine-replayable | Excel is the CPA-facing artifact; journal and sidecar state preserve deterministic replay. |
| Runtime-editable rules vs financial correctness | Rhai handles heuristics at controlled boundaries; Rust types enforce money, identity, validation, and workbook contracts. |
| Agent autonomy vs operator control | MCP exposes capability families; host policy, audit, approvals, notifications, and credentials remain owned by l3dg3rr. |
| Rich visual workflows vs stable execution | A narrow Rhai diagram DSL renders Mermaid and isometric views while typed Rust workflow structs own execution contracts. |
| Xero integration vs local-first privacy | Xero is a supervised capability reached through worker tools and reconciled evidence, not raw credential leakage to a model. |
| Claude/Desktop installability vs privileged Windows control | MCPB installs only the Claude-facing controller; a native Windows installer owns service, tray, repair, update, and UAC boundaries. |
| Office-native diagrams vs local evidence ownership | OneNote/Office and SharePoint publish versioned playbook artifacts; ledgrrr remains the source of truth for evidence, simulation, and refresh provenance. |
MECE module grouping keeps the logic approachable:
| Layer | Responsibility | Primary files |
|---|---|---|
| Bookkeeping truth | ingest, journal, workbook projection, audit output | crates/ledger-core/src/ingest.rs, journal.rs, workbook.rs |
| Typed domain model | documents, transactions, accounts, tax categories, validation state | document.rs, classify.rs, validation.rs, legal.rs |
| Ontology graph | typed links between documents, accounts, transactions, evidence, Xero entities | crates/ledgerr-mcp/src/ontology.rs, crates/ledger-core/src/graph.rs, book/src/ontology-type-mesh.md |
| Scriptable policy | editable Rhai classification and document-shape rules | rules/, classify.rs, rule_registry.rs |
| Workflow control | pipeline state, scheduled operations, approval/reversibility metadata | pipeline.rs, workflow.rs, ledger_ops.rs, calendar.rs |
| Visualization | Mermaid, isometric docs renderer, live Rhai editor | crates/mdbook-rhai-mermaid/, book/theme/rhai-live-core.js, visualize.rs |
| Agent boundary | published MCP capability families and deterministic argument contracts | crates/ledgerr-mcp/src/contract.rs, mcp_adapter.rs, docs/mcp-capability-contract.md |
| Operator host | desktop settings, notifications, local chat endpoint, tray/window control | crates/ledgerr-host/src/ |
| Desktop packaging | Claude MCPB controller, Windows service/tray installer, local runtime status | PRD-11.md, book/src/desktop-agent-office-playbook.md, crates/ledgerr-host/src/ |
| Microsoft 365 surface | OneNote/Office diagram task pane and SharePoint playbook rendering | PRD-11.md, future Office add-in manifest, future SPFx package |
VENDOR--ACCOUNT--YYYY-MM--DOCTYPE.ext, infer document shape, and normalize rows.AUDIT.log history.There are three related but distinct Rhai surfaces:
| Surface | Purpose | Supported shape |
|---|---|---|
| Transaction rules | Runtime tax/bookkeeping classification | fn classify(tx) -> #{ category, confidence, review, reason } |
| Workflow compiler output | Runtime state transition function | generated Rhai switch [state, event.kind] { ... } from WorkflowToml |
| Documentation diagram DSL | Visual workflow blocks in mdBook and live editor | fn source() -> target, if expression -> target, match expr => Arm -> target |
The match operator discussed in the docs is a switch-like visualization idiom for branch-heavy workflows. Repeated arms with the same expression collapse into one semantic match node:
fn verify_result() -> match_result_disposition
match result.disposition => Disposition::Unrecoverable -> halt_pipeline
match result.disposition => Disposition::Recoverable -> repair_and_retry
match result.disposition => Disposition::Advisory -> record_note
match result.disposition => _ -> operator_review
fn repair_and_retry() -> requeue_validation
Current behavior:
| Behavior | Status |
|---|---|
| One match node per expression | Implemented in crates/mdbook-rhai-mermaid/src/parser.rs and mirrored in book/theme/rhai-live-core.js |
| Declaration-ordered arms | Implemented with IndexMap in Rust and ordered Map behavior in JS |
| Labeled outgoing edges | Implemented in Mermaid output and live editor previews |
Default arm detection (_, else, otherwise, default) | Implemented with visual default annotation |
| Isometric lane assignment for arms | Implemented in the live docs renderer |
| Rich explicit rejoin semantics and animated lane reflow | Planned / in progress; see the match plan chapter |
Deep references:
See Capability Map for the full component table.
| Capability | Status | Notes |
|---|---|---|
| Filename convention parser | Implemented | VENDOR--ACCOUNT--YYYY-MM--DOCTYPE.ext routing |
| Blake3 transaction identity | Implemented | idempotent transaction IDs |
| Journal and workbook ingest projection | Implemented | workbook remains projection/audit artifact |
| Rhai classification engine | Implemented | strict output schema, review flags |
| Rule registry and deterministic waterfall | Implemented | semantic selector is still planned |
| Document shape classifier | Implemented | vendor/format inference for bank statements and CSVs |
| Business calendar | Implemented | US/AU tax defaults and recurring events |
| Validation disposition model | Implemented | unrecoverable/recoverable/advisory issue handling |
| Constraint + legal synergy layer | Implemented | ConstraintEvaluation → Issue, Z3Result → Issue, CommitGate, verify_legal(), check_constraints() wired into pipeline (PRD-7 Phase 0) |
| Legal solver path | Implemented | AU GST s38-190/s40-5, AU FBT, US Schedule C, US FBAR, US FEIE; Z3 behind ledger-core/legal-z3; Jurisdiction::legal_ruleset() |
| Workflow TOML compiler | Implemented | Mermaid, Rhai FSM, Rust enum generation |
| mdBook Rhai-to-Mermaid preprocessor | Implemented | supports fn, if, and match diagram DSL lines |
| Live Rhai docs editor | Implemented | synchronized isometric and Mermaid views |
| Xero capability family | In flight | supervised MCP capability, not raw credential exposure |
| Tauri desktop host | Active | sole operator host (legacy Slint surface removed, #50) |
| VZ panel — Cytoscape.js + dagre layout | Active | hierarchical type/trait graph in Tauri sidebar; dagre TB layout; CDP observable on port 19222 |
| Evidence traceability (arc-kit-au) | Implemented | petgraph-backed provenance graph with deterministic node identity |
| Claude Desktop MCPB bundle | Implemented (Phase 1) | ledgrrr-claude.mcpb packages the ledgrrr-mcp controller via just package-desktop-mcpb; all eleven ledgrrr_* tools live |
| Native Windows dogfood package | Implemented (test-signed) | sparse MSIX/external-location identity package plus per-user Win32 payload; reproducibly built and install/repair/uninstall-smoked on Windows CI. Public signing is intentionally deferred. |
| OneNote/Office add-in | Missing | future task pane generates, previews, inserts, and refreshes versioned diagram/playbook artifacts |
| SharePoint SPFx web part | Missing | future web part renders published playbook artifacts in SharePoint pages/libraries |
| Local CPU model runtime | Planned | future profile supports offline playbook generation, mutation, and simulation |
| Docling extraction bridge | Missing | planned local extraction sidecar |
| File watcher | Missing | notify not yet wired as an end-to-end inbox loop |
The roadmap beyond the current stable capability set spans three planned directions. See the linked PRDs for full specification.
PRD-7.md specifies the complete integration of the three verification layers (Kasuari constraint solver, Z3 legal solver, typed pipeline) into a unified, jurisdiction-aware pipeline.
Phase 0 is implemented (constraint + legal signals now flow into MetaCtx and produce typed Issues). Remaining phases:
TransactionFacts auto-populated from pipeline state_audit sheet materialization — every committed transaction row gets constraint_score, legal_result, disposition, and stage_trace_json columns for CPA reviewPRD-8.md specifies a formal verification suite using the Kani bit-precise model checker to prove the type system has no arithmetic gaps between versions.
Key harnesses planned:
InvoiceConstraintSolver arithmetic correctness (no overflow, correct GST tolerance)VendorConstraintSet interval invariants (p05 ≤ p95, non-negative)EvidenceGraph structural integrity (no duplicate nodes/edges, NodeId determinism)EvidenceChain<S> typestate transition completenessCommitGate exhaustiveness (every Reconciled state routes to exactly one gate)PRD-6-FUTURE.md defines a longer-horizon capability: a #[attested("invariant")] proc-macro lint that forces any type claiming a formal property to provide machine-verifiable assertions checked by both Z3 (logical predicates) and Kasuari (numerical bounds), formally proved by Kani, and recorded in an immutable append-only invariant ledger.
Core idea: the Excel workbook gains a _invariants sheet where every type-level claim (e.g., "this invoice GST arithmetic is valid", "this pipeline state has passed legal review") is a persistent, Blake3-chained record linking the runtime verification result to the Kani proof that held at build time. New invariants can be registered by any crate at runtime without modifying ledger-core, making the knowledge system self-extensible.
This closes the gap between structural type safety (what the Rust type system currently enforces) and semantic correctness (what a CPA needs to trust the output).
PRD-11.md defines the Windows and Microsoft 365 product packaging target. Claude Desktop receives a MCPB bundle containing a small ledgrrr-mcp controller (Phase 1 implemented — see MCPB Binary Distinction). The privileged desktop stack will be installed by a native Windows package, which owns ledgrrr-service.exe, ledgrrr-tray.exe, local model/runtime assets, repair/uninstall, and update metadata.
The same ledgrrr playbook model is exposed through Claude, b00t, OneNote/Office, and SharePoint:
ledgrrr_status, ledgrrr_install_plan, ledgrrr_render_diagram, and ledgrrr_simulate_pipeline.status, install --dry-run, render, simulate, and export-office JSON contracts.l3dg3rr works in concert with the _b00t_ ecosystem: a mesh of typed, lazy-loaded capabilities that govern how agents discover, install, and execute skills, roles, and blessings.
Every capability in the b00t mesh is expressed as a .datum file — a typed document with a structured AST (crates/datum/src/ast.rs), logic gate primitives (crates/datum/src/logic.rs), protocol encoding analysis (crates/datum/src/protocol.rs), and .tomllmd compound document format for summary-level distillation (verbatim / executive / epigram).
Core datum types in the mesh:
| Type | Purpose | Example |
|---|---|---|
mcp | MCP server capability | b00t-mcp.mcp, just-mcp.mcp |
cli | CLI tool capability | just.cli, uv.cli, task.cli |
install | Installation recipe | rust.install, docker.install |
config | Configuration schema | opencode.config, b00t.config |
skill | Agent skill definition | managing-kubernetes-clusters.skill |
workflow | Multi-step automation | release.workflow, deploy.workflow |
ontology | Entity relationship graph | capability.ontology |
agent | Agent role/persona | executive.agent, operator.agent |
provider | MCP provider registration | b00t.provider, just.provider |
surface | ProcessSurface lifecycle | ralph-loop.surface |
Skills are lazy-loaded by progressive disclosure: a skill is only ingested into context when a matching capability trigger fires. The capability map (B00T-CAPABILITY-MAP.md) tracks which datums map to which skill names, and the RuleRegistry (crates/ledger-core/src/rule_registry.rs) uses deterministic keyword waterfall + semantic candidate selection to route requests to the right rule set.
Between capability loads and skill iterations, the Ralph loop (crates/b00t-iface/src/ralph.rs) drives an iterative propose → execute → judge → record cycle:
Init → [Propose → Execute → Judge → Record → Maintain]^n → Terminate
This generalizes the karpathy/autoresearch pattern as a typed ProcessSurface with governance-enforced TTL, crash budget, max iterations, and cadence. Each iteration generates an ExperimentVerdict (Pass/Fail) that feeds into the next proposal — the agent keeps iterating until the task objective is met or the budget is exhausted.
The SurfaceHarness (crates/b00t-iface/src/exec/harness.rs) wraps any ProcessSurface with a SurfaceMachine state machine and GovernancePolicy constraints, producing a PromiseChain audit record for every lifecycle transition.
The system determines capability preference using an ordered match of agent role tier (sm0l / ch0nky / frontier), skill invariant tags, and context window budget. Selection follows:
#kebab-case tags from crates/ledger-core/src/tags.rs).tomllmd merge strategies can combine two+ datums at different summary levels into a higher-order meta-learn datumDatum types have a dedicated visualization layer:
crates/datum/src/logic.rs defines NAND, NOR, ADD, WAIT, TX, RX, CAP gates with typed port arity and flux capacitor meta-state stabilitycrates/datum/src/protocol.rs evaluates Z3-style XOR optimality (O = P XOR B) and constraint strength (Required / Strong / Medium / Weak)crates/b00t-iface/src/viz/mod.rs produces SVG/glTF scene graphs with semantic role-driven icon/color/layoutThe McpProvider trait (crates/ledgerr-mcp/src/provider.rs) and McpProviderRegistry allow b00t's external MCP providers (b00t-mcp, just, ir0ntology) to register their tools alongside the built-in ledgerr_* capability families. The ServiceActor gate system (crates/ledgerr-mcp/src/actor.rs, gate.rs) routes typed messages through channels, forming the concrete dataflow that maps to the flux capacitor gate metaphor.
This project started as a local-first bookkeeping pipeline — ingest PDF statements, classify transactions with Rhai rules, export a CPA-auditable Excel workbook (see System Thesis above; that pipeline is still real and still works). The architecture kept revealing a deeper structure: the bookkeeping pipeline was one surface of a more general systems-modeling and action/decision registry, which is why the framing at the top of this README no longer leads with tax/bookkeeping. The same MetaCtx carry-forward confidence model that compounds validation scores also governs which b00t capabilities load into agent context, and the same typed-state machine now governs requirements/decisions/costs, not just financial documents.
The published book is the detailed reference and should be preferred over expanding the README indefinitely:
ledgerr_* tool familiesBuild and validate docs locally:
just docgen
just docgen-check
just docserve
Prerequisites:
| Tool | Purpose |
|---|---|
| Rust 1.88+ | workspace build/test |
just | canonical command runner |
mdbook + mdbook-mermaid | book generation |
mdbook-rhai-mermaid | Rhai diagram preprocessor |
cocogitto | conventional versioning and changelog automation |
Common recipes:
# Run the full test suite plus MCP outcome smoke path.
just test
# Build the book into book/book/.
just docgen
# Validate diagrams, links, and live Rhai JS tests.
just docgen-check
# Serve the book locally with live Rhai editing.
just docserve
# Start the stdio MCP server.
just mcp-start
Use Justfile as the executable workflow contract. When a command changes, update the recipe first and reference the recipe name from docs.
This project produces two distinct .mcpb bundles for different use cases:
| Binary | MCPB name | Purpose | Output |
|---|---|---|---|
ledgerr-mcp-server (domain server) | ledgerr-mcp-*.mcpb | Full tax ledger dataplane: PDF ingest, transaction classification, Rhai rules, Xero, reconciliation, workbook export. Runs as a stdio MCP server for general agent use. | dist/ledgerr-mcp-<target>.mcpb (ZIP — built by just bundle) |
ledgrrr-mcp (desktop controller) | ledgrrr-claude.mcpb | Claude Desktop controller per PRD-11 §3.1: the eleven ledgrrr_* tools for status, install planning, service/tray control, diagram render, simulation, and Office artifact export. | dist/ledgrrr-claude.mcpb/ (directory — built by just package-desktop-mcpb) |
Use just bundle for the domain server MCPB and just package-desktop-mcpb for the desktop controller. The desktop controller .mcpb directory can be referenced directly in Claude Desktop's MCP config.
crates/ledgerr-mcp/src/contract.rs: source of truth for the published MCP surface.The default MCP catalog should stay collapsed to the top-level ledgerr_* capability families. Add sub-operations through required action parameters instead of expanding the default tool list.
l3dg3rr follows an odd/even minor version convention, similar to the Ubuntu LTS model.
| Minor version | Series | Characteristics |
|---|---|---|
Even (1.0, 1.2, 1.4, 1.8, …) | Stable | Long-term supported. Full test gate including local Phi-4 model-inference tests. GitHub release published. Suitable for production operator use. |
Odd (1.1, 1.3, 1.5, 1.7, …) | Dev / Experimental | Fast-moving. Breaking changes within a major series are permitted. Model-inference tests may be skipped. GitHub pre-release created by the same release workflow. No LTS support. |
# Release bump — outcome depends on the next version:
# - even minor => stable release, full test gate including phi4 inference, GitHub release created
# - odd minor => dev/experimental release, fast gate only, no stable GitHub release
just release minor # or: just release major / just release patch
# Fast test gate only (excludes phi4 GGUF inference, ~seconds)
just test-fast
release recipe doescargo test suite including phi4 GGUF inference--skip phi4_produces_output --skip phi4_mistral_produces_output)./scripts/e2e_mvp.sh end-to-end smoke pathcog bump --<version> — sets version in all Cargo.toml files, creates a conventional-commit bump commit and a semver git taggit push --follow-tagsgh release create --latest)gh release create --prerelease)Pushing the tag triggers .github/workflows/docs.yml, which redeploys GitHub Pages regardless of minor parity.
All release artifacts are attached to the corresponding GitHub Release once .github/workflows/mcpb-publish.yml (MCP server bundles) and .github/workflows/msi-publish.yml (desktop app installer) finish running for that tag:
| Platform | Artifact | Purpose | Produced by |
|---|---|---|---|
| Linux (x86_64) | ledgerr-mcp-x86_64-unknown-linux-musl.mcpb | Domain server (ledgerr-mcp-server) — see MCPB Binary Distinction | mcpb-publish.yml |
| macOS (Intel) | ledgerr-mcp-x86_64-apple-darwin.mcpb | Domain server | mcpb-publish.yml |
| macOS (Apple Silicon) | ledgerr-mcp-aarch64-apple-darwin.mcpb | Domain server | mcpb-publish.yml |
| Windows (x86_64) | ledgerr-mcp-x86_64-pc-windows-msvc.mcpb | Domain server | mcpb-publish.yml |
| Windows (x86_64) | ledgrrr_<version>_x64_en-US.msi | Desktop host app — tray icon, settings UI, local chat (host-tauri, see PRD-11) | msi-publish.yml |
If a given release page is missing an artifact you expect, check that workflow's run for that tag — matrix legs can fail independently without blocking the others (mcpb-publish.yml's upload job only requires at least one platform to succeed).
To install the desktop app on Windows: download the .msi from the latest stable release and run it. To run the domain MCP server locally instead of downloading a binary, see just mcp-podman-run above or build from source with just bundle.
docker build -f Containerfile -t l3dg3rr:dev .
docker run --rm -i \
-v "$PWD/data:/data" \
l3dg3rr:dev
The container runs ledgerr-mcp-server over stdio. Mount /data for local workbook and document inputs.
177 commits
160 commits
23 commits
20 commits
JavaScript
57.0%
Rust
38.8%
A personal financial document knowledge management system for dual AU/US citizens with businesses in both countries principally targeting Claude cowork on windows (.mcpb distribution)
JavaScript
0
380 commits
updated Sep 7, 2026
Note on naming: This project uses multiple names (
l3dg3rr,ledgerr-mcp,ledgrrr,ledg3rr) depending on context. See POLYSEME-MAP.md for the mapping.
l3dg3rr is a general-purpose, git-versioned systems modeling and action/decision registry: a strongly typed, ontologically linked graph of scriptable, visual-first workflows, where Rust owns structural invariants, Rhai owns editable classification and workflow rules, and AI/LLM agents drive supervised ETL through MCP tools without taking custody of credentials or approval authority. Local-first bookkeeping — turning financial documents into an accountant-usable, CPA-auditable source of truth — is the first dogfood vertical proving out that substrate, not the project's purpose. Requirements (ReqIF), schema/data modeling (LinkML), and a decision+cost ledger are newer verticals sitting on the same substrate: the ontology graph, the evidence chain, Rhai policy, and KerML/OWL2 metamodel work.
Read the live book: https://promptexecution.github.io/ledgrrr/
Bookkeeping vertical's primary outcome: ingest raw historical statements, classify and reconcile transactions, preserve evidence and mutation history, then export a CPA-reviewable Excel workbook without requiring private data to leave the local machine.
The project is intentionally not just a PDF parser, a rules folder, or a visualization experiment. Those are subsystems of one general process/action control plane, expressed here through its original bookkeeping vertical:
fn source_documents() -> typed_document_graph
fn typed_document_graph() -> extraction_and_normalization
fn extraction_and_normalization() -> transaction_classification
fn transaction_classification() -> validation_and_legal_checks
fn validation_and_legal_checks() -> reconciliation
fn reconciliation() -> workbook_export
fn workbook_export() -> cpa_review
fn cpa_review() -> audit_history
The workbook remains that vertical's human and accounting interface. The graph, sidecar state, Rhai rules, MCP tools, and visualization layers exist to make it reproducible, explainable, and agent-accessible — and the same typed-state machine now also governs non-bookkeeping verticals (requirements, decisions, costs) and agent capability discovery/skill lifecycle, not just financial documents.
l3dg3rr resolves recurring product contradictions by separating concerns instead of adding one-off glue:
| Contradiction | Resolution |
|---|---|
| Accountant-readable vs machine-replayable | Excel is the CPA-facing artifact; journal and sidecar state preserve deterministic replay. |
| Runtime-editable rules vs financial correctness | Rhai handles heuristics at controlled boundaries; Rust types enforce money, identity, validation, and workbook contracts. |
| Agent autonomy vs operator control | MCP exposes capability families; host policy, audit, approvals, notifications, and credentials remain owned by l3dg3rr. |
| Rich visual workflows vs stable execution | A narrow Rhai diagram DSL renders Mermaid and isometric views while typed Rust workflow structs own execution contracts. |
| Xero integration vs local-first privacy | Xero is a supervised capability reached through worker tools and reconciled evidence, not raw credential leakage to a model. |
| Claude/Desktop installability vs privileged Windows control | MCPB installs only the Claude-facing controller; a native Windows installer owns service, tray, repair, update, and UAC boundaries. |
| Office-native diagrams vs local evidence ownership | OneNote/Office and SharePoint publish versioned playbook artifacts; ledgrrr remains the source of truth for evidence, simulation, and refresh provenance. |
MECE module grouping keeps the logic approachable:
| Layer | Responsibility | Primary files |
|---|---|---|
| Bookkeeping truth | ingest, journal, workbook projection, audit output | crates/ledger-core/src/ingest.rs, journal.rs, workbook.rs |
| Typed domain model | documents, transactions, accounts, tax categories, validation state | document.rs, classify.rs, validation.rs, legal.rs |
| Ontology graph | typed links between documents, accounts, transactions, evidence, Xero entities | crates/ledgerr-mcp/src/ontology.rs, crates/ledger-core/src/graph.rs, book/src/ontology-type-mesh.md |
| Scriptable policy | editable Rhai classification and document-shape rules | rules/, classify.rs, rule_registry.rs |
| Workflow control | pipeline state, scheduled operations, approval/reversibility metadata | pipeline.rs, workflow.rs, ledger_ops.rs, calendar.rs |
| Visualization | Mermaid, isometric docs renderer, live Rhai editor | crates/mdbook-rhai-mermaid/, book/theme/rhai-live-core.js, visualize.rs |
| Agent boundary | published MCP capability families and deterministic argument contracts | crates/ledgerr-mcp/src/contract.rs, mcp_adapter.rs, docs/mcp-capability-contract.md |
| Operator host | desktop settings, notifications, local chat endpoint, tray/window control | crates/ledgerr-host/src/ |
| Desktop packaging | Claude MCPB controller, Windows service/tray installer, local runtime status | PRD-11.md, book/src/desktop-agent-office-playbook.md, crates/ledgerr-host/src/ |
| Microsoft 365 surface | OneNote/Office diagram task pane and SharePoint playbook rendering | PRD-11.md, future Office add-in manifest, future SPFx package |
VENDOR--ACCOUNT--YYYY-MM--DOCTYPE.ext, infer document shape, and normalize rows.AUDIT.log history.There are three related but distinct Rhai surfaces:
| Surface | Purpose | Supported shape |
|---|---|---|
| Transaction rules | Runtime tax/bookkeeping classification | fn classify(tx) -> #{ category, confidence, review, reason } |
| Workflow compiler output | Runtime state transition function | generated Rhai switch [state, event.kind] { ... } from WorkflowToml |
| Documentation diagram DSL | Visual workflow blocks in mdBook and live editor | fn source() -> target, if expression -> target, match expr => Arm -> target |
The match operator discussed in the docs is a switch-like visualization idiom for branch-heavy workflows. Repeated arms with the same expression collapse into one semantic match node:
fn verify_result() -> match_result_disposition
match result.disposition => Disposition::Unrecoverable -> halt_pipeline
match result.disposition => Disposition::Recoverable -> repair_and_retry
match result.disposition => Disposition::Advisory -> record_note
match result.disposition => _ -> operator_review
fn repair_and_retry() -> requeue_validation
Current behavior:
| Behavior | Status |
|---|---|
| One match node per expression | Implemented in crates/mdbook-rhai-mermaid/src/parser.rs and mirrored in book/theme/rhai-live-core.js |
| Declaration-ordered arms | Implemented with IndexMap in Rust and ordered Map behavior in JS |
| Labeled outgoing edges | Implemented in Mermaid output and live editor previews |
Default arm detection (_, else, otherwise, default) | Implemented with visual default annotation |
| Isometric lane assignment for arms | Implemented in the live docs renderer |
| Rich explicit rejoin semantics and animated lane reflow | Planned / in progress; see the match plan chapter |
Deep references:
See Capability Map for the full component table.
| Capability | Status | Notes |
|---|---|---|
| Filename convention parser | Implemented | VENDOR--ACCOUNT--YYYY-MM--DOCTYPE.ext routing |
| Blake3 transaction identity | Implemented | idempotent transaction IDs |
| Journal and workbook ingest projection | Implemented | workbook remains projection/audit artifact |
| Rhai classification engine | Implemented | strict output schema, review flags |
| Rule registry and deterministic waterfall | Implemented | semantic selector is still planned |
| Document shape classifier | Implemented | vendor/format inference for bank statements and CSVs |
| Business calendar | Implemented | US/AU tax defaults and recurring events |
| Validation disposition model | Implemented | unrecoverable/recoverable/advisory issue handling |
| Constraint + legal synergy layer | Implemented | ConstraintEvaluation → Issue, Z3Result → Issue, CommitGate, verify_legal(), check_constraints() wired into pipeline (PRD-7 Phase 0) |
| Legal solver path | Implemented | AU GST s38-190/s40-5, AU FBT, US Schedule C, US FBAR, US FEIE; Z3 behind ledger-core/legal-z3; Jurisdiction::legal_ruleset() |
| Workflow TOML compiler | Implemented | Mermaid, Rhai FSM, Rust enum generation |
| mdBook Rhai-to-Mermaid preprocessor | Implemented | supports fn, if, and match diagram DSL lines |
| Live Rhai docs editor | Implemented | synchronized isometric and Mermaid views |
| Xero capability family | In flight | supervised MCP capability, not raw credential exposure |
| Tauri desktop host | Active | sole operator host (legacy Slint surface removed, #50) |
| VZ panel — Cytoscape.js + dagre layout | Active | hierarchical type/trait graph in Tauri sidebar; dagre TB layout; CDP observable on port 19222 |
| Evidence traceability (arc-kit-au) | Implemented | petgraph-backed provenance graph with deterministic node identity |
| Claude Desktop MCPB bundle | Implemented (Phase 1) | ledgrrr-claude.mcpb packages the ledgrrr-mcp controller via just package-desktop-mcpb; all eleven ledgrrr_* tools live |
| Native Windows dogfood package | Implemented (test-signed) | sparse MSIX/external-location identity package plus per-user Win32 payload; reproducibly built and install/repair/uninstall-smoked on Windows CI. Public signing is intentionally deferred. |
| OneNote/Office add-in | Missing | future task pane generates, previews, inserts, and refreshes versioned diagram/playbook artifacts |
| SharePoint SPFx web part | Missing | future web part renders published playbook artifacts in SharePoint pages/libraries |
| Local CPU model runtime | Planned | future profile supports offline playbook generation, mutation, and simulation |
| Docling extraction bridge | Missing | planned local extraction sidecar |
| File watcher | Missing | notify not yet wired as an end-to-end inbox loop |
The roadmap beyond the current stable capability set spans three planned directions. See the linked PRDs for full specification.
PRD-7.md specifies the complete integration of the three verification layers (Kasuari constraint solver, Z3 legal solver, typed pipeline) into a unified, jurisdiction-aware pipeline.
Phase 0 is implemented (constraint + legal signals now flow into MetaCtx and produce typed Issues). Remaining phases:
TransactionFacts auto-populated from pipeline state_audit sheet materialization — every committed transaction row gets constraint_score, legal_result, disposition, and stage_trace_json columns for CPA reviewPRD-8.md specifies a formal verification suite using the Kani bit-precise model checker to prove the type system has no arithmetic gaps between versions.
Key harnesses planned:
InvoiceConstraintSolver arithmetic correctness (no overflow, correct GST tolerance)VendorConstraintSet interval invariants (p05 ≤ p95, non-negative)EvidenceGraph structural integrity (no duplicate nodes/edges, NodeId determinism)EvidenceChain<S> typestate transition completenessCommitGate exhaustiveness (every Reconciled state routes to exactly one gate)PRD-6-FUTURE.md defines a longer-horizon capability: a #[attested("invariant")] proc-macro lint that forces any type claiming a formal property to provide machine-verifiable assertions checked by both Z3 (logical predicates) and Kasuari (numerical bounds), formally proved by Kani, and recorded in an immutable append-only invariant ledger.
Core idea: the Excel workbook gains a _invariants sheet where every type-level claim (e.g., "this invoice GST arithmetic is valid", "this pipeline state has passed legal review") is a persistent, Blake3-chained record linking the runtime verification result to the Kani proof that held at build time. New invariants can be registered by any crate at runtime without modifying ledger-core, making the knowledge system self-extensible.
This closes the gap between structural type safety (what the Rust type system currently enforces) and semantic correctness (what a CPA needs to trust the output).
PRD-11.md defines the Windows and Microsoft 365 product packaging target. Claude Desktop receives a MCPB bundle containing a small ledgrrr-mcp controller (Phase 1 implemented — see MCPB Binary Distinction). The privileged desktop stack will be installed by a native Windows package, which owns ledgrrr-service.exe, ledgrrr-tray.exe, local model/runtime assets, repair/uninstall, and update metadata.
The same ledgrrr playbook model is exposed through Claude, b00t, OneNote/Office, and SharePoint:
ledgrrr_status, ledgrrr_install_plan, ledgrrr_render_diagram, and ledgrrr_simulate_pipeline.status, install --dry-run, render, simulate, and export-office JSON contracts.l3dg3rr works in concert with the _b00t_ ecosystem: a mesh of typed, lazy-loaded capabilities that govern how agents discover, install, and execute skills, roles, and blessings.
Every capability in the b00t mesh is expressed as a .datum file — a typed document with a structured AST (crates/datum/src/ast.rs), logic gate primitives (crates/datum/src/logic.rs), protocol encoding analysis (crates/datum/src/protocol.rs), and .tomllmd compound document format for summary-level distillation (verbatim / executive / epigram).
Core datum types in the mesh:
| Type | Purpose | Example |
|---|---|---|
mcp | MCP server capability | b00t-mcp.mcp, just-mcp.mcp |
cli | CLI tool capability | just.cli, uv.cli, task.cli |
install | Installation recipe | rust.install, docker.install |
config | Configuration schema | opencode.config, b00t.config |
skill | Agent skill definition | managing-kubernetes-clusters.skill |
workflow | Multi-step automation | release.workflow, deploy.workflow |
ontology | Entity relationship graph | capability.ontology |
agent | Agent role/persona | executive.agent, operator.agent |
provider | MCP provider registration | b00t.provider, just.provider |
surface | ProcessSurface lifecycle | ralph-loop.surface |
Skills are lazy-loaded by progressive disclosure: a skill is only ingested into context when a matching capability trigger fires. The capability map (B00T-CAPABILITY-MAP.md) tracks which datums map to which skill names, and the RuleRegistry (crates/ledger-core/src/rule_registry.rs) uses deterministic keyword waterfall + semantic candidate selection to route requests to the right rule set.
Between capability loads and skill iterations, the Ralph loop (crates/b00t-iface/src/ralph.rs) drives an iterative propose → execute → judge → record cycle:
Init → [Propose → Execute → Judge → Record → Maintain]^n → Terminate
This generalizes the karpathy/autoresearch pattern as a typed ProcessSurface with governance-enforced TTL, crash budget, max iterations, and cadence. Each iteration generates an ExperimentVerdict (Pass/Fail) that feeds into the next proposal — the agent keeps iterating until the task objective is met or the budget is exhausted.
The SurfaceHarness (crates/b00t-iface/src/exec/harness.rs) wraps any ProcessSurface with a SurfaceMachine state machine and GovernancePolicy constraints, producing a PromiseChain audit record for every lifecycle transition.
The system determines capability preference using an ordered match of agent role tier (sm0l / ch0nky / frontier), skill invariant tags, and context window budget. Selection follows:
#kebab-case tags from crates/ledger-core/src/tags.rs).tomllmd merge strategies can combine two+ datums at different summary levels into a higher-order meta-learn datumDatum types have a dedicated visualization layer:
crates/datum/src/logic.rs defines NAND, NOR, ADD, WAIT, TX, RX, CAP gates with typed port arity and flux capacitor meta-state stabilitycrates/datum/src/protocol.rs evaluates Z3-style XOR optimality (O = P XOR B) and constraint strength (Required / Strong / Medium / Weak)crates/b00t-iface/src/viz/mod.rs produces SVG/glTF scene graphs with semantic role-driven icon/color/layoutThe McpProvider trait (crates/ledgerr-mcp/src/provider.rs) and McpProviderRegistry allow b00t's external MCP providers (b00t-mcp, just, ir0ntology) to register their tools alongside the built-in ledgerr_* capability families. The ServiceActor gate system (crates/ledgerr-mcp/src/actor.rs, gate.rs) routes typed messages through channels, forming the concrete dataflow that maps to the flux capacitor gate metaphor.
This project started as a local-first bookkeeping pipeline — ingest PDF statements, classify transactions with Rhai rules, export a CPA-auditable Excel workbook (see System Thesis above; that pipeline is still real and still works). The architecture kept revealing a deeper structure: the bookkeeping pipeline was one surface of a more general systems-modeling and action/decision registry, which is why the framing at the top of this README no longer leads with tax/bookkeeping. The same MetaCtx carry-forward confidence model that compounds validation scores also governs which b00t capabilities load into agent context, and the same typed-state machine now governs requirements/decisions/costs, not just financial documents.
The published book is the detailed reference and should be preferred over expanding the README indefinitely:
ledgerr_* tool familiesBuild and validate docs locally:
just docgen
just docgen-check
just docserve
Prerequisites:
| Tool | Purpose |
|---|---|
| Rust 1.88+ | workspace build/test |
just | canonical command runner |
mdbook + mdbook-mermaid | book generation |
mdbook-rhai-mermaid | Rhai diagram preprocessor |
cocogitto | conventional versioning and changelog automation |
Common recipes:
# Run the full test suite plus MCP outcome smoke path.
just test
# Build the book into book/book/.
just docgen
# Validate diagrams, links, and live Rhai JS tests.
just docgen-check
# Serve the book locally with live Rhai editing.
just docserve
# Start the stdio MCP server.
just mcp-start
Use Justfile as the executable workflow contract. When a command changes, update the recipe first and reference the recipe name from docs.
This project produces two distinct .mcpb bundles for different use cases:
| Binary | MCPB name | Purpose | Output |
|---|---|---|---|
ledgerr-mcp-server (domain server) | ledgerr-mcp-*.mcpb | Full tax ledger dataplane: PDF ingest, transaction classification, Rhai rules, Xero, reconciliation, workbook export. Runs as a stdio MCP server for general agent use. | dist/ledgerr-mcp-<target>.mcpb (ZIP — built by just bundle) |
ledgrrr-mcp (desktop controller) | ledgrrr-claude.mcpb | Claude Desktop controller per PRD-11 §3.1: the eleven ledgrrr_* tools for status, install planning, service/tray control, diagram render, simulation, and Office artifact export. | dist/ledgrrr-claude.mcpb/ (directory — built by just package-desktop-mcpb) |
Use just bundle for the domain server MCPB and just package-desktop-mcpb for the desktop controller. The desktop controller .mcpb directory can be referenced directly in Claude Desktop's MCP config.
crates/ledgerr-mcp/src/contract.rs: source of truth for the published MCP surface.The default MCP catalog should stay collapsed to the top-level ledgerr_* capability families. Add sub-operations through required action parameters instead of expanding the default tool list.
l3dg3rr follows an odd/even minor version convention, similar to the Ubuntu LTS model.
| Minor version | Series | Characteristics |
|---|---|---|
Even (1.0, 1.2, 1.4, 1.8, …) | Stable | Long-term supported. Full test gate including local Phi-4 model-inference tests. GitHub release published. Suitable for production operator use. |
Odd (1.1, 1.3, 1.5, 1.7, …) | Dev / Experimental | Fast-moving. Breaking changes within a major series are permitted. Model-inference tests may be skipped. GitHub pre-release created by the same release workflow. No LTS support. |
# Release bump — outcome depends on the next version:
# - even minor => stable release, full test gate including phi4 inference, GitHub release created
# - odd minor => dev/experimental release, fast gate only, no stable GitHub release
just release minor # or: just release major / just release patch
# Fast test gate only (excludes phi4 GGUF inference, ~seconds)
just test-fast
release recipe doescargo test suite including phi4 GGUF inference--skip phi4_produces_output --skip phi4_mistral_produces_output)./scripts/e2e_mvp.sh end-to-end smoke pathcog bump --<version> — sets version in all Cargo.toml files, creates a conventional-commit bump commit and a semver git taggit push --follow-tagsgh release create --latest)gh release create --prerelease)Pushing the tag triggers .github/workflows/docs.yml, which redeploys GitHub Pages regardless of minor parity.
All release artifacts are attached to the corresponding GitHub Release once .github/workflows/mcpb-publish.yml (MCP server bundles) and .github/workflows/msi-publish.yml (desktop app installer) finish running for that tag:
| Platform | Artifact | Purpose | Produced by |
|---|---|---|---|
| Linux (x86_64) | ledgerr-mcp-x86_64-unknown-linux-musl.mcpb | Domain server (ledgerr-mcp-server) — see MCPB Binary Distinction | mcpb-publish.yml |
| macOS (Intel) | ledgerr-mcp-x86_64-apple-darwin.mcpb | Domain server | mcpb-publish.yml |
| macOS (Apple Silicon) | ledgerr-mcp-aarch64-apple-darwin.mcpb | Domain server | mcpb-publish.yml |
| Windows (x86_64) | ledgerr-mcp-x86_64-pc-windows-msvc.mcpb | Domain server | mcpb-publish.yml |
| Windows (x86_64) | ledgrrr_<version>_x64_en-US.msi | Desktop host app — tray icon, settings UI, local chat (host-tauri, see PRD-11) | msi-publish.yml |
If a given release page is missing an artifact you expect, check that workflow's run for that tag — matrix legs can fail independently without blocking the others (mcpb-publish.yml's upload job only requires at least one platform to succeed).
To install the desktop app on Windows: download the .msi from the latest stable release and run it. To run the domain MCP server locally instead of downloading a binary, see just mcp-podman-run above or build from source with just bundle.
docker build -f Containerfile -t l3dg3rr:dev .
docker run --rm -i \
-v "$PWD/data:/data" \
l3dg3rr:dev
The container runs ledgerr-mcp-server over stdio. Mount /data for local workbook and document inputs.
177 commits
160 commits
23 commits
20 commits
JavaScript
57.0%
Rust
38.8%