Storage

Repairledger is user-global: a single config at ${XDG_CONFIG_HOME:-~/.config}/ledger/repairledger.toml and a single data path at ${XDG_DATA_HOME:-~/.local/share}/ledger/repairledger/. Agents in any repository can log observations without writing into the current source tree.

Configuration

config_version = 1

[ledger]
code = "rl"
name = "repairledger"

[storage]
data_path = "~/.local/share/ledger/repairledger"

[storage].data_path accepts absolute paths, ~-expanded paths, and paths relative to the config file directory. The legacy [storage].repairledger_dir field is still accepted when data_path is absent, but data_path is the preferred form.

Set REPAIRLEDGER_CONFIG=/absolute/path/to/rl.toml to point at a custom config file. The override must resolve to an absolute path.

Directory layout

~/.config/ledger/
  repairledger.toml

~/.local/share/ledger/repairledger/
  storage.yaml
  repairs/
    repair-0001/
      repair.yaml
      components/
        00-summary.md
        10-context.md
        20-tool-call.md
        30-expected-behavior.md
        40-actual-behavior.md
        50-reproduction.md
        60-impact.md
        70-workaround.md
        80-diagnosis.md
        90-suggested-fix.md
        95-validation.md
        99-notes.md
      rendered/
        latest.md
        repair-0001-v0003.md
      versions/
        v0001/
          repair.yaml
          components/
            ...
        v0002/
          ...
  reports/
    repairledger-report.md
  exports/
    repairledger-report.md
    repair-0001.md

The exports/ directory holds the default output of repairledger report export and repairledger repair export. The reports/ directory holds the default output of repairledger report build.

Version snapshots

Every mutation increments the repair version and writes a complete post-mutation snapshot under versions/v000X/. Snapshots contain repair.yaml and all component files.

Concurrency

storage.yaml is shared across all agents. Repair ID allocation, repair creation, and active-repair updates are serialized with an inter-process fcntl.flock against <data path>/.repairledger.lock. Initialization is serialized with a separate lock adjacent to the config file.

A global active_repair_id is advisory. When multiple repairs exist, mutating commands (repair status, repair archive, repair build, repair component set, repair component append) require an explicit --repair REPAIR_ID.