Luigit
repositories / termux-janitor

termux-janitor

Interactive cleanup assistant for Termux: transparent, safe, confirmed disk reclamation.

owned by admin

spec/fixtures/classification/thresholds.md

Raw
Rendered preview

Classification thresholds

Fixture: fixture-classification-thresholds@2

Given

The generated specification projection contains compiled classification thresholds.

When

The fixture inspects threshold values, units, and ordering.

Required invariants

  • INV-THRESHOLD-VALUES: Every version 1 default threshold has its canonical value and unit.
  • INV-THRESHOLD-ORDER: The large-directory threshold is at least the large-file threshold.
  • INV-THRESHOLD-BOUNDARY-SETS: A candidate exactly at an inclusive size or age threshold satisfies its rule, and one unit below does not.

Forbidden effects

  • NO-THRESHOLD-DUPLICATES: No generated threshold key occurs more than once.

Instrumentation

try fixture.given_generated_thresholds();
try fixture.when_inspect_thresholds();
try fixture.then_inv_threshold_values();
try fixture.then_inv_threshold_order();
try fixture.then_inv_threshold_boundary_sets();
try fixture.forbid_no_threshold_duplicates();

Variations

Invalid values, duplicate keys, missing thresholds, and an inverted size relationship are covered by product-registry unit validation.

Limitations

This fixture verifies generated defaults. It does not verify configuration parsing or scan-time age decisions.

# Classification thresholds

**Fixture:** `fixture-classification-thresholds@2`

## Given

The generated specification projection contains compiled classification thresholds.

## When

The fixture inspects threshold values, units, and ordering.

## Required invariants

- **`INV-THRESHOLD-VALUES`:** Every version 1 default threshold has its canonical value and unit.
- **`INV-THRESHOLD-ORDER`:** The large-directory threshold is at least the large-file threshold.
- **`INV-THRESHOLD-BOUNDARY-SETS`:** A candidate exactly at an inclusive size or age threshold satisfies its rule, and one unit below does not.

## Forbidden effects

- **`NO-THRESHOLD-DUPLICATES`:** No generated threshold key occurs more than once.

## Instrumentation

```zig tj-test
try fixture.given_generated_thresholds();
try fixture.when_inspect_thresholds();
try fixture.then_inv_threshold_values();
try fixture.then_inv_threshold_order();
try fixture.then_inv_threshold_boundary_sets();
try fixture.forbid_no_threshold_duplicates();
```

## Variations

Invalid values, duplicate keys, missing thresholds, and an inverted size relationship are covered by product-registry unit validation.

## Limitations

This fixture verifies generated defaults. It does not verify configuration parsing or scan-time age decisions.