Skip to main content

Empirical preflight probes for omegaprompt calibration: judge consistency, endpoint schema reliability, context-budget margin, latency, noise floor. Emits PreflightReport records the omegaprompt pipeline consumes via derive_adaptation_plan.

Project description

mini-omega-lock

License: MIT Python Parent

Empirical preflight probes for omegaprompt calibration. Measures the actual environment (judge consistency, endpoint schema reliability, context-budget margin, latency, noise floor) and emits PreflightReport records that feed omegaprompt's derive_adaptation_plan.

pip install mini-omega-lock

Why this is separate from omegaprompt

omegaprompt ships a plugin interface (omegaprompt.preflight.contracts + omegaprompt.preflight.adaptation) but no probe code. Standalone users do not need preflight probes — they run calibration with declared defaults. Users who want adaptive thresholds tuned to their actual infrastructure install this package alongside:

pip install omegaprompt mini-omega-lock

What it measures

Measurement Function What it tells you
Judge consistency measure_judge_consistency Same (response, rubric) scored N times; 1 - CV. Low = noisy judge, need rescore_count > 1.
Endpoint schema reliability probe_strict_schema STRICT_SCHEMA probe success fraction. < 0.9 triggers JSON_OBJECT fallback.
Context budget margin compute_context_margin 1 - (longest_call_tokens / context_window). Negative = overflow.
Performance projection project_performance Mean probe latency → projected calibration wall time.
Noise floor noise_floor_estimate Stdev of fitness under identical parameters. Sets adaptive min_kc4.

The composite entry point is empirical_preflight(), which runs all five in one call and returns the three measurement records omegaprompt's adaptation layer consumes.

Usage

from omegaprompt import make_provider, PreflightReport, derive_adaptation_plan
from omegaprompt.domain.dataset import DatasetItem
from omegaprompt.domain.judge import Dimension, JudgeRubric
from omegaprompt.judges.llm_judge import LLMJudge
from mini_omega_lock import empirical_preflight

judge_provider = make_provider("anthropic")
judge = LLMJudge(provider=judge_provider)
rubric = JudgeRubric(dimensions=[Dimension(name="accuracy", description="x", weight=1.0)])
probe_item = DatasetItem(id="probe", input="2+2", reference="4")

judge_quality, endpoint, performance = empirical_preflight(
    judge=judge,
    rubric=rubric,
    probe_item=probe_item,
    probe_response="4",
    consistency_repeats=3,
    dataset_size_hint=10,
    candidates_expected=20,
)

report = PreflightReport(
    judge_quality=judge_quality,
    endpoint=endpoint,
    performance=performance,
)
plan = derive_adaptation_plan(report=report)
# plan.min_kc4_override, plan.rescore_count, etc.

Design principles

  • No fabricated numbers. Every measurement is computed from a real provider response. No heuristic estimation.
  • Minimal probe budget. Default 3 consistency repeats + 3 schema probes + 1 context-margin compute = 7-10 API calls per preflight. Worth < $0.01 on frontier tiers.
  • Protocol-conformant output. Emits omegaprompt.preflight.contracts.JudgeQualityMeasurement / EndpointMeasurement / PerformanceMeasurement exactly. No shape drift.
  • Composable. Can run alongside mini-antemortem-cli (analytical preflight) into the same PreflightReport.

Validation

All adapter tests mock the provider SDK; no network, no API credits, fully offline. Run with pytest -q.

Relation to the family

  • omega-lock — parameter-calibration framework. The naming "mini-omega-lock" echoes this family; the sensitivity + walk-forward + KC-4 discipline comes from there.
  • omegaprompt — prompt calibration engine. This package feeds its preflight plugin interface.
  • mini-antemortem-cli — analytical sibling. Runs deterministic trap classification over config before calibration.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mini_omega_lock-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mini_omega_lock-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file mini_omega_lock-0.1.0.tar.gz.

File metadata

  • Download URL: mini_omega_lock-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_omega_lock-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a47c06fdfffaf91132a09daea93b6e25b170ad0b4ae54a5e432990b350208f4
MD5 af34ceeed21299ed51ae7145d8c8915e
BLAKE2b-256 e14f383c6aa14cc2feef24d491eb7f8787f25a6568241999d94263220779ac0a

See more details on using hashes here.

File details

Details for the file mini_omega_lock-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mini_omega_lock-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_omega_lock-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e51fe5ee8d251ebf8746cbf9dcd643114b95c4c054d13d827020bc42820ae6ff
MD5 3b7acf7267a0499ae6091de1309e4288
BLAKE2b-256 f6717337fdbe828c6c08dc19a184c255b524e5d3ef2755322b104bb4f4266e1e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page