Skip to content

Confidence: Jev's peak statistic, (n·peak − 1)/(n − 1), not normalized entropy - #1

Merged
fidecastro merged 1 commit into
mainfrom
fix/jev-confidence
Sep 23, 2026
Merged

fidecastro merged 1 commit into
mainfrom
fix/jev-confidence

Conversation

@fidecastro

@fidecastro fidecastro commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

confidence on choice and score answers did not carry Jev's meaning. TypeSafe defines it as (n × peak − 1) / (n − 1) (docs, worked example [0.90, 0.06, 0.04] → 0.85), and its published thresholds (act above 0.9, review 0.5–0.9, route to a human below 0.5) refer to that number. jevify served one minus the normalized entropy under the same field name, which is systematically lower and would have moved a client's threshold decisions. User ai.sling.42 in the NVIDIA forum thread caught it.

Distribution Before Jev
0.90 / 0.06 / 0.04 0.643 0.850
0.94 / 0.05 / 0.01 (README example) 0.769 0.910
0.90 / 0.10 0.531 0.800
0.60 / 0.40 0.029 0.200

Changes

  • jevify/domain/distribution.py: the one statistics chokepoint now computes Jev's peak statistic for choice and score. Noul is unchanged: Jev's noul carries no confidence, and jevify's distance-from-one-half stays under x_jevify only.
  • tests/test_distribution.py: assertions use TypeSafe's literals (written red first).
  • docs/adr/0003-jev-compatible-api.md: new D8; status line and index row updated.
  • docs/00-invariants.md: §5 confidence rule amended, recorded in §7 with the previous wording.
  • SKILL.md: one sentence saying what confidence is.

Committed scorecards under docs/evidence/ that predate this keep the entropy value in their wrong-case column and are not rewritten (a number in a document comes from a run); the reliability table bins on top probability and is unaffected.

Proof

  • uv run pytest -m "not live and not encoder" green on the working tree (4 skips, as on main).
  • uv run ruff check . && uv run ruff format --check . clean.
  • uv run mypy jevify: 24 pre-existing errors, same count as main; none in the changed file.
  • Not exercised: live backends and the encoder extra.

🤖 Generated with Claude Code

…d entropy

TypeSafe defines confidence on choice and score answers as
(n × peak − 1) / (n − 1): 0 when uniform, 1 when certain, with the worked
example [0.90, 0.06, 0.04] → 0.85. jevify served one minus the normalized
entropy under the same field name, which is systematically lower (0.64 on
that example) and would have moved a client's threshold decisions. A reader
of the NVIDIA forum thread caught it.

The formula changes in the one statistics chokepoint; the tests assert
TypeSafe's literals. ADR-0003 gains D8, invariants §5 is amended and the
change is recorded in §7 with the previous wording. Committed scorecards
that predate this keep their recorded numbers, as the ADR says.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@fidecastro
fidecastro merged commit 5df9211 into main Sep 23, 2026
9 of 10 checks passed
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