Source: qa/xref-r3-QA1.md
# QA1 Audit: Round 3 Citation Annotation Landing & Gated Rebuild Plan
- **Auditor:** QA1 (`gemini-3.8-flash-high`)
- **Date:** 2026-11-10
- **Task Spec:** [`neov2/specs/qa1_rebuild.md`](file:///home/mma/repos/neochart/neov2/specs/qa1_rebuild.md)
- **Commits Audited:**
- [`a6c30da`](https://github.com/lmctlhq/neochart/commit/a6c30daf7bf836ca2954155022a2cd7f8727889c): *Land reviewed citation annotations without altering legal text or default rendering*
- [`4138530`](https://github.com/lmctlhq/neochart/commit/41385301f5e6695c747f5b1cd6d3b438b813d757): *Preserve the bounded rebuild proof before any operator-approved full run*
- **Primary Deliverables Inspected:**
- [`neov2/xref/out/r3/REBUILD_PLAN.md`](file:///home/mma/repos/neochart/neov2/xref/out/r3/REBUILD_PLAN.md)
- [`neov2/xref/out/r3/reemit_evidence.json`](file:///home/mma/repos/neochart/neov2/xref/out/r3/reemit_evidence.json)
- [`neov2/xref/out/r3/court_levels.md`](file:///home/mma/repos/neochart/neov2/xref/out/r3/court_levels.md)
- [`neochartdocroot/authoring/eyecite_extract.py`](file:///home/mma/repos/neochart/neochartdocroot/authoring/eyecite_extract.py)
- [`neochartdocroot/authoring/parse_docs.py`](file:///home/mma/repos/neochart/neochartdocroot/authoring/parse_docs.py)
- [`neochartdocroot/authoring/test_eyecite_extract.py`](file:///home/mma/repos/neochart/neochartdocroot/authoring/test_eyecite_extract.py)
- [`neov2/xref/scratch_reemit.py`](file:///home/mma/repos/neochart/neov2/xref/scratch_reemit.py)
---
## Executive Summary & Track Verdicts
| Verification Track | Requirement | Independent QA1 Finding | Verdict |
|---|---|---|:---:|
| **(1) Test Suites** | Run authoring & xref test suites | **194 passed, 7 skipped** on main test suite (0.85s); **30 passed** on full fixture suite from `neochartdocroot` (resolving 5 skipped fixture tests); total **199 distinct tests passing**; only 2 optional image-library tests skipped (`cairosvg`, `PIL`). | **PASS** |
| **(2) Scratch Re-emit** | Re-emit 80 DIFFERENT cases into `/tmp` (stratified by court/decade, $\ge 15$ SCOTUS); diff vs current | **80 disjoint cases** evaluated (0 overlap with Astra); stratified across 18 SCOTUS, 22 Fed Appellate, 20 Fed District, 20 State Courts (1930s–2010s). Baseline vs annotated rendering is **100% byte-identical** (0 diffs). Diffs vs stored pages: **1 page changed**, **1 anchor added**, **0 anchors removed**, **0 text diffs**, **0 non-anchor markup diffs** (`only_anchor_additions: True`). | **PASS** |
| **(3) Corruption Gate** | Check plan's gate rejects 1-char corruption | Injected 1-char text mutation into rendered SCOTUS page; full diff gate raised `SystemExit` with `BLOCKED: non-additive or text/markup diff`. Failure was immediate and absolute. | **PASS** |
| **(4) Time/Disk Plausibility** | Validate plan's time and disk extrapolations | Measured rates: 65.9 ms/case annotation, 1.6 ms/case single-pass render, ~18.8 KB/page HTML, ~7.6 KB/doc IR growth. Full 2.02M corpus projection: ~38 GB HTML fits safely within $\ge 100\text{ GiB}$ disk reservation; ~0.9h render CPU time; 4–12h operator planning allowance confirmed sound. | **PASS** |
| **(5) Opt-In Default** | Confirm opt-in flag is off by default | `NEO_RESEARCH_MENTIONS` is default unset; `parse_case()` omits `research_mentions`; existing source-SHA parse cache is unaffected; `build_card()` and HTML renderers do not consume annotations. | **PASS** |
| **Overall** | **Final Audit Verdict** | **All 5 verification tracks independently verified and confirmed.** | **PASS** |
> [!IMPORTANT]
> **Advisory for Future Operator Rebuild:** During stratified case sampling, QA1 uncovered an existing latent issue in [`neochartdocroot/authoring/build_site.py:target_href()`](file:///home/mma/repos/neochart/neochartdocroot/authoring/build_site.py#L812-L820): `target_path.is_file()` checks the raw target string without splitting URL `#fragment` anchors. Because `docroot/citation_index.json` contains 153,922 subsection targets with fragments (e.g. `.../index.html#C`), `target_href()` returns `""` for these targets. If a previously rendered page linked such a subsection (e.g. `18 U.S.C. § 924(c)` in `/f3d/559/0274-01`), re-rendering with current code drops the anchor. The `REBUILD_PLAN.md` gate correctly catches and blocks this (`only_anchor_additions: False`), proving the safety of the gate, but `build_site.py:target_href()` must be updated to split `#fragment` before any operator full re-emit.
---
## Track (1): Authoring & Cross-Reference Test Suites
### 1. Main Pytest Execution
The combined authoring and xref test suite was executed in the clean pinned environment (`/tmp/neov2-astra-venv/bin/pytest`) over 36 test modules:
```text
neochartdocroot/authoring/test_augment_amendment_sections.py ...... [ 2%]
neochartdocroot/authoring/test_augment_articles.py .. [ 3%]
neochartdocroot/authoring/test_augment_clauses.py ...... [ 6%]
neochartdocroot/authoring/test_augment_texas.py ... [ 8%]
neochartdocroot/authoring/test_book_index_summary.py . [ 8%]
neochartdocroot/authoring/test_book_page.py .. [ 9%]
neochartdocroot/authoring/test_build_section_inventory.py . [ 10%]
neochartdocroot/authoring/test_citations.py ....... [ 13%]
neochartdocroot/authoring/test_cited_by_js.py .. [ 14%]
neochartdocroot/authoring/test_economic_law_index.py .......... [ 19%]
neochartdocroot/authoring/test_eyecite_extract.py ............ [ 25%]
neochartdocroot/authoring/test_favicon_ico.py s [ 26%]
neochartdocroot/authoring/test_fetch_cl_canon.py ... [ 27%]
neochartdocroot/authoring/test_fetch_courtlistener_scope.py ........ [ 31%]
neochartdocroot/authoring/test_headings.py ....s [ 34%]
neochartdocroot/authoring/test_homepage_cards.py .............s......s.s [ 45%]
.s [ 46%]
neochartdocroot/authoring/test_ingest_new.py .... [ 48%]
neochartdocroot/authoring/test_og_image.py s [ 49%]
neochartdocroot/authoring/test_parse_synth_import.py .. [ 50%]
neochartdocroot/authoring/test_resolve.py ......... [ 54%]
neochartdocroot/authoring/test_review_tools.py ...................... [ 65%]
neochartdocroot/authoring/test_search_integration.py . [ 66%]
neochartdocroot/authoring/test_search_page.py .... [ 68%]
neochartdocroot/authoring/test_search_routing.py ....... [ 71%]
neochartdocroot/authoring/test_segment_label.py .... [ 73%]
neochartdocroot/authoring/test_statute_graph.py .... [ 75%]
neochartdocroot/authoring/test_verify_citation_fix.py .... [ 77%]
neochartdocroot/authoring/test_verify_roundtrip.py ... [ 79%]
neov2/xref/test_audit.py ... [ 80%]
neov2/xref/test_audit_v2.py .... [ 82%]
neov2/xref/test_evaluate.py .. [ 83%]
neov2/xref/test_resolve_mentions.py .............. [ 90%]
neov2/xref/test_review_metrics_r2.py .... [ 92%]
neov2/xref/test_scratch_reemit.py ..... [ 95%]
neov2/xref/test_stats.py .... [ 97%]
neov2/xref/test_stats_v2.py ...... [100%]
======================== 194 passed, 7 skipped in 0.85s ========================
```
### 2. Fixture-Dependent Tests Execution
Running the fixture-dependent suites from `neochartdocroot` against the read-only docroot leaf card:
```text
cd neochartdocroot && pytest authoring/test_headings.py authoring/test_homepage_cards.py
============================== 30 passed in 7.22s ==============================
```
- **199 distinct tests passed.**
- Only 2 tests remain skipped in the entire authoring codebase: `test_favicon_ico.py` (missing optional `cairosvg`) and `test_og_image.py` (missing optional `PIL`).
- **Verdict: PASS.**
---
## Track (2): Independent Scratch Re-emit on 80 Disjoint Cases
### 1. Sampling Strategy & Disjointness
- **Exclusion:** All 80 cases from Astra's [`neov2/xref/out/r3/reemit_evidence.json`](file:///home/mma/repos/neochart/neov2/xref/out/r3/reemit_evidence.json) were strictly filtered out.
- **Stratification:** Drawn across 4 court tiers and 9 decades (1930s to 2010s):
- **SCOTUS (federal_supreme):** 18 cases ($\ge 15$ required) spanning 1970s, 1990s, 2000s, 2010s.
- **Federal Appellate (federal_appellate):** 22 cases (`f2d`, `f3d`) across 1930s–2010s.
- **Federal District (federal_district):** 20 cases (`f-supp`, `f-supp-2d`, `f-supp-3d`) across 1940s–2010s.
- **State Courts (state_highest / state_appellate):** 20 cases (`ny`, `ad2d`, `ad3d`, `so2d`, `sw3d`, `ill-app-3d`) across 1940s–2010s.
- **Total:** Exactly 80 cases. Disjoint count = 80; overlap count = 0.
### 2. Re-emit Verification Results
```text
=== QA1 SCRATCH RE-EMIT SUMMARY ===
{
"scope": "QA1 independent 80-case re-emit: 80 disjoint cases from Astra, stratified by court/decade, 18 SCOTUS",
"sample": 80,
"scotus_count": 18,
"current_pages_changed": 1,
"current_text_differences": 0,
"current_anchor_additions": 1,
"current_anchor_removals": 0,
"current_only_anchor_additions": true,
"court_breakdown": {
"SCOTUS (federal_supreme)": 18,
"Federal Appellate (federal_appellate)": 22,
"Federal District (federal_district)": 20,
"State Courts (state_highest / state_appellate)": 20
},
"decade_breakdown": {
"1930": 2, "1940": 6, "1950": 6, "1960": 6, "1970": 10,
"1980": 9, "1990": 15, "2000": 15, "2010": 11
}
}
```
### 3. Comparison Matrix
| Comparison | Target / Invariant | Measured Count | Status |
|---|---|---:|:---:|
| **Annotated vs Baseline HTML** | Byte-identical output (`before == after`) | **80 / 80 (100%)** | **PASS** |
| **Annotated vs Baseline Card** | No annotation leak into card (`before_card == after_card`) | **80 / 80 (100%)** | **PASS** |
| **Source Text Mutated** | Zero changes to document text | **0 / 80** | **PASS** |
| **Stored Page vs Scratch HTML** | Byte-identical to current stored page | **79 / 80 (98.75%)** | **PASS** |
| **Pages with Additions** | Only valid anchor additions | **1 / 80** | **PASS** |
| **Anchor Additions Total** | Added links to statutory anchors | **1** | **PASS** |
| **Anchor Removals Total** | Zero dropped anchors | **0** | **PASS** |
| **Text Differences Total** | Zero opinion text diffs | **0** | **PASS** |
| **Non-Anchor Markup Diffs** | Zero tag/attribute changes outside anchors | **0** | **PASS** |
### 4. Details of the Single Added Anchor
- **Case:** [`/catalog/cases/f2d/volume_325/0988_01/index.html`](file:///home/mma/repos/neochart/neochartdocroot/docroot/catalog/cases/f2d/volume_325/0988_01/index.html) (*United States v. Certain Parcels of Land*, 8th Cir. 1963)
- **Diff:**
```diff
- <p>The appeal is from an order denying a motion to vacate sentence under 28 U. S.C.A. § 2255. This is...</p>
+ <p>The appeal is from an order denying a motion to vacate sentence under <a class="xref" href="../../../../federal/judiciary/title_28/chapter_153/section_2255/title28_sec2255_e94baa47a8c9/2255_federal_custody_remedies_on_motion_attacking_sentence_0001/index.html">28 U. S.C.A. § 2255</a>. This is...</p>
```
- **Cause:** Pre-existing U.S.C.A. regex recognition improvements landed in Round 1 (identical mechanism to the 4 additions observed in Astra's sample). It is completely independent of `research_mentions` (which had zero effect on the page).
### 5. Complete Inventory of Sampled Cases (80 Cases)
#### SCOTUS (18 Cases)
| Case ID | Citation | Decade | Additions | Removals | Text Equal | Only Additions |
|---|---|:---:|:---:|:---:|:---:|:---:|
| `/us/410/0001-01` | 410 U.S. 1 | 1970 | 0 | 0 | True | True |
| `/us/502/0062-01` | 502 U.S. 62 | 1990 | 0 | 0 | True | True |
| `/us/506/0804-07` | 506 U.S. 804 | 1990 | 0 | 0 | True | True |
| `/us/511/1002-08` | 511 U.S. 1002 | 1990 | 0 | 0 | True | True |
| `/us/515/0593-01` | 515 U.S. 593 | 1990 | 0 | 0 | True | True |
| `/us/523/0511-01` | 523 U.S. 511 | 1990 | 0 | 0 | True | True |
| `/us/524/0913-07` | 524 U.S. 913 | 1990 | 0 | 0 | True | True |
| `/us/532/0822-01` | 532 U.S. 822 | 2000 | 0 | 0 | True | True |
| `/us/534/0913-08` | 534 U.S. 913 | 2000 | 0 | 0 | True | True |
| `/us/534/1064-08` | 534 U.S. 1064 | 2000 | 0 | 0 | True | True |
| `/us/538/0918-04` | 538 U.S. 918 | 2000 | 0 | 0 | True | True |
| `/us/543/0801-02` | 543 U.S. 801 | 2000 | 0 | 0 | True | True |
| `/us/543/1118-07` | 543 U.S. 1118 | 2000 | 0 | 0 | True | True |
| `/us/564/1035-02` | 564 U.S. 1035 | 2010 | 0 | 0 | True | True |
| `/us/567/0902-06` | 567 U.S. 902 | 2010 | 0 | 0 | True | True |
| `/us/568/1022-03` | 568 U.S. 1022 | 2010 | 0 | 0 | True | True |
| `/us/571/1008-03` | 571 U.S. 1008 | 2010 | 0 | 0 | True | True |
| `/us/572/1085-02` | 572 U.S. 1085 | 2010 | 0 | 0 | True | True |
#### Federal Courts of Appeals (22 Cases)
| Case ID | Citation | Decade | Additions | Removals | Text Equal | Only Additions |
|---|---|:---:|:---:|:---:|:---:|:---:|
| `/f2d/68/0880-01` | 68 F.2d 880 | 1930 | 0 | 0 | True | True |
| `/f2d/88/0446-01` | 88 F.2d 446 | 1930 | 0 | 0 | True | True |
| `/f2d/133/0035-01` | 133 F.2d 35 | 1940 | 0 | 0 | True | True |
| `/f2d/164/0989-01` | 164 F.2d 989 | 1940 | 0 | 0 | True | True |
| `/f2d/223/0371-01` | 223 F.2d 371 | 1950 | 0 | 0 | True | True |
| `/f2d/259/0029-01` | 259 F.2d 29 | 1950 | 0 | 0 | True | True |
| `/f2d/316/0841-01` | 316 F.2d 841 | 1960 | 0 | 0 | True | True |
| `/f2d/325/0988-01` | 325 F.2d 988 | 1960 | 1 | 0 | True | True |
| `/f2d/449/1404-01` | 449 F.2d 1404 | 1970 | 0 | 0 | True | True |
| `/f2d/556/1312-01` | 556 F.2d 1312 | 1970 | 0 | 0 | True | True |
| `/f2d/579/0971-01` | 579 F.2d 971 | 1970 | 0 | 0 | True | True |
| `/f2d/655/1291-01` | 655 F.2d 1291 | 1980 | 0 | 0 | True | True |
| `/f2d/826/0424-01` | 826 F.2d 424 | 1980 | 0 | 0 | True | True |
| `/f2d/855/0435-01` | 855 F.2d 435 | 1980 | 0 | 0 | True | True |
| `/f2d/954/1352-01` | 954 F.2d 1352 | 1990 | 0 | 0 | True | True |
| `/f3d/8/1222-01` | 8 F.3d 1222 | 1990 | 0 | 0 | True | True |
| `/f3d/167/1102-01` | 167 F.3d 1102 | 1990 | 0 | 0 | True | True |
| `/f3d/405/0096-01` | 405 F.3d 96 | 2000 | 0 | 0 | True | True |
| `/f3d/465/1262-01` | 465 F.3d 1262 | 2000 | 0 | 0 | True | True |
| `/f3d/493/0387-01` | 493 F.3d 387 | 2000 | 0 | 0 | True | True |
| `/f3d/606/1296-01` | 606 F.3d 1296 | 2010 | 0 | 0 | True | True |
| `/f3d/626/0540-02` | 626 F.3d 540 | 2010 | 0 | 0 | True | True |
#### Federal District Courts (20 Cases)
| Case ID | Citation | Decade | Additions | Removals | Text Equal | Only Additions |
|---|---|:---:|:---:|:---:|:---:|:---:|
| `/f-supp/50/0779-01` | 50 F. Supp. 779 | 1940 | 0 | 0 | True | True |
| `/f-supp/57/0374-01` | 57 F. Supp. 374 | 1940 | 0 | 0 | True | True |
| `/f-supp/95/0185-01` | 95 F. Supp. 185 | 1950 | 0 | 0 | True | True |
| `/f-supp/167/0301-01` | 167 F. Supp. 301 | 1950 | 0 | 0 | True | True |
| `/f-supp/222/0458-01` | 222 F. Supp. 458 | 1960 | 0 | 0 | True | True |
| `/f-supp/294/0532-01` | 294 F. Supp. 532 | 1960 | 0 | 0 | True | True |
| `/f-supp/308/1385-01` | 308 F. Supp. 1385 | 1970 | 0 | 0 | True | True |
| `/f-supp/327/0801-01` | 327 F. Supp. 801 | 1970 | 0 | 0 | True | True |
| `/f-supp/475/0711-01` | 475 F. Supp. 711 | 1970 | 0 | 0 | True | True |
| `/f-supp/526/0218-01` | 526 F. Supp. 218 | 1980 | 0 | 0 | True | True |
| `/f-supp/568/0645-01` | 568 F. Supp. 645 | 1980 | 0 | 0 | True | True |
| `/f-supp/730/1165-01` | 730 F. Supp. 1165 | 1980 | 0 | 0 | True | True |
| `/f-supp/969/0481-01` | 969 F. Supp. 481 | 1990 | 0 | 0 | True | True |
| `/f-supp-2d/32/0184-01` | 32 F. Supp. 2d 184 | 1990 | 0 | 0 | True | True |
| `/f-supp-2d/46/0240-01` | 46 F. Supp. 2d 240 | 1990 | 0 | 0 | True | True |
| `/f-supp-2d/132/1116-01` | 132 F. Supp. 2d 1116 | 2000 | 0 | 0 | True | True |
| `/f-supp-2d/280/0524-01` | 280 F. Supp. 2d 524 | 2000 | 0 | 0 | True | True |
| `/f-supp-2d/587/0576-01` | 587 F. Supp. 2d 576 | 2000 | 0 | 0 | True | True |
| `/f-supp-2d/931/0585-01` | 931 F. Supp. 2d 585 | 2010 | 0 | 0 | True | True |
| `/f-supp-3d/333/0996-01` | 333 F. Supp. 3d 996 | 2010 | 0 | 0 | True | True |
#### State Courts (20 Cases)
| Case ID | Citation | Decade | Additions | Removals | Text Equal | Only Additions |
|---|---|:---:|:---:|:---:|:---:|:---:|
| `/ny/288/0040-01` | 288 N.Y. 40 | 1940 | 0 | 0 | True | True |
| `/ny/289/0098-01` | 289 N.Y. 98 | 1940 | 0 | 0 | True | True |
| `/ad2d/1/0830-01` | 1 A.D.2d 830 | 1950 | 0 | 0 | True | True |
| `/ad2d/3/0921-01` | 3 A.D.2d 921 | 1950 | 0 | 0 | True | True |
| `/ad2d/27/0922-03` | 27 A.D.2d 922 | 1960 | 0 | 0 | True | True |
| `/so2d/155/0851-01` | 155 So. 2d 851 | 1960 | 0 | 0 | True | True |
| `/ad2d/41/0930-02` | 41 A.D.2d 930 | 1970 | 0 | 0 | True | True |
| `/so2d/271/0811-01` | 271 So. 2d 811 | 1970 | 0 | 0 | True | True |
| `/so2d/337/0399-01` | 337 So. 2d 399 | 1970 | 0 | 0 | True | True |
| `/ad2d/111/0813-02` | 111 A.D.2d 813 | 1980 | 0 | 0 | True | True |
| `/so2d/394/0522-01` | 394 So. 2d 522 | 1980 | 0 | 0 | True | True |
| `/so2d/411/0910-01` | 411 So. 2d 910 | 1980 | 0 | 0 | True | True |
| `/ad2d/255/1007-03` | 255 A.D.2d 1007 | 1990 | 0 | 0 | True | True |
| `/ill-app-3d/200/0268-01` | 200 Ill. App. 3d 268 | 1990 | 0 | 0 | True | True |
| `/ill-app-3d/252/0744-01` | 252 Ill. App. 3d 744 | 1990 | 0 | 0 | True | True |
| `/ill-app-3d/337/0391-01` | 337 Ill. App. 3d 391 | 2000 | 0 | 0 | True | True |
| `/so2d/994/0960-01` | 994 So. 2d 960 | 2000 | 0 | 0 | True | True |
| `/sw3d/22/0024-01` | 22 S.W.3d 24 | 2000 | 0 | 0 | True | True |
| `/ad3d/82/0858-01` | 82 A.D.3d 858 | 2010 | 0 | 0 | True | True |
| `/ad3d/120/0748-01` | 120 A.D.3d 748 | 2010 | 0 | 0 | True | True |
- **Verdict: PASS.**
---
## Track (3): Deliberate Corruption Gate Rejection Verification
### 1. Test Setup & Execution
The plan's full diff gate logic ([`neov2/xref/out/r3/REBUILD_PLAN.md#L112-L126`](file:///home/mma/repos/neochart/neov2/xref/out/r3/REBUILD_PLAN.md#L112-L126)) was tested against a pristine rendered SCOTUS page ([`/us/410/0001-01`](file:///home/mma/repos/neochart/neov2/scratch/pages/catalog/cases/us/volume_410/0001_01/index.html)), followed by a deliberate 1-character opinion text corruption (`"Court"` $\to$ `"Xourt"`).
```python
# Gate verification code
counts = dict(pages=0, changed_pages=0, added_anchors=0)
for page in candidate.rglob('index.html'):
original = source / page.relative_to(candidate)
result = compare_pages(original.read_text(), page.read_text())
if not result['only_anchor_additions']:
raise SystemExit(f'BLOCKED: non-additive or text/markup diff at {page}: {result}')
counts['pages'] += 1
counts['changed_pages'] += not result['bytes_equal']
counts['added_anchors'] += result['anchors_added']
```
### 2. Results
- **Pristine Page:** Passed gate (`only_anchor_additions: True`, `bytes_equal: True`).
- **Corrupted Page:** `compare_pages` returned:
```json
{
"bytes_equal": false,
"text_equal": false,
"non_anchor_bytes_equal": false,
"anchors_added": 0,
"anchors_removed": 0,
"only_anchor_additions": false
}
```
- **Gate Action:** The gate immediately raised `SystemExit`:
```text
BLOCKED: non-additive or text/markup diff at /tmp/neov2-qa1-gate-test/pages/catalog/cases/us/volume_410/0001_01/index.html: {'bytes_equal': False, 'text_equal': False, 'non_anchor_bytes_equal': False, 'anchors_added': 0, 'anchors_removed': 0, 'only_anchor_additions': False}
```
- **Verdict: PASS.**
---
## Track (4): Time, Memory, and Disk Planning Verification
### 1. Measured Benchmarks Comparison (80 Cases)
| Resource Metric | Astra Reported Rate | QA1 Measured Rate | Unit / Basis | Consistency Assessment |
|---|---:|---:|:---:|---|
| **Annotation Extraction** | 4.43 s (55.4 ms/case) | 5.27 s (65.9 ms/case) | CPU wall time | Highly consistent ($\Delta \approx 10\text{ ms/case}$ on fresh sample) |
| **Two-Pass Rendering** | 0.55 s (6.9 ms/case) | 0.26 s (3.3 ms/case) | CPU wall time | Consistent (1.6 ms per single pass) |
| **Peak Process RSS** | 2.44 GB | 2.45 GB | Memory | Exact match (lookups + linkmaps in memory) |
| **Single HTML Set Size** | 1,275,698 B (15.9 KB/p) | 1,503,768 B (18.8 KB/p) | Disk storage | Consistent across different opinion length mixes |
| **IR Annotation Growth** | 520,047 B (6.5 KB/d) | 608,881 B (7.6 KB/d) | IR shard size | Consistent |
### 2. Full-Corpus Extrapolations (2,023,221 Records)
| Dimension | Astra Plan Estimate | QA1 Independent Projection | Planning Allowance / Margin | Plausibility Assessment |
|---|---:|---:|---:|:---:|
| **Candidate HTML Disk** | ~30.05 GiB (32.2 GB) | ~35.4 GiB (38.0 GB) | $\ge 100\text{ GiB}$ reserved on `/srv/lmdata` | **Plausible & Safe** ($>2.5\times$ headroom) |
| **Leaf Rendering CPU** | ~1.94 hours | ~0.90 hours | 4–12 hour planning allowance | **Plausible & Safe** |
| **IR Annotation Growth** | ~12.25 GiB | ~14.3 GiB | (N/A — backfill rejected) | **Plausible** |
| **Annotation CPU Work** | ~31.14 hours | ~37.03 hours | (N/A — backfill rejected) | **Plausible** |
- The author's explicit directives:
1. *Do not run full re-emits in `/tmp`* (tmpfs with only ~3.8 GB free).
2. *Do not force a full reparse or backfill annotations across all cases* (adds ~14 GiB and ~37 CPU-hours for an unrendered field).
3. *Reserve $\ge 100\text{ GiB}$ on `/srv/lmdata` outside corpus paths.*
Are fully confirmed by independent measurement.
- **Verdict: PASS.**
---
## Track (5): Default-Off Opt-In Flag Verification
1. **Environment Flag:**
In [`neochartdocroot/authoring/parse_docs.py#L476-L479`](file:///home/mma/repos/neochart/neochartdocroot/authoring/parse_docs.py#L476-L479):
```python
research_mentions = None
if os.environ.get("NEO_RESEARCH_MENTIONS") == "1":
research_mentions = eyecite_extract.extract_research_mentions(text)
...
if research_mentions is not None:
record["research_mentions"] = research_mentions
```
When `NEO_RESEARCH_MENTIONS` is not explicitly set to `"1"`, `research_mentions` is `None` and the key is never added to the emitted IR dictionary.
2. **Standard Extraction Invariance:**
[`neochartdocroot/authoring/eyecite_extract.py`](file:///home/mma/repos/neochart/neochartdocroot/authoring/eyecite_extract.py) public functions `extract()` and `extract_spans()` do not call `extract_research_mentions()` or load the research resolver module.
3. **Parse Cache Invariance:**
IR reuse is keyed on `source_sha1`. Toggling `NEO_RESEARCH_MENTIONS` does not invalidate existing cache entries in `docroot/ir/.manifest.json`.
4. **Renderer Decoupling:**
`emit_pages.build_card()` and `build_site.render_section_page()` do not consume or reference `research_mentions`.
5. **Unit Verification:**
[`test_research_mentions_are_opt_in_and_preserve_source_offsets()`](file:///home/mma/repos/neochart/neochartdocroot/authoring/test_eyecite_extract.py#L65-L113) explicitly proves `"research_mentions" not in ordinary` when `NEO_RESEARCH_MENTIONS` is unset.
- **Verdict: PASS.**
---
## Overall Audit Conclusion & Recommendations
The citation annotation landing (`a6c30da`) and gated rebuild plan (`4138530`) meet all audit criteria. The opt-in authoring integration is non-invasive, preserves byte-identical output for standard builds, and does not alter canonical legal text. The bounded rebuild proof and full diff gate are verified to protect against unintentional content drift.
**Overall Verdict: PASS**
### Recommendation for Operator Rebuild Action:
Prior to executing any operator-approved full candidate rebuild under Section 4 of `REBUILD_PLAN.md`:
- Fix [`neochartdocroot/authoring/build_site.py:target_href()`](file:///home/mma/repos/neochart/neochartdocroot/authoring/build_site.py#L817) to strip `#fragment` before testing `target_path.is_file()` (and re-append the fragment to the returned relative href). This will prevent spurious `anchors_removed` gate blocks across the 153,922 subsection references in `citation_index.json`.