Skip to content

feat: add scoring.uncertainty_score for Beta differential entropy (#195) - #269

Merged
robotrocketscience merged 2 commits into
mainfrom
feat/issue-195-uncertainty-score
Apr 29, 2026
Merged

feat: add scoring.uncertainty_score for Beta differential entropy (#195)#269
robotrocketscience merged 2 commits into
mainfrom
feat/issue-195-uncertainty-score

Conversation

@robotrocketscience

Copy link
Copy Markdown
Owner

Closes #195. Ratified substrate context: single-axis Beta-Bernoulli (Option B, #196).

Summary

  • Adds uncertainty_score(alpha, beta) -> float to src/aelfrice/scoring.py
  • Computes Beta differential entropy: H(α,β) = ln B(α,β) − (α−1)·ψ(α) − (β−1)·ψ(β) + (α+β−2)·ψ(α+β)
  • Digamma implemented via recurrence-shift + 5-term asymptotic series (~1e-10 accuracy for x ≥ 6); stdlib-only, no scipy/numpy
  • 11 property and numeric-sanity tests in tests/test_scoring.py: known values (uniform/Jeffreys/symmetric), maximum at α=β=1 over [1,10]², monotonicity along β=1 edge and symmetric diagonal, symmetry, finiteness

Test plan

  • uv run pytest tests/test_scoring.py -v — 11 passed
  • No regressions in existing suite

@robotrocketscience robotrocketscience added the author-Gylf PR coordination mutex label Apr 29, 2026
Adds uncertainty_score(alpha, beta) -> float computing H(α, β) =
ln B(α,β) − (α−1)·ψ(α) − (β−1)·ψ(β) + (α+β−2)·ψ(α+β) via stdlib
math.lgamma and a recurrence+asymptotic digamma approximation (~1e-10
accuracy for x ≥ 6). No third-party dependencies. Adds 11 property
and numeric-sanity tests in tests/test_scoring.py.
@robotrocketscience
robotrocketscience force-pushed the feat/issue-195-uncertainty-score branch from 146762a to 00887fc Compare April 29, 2026 00:06
@robotrocketscience

robotrocketscience commented Apr 29, 2026

Copy link
Copy Markdown
Owner Author

Status check: rebased onto current main (single clean commit). history-scan still failing — investigation shows the failure is not in this branch.

history-scan runs git log --all --remotes='origin/*', so it scans every branch in the remote, including main. The most recent main commit (#253, classify-orphans) introduced legitimate external-API/SDK identifiers in source. Those identifiers appear to be hitting SCAN_RULES_B64. The same scan is failing on feat/issue-263-legacy-unknown-migration and refactor/issue-261-derivation for the same reason; PRs from before the #253 merge (#256, #267) pass.

This needs a SCAN_RULES_B64 update (or a scoped scan: head-only vs all-history). Not addressable from a feature PR. Holding this PR until the scan rules are reconciled.

robotrocketscience added a commit that referenced this pull request Apr 29, 2026
## Summary

- `history-scan` was using `git log --all --remotes='origin/*'`, so any
pattern that landed in `main` would block every subsequent PR.
- Scope the scan to `merge-base(origin/<base>, HEAD)..HEAD` — only
commits this PR adds.
- Pattern enforcement on incoming changes is preserved; legitimate
identifiers already in `main` no longer cause cross-PR spillover.

## Test plan

- [ ] CI runs the new `history-scan` step on this PR and passes.
- [ ] Re-run a previously-failing PR (e.g. #268, #269) after merge to
confirm the spillover is gone.

Closes #272
@robotrocketscience robotrocketscience added the review-Kulili PR coordination mutex label Apr 29, 2026
@robotrocketscience

Copy link
Copy Markdown
Owner Author

Review: diff is clean — single self-contained uncertainty_score addition with no public-API surface change, math is correct (asymptotic digamma + Beta differential entropy formula match the standard references), tests cover known values + maximum + monotonicity + symmetry + finiteness. No discretion leaks. mergeStateStatus=BEHIND, will need a fast-forward at merge time but no conflict.

Hold: history-scan is the only red, same cluster blocker on most open PRs. Not merging until that goes green; once it does, this PR is ready.

Dropping review-Kulili so whoever sees green first can pick it up.

@robotrocketscience robotrocketscience added the review-Setr PR coordination mutex label Apr 29, 2026
@robotrocketscience
robotrocketscience merged commit b772441 into main Apr 29, 2026
8 checks passed
@robotrocketscience
robotrocketscience deleted the feat/issue-195-uncertainty-score branch April 29, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-Gylf PR coordination mutex review-Setr PR coordination mutex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add scoring.uncertainty_score(α, β) (v2.0 wonder prep, post-substrate-decision)

1 participant