Metadata-Version: 2.4
Name: mini-antemortem-cli
Version: 0.1.0
Summary: Analytical preflight for omegaprompt calibration: deterministic classifier over seven calibration trap patterns (self-agreement bias, small-sample KC-4 power, variant homogeneity, rubric concentration, judge budget, empty reference, missing held-out slice). Emits AnalyticalFinding records the omegaprompt pipeline consumes via derive_adaptation_plan.
Project-URL: Homepage, https://github.com/hibou04-ops/mini-antemortem-cli
Project-URL: Repository, https://github.com/hibou04-ops/mini-antemortem-cli
Project-URL: Parent package, https://github.com/hibou04-ops/omegaprompt
Project-URL: Issues, https://github.com/hibou04-ops/mini-antemortem-cli/issues
Author: hibou04-ops
License: MIT License
        
        Copyright (c) 2026 hibou04-ops
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: analytical-audit,antemortem,omega-lock,omegaprompt,preflight,prompt-calibration
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: omegaprompt>=1.1.0
Requires-Dist: pydantic>=2.6.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# mini-antemortem-cli

[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org)
[![Parent](https://img.shields.io/badge/parent-omegaprompt%E2%89%A51.1.0-blueviolet.svg)](https://pypi.org/project/omegaprompt/)

> **Analytical preflight for [omegaprompt](https://pypi.org/project/omegaprompt/) calibration.** Reads the run configuration and classifies seven calibration-specific trap patterns against deterministic rules. No API calls, no network; reasoning is deterministic given the inputs. Emits `AnalyticalFinding` records that feed `omegaprompt`'s `derive_adaptation_plan`.

```bash
pip install mini-antemortem-cli
```

## Why this is separate from omegaprompt

`omegaprompt` ships a **plugin interface** (`omegaprompt.preflight.contracts` + `omegaprompt.preflight.adaptation`) but no classifier code. Standalone users do not need analytical preflight — the main pipeline runs with declared defaults. Users who want analytical risk assessment over their configuration install this package alongside:

```bash
pip install omegaprompt mini-antemortem-cli
```

## Trap patterns

Seven deterministic classifications run against the run config:

| Trap id | Hypothesis |
|---|---|
| `self_agreement_bias` | Target and judge share a vendor; judge's biases overlap with target. |
| `small_sample_kc4_power` | Dataset too small for Pearson correlation to carry statistical power. |
| `variants_homogeneous` | System-prompt variants are too similar for sensitivity to have signal. |
| `rubric_weight_concentration` | A single rubric dimension carries most of the weight. |
| `judge_budget_too_small` | Judge output budget is SMALL but rubric has many dimensions + gates. |
| `empty_reference_with_strict_rubric` | No dataset item has a reference; rubric implies ground-truth comparison. |
| `no_held_out_slice` | No `--test` slice; walk-forward cannot run. |

Each pattern returns one of `REAL` / `GHOST` / `NEW` / `UNRESOLVED` with a severity (`blocker` / `high` / `medium` / `low`) and a remediation hint.

## Usage

```python
from omegaprompt.domain.dataset import Dataset, DatasetItem
from omegaprompt.domain.judge import Dimension, HardGate, JudgeRubric
from omegaprompt.domain.params import PromptVariants
from omegaprompt.preflight import PreflightReport, derive_adaptation_plan
from mini_antemortem_cli import analytical_preflight

rubric = JudgeRubric(
    dimensions=[
        Dimension(name="accuracy", description="correct", weight=0.85),
        Dimension(name="clarity",  description="readable", weight=0.15),
    ],
    hard_gates=[HardGate(name="no_refusal", description="x", evaluator="judge")],
)
variants = PromptVariants(system_prompts=["You are an assistant."], few_shot_examples=[])
train = Dataset(items=[DatasetItem(id=f"t{i}", input=f"task {i}") for i in range(5)])
test = Dataset(items=[DatasetItem(id=f"v{i}", input=f"val {i}") for i in range(3)])

findings = analytical_preflight(
    target_provider="openai",
    target_model="gpt-4o-mini",
    judge_provider="openai",
    judge_model="gpt-4o-mini",
    train_dataset=train,
    test_dataset=test,
    rubric=rubric,
    variants=variants,
    judge_output_budget="small",
)

report = PreflightReport(analytical_findings=findings)
plan = derive_adaptation_plan(report=report)
# plan.skip_axes, plan.max_gap_override, etc.
```

## Design principles

- **Deterministic.** Same config in, same findings out. No LLM calls; no sampling noise.
- **Source-level citations.** Each finding carries a `note` describing the rule that fired and a `remediation` hint. No hand-wave.
- **Severity discipline.** `high` severity findings drive `AdaptationPlan` overrides that *only strengthen* the discipline (per `apply_adaptation_plan` invariants).
- **Extensible.** Add your own `TrapPattern` and classifier function; compose with the built-in seven.

## Validation

Every trap pattern has positive + negative test cases. No API calls, fully offline. Run with `pytest -q`.

## Relation to the family

- **[Antemortem](https://github.com/hibou04-ops/Antemortem)** / **[antemortem-cli](https://pypi.org/project/antemortem/)** — pre-implementation reconnaissance discipline for code changes. The naming "mini-antemortem-cli" echoes this family; the *enumerate-then-classify* pattern comes from there.
- **[omegaprompt](https://pypi.org/project/omegaprompt/)** — prompt calibration engine. This package feeds its preflight plugin interface.
- **[mini-omega-lock](https://pypi.org/project/mini-omega-lock/)** — empirical sibling. Runs live probes to measure judge consistency and endpoint reliability.

## License

MIT. See [LICENSE](LICENSE).
