❄ Sequence Diagrams

Sequence Diagrams

Workflow: record one observation

The write path taken every time a project finishes with an address. It is the only way data enters the store.

sequenceDiagram
    participant P as Project runner
    participant CLI as tools/ledger.py
    participant S as ledger/ip-ledger.json
    P->>CLI: observe  --project --stage --outcome --reason
    CLI->>S: load() whole store
    CLI->>CLI: row = existing row, or blank_row(ip)
    CLI->>CLI: append one dict to history
    CLI->>CLI: refresh latest scalars, last_seen, projects[]
    CLI->>S: save() via realpath -> tmp -> os.replace -> chmod 0600
    CLI-->>P: one line: what was recorded

Walkthrough

Workflow: regenerate the views

Run whenever someone needs "what is unused?" or "what can be re-dialled?".

sequenceDiagram
    participant O as Operator
    participant CLI as tools/ledger.py
    participant S as ledger/ip-ledger.json
    participant V as views/*.json
    O->>CLI: views
    CLI->>S: load()
    CLI->>CLI: fresh = rows where real_observation() is false
    CLI->>CLI: reusable = rows where is_reusable() is true
    CLI->>CLI: by-project = group history entries by project
    CLI->>V: write fresh-ips.json, reusable.json, by-project.json
    CLI-->>O: counts per view

Walkthrough