Skip to content

docs: add Generator Reachability Lab Phase 0 metric-inventory audit - #154

Merged
PhysShell merged 4 commits into
mainfrom
claude/reachability-lab-phase0-audit
Jul 26, 2026
Merged

docs: add Generator Reachability Lab Phase 0 metric-inventory audit#154
PhysShell merged 4 commits into
mainfrom
claude/reachability-lab-phase0-audit

Conversation

@PhysShell

@PhysShell PhysShell commented Jul 26, 2026

Copy link
Copy Markdown
Owner

What

New audit docs/audit/2026-07-generator-reachability-metric-inventory.md — the Phase 0 deliverable named in generator-reachability-lab.md §5.

Docs-only research artifact; binds nothing (the proposal binds nothing until accepted). Phase 0 adds no production code. Every code claim is verified against the tree and cited by file:line.

Phase 0 is a drafted, honest, incomplete deliverable: items 1–4 & 6 are answered; item 5 (measured cost) is outstanding (no Rust toolchain was available to run the specified harness), so Phase 0 is not yet satisfied as an evidence gate.

The six required answers (§5)

  1. Inventory of the metric layer (scoring/similarity/novelty/syncopation/feature/rerank/structure/gesture/closure), with the versioned policies present (similarity v3, novelty v1, generation_rerank v1, structure v1, closure v1).
  2. Per-axis triage (reuse/extend/new). Headline: the debt is privacy, not absence — reusable primitives are private helpers awaiting disciplined extraction.
  3. Holdout — per mode, because the model carries a source-file identity, not a song identity:
    • HoldoutTargetSourceFileCONDITIONAL PASS (requires sha256; sha256-less records fall back to a basename and must fail closed).
    • HoldoutTargetFragmentCONDITIONAL PASS within one source file (sha256 + bar_range; None = whole-source overlap).
    • HoldoutTargetSongBLOCKED today: no canonical song_id groups the several tabs of one composition (MIDI vs GP5 → different sha256), so a song holdout would silently keep one and exclude the other. Needs a canonical song identity (or a files→song manifest) as a Phase-1 prerequisite. EnsembleRef.group_id is one source span, not a song, so it can't substitute.
    • Also: identity is structurally dropped at CorpusMaterial construction — a blocker for post-hoc leak attribution only.
  4. Target eligibility — correction: there is no ExactVoice type; the monophonic (onset,duration,pitch) projection is a private gesture::top_line. The generator's output is provably monophonic, so poly/chord/technique targets are correctly ineligible.
  5. Cost benchmark: no bench infra (no criterion, no benches/). Protocol + a zero-production-code dev-only harness given; numbers TBD (unmeasured) — Phase 0 stays incomplete until they are recorded.
  6. Roadmap placement: recommend an ADR for the measurement/holdout boundary + an isolated lab crate (ADR-0010 precedent), not a new stage; no SN invented (glossary §0).

Also flags the three private "melodic line" extractors — consolidate before a fourth.

Also

  • generator-reachability-lab.md — back-reference to the drafted (not-complete) audit; §6 records that HoldoutTargetSong needs a canonical song identity as a Phase-1 prerequisite.

Review

Addressed two Codex rounds + arbiter REQUEST CHANGES: fail-closed content identity, newextend onset triage, "delivered"→"drafted", and the file-vs-song holdout split (HoldoutTargetSong BLOCKED).

Docs-only → CI (Rust-only) green. Not a completed Phase 0 — an honest Phase 0 draft. Not merging without an explicit human GO.

🤖 Generated with Claude Code

https://claude.ai/code/session_012T7SRMiXmZe5v1imtrKMPi

Delivers the Phase 0 audit named in generator-reachability-lab.md §5
(docs-only; no production code; binds nothing until the proposal is accepted).
Six required answers, every code claim verified by file:line:

1. Inventory of the metric layer (scoring/similarity/novelty/syncopation/
   feature/rerank/structure/gesture/closure) with versioned policies
   (similarity v3, novelty v1, generation_rerank v1, structure v1, closure v1).
2. Per-axis triage (reuse/extend/new) — the debt is privacy, not absence:
   the reusable primitives are private helpers.
3. Holdout feasibility: PASS — enforceable on Vec<LoadedChunk> before
   corpus_material() (generation_input.rs:137). Identity is dropped at
   CorpusMaterial construction — a blocker for post-hoc leak attribution only,
   not for holdout. Caveat: bar_range is Option (None = whole-file overlap).
4. Target eligibility: honest correction — no ExactVoice type exists; the
   monophonic (onset,duration,pitch) projection is a private gesture::top_line.
   Generator output is provably monophonic, so poly/chord/technique targets are
   correctly ineligible.
5. Cost benchmark: no bench infra exists (no criterion/benches). Protocol +
   dev-only harness specified; numbers TBD (Rust toolchain unavailable in the
   authoring env) — measurement is a mechanical follow-up.
6. Roadmap placement: recommend an ADR for the measurement/holdout boundary +
   an isolated lab crate (constraint-lab/ADR-0010 precedent), not a new stage;
   no SN number invented (glossary §0).

Also flags three private "melodic line" extractors (consolidate before a
fourth). Back-references the audit from the proposal §5.

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 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 35 minutes

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: a556ffd4-ac4f-45bd-b566-1a46a227ecd3

📥 Commits

Reviewing files that changed from the base of the PR and between a37332e and f42c95b.

📒 Files selected for processing (2)
  • docs/audit/2026-07-generator-reachability-metric-inventory.md
  • docs/proposals/generator-reachability-lab.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/reachability-lab-phase0-audit

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: 084fbd5bfe

ℹ️ 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 on lines +185 to +186
song identity (`title`, `filename`, `sha256`) are **required**; the source range
`bar_range` is **`Option`**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject records without a content identity from holdout

For pre-v9 records, SourceRef::sha256 is explicitly optional (core/src/corpus.rs:45-50,114-120), and load_chunk falls back to the basename when it is absent (cli/src/generation_input.rs:83-101); the code itself notes that a filename is not an identity. Therefore a corpus containing such a record cannot reliably implement HoldoutTargetSong by source identity, so declaring PASS here can label a leaky run as a valid holdout. These records need to be rejected/migrated in holdout mode, or the missing identity must remain a Phase-1 blocker.

Useful? React with 👍 / 👎.

Comment on lines +212 to +214
No production code. Deliverable (**delivered** — see
[`../audit/2026-07-generator-reachability-metric-inventory.md`](../audit/2026-07-generator-reachability-metric-inventory.md);
a docs-only draft that binds nothing until this proposal is accepted):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Finish the cost benchmark before marking Phase 0 delivered

The Phase-0 contract still requires measured costs at 1k/10k/100k trials (item 5), but the linked audit explicitly leaves every value as TBD (unmeasured) and supplies only a harness sketch. Marking the deliverable as completed can let later work treat the evidence gate as satisfied even though the benchmark result that gates directed-search discussion does not exist; keep Phase 0 incomplete until those measurements are recorded.

Useful? React with 👍 / 👎.


| Proposed fact | Best existing source | Decision | Reason (grounded) |
| --- | --- | --- | --- |
| Exact onset set | `syncopation::track_onsets` (`syncopation.rs:59`, private); `structure::track_notes` (`:127`) | **new** | No public onset-set projection; extractors are private and on different shapes. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Classify the existing onset extractor as an extension

The table defines extend as lifting an existing private helper, then labels this row new solely because the onset extractor is private. For eligible monophonic inputs, syncopation::track_onsets already computes the exact onset set, and novelty::top_line also contains the required onsets, so following this triage would encourage another projection despite the audit's extraction-first goal. Mark this as extend and select the shared line/onset primitive to lift.

Useful? React with 👍 / 👎.

…red, onset triage)

Three Codex findings on 084fbd5, all accepted:

- P1 holdout content identity: "PASS" was too strong. SourceRef.sha256 is
  Option (pre-v9) and the loader falls back to the basename
  (cli/src/generation_input.rs:87-101; "a filename is not an identity"), so a
  corpus with sha256-less records cannot reliably do HoldoutTargetSong by
  content identity. Verdict qualified to fail-closed: reject/migrate records
  without sha256 in holdout mode (the proposal's own §6 fail-closed law), or the
  missing identity is a Phase-1 blocker. Records WITH sha256 stay fully reliable.
- P2 "delivered" overstated: item 5 (measured cost) is still TBD, so Phase 0 is
  not satisfied as an evidence gate. Proposal back-reference changed to
  "drafted, not yet complete"; audit §0 says so explicitly.
- P2 onset-set triage: reclassified new -> extend to match the audit's own
  extend definition (syncopation::track_onsets already computes the onset set
  privately; lift the shared line/onset primitive rather than author a new one).

Docs-only; binds nothing.

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

@codex — all three findings accepted and fixed in 2583e20 (reviewed 084fbd5b):

  • P1 — Reject records without a content identity from holdout. Correct, and load-bearing. SourceRef.sha256 is Option (corpus.rs:120) and the loader keys on sha256.unwrap_or_else(|| filename) (cli/src/generation_input.rs:87-91), verifying the hash only if let Some(expected) (:99-101) — "a filename is not an identity". I downgraded the verdict from a flat PASS to "PASS, conditional on fail-closed handling of records without a content identity": per the proposal's own §6 fail-closed law, holdout must reject or migrate sha256-less records, never trust a basename; absent that, the missing identity is a Phase-1 blocker. Records with sha256 remain fully reliable (the hash check runs, a mismatch is a hard failure). Reflected in §0 and §3 (new "Condition (fail-closed content identity)" item).
  • P2 — Finish the cost benchmark before marking Phase 0 delivered. Agreed — "delivered" overstated it while item 5 is TBD. The proposal back-reference is now "drafted, not yet complete — item 5's measured cost is still pending, so Phase 0 is not satisfied as an evidence gate", and audit §0 states the same explicitly.
  • P2 — Classify the onset extractor as extend. Agreed, it contradicted my own extend definition. Reclassified new → extend: syncopation::track_onsets already computes the exact onset set privately, so the row now says lift the shared line/onset primitive (canonicalising the ordering the HashSet drops), not author a new projection.

CI green on the new head; docs-only. Please re-review 2583e20. Not merging without an explicit human GO.

@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: 2583e20b5a

ℹ️ 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 on lines +234 to +235
identity is a Phase-1 blocker, not a footnote. (Records *with* `sha256` are
fully reliable — the content check runs and a mismatch is a hard failure.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require a song ID before trusting hash-bearing records

When the same song is represented by two different MIDI/Guitar Pro files, both records can have valid but different SHA-256 values, so the claim that hash-bearing records are “fully reliable” still allows HoldoutTargetSong to retain target-song material. SourceRef has only a basename and file-content hash (core/src/corpus.rs:98-120), while EnsembleRef.group_id identifies parts from one source span rather than the song (core/src/corpus.rs:271-279); there is no stable song ID in the model. Phase 1 therefore needs a canonical song identity (or must redefine this mode as exact-source-file holdout) before this can be a conditional PASS.

Useful? React with 👍 / 👎.

The audit conflated source-file identity with song identity. The model
(schema v9) has sha256 (one file's content hash), filename, a free-form title,
and EnsembleRef.group_id (siblings of ONE source span) — but NO canonical
song_id. So two tabs of one composition (MIDI vs GP5) hash differently and one
leaks while the other is held out: a source-file holdout mislabelled as a song
holdout.

Verdict split into three modes:
- HoldoutTargetSourceFile: CONDITIONAL PASS (needs sha256; sha-less fail closed).
- HoldoutTargetFragment: CONDITIONAL PASS within one source file (sha256 +
  bar_range; None = whole-source overlap).
- HoldoutTargetSong: BLOCKED today — needs a canonical song_id (or a versioned
  files->song manifest) as a Phase-1 prerequisite; EnsembleRef.group_id is one
  source span, not a song, and cannot substitute.

Also: dropped the "title/filename/sha256 = required song identity" overstatement
(title is free-form; sha256/track_index/bar_range are Option); qualified
"fully reliable" to "reliable as a source-FILE identity". Proposal §6 keeps
HoldoutTargetSong but records it is not fail-closed-implementable today.
PR body updated to match (was still "PASS" / "delivered").

Docs-only; binds nothing.

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

Accepted — the file-vs-song identity conflation was the real defect. Fixed in 6ad6075 (verified against the model: title is free-form String at corpus.rs:372; EnsembleRef.group_id is "one source span, several parts" at corpus.rs:275; grep confirms no song identifier exists).

Holdout verdict split into three modes (§3):

  • HoldoutTargetSourceFileCONDITIONAL PASS: requires source.sha256; sha256-less records fall back to basename and must fail closed (reject/migrate).
  • HoldoutTargetFragmentCONDITIONAL PASS within one identified source file: sha256 + bar_range (None = whole-source overlap).
  • HoldoutTargetSongBLOCKED today: no canonical song_id, so two tabs of one composition (MIDI vs GP5) hash differently and one leaks while the other is held out. Needs a canonical song_id (or a versioned files→song manifest) as a Phase-1 prerequisite; EnsembleRef.group_id (one source span) cannot substitute.

Also dropped the "title/filename/sha256 = required song identity" overstatement (title is free-form; sha256/track_index/bar_range are all Option), and qualified "fully reliable" → "reliable as a source-file identity, not the song identity HoldoutTargetSong needs".

Proposal §6 keeps HoldoutTargetSong but now records it is not fail-closed-implementable on the current model and needs a canonical song identity first.

PR body updated to match the head — was still "Holdout: PASS" / "delivered audit"; now states the three-mode split and Phase-0-incomplete.

Standing accepted (per your note): onset newextend, sha-less fail-closed, Phase 0 honestly incomplete on cost, proposal no longer calls the audit a completed evidence gate, cost benchmark TBD with directed-search discussion closed until measured. This remains an honest Phase 0 draft, not a completed Phase 0. CI green expected on 6ad6075; not merging without an explicit human GO.

… CHANGES)

1. CorpusMode enum: add HoldoutTargetSourceFile — the audited file-level mode
   that PASSes today existed only in prose; the proposal enum now enumerates
   NoCorpus / HoldoutTargetSourceFile / HoldoutTargetFragment / HoldoutTargetSong
   / LeakyDiagnostic, with HoldoutTargetSong marked BLOCKED until a song_id.
2. Proposal §5 starter table: onset row none/new -> track_onsets/extend, to
   match the audit triage (else a future agent builds a fourth extractor).
3. Eligibility record: carry per-mode identity explicitly — source_sha256
   (required, file/fragment modes typed-refuse without it), canonical_song_id
   (Option; HoldoutTargetSong typed-refuses without it), bar_range, track_index,
   projection, eligibility. No basename fallback.

Docs-only; binds nothing. Still an honest Phase 0 DRAFT (item 5 cost run
outstanding), not a completed Phase 0.

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

Thanks — three consistency fixes pushed in f42c95b:

  1. HoldoutTargetSourceFile added to the enum. The audited file-level mode existed only in prose; the proposal §6 CorpusMode now enumerates NoCorpus / HoldoutTargetSourceFile / HoldoutTargetFragment / HoldoutTargetSong / LeakyDiagnostic, with HoldoutTargetSong commented BLOCKED-until-song_id.
  2. Proposal §5 starter table onset row synced none/new`syncopation::track_onsets` (private) / `top_line` / extend, matching the audit triage (so no fourth extractor gets built).
  3. Eligibility record carries per-mode identity explicitly (§4): source_sha256 (REQUIRED — file/fragment modes typed-refuse without it), canonical_song_id (Option; HoldoutTargetSong typed-refuses without it), bar_range, track_index, projection, eligibility. No basename fallback.

This is one consistency commit with exactly the three requested changes; nothing else touched. Still an honest Phase 0 draft — item 5 (cost run) remains a separate mandatory closure, not satisfied here.

CI running on f42c95b. On your explicit GO + green CI + no new current-head finding, I'll merge as a Phase 0 draft (gh pr merge 154 --merge --delete-branch) — noting the environment may block the merge action on my side, in which case I'll ask you to run it.

@PhysShell

Copy link
Copy Markdown
Owner Author

@codex — the 10:14 P1 ("Require a song ID before trusting hash-bearing records") is fully addressed in 6ad6075 + f42c95b, and I took exactly your suggested alternative: the reliable mode is redefined as exact-source-file holdout (HoldoutTargetSourceFile, now in the CorpusMode enum), while HoldoutTargetSong is BLOCKED until a canonical song_id (or a versioned files→song manifest) exists — a Phase-1 prerequisite. The "fully reliable" claim is gone, replaced by "reliable as a source-file identity, not the song identity HoldoutTargetSong needs". Your citations (corpus.rs:98-120, :271-279) match the audit's. This closes the finding.

@PhysShell
PhysShell merged commit 803aa5f into main Jul 26, 2026
15 checks passed
@PhysShell
PhysShell deleted the claude/reachability-lab-phase0-audit branch July 26, 2026 10:52
@chatgpt-codex-connector

Copy link
Copy Markdown

Review Result

Confirmed — the P1 finding is fully resolved. No further changes requested.

The updated documentation now:

The original “fully reliable” song-level implication is gone. The proposal and audit are now internally consistent about what the current corpus model can and cannot guarantee.

No repository changes were necessary, so I did not create a commit or a follow-up pull request. The original PR is already present in the current history as merge commit 803aa5f.

Checks

  • git diff 2583e20..f42c95b -- docs/audit/2026-07-generator-reachability-metric-inventory.md docs/proposals/generator-reachability-lab.md
  • rg -n "HoldoutTarget(SourceFile|Song|Fragment)|canonical.song|source-file identity|fully reliable|source_sha256" docs/audit/2026-07-generator-reachability-metric-inventory.md docs/proposals/generator-reachability-lab.md
  • git status --short --branch
  • git log --oneline -6

View task →

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