Skip to main content

B2 Hygiene

@sntxrr/b2-hygienev2026.08.06.1· 5d agoREPORTS
01README

Audit a scanned Backblaze B2 account for hidden-version retention gaps, over-scoped or orphaned application keys, and public buckets. Two reports: a method-scope audit of one b2-account scan, and a workflow-scope companion that joins those findings to @sntxrr/b2/files byte totals so each gap is ranked by what fixing it recovers. Read-only — both analyse resources already written and never call B2.

02Release Notes

Adds @sntxrr/b2/fleet-hygiene, a workflow-scope companion that joins the findings to what they cost.

The existing method-scope @sntxrr/b2/hygiene is unchanged and still runs after a single b2-account scan. The new report runs after a WORKFLOW and reads up to three steps — b2-account (findings), b2-files (non-current byte cost) and b2-transfer (abandoned uploads) — each located by the SPEC it wrote rather than by step or model name, so renaming a step does not break it.

The split is not stylistic. A method-scope report only ever sees resources its own execution produced, and the byte totals live in a different model's; workflow scope is the only place the two can meet.

It ranks findings by recoverable bytes rather than severity, because 24 identical lifecycle findings tell you nothing about where to start.

A byte total has four states and three of them are not zero: measured, truncated (a FLOOR), unmeasurable (a names listing cannot see a non-current version) and unmeasured. Unmeasurable and unmeasured buckets are excluded from the fleet total ENTIRELY, including their known current bytes, because contributing half a bucket's numbers shrinks the apparent waste ratio. Understating the debt is the one direction this must not fail in.

Abandoned uploads carry a safety rule. An in-progress upload and an abandoned one are the same object in the B2 API, so anything younger than a day is counted as excluded rather than reported as waste — cancelling a live upload discards every part already sent while the uploading tool believes it succeeded. The excluded counts always print, so 'we found none' stays distinguishable from 'we deliberately left some out'.

Three independent completeness flags — inventoryComplete, sizingComplete, uploadSweepComplete — because each can be true while another is false.

Also fixes: b2/hygiene's 22 tests had never actually run (execute had no declared return type, so deno test aborted at type-check and they passed only under --no-check); a fixed-GiB format rendered five real buckets as 0.00 GiB in a table whose every row is > 0 by construction; and a clean upload sweep reported as no sweep at all, because a scan that finds nothing writes no snapshots for spec-based discovery to match on.

Live-verified across the full 24-bucket fleet, including the first observation of a bucket that correctly does NOT trigger a lifecycle finding.

03Reports2
@sntxrr/b2/fleet-hygieneworkflow
b2_fleet_hygiene.ts

Audit a Backblaze B2 fleet and price the result: joins @sntxrr/b2/hygiene's findings to the non-current byte totals from @sntxrr/b2/files, so a lifecycle gap is ranked by what fixing it recovers. Read-only — reads what the workflow's steps already wrote and never calls B2.

auditsecuritycostbackblazeb2
@sntxrr/b2/hygienemethod
b2_hygiene.ts

Audit a scanned Backblaze B2 account for hidden-version retention gaps, over-scoped or orphaned application keys, and public buckets. Read-only — analyses the scan's resources and never calls B2.

auditsecuritycostbackblazeb2
04Previous Versions1
2026.08.05.1

First release. Read-only fleet audit over a b2-account scan: hidden-version retention gaps, account-wide and orphaned application keys, dangerous key capabilities, and public buckets. Never calls B2. A truncated inventory is never presented as a clean account, and an unparseable lifecycle rule is reported as 'cannot tell' rather than as a missing rule.

05Stats
A
100 / 100
Downloads
0
Archive size
32.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels