# Regulation Change Sentinel
**When the rules behind your grants change overnight, which compliance decisions are now wrong?**
An explainable agent that re-checks a grant recipient's compliance register against a rewritten federal regulation, using **one federated [Zetaris](https://www.zetaris.com) view** over a PostgreSQL database, a file store and the **live eCFR government API**.
[](https://github.com/Agnuxo1/zetaris-regulation-change-sentinel/actions/workflows/ci.yml)



---
## 28 October improvement — modal-aware v2
**Official delivery:** the video, English subtitles and write-up were uploaded
to the organiser's Dropbox on 28 October at 20:41–20:42 UTC. All three files
were verified in a fresh folder listing. [Delivery record](docs/DELIVERY_20261028.md).
Organiser confirmation of completeness and judging results are still pending.
The executable Python candidate and a new **live federated Zetaris view** now
also track `will` and `can`. On the same 48 labelled assessments, this recovers
one additional material change with **no additional false positive**:
| | Original v1 | Modal v2 |
|---|---:|---:|
| Recall | 0.8421 | **0.8947** |
| Precision | 0.6400 | **0.6538** |
| F1 | 0.7273 | **0.7556** |
| Review queue | 25 | 26 |
The live SQL and independent Python candidate agree on **48/48 verdicts**.
This is an exploratory improvement on the known benchmark; the paired
section-bootstrap interval for ΔF1 is [0, 0.1068], not proof of performance on
unseen regulations. [Implementation, all three ablations and limits](docs/MODAL_V2.md) ·
[Live agreement](results/modal-v2/live-agreement.json) · [Per-case results](results/modal-v2/predictions.csv).
```sh
python -m src.control_modal_v2
python scripts/evaluate_modal_variants.py
python -m src.sentinel provision --variant modal-v2
python -m src.sentinel review --variant modal-v2
```
The tables and video below describe v1; its results remain reproducible.
## Contents
- [The problem](#the-problem)
- [What the Sentinel does](#what-the-sentinel-does)
- [Zetaris, live](#zetaris-live)
- [Results](#results)
- [How it works](#how-it-works)
- [Reproduce it](#reproduce-it)
- [Repository layout](#repository-layout)
- [Exact role of Zetaris](#exact-role-of-zetaris)
- [Limitations and honest notes](#limitations-and-honest-notes)
- [Credits and licences](#credits-and-licences)
## The problem
On **1 October 2024** the U.S. Uniform Guidance for federal awards, **2 CFR Part 200**, was rewritten. The official eCFR version index marks **188 sections** as amended on that date. Thresholds every grants office relies on moved — equipment from $5,000 to $10,000, the single-audit trigger from $750,000 to $1,000,000, the MTDC subaward cap from $25,000 to $50,000 — while hundreds of other paragraphs changed only in wording ("non-Federal entity" became "recipient or subrecipient").
A grants office holds dozens of documented compliance assessments, each quoting the paragraph it relied on. After a rewrite like this, the safe default is to re-review all of them. That is expensive, and most of the work is wasted on editorial changes.
## What the Sentinel does
For every assessment in the register, the Sentinel answers three questions and shows its evidence:
1. **Is the quoted paragraph still there, word for word?** → `UNCHANGED`
2. **If not, where is its successor in the new version?** The closest paragraph of the same section by normalised Levenshtein distance; nothing close enough → `REVIEW_NOT_FOUND`.
3. **Did the facts change?** Amounts, percentages, durations and obligation words (`must`, `may`, `unallowable`, `prior approval`, …) are extracted from both versions and compared. Any difference → `REVIEW_MATERIAL`; none → `EDITORIAL_ONLY` and the assessment stands.
All three decisions run **inside Zetaris**, as a single SQL view that joins the three live sources. The agent only reads that view and turns each row into an explanation a reviewer can check in seconds: