Skip to content

docs(migrate): v9 corpus backfill — run report + verified evidence (PR C) - #163

Merged
PhysShell merged 3 commits into
mainfrom
claude/v9-corpus-backfill
Jul 28, 2026
Merged

docs(migrate): v9 corpus backfill — run report + verified evidence (PR C)#163
PhysShell merged 3 commits into
mainfrom
claude/v9-corpus-backfill

Conversation

@PhysShell

@PhysShell PhysShell commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What

PR C of the corpus-modernization arc: executed migrate-v9 (#162) on a fresh copy of ~/griff_data and verified the result. Docs/evidence only — the live corpus is untouched, and a production cutover is a separate, separately-authorized step.

Arc: A (census #158) → B (migration contract + tool #162) → C (run + verify, this) → D (v10 song_id, blocked on ADR-0031).

Verified results (all independently recomputed)

Check Result
Migrated 9907 standalone chunks + 2 manifests (curated 220 + ingest 9687), zero refusals
sha256 coverage 100% — 9907/9907, 220/220, 9687/9687
track_index 0% everywhere — never guessed
Digest correctness 100% — each sha256 == SHA-256 of the resolved tab
Structural diff stripping the added sha256 reproduces every record exactly; only manifest change is schema_version 8→9
Census before/after v9 sha256 coverage 0 → 9907; input_digest + manifests changed; every other census block identical (counts, reconciliation, ensemble, duplicates, …)
File-level holdout smoke v8 FAILS CLOSED (9907 keyless) → v9 PASSES: 399 source files, deterministic 20% holdout (77 src / 1792 chunks) vs train (322 src / 8115 chunks), zero source-file leakage

Incidental finding: 400 referenced filenames → 399 distinct digests — two differently-spelled Underoath filenames are byte-identical (the migrator's duplicate-bytes-are-unique rule handled it), a latent same-recording signal for the future song_id work.

Deliverables

Notes

  • The migrator emits records only (9909 files); the 20 corpus-root source tabs + _inventory/ artifacts are not its output — a cutover carries them over verbatim.
  • No track_index recovery (separate work). No v10 (blocked on ADR-0031).

🤖 Generated with Claude Code

https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi

Summary by CodeRabbit

  • Documentation
    • Added a migration report documenting the v9 corpus backfill, validation results, census changes, and reproducibility steps.
    • Added a comprehensive v9 corpus health report covering manifests, source reconciliation, coverage, annotation totals, ensemble integrity, duplicate content, and file formats.
    • Documented v10 readiness indicators and known migration non-goals.

Executed migrate-v9 on a fresh copy of ~/griff_data (never in place) and
verified the result. Live corpus untouched; production cutover is a
separate authorized step.

Evidence (all independently recomputed):
- 9907 standalone chunks + 2 manifests (curated 220 + ingest 9687)
  migrated, zero refusals — every source.filename resolved uniquely.
- sha256 coverage 100% (9907/9907; 220/220; 9687/9687); track_index 0%
  (never guessed); each digest equals the SHA-256 of the resolved tab.
- structural diff: stripping the added sha256 reproduces every record
  exactly; the only manifest change is schema_version 8→9.
- census before/after: v9 sha256 coverage 0→9907; input_digest and
  manifests changed; every other census block identical.
- file-level holdout smoke: v8 FAILS CLOSED (9907 keyless) → v9 PASSES
  (399 source files, deterministic 20% holdout, zero source-file leakage).
- incidental: 400 filenames → 399 digests (two byte-identical Underoath
  spellings) — a latent same-recording signal for future song_id work.

Adds the v9 census artifact; leaves the #158 v8 baseline untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PhysShell, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 353c245b-886f-4af5-8b69-a10f825e022a

📥 Commits

Reviewing files that changed from the base of the PR and between 68adfec and 516ce58.

📒 Files selected for processing (3)
  • docs/audit/2026-07-v9-corpus-backfill.md
  • migrate/README.md
  • migrate/verify-v9-backfill.py
📝 Walkthrough

Walkthrough

Adds a migration run report and a JSON health artifact for the v8-to-v9 corpus backfill, covering source hashing, reconciliation, coverage, readiness, integrity, duplicate detection, and reproducibility details.

Changes

v9 Corpus Audit

Layer / File(s) Summary
Migration execution and verification
docs/audit/2026-07-v9-corpus-backfill.md
Documents migration inputs, source.sha256 coverage, structural verification, census changes, holdout results, non-goals, and reproduction commands.
Health inventory and reconciliation
docs/audit/2026-07-v9-corpus-health.json
Records manifest inventories, aggregate counts, source matching, missing or ambiguous source results, unreferenced tabs, and v9 coverage metrics.
Readiness and integrity diagnostics
docs/audit/2026-07-v9-corpus-health.json
Records v10 readiness mappings, annotation coverage, ensemble integrity, duplicate tabs, and transcription format distributions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • PhysShell/griff#162: Introduces the migrate-v9 tool whose backfill execution and verification are documented here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: documenting the v9 corpus backfill run with verification evidence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/v9-corpus-backfill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68adfecec3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/audit/2026-07-v9-corpus-backfill.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/audit/2026-07-v9-corpus-backfill.md (1)

74-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add a language to the fenced block (MD040).

markdownlint flags this fence. text suffices for digest output.

♻️ Proposed fix
-```
+```text
 before: c004d5225b51563137d538495f076e6e4f1086f407a1de2c8372fbcd3d186194
 after : 810421840463560b78233ebe79e89d05101b3ca14a0ee29a7774dc500cafd790
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/audit/2026-07-v9-corpus-backfill.md around lines 74 - 77, Add the
text language identifier to the fenced digest-output block so it satisfies
markdownlint rule MD040, preserving the block’s existing contents.


</details>

<!-- cr-comment:v1:93428e29ded48a9de346a5b4 -->

_Source: Linters/SAST tools_

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @docs/audit/2026-07-v9-corpus-backfill.md:

  • Around line 122-123: Adjust the wrapped sentence around the Underoath
    filenames so the hyphenated phrase does not split across lines with a leading
    space; keep the wording and meaning unchanged while ensuring Markdown renders
    “differently-spelled” correctly.

Nitpick comments:
In @docs/audit/2026-07-v9-corpus-backfill.md:

  • Around line 74-77: Add the text language identifier to the fenced
    digest-output block so it satisfies markdownlint rule MD040, preserving the
    block’s existing contents.

</details>

<details>
<summary>🪄 Autofix (Beta)</summary>

Fix all unresolved CodeRabbit comments on this PR:

- [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)
- [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro Plus

**Run ID**: `356f55ae-22b3-4e7e-ba35-234213b122e6`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 36965e538fde8d3ed591a50499bfee2c64dadcba and 68adfecec3032f05fed877b1e8040ddcc2d8aa78.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `docs/audit/2026-07-v9-corpus-backfill.md`
* `docs/audit/2026-07-v9-corpus-health.json`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment thread docs/audit/2026-07-v9-corpus-backfill.md Outdated
… layout

Close the arbiter's REQUEST CHANGES on the reproduction contract (the
migration was fine; the notarization was not).

1. Directory layout documented. The tabs root is <copy>/tabs with the 410
   tab files nested in <copy>/tabs/tabs/, so census records each identity
   with a `tabs/` path component — which is what the committed input_digest
   is computed over. Re-running census with this exact root reproduces
   e2b72750… bit-for-bit (verified on a fresh copy; committed v9 census JSON
   is byte-identical to fresh output).

2. Committed deterministic verifier. migrate/verify-v9-backfill.py reproduces
   and checks every independent claim — sha256 coverage, per-record digest
   correctness, the structural diff, both record-tree digests, and the
   file-level holdout partition — with the exact algorithms (tab resolution,
   tree-digest formula, holdout bucket) fixed in its docstring. Reproduce
   section now drives it; record-tree digests updated to the verifier's
   canonical values.

Clean-room check on a fresh ~/griff_data copy: verifier ALL CHECKS PASS
(9907/9907 coverage, 0 track_index, 77/1792 holdout vs 322/8115, 0 leakage),
census input_digest reproduces.

Cosmetics: fixed the "differently-spelled" line wrap; digest fences tagged
`text`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
@PhysShell

Copy link
Copy Markdown
Owner Author

REQUEST CHANGES addressed — reproduction contract now holds

New head 9d45b84e6ec482e093ca13c66b68642e7ecc3065.

1. Census tabs-root / layout. The gap was documentation, not the digest. The copy's tabs are nested: the tabs root is <copy>/tabs, but the 410 files sit in <copy>/tabs/tabs/, so census records each identity with a tabs/ path component — exactly what the committed input_digest is computed over. Re-running census <copy>/corpus <copy>/tabs reproduces e2b72750… bit-for-bit, and the committed 2026-07-v9-corpus-health.json is byte-identical to fresh census output. The report now documents this layout explicitly (with an ASCII tree) and why census sees exactly 410 tabs.

2. Committed deterministic verifier. migrate/verify-v9-backfill.py <before> <after> <tabs> reproduces and checks every independent claim — sha256 coverage, per-record digest correctness, the structural diff, both record-tree digests, and the holdout partition — exiting non-zero on any failure. The exact algorithms are fixed in its docstring: tab resolution (basename→stem, dup-bytes-not-ambiguous), the record-tree-digest formula (POSIX relpath, UTF-8 sort, "<sha> <relpath>\n", sha256 of the concatenation), and the holdout bucket (int(sha256(key)[:8],16) % 5 == 0, fixed 1-of-5, order-independent). The Reproduce section now drives it; record-tree digests were regenerated to the verifier's canonical values (875b89f8… / 352511fc…).

Clean-room proof (fresh ~/griff_data copy, following the committed instructions):

  • verifier → ALL CHECKS PASS: 9907/9907 coverage, 0 track_index, 9907/9907 correct, 9907/9907 structural, holdout 77 src/1792 chunks vs 322 src/8115 chunks, 0 leakage;
  • census input_digest reproduces; committed JSON byte-identical.

Cosmetics fixed: differently-spelled line wrap; digest fences tagged text.

The #158 v8 baseline (census/corpus-health.json) remains untouched. No production cutover; no live corpus modified. Awaiting GO.

Close the arbiter's remaining notary defect: ALL CHECKS PASS proved "some
correctly-migrated 9907-record corpus", not THIS snapshot. The verifier now
require()s the exact evidence fingerprint:

  before/after record-tree digests, 399 distinct sources, and the
  77/1792 · 322/8115 holdout split

against committed constants — a different corpus (even one this tool
migrated correctly) now fails instead of printing ALL CHECKS PASS. Proven
with two negative runs (swapped census files; after=v8 corpus) that exit 1.

Given the two census JSON outputs, the verifier also asserts they are
byte-identical to census/corpus-health.json and the committed v9 artifact —
so "byte-identical to fresh output" is machine-checked, not eyeballed. The
Reproduce section now runs census first and passes both JSONs to the
verifier.

Clean-room on a fresh ~/griff_data copy: fully-bound verifier exits 0
(coverage, correctness, structural diff, pinned tree digests, pinned
holdout counts, census byte-identity).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi
@PhysShell

Copy link
Copy Markdown
Owner Author

REQUEST CHANGES addressed — evidence now bound to this snapshot

New head 516ce58a7f382557a90e428cccf524664d1d7ba8.

1. ALL CHECKS PASS is now snapshot-specific. The verifier require()s the exact fingerprint of the PR C corpus, not just the general invariants:

before tree = 875b89f8…   after tree = 352511fc…
distinct sources = 399
holdout = 77 src / 1792 chunks     train = 322 src / 8115 chunks

A different corpus — even one this same tool migrated correctly — now fails instead of printing ALL CHECKS PASS. Proven with two negative runs (swapped census files; after pointed at the v8 corpus) that both exit 1. The constants are documented as the snapshot fingerprint: if the corpus legitimately changes, the report and constants are regenerated together.

2. Census artifacts are machine-checked, not eyeballed. Given the two census JSON outputs, the verifier asserts them byte-identical to census/corpus-health.json (v8 baseline) and docs/audit/2026-07-v9-corpus-health.json (v9). The Reproduce section now runs census first and passes both JSONs to the verifier, so the "byte-identical to fresh output" claim is part of the reproducible contract.

3. Stale Codex tabs-root thread — replied and resolved; the current text (nested <copy>/tabs/tabs/ layout + bit-for-bit input_digest reproduction) closes it.

Clean-room proof (fresh ~/griff_data copy):

verify-v9-backfill.py <copy>/corpus <out> <copy>/tabs before.json after.json
→ coverage 9907/9907, track_index 0, structural 9907/9907,
  tree digests + holdout counts match fingerprint,
  census before.json / after.json IDENTICAL to committed
→ ALL CHECKS PASS (exit 0)

No live corpus touched; #158 v8 baseline untouched; no production cutover. Awaiting GO.

@PhysShell
PhysShell merged commit cc31125 into main Jul 28, 2026
15 checks passed
@PhysShell
PhysShell deleted the claude/v9-corpus-backfill branch July 28, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant