Files
git.stella-ops.org/docs/features/checked/binaryindex/binaryindex-ops-endpoints.md
2026-02-12 10:27:23 +02:00

33 lines
2.4 KiB
Markdown

# BinaryIndex Ops Endpoints (Health, Bench, Cache Stats, Config)
## Module
BinaryIndex
## Status
VERIFIED
## Description
Ops endpoints for BinaryIndex: health (lifter warmness), bench/run (latency measurement), cache stats (Valkey hit/miss), and effective config with deterministic JSON responses.
## Implementation Details
- **Modules**: `src/BinaryIndex/StellaOps.BinaryIndex.WebService/`
- **Key Classes**:
- `BinaryIndexOpsController` (`src/BinaryIndex/StellaOps.BinaryIndex.WebService/Controllers/BinaryIndexOpsController.cs`) - exposes `GET /api/v1/ops/binaryindex/health`, bench, cache stats, and config endpoints; integrates with `B2R2LifterPool` and `FunctionIrCacheService`
- `B2R2LifterPool` (`src/BinaryIndex/__Libraries/StellaOps.BinaryIndex.Disassembly.B2R2/B2R2LifterPool.cs`) - provides pool stats (warm ISAs, pool sizes, acquire timeouts)
- `FunctionIrCacheService` (`src/BinaryIndex/__Libraries/StellaOps.BinaryIndex.Cache/FunctionIrCacheService.cs`) - Valkey-based function IR cache with hit/miss reporting
- `B2R2LifterPoolOptions` (`src/BinaryIndex/__Libraries/StellaOps.BinaryIndex.Disassembly.B2R2/B2R2LifterPoolOptions.cs`) - pool configuration (MaxPoolSizePerIsa, EnableWarmPreload, AcquireTimeout)
- `BinaryIndexOptions` (`src/BinaryIndex/__Libraries/StellaOps.BinaryIndex.Core/Configuration/BinaryIndexOptions.cs`) - top-level options with B2R2Pool, SemanticLifting sections
- `InMemoryBinaryVulnerabilityService` (`src/BinaryIndex/StellaOps.BinaryIndex.WebService/Services/InMemoryBinaryVulnerabilityService.cs`) - deterministic fallback DI implementation used to keep ops/resolution startup healthy in local/offline mode
- **Source**: SPRINT_20260112_004_BINIDX_b2r2_lowuir_perf_cache.md
## E2E Test Plan
- [x] Call `GET /api/v1/ops/binaryindex/health` and verify response includes lifter pool/cache readiness fields
- [x] Call `POST /api/v1/ops/binaryindex/bench/run` and verify deterministic latency measurement JSON
- [x] Call `GET /api/v1/ops/binaryindex/cache` and verify hit/miss counts and cache key metadata
- [x] Call `GET /api/v1/ops/binaryindex/config` and verify effective configuration is returned with secrets redacted
- [x] Verify negative path for bench input validation (`iterations=0` returns `400`)
## Verification
- Verified on 2026-02-11 via `run-002`.
- Artifacts: `docs/qa/feature-checks/runs/binaryindex/binaryindex-ops-endpoints/run-002/`