The first part of Prüfwerk metering (LB §2 Abs. 4-5, §7): what a scan
is metered by, without counting or enforcing anything yet.
- A target is included or extra (`billing`). The oldest active targets
are included, up to the plan's `limits.included_targets` from the
registry; the rest are extra. The split is stored, refreshed before
each scan and when a target is created, so archiving an included
target moves the oldest extra one up. A plan without the limit (all
plans today) includes every target.
- Each scan run records its `attribution`: request (the customer
started it), support, change (new commits, other uploads, a live
URL) or rescan (only the Prüfwerk build changed). Change detection
sets it for scheduled and webhook scans, so our rescan after an
update is told apart from a customer's change.
- `chargeable` says whether the run counts once it completes: a
request always, a change only on an extra target, a rescan or a
support scan never. scan.completed carries both as properties.
- The targets list badges an extra target.
Counters, the daily limit and the cap follow in the next PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>