Skip to content

feat: gate seed-sensitivity report + CLI flags (#36) - #67

Merged
krish1925 merged 3 commits into
developmentfrom
feat/gate-seed-sensitivity
Aug 5, 2026
Merged

krish1925 merged 3 commits into
developmentfrom
feat/gate-seed-sensitivity

Conversation

@krish1925

Copy link
Copy Markdown
Owner

Summary

Implements #36: seed-sensitivity analysis for the gate command.

Changes

  • QualityGate.seed_sensitivity() — refits RidgeMapping on subsamples across seeds and reports retention stability (thread-pooled).
  • SeedSensitivityReport dataclass (runs/seeds/per-seed retention+top1/mean/std/min/max/unstable/threshold) with to_dict().
  • CLI: --seed-sensitivity, --seed-sensitivity-runs, --seed-sensitivity-threshold, --seed-sensitivity-seed; mapping optional in standalone mode; queries/corpus mode rejected; WARN + exit 1 when unstable.
  • JSON/Markdown/HTML output includes the seed-sensitivity section.

Bug fix included

Fixes a pre-existing v2 binary-format regression (#62) that broke .isotrieve save/load roundtrip: _find_payload_start re-aligned to an 8-byte boundary even though FIXED_HEADER_SIZE is 12 bytes, overshooting the payload by 4 bytes. Now FIXED_HEADER_SIZE + ceil(header_len/8)*8, matching the TS writer; v1 files read at offset 8. The gate CLI tests depend on this fix.

Verification

  • pytest: 160 passed, 7 skipped
  • ruff check on touched files: clean
  • mypy on touched files: clean

Krish Patel added 2 commits August 4, 2026 16:02
- QualityGate.seed_sensitivity(): refit RidgeMapping on subsamples across
  seeds, report per-seed retention/top1, mean/std/min/max, unstable flag
- SeedSensitivityReport dataclass with to_dict()
- CLI gate: --seed-sensitivity / --seed-sensitivity-runs / --seed-sensitivity-threshold / --seed-sensitivity-seed
- mapping optional when --seed-sensitivity (standalone run), reject
  queries/corpus mode, WARN + exit 1 when unstable
- JSON/MD/HTML output includes seed_sensitivity; HTML renders section
- fix: .isotrieve v2 reader misaligned payload start by 4 bytes
  (_find_payload_start aligned to 8-boundary though FIXED_HEADER_SIZE=12);
  now uses FIXED_HEADER_SIZE + ceil(header_len/8)*8, matching TS writer.
  v1 files read at offset 8 with no padding. Fixes save/load roundtrip
  regression from binary-format-v2 (#62).
- tests: seed-sensitivity unit + CLI coverage
# Conflicts:
#	isotrieve-python/src/isotrieve/mapping/base.py
@krish1925
krish1925 merged commit ca6680b into development Aug 5, 2026
1 of 6 checks passed
@krish1925
krish1925 deleted the feat/gate-seed-sensitivity branch August 27, 2026 23:32
@krish1925 krish1925 mentioned this pull request Aug 30, 2026
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