adopt-coverage 0.4.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: adopt-coverage
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: recompute_coverage and the cache-disagreement alarm. Implemented in S4.
5
5
  Project-URL: Homepage, https://github.com/onboardux/onboard-core
6
6
  Project-URL: Source, https://github.com/onboardux/onboard-core
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "adopt-coverage"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "recompute_coverage and the cache-disagreement alarm. Implemented in S4."
5
5
  requires-python = ">=3.12"
6
6
  license = "Apache-2.0"
@@ -317,6 +317,7 @@ def recompute_coverage(
317
317
  environment_id: str | None = None,
318
318
  *,
319
319
  clock: Clock | None = None,
320
+ compare_cache: bool = True,
320
321
  ) -> CoverageResult:
321
322
  """Evaluate coverage for every identity in scope. **The authority.**
322
323
 
@@ -328,6 +329,13 @@ def recompute_coverage(
328
329
  environment_id: One environment, or `None` for every environment of the
329
330
  system.
330
331
  clock: Injected clock; tests pass `ManualClock`.
332
+ compare_cache: `False` only for the rebuild that immediately follows a
333
+ command's *own* change to coverage, after that command checked the
334
+ cache agreed before it wrote (`adopt_cli.commands._coverage_support`).
335
+ The comparison is then meaningless -- the command just moved the
336
+ truth on purpose -- and an alarm for it would be the false page that
337
+ teaches an operator to ignore the real one. Every other caller keeps
338
+ the default, because the comparison is the alarm.
331
339
 
332
340
  Returns:
333
341
  Per-identity coverage plus a `disagreements` list against
@@ -385,7 +393,7 @@ def recompute_coverage(
385
393
  recomputed=verdict.covered,
386
394
  )
387
395
  for verdict in verdicts
388
- if cached[verdict.identity_id] != verdict.covered
396
+ if compare_cache and cached[verdict.identity_id] != verdict.covered
389
397
  )
390
398
 
391
399
  if disagreements:
File without changes
File without changes