Skip to content

fix(fees): a paused bot could be billed for a gain it never realised - #3

Merged
savvaniss merged 1 commit into
mainfrom
deep-research
Jul 29, 2026
Merged

fix(fees): a paused bot could be billed for a gain it never realised#3
savvaniss merged 1 commit into
mainfrom
deep-research

Conversation

@savvaniss

Copy link
Copy Markdown
Contributor

Summary

Part of an estate-wide remediation of the 49-ticket defect register in audit.md, sequenced by the phase plan in upgrade.md. Each ticket was resolved against its own Done when boxes, then handed to an independent reviewer told to assume it was not fixed and to walk the ticket's How it fails scenario through the new code.

Verification

  • pnpm typecheck passes across every workspace in this repo.
  • Each ticket carries a reproduction of its documented failure, then evidence that it no longer occurs.
  • Findings that survived adversarial review were sent back for a repair pass before landing.

What has NOT been verified

Stated plainly so review effort goes to the right places:

  • No end-to-end run of the assembled stack. Typechecks and unit tests are not the same as driving the feature. docker compose build returns exit 0 while cancelling every target, so a green build here would prove nothing anyway.
  • Some tickets in the wider programme came back partial or INCOMPLETE; where any of those touch this repo they are listed in the commit body rather than hidden.
  • Documentation corrections were verified against source, but the estate has a history of docs drifting from code — treat prose changes as claims to check, not conclusions.

🤖 Generated with Claude Code

CF-03 — do not assess a new settlement charge while an older row for the
same bot is still unresolved.
CF-04 — closed by CF-03's work; Pay's idempotency_in_flight is no longer
written off as uncollectable.
CF-19 — the final fee settlement of a stopped bot is retried. The sweep
now carries a scope: running bots are assessed, paused and stopped bots
have arrears collected and nothing more, so a pause cannot be billed
against stale unrealised equity. Deferrals log instead of vanishing.

Co-Authored-By: Claude <noreply@anthropic.com>
@savvaniss
savvaniss merged commit b1f0568 into main Jul 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant