nutrient-extraction-samples

Mortgage-assistance form extraction

This developer sample maps page 1 of an authentic public Request for Mortgage Assistance (RMA) form to eight reviewable fields. The visible names, identifiers, address, phone number, selections, and hardship explanation are privacy-safe demo values. They are not customer data, a real borrower, or a lending decision.

The committed output is a reviewed, receipt-bound live API response over this public-form demo input. It matched 6/8 predeclared values exactly, returned a valid page-bounded primary region for all eight fields, and retains both punctuation mismatches. Reviewed does not mean correct, and it does not approve publication.

Open this reviewed proof on GitHub Pages →

Source and transformation

The exact historical download URL for the repository scan was not recorded. The Treasury URL above is canonical program context and is not claimed to be the byte-download URL for the frozen file.

build_public_form.py verifies the original bytes, preserves the previous bespoke PDF as data/legacy-synthetic-mortgage-verification.pdf, rasterizes source page 1, and fits it beneath the provenance rail on one exact 612x792 PDF page. The result contains no AcroForm field tree, Widget annotations, or JavaScript. The eight source boxes in fixture.json were independently drawn over the final rendered page and visually checked against their exact values.

Rebuild the deterministic PDF from the repository root:

python3 demos/mortgage_verification/build_public_form.py

Two consecutive builds must report the same derived SHA-256 above.

Offline provisional proof

From the repository root:

python3 demos/mortgage_verification/generate_demo.py --provisional
python3 demos/mortgage_verification/check_expected.py --allow-provisional

Open demos/mortgage_verification/provisional/output/index.html directly. The page is self-contained. These commands do not read NUTRIENT_API_KEY, access a live cache, call the network, or consume credits. A zero exit code means only that the fixture-derived values and independently recorded source boxes match the oracle in expected.json. They write only below provisional/ and never replace the committed reviewed artifacts under output/.

Live refresh gate

Only --refresh can read NUTRIENT_API_KEY, call the Data Extraction API, and consume credits. Run it only within an explicitly approved live gate:

python3 demos/mortgage_verification/generate_demo.py --refresh
python3 demos/mortgage_verification/check_expected.py
python3 demos/mortgage_verification/generate_demo.py --replay-live

The refresh path writes a new cache whose key is bound to this public-form PDF and a matching request-ID/SHA-256 receipt. Historical synthetic caches and receipts remain preserved and are not valid evidence for the new input. Live replays require both a matching cache and receipt; they never fall back to provisional evidence.

After the live response has received a recorded independent review, reproduce that reviewed state with:

python3 demos/mortgage_verification/generate_demo.py --replay-reviewed
python3 demos/mortgage_verification/check_expected.py --reviewed-live

Those flags reproduce a recorded review; they do not perform a new review or approve publication.

Boundaries

This sample demonstrates extraction and returned primary source regions. It is not KYC, underwriting, an eligibility decision, or an accuracy, compliance, security, or performance benchmark. The servicer region clips the decisive final period, so the page does not claim complete semantic grounding.

Generated provisional artifacts are provisional/evidence.json, provisional/output/source-page.png, provisional/output/comparison.json, and provisional/output/index.html. The current output artifacts represent the reviewed public-form response; historical captures in output/playwright/ remain legacy evidence.