Skip to main content

RIDI

Allocation identity for capacity-limited AI

See what aggregate evaluation can miss: who actually received the scarce slots.

tests PyPI python license status

RIDI graphical abstract: identical audits can yield different AI decisions

PyPI · Open in Colab · 60-second Quick Start · Python API · Reporting checklist · Paper & evidence


The one-line idea

Performance, fairness, calibration and ranking metrics remain necessary. RIDI asks a different question at the score-to-action boundary:

Which identities occupy the finite queue, shortlist or context window—and did those identities change?

Two systems can be exactly indistinguishable under a declared audit while assigning scarce slots to different identities. In the preregistered RAG experiment behind this project, that difference sometimes changed the downstream AI decision itself.


Install and use it in seconds

pip install ridi-audit
ridi-audit demo

Already have two selected lists?

from ridi_audit import compare_allocations

reference = ["doc-1", "doc-2", "doc-3", "doc-4"]
updated   = ["doc-1", "doc-2", "doc-9", "doc-4"]

report = compare_allocations(reference, updated)
print(report)
RIDI Allocation Comparison
--------------------------
Before size:   4
After size:    4
Overlap:       3
Changed slots: 1
RIDI:          0.400000

This is the shortest path for RAG contexts, shortlists, alert queues, remediation lists and other realized top-k allocations.

Have paired candidate scores?

import pandas as pd
from ridi_audit import audit

before = pd.read_csv("before.csv")
after = pd.read_csv("after.csv")

report = audit(before, after, k=[10, 50, 100])
controlled = report.control(k=100, eta=0.001)

What RIDI adds

You already report RIDI adds
performance / accuracy whether the identities receiving action changed
group fairness realized membership change inside or across groups
rank correlation finite top-k membership stability
retrieval quality which passages actually entered the context window
model/version comparison a direct allocation-level comparator

For equal-size selected sets A and B:

RIDI(A, B) = 1 - |A ∩ B| / |A ∪ B|

RIDI is not a replacement for AUROC, precision, recall, nDCG, calibration, robustness, safety or fairness. It makes realized membership observable.


Evidence behind the project

Test Current result
Preregistered RAG, 800 queries Exact registered retrieval-audit equivalence with 17.27% benchmark-defined correctness divergence at the primary condition (95% CI 14.60–20.03%)
SciFact 275 Same positive passage, rank and registered retrieval metrics; identity substitution changes SUPPORTS → REFUTES; order-only control remains SUPPORTS
EPSS production update 565 / 1,000 priorities changed (RIDI=0.722) vs adjacent same-version controls of 0 and 7
Exact identity–utility frontier Separates necessary from avoidable turnover under an explicit utility-regret budget, with no retraining

Most RAG benchmark-defined outcomes remained stable. The claim is behavioral non-equivalence can exist inside an exactly audit-equivalent class, not that every allocation change is harmful or that all AI systems are fragile.

Independent verification status — 4 Sep 2026

  • The sealed EPSS numerical workflow was reproduced by two independent external executors in separate environments.
  • SciFact 275 was independently regenerated twice, blind, by external executors using distinct serving environments.
  • Mohammed Hamdan: all registered retrieval-audit quantities remained identical; reference and identity control were SUPPORTS (the identity output was byte-identical to reference), the order-only permutation remained SUPPORTS, and the audit-equivalent identity substitution produced REFUTES. His run used the same frozen inputs and prompt conditioning but, because of hardware limits, used a disclosed Q4_K_M qwen3:8b llama.cpp/Ollama serving path rather than the frozen bf16 Hugging Face pipeline.
  • Théophile Ossard: independently reproduced the same substantive SUPPORTS versus REFUTES pattern on a distinct GPU/software stack. His regenerated reference prefixed the verdict with Verdict:, exposing a strict-parser boundary that is retained transparently.
  • These are independent computational regenerations, not a CODECHECK certificate. Community CODECHECK request #208 is registered; formal checking has not begun.

Read the evidence and boundaries →


Designed to drop into research workflows

Framework-agnostic. RIDI needs identities—and optionally scores—not a particular model library.

Two entry points. compare_allocations() for selected IDs; audit() for paired score tables.

Publication-ready output. Reports can emit dictionaries or Markdown records.

Control, not only measurement. AuditReport.control() exposes the exact identity–utility frontier.

Reproducible by default. Deterministic tie handling, CI on Python 3.10–3.12, locked research workflows, negative results retained, and explicit verification boundaries.

Common settings: RAG and information retrieval · cybersecurity remediation · clinical alerts · fraud/compliance triage · inspection queues · hiring/shortlisting · grant review · moderation · any budget-constrained ranking or finite action set.

Copy-paste recipes →


Use it in a paper

The Allocation Identity Reporting Checklist covers capacity, selection rule, comparator, identity metrics, controls, conventional evaluation, privacy and downstream outcomes.

A minimal methods sentence is:

We audited allocation identity at the prespecified capacity by reporting selected-set overlap, changed slots and RIDI alongside the domain’s conventional evaluation metrics.

Adapt it to the design; do not claim endpoints you did not test.


Replicate it. Challenge it. Extend it.

Independent reproductions, boundary cases, discrepancies and null results are welcome. Use the dedicated GitHub issue forms for an Independent replication or a New domain application.

Contributing guide →


Current manuscript

Identical audits can yield different AI decisions

The public repository is synchronized to the current science/product lock as of 4 Sep 2026. The manuscript is prepared for journal submission; it is not peer reviewed, accepted or published.

Registered RxNorm and Open Targets failures remain part of the project record to delimit the claim. Allocation identity alone does not establish correctness, fairness, causal harm, benefit, clinical utility or model superiority.


Citation

If you use RIDI or ridi-audit, cite the software using CITATION.cff and the accompanying manuscript when a public bibliographic record is available.

Adeeb Noor
Department of Information Technology, Faculty of Computing and Information Technology
King Abdulaziz University, Jeddah, Saudi Arabia
ORCID: 0000-0002-8251-1853

Metadata

Release files for ridi-audit 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ridi-audit 1.1.0
File Size Uploaded Provenance
ridi_audit-1.1.0.tar.gz 21.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ridi-audit 1.1.0
File Interpreter ABI Platform
ridi_audit-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.3 kB

Release files / ridi_audit-1.1.0.tar.gz

Download URL ridi_audit-1.1.0.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a6993fe069f34cb8af7a06f5a203c819f7cf5ac9c1a08a7783d89d153f53bf25
BLAKE2b-256 checksum
How to use checksums
c8d99a3185fed1d1b597d83368e3ed60fe5d942c88788071eca74f3abfa2a53b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ridi_audit-1.1.0-py3-none-any.whl

Download URL ridi_audit-1.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
351d7e7de5bfc27db87abed6326b5c45a2e1503b0ddbdbfa830bd27623326563
BLAKE2b-256 checksum
How to use checksums
872c087309c3fcca454ca7cc8ff09cf54114b5eec53f31cc3168c896b13d4aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Security for ridi-audit 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ridi_audit-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page