Skip to content

statusline.py re-binds 7 dead _ledgerlib members after the T-12 extraction #177

Description

@SUaDtL

statusline.py re-binds 7 dead _ledgerlib members (incl. three underscore-privates) never referenced after the T-12 extraction

Severity: low | Confidence: 0.85 | Effort: S
Where:
plugins/ca/hooks/statusline.py:78-86
Evidence: The T-12 ledger extraction left statusline.py re-binding _ledgerlib's members into module scope (_tx_accumulate, _agg_reqs, _totals, api_cost, price_for, ledger_path, API_PRICES, lines 79-86). Grepping the whole file, these 7 names appear only at their binding site and in a descriptive comment (line 494); they are referenced nowhere else. Only ledger_update (line 78 -> used at 1000) and persist_sess_start (85 -> 1013) are live. Three of the dead bindings (_tx_accumulate, _agg_reqs, _totals) reach across the module boundary into underscore-private members.
Impact: Dead imported symbols masquerade as a used public surface: a reader cannot tell the extraction is complete, and the private-member reach couples statusline to _ledgerlib internals that could otherwise be renamed freely. The dead fallback branch (lines 90-95) must also keep synthesising these unused names to stay symmetric, compounding the noise on a robustness-critical file.
Recommendation: Delete the 7 unused re-bindings (lines 79-84, 86) and the matching fallback stubs; keep only ledger_update and persist_sess_start plus the direct _ledgerlib.burn_samples call. If any removed names are needed later, import them at the call site rather than reaching into _ledgerlib privates.
Acceptance criteria:

  • statusline.py binds only the _ledgerlib members it actually references
  • no underscore-private _ledgerlib member is imported across the module boundary
  • test_statusline.py green and py_compile clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions