Skip to content

Add IO data-quality triage report + warning W128#529

Merged
jeffreylouden merged 2 commits into
mainfrom
io-quality-triage
Jul 11, 2026
Merged

Add IO data-quality triage report + warning W128#529
jeffreylouden merged 2 commits into
mainfrom
io-quality-triage

Conversation

@jeffreylouden

@jeffreylouden jeffreylouden commented Jul 11, 2026

Copy link
Copy Markdown
Member

Context

Follow-up to #212 (IO positioning). Pillar 1 of the I/O data-quality plan — triage & prevention — so enrichment can be prioritized and new imports stop regressing.

The commit was briefly pushed straight to main by mistake and reverted there; this PR reintroduces it under normal review.

What's in here

pnpm io-quality report — scores every hardware entry and prints a prioritized worklist:

  • Correctness smells: combine candidates (maxConnections>1 on single-jack connections), collapsed stereo/numbered-pair names ("Outputs 1/2", "Analog In L/R"), uniform-position imports (all jacks on one edge — the H90's original bug).
  • Missing I/O: connectivity-category devices (interfaces, mixers, synths…) with no io at all.
  • Spatial gap: entries with I/O but no columnPosition/rowPosition, densest first.
  • Supports --json and --limit.

Warning W128 (advisory, non-blocking) — flags maxConnections>1 on single-jack connections in pnpm validate, excluding intentional aggregates ("All Slots").

scripts/lib/io-heuristics.ts — shared combine heuristic so report and validator stay in lockstep.

Current picture (from the report)

  • 5,260 hardware entries; 51% have any I/O, <1% have column/row layout
  • 16 combine candidates, 24 collapsed-pair-name entries, 678 uniform-position entries
  • 1,491 connectivity-category devices missing I/O entirely

Verification

  • pnpm validate ✅ (W128 fires 16× advisory, exit 0), typecheck ✅, lint ✅, test ✅ (107/107)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added pnpm io-quality to generate an IO Quality & Coverage Report highlighting correctness smells, connectivity IO gaps, and missing column/row enrichment.
    • Added --json output and --limit to scope report size (default 20).
  • Documentation
    • Added advisory warning W128 to VALIDATION_ERRORS.md, including when it triggers and remediation steps.
  • Validation
    • Emit W128 when an IO entry looks like it may combine multiple physical jacks (maxConnections > 1 on single-jack connection types).

Follow-up to #212. Adds detection/prevention tooling for hardware I/O data:

- pnpm io-quality: scores every hardware entry and prints a prioritized
  worklist (correctness smells, missing I/O in connectivity categories,
  column/row coverage gaps). Supports --json and --limit.
- Warning W128 (advisory): flags maxConnections>1 on single-jack connections
  where multiple physical jacks were likely collapsed into one entry, with
  aggregate names ("All Slots") excluded.
- scripts/lib/io-heuristics.ts shares the combine heuristic between the report
  and the validator so CI and triage stay in lockstep.
- Document W128 in docs/VALIDATION_ERRORS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 593949b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
catalog Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added documentation Documentation updates scripts Changes to build/validation scripts labels Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3cd54c3a-b310-471d-a1c4-a537ed18e995

📥 Commits

Reviewing files that changed from the base of the PR and between b6a7935 and 593949b.

📒 Files selected for processing (1)
  • scripts/lib/error-codes.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/lib/error-codes.ts

Walkthrough

Changes

The PR adds shared IO quality heuristics, validator warning W128, and a new pnpm io-quality CLI that analyzes hardware YAML entries and reports prioritized correctness, connectivity, and spatial coverage gaps. It also adds command wiring and documentation.

IO quality tooling

Layer / File(s) Summary
Shared heuristic and W128 validation
scripts/lib/io-heuristics.ts, scripts/lib/error-codes.ts, scripts/validate.ts, docs/VALIDATION_ERRORS.md
Detects single-jack entries claiming multiple connections and emits the registered W128 advisory warning with documentation.
IO quality report generation
scripts/io-quality.ts
Analyzes hardware IO metrics, builds prioritized worklists, and supports human-readable, --json, and --limit output.
Command wiring and release notes
package.json, .changeset/io-quality-report.md
Registers pnpm io-quality and documents the report and W128 warning.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI as io-quality CLI
  participant Report as generateReport
  participant Files as Hardware YAML files
  participant Metadata as Category grouping metadata
  CLI->>Report: generateReport(limit)
  Report->>Files: enumerate and analyze entries
  Report->>Metadata: load category exemptions
  Report-->>CLI: return prioritized worklists
  CLI-->>CLI: print JSON or formatted report
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: an IO triage report plus the new W128 warning.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch io-quality-triage

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
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/VALIDATION_ERRORS.md`:
- Around line 501-510: Align the W128 documentation heading with the registered
anchor in ERROR_INFO: either rename the heading to produce the existing
w128-io-combine-candidate slug or update the anchor in error-codes.ts to match
the current heading slug. Ensure the heading and anchor resolve to the same
identifier.

In `@scripts/lib/error-codes.ts`:
- Around line 274-277: Update the anchor for
ValidationErrorCode.W128_IO_COMBINE_CANDIDATE to
"w128-io-entry-may-combine-multiple-physical-jacks" so it matches the
corresponding heading slug in the validation errors documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f018d2d9-8286-4f0e-88d7-78f15945ed31

📥 Commits

Reviewing files that changed from the base of the PR and between 8bc5855 and b6a7935.

📒 Files selected for processing (7)
  • .changeset/io-quality-report.md
  • docs/VALIDATION_ERRORS.md
  • package.json
  • scripts/io-quality.ts
  • scripts/lib/error-codes.ts
  • scripts/lib/io-heuristics.ts
  • scripts/validate.ts

Comment thread docs/VALIDATION_ERRORS.md
Comment thread scripts/lib/error-codes.ts
The registered anchor 'w128-io-combine-candidate' did not match the GitHub
slug of the "### W128: IO Entry May Combine Multiple Physical Jacks" heading,
so getDocsUrl(W128) linked to a non-existent fragment. Align the anchor with
the heading slug, matching the convention used by the other W1xx entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeffreylouden jeffreylouden merged commit 860c7be into main Jul 11, 2026
8 checks passed
@jeffreylouden jeffreylouden deleted the io-quality-triage branch July 11, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation updates scripts Changes to build/validation scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant