Add IO position enrichment tool + backfill Eventide H90 (#212)#526
Conversation
Starts issue #212 (rowPosition/columnPosition on IO entries). - Add `pnpm enrich-io <slug>` interactive tool to assign columnPosition (left-to-right) and rowPosition (top-to-bottom) to a hardware entry's IO ports, writing back to YAML with formatting preserved. - Document the ordering convention in schema/CONTEXT.md (via generate-context.ts) and CLAUDE.md, including "one io entry per physical jack". - Fully correct the Eventide H90 as the validation case: all 14 discrete rear-panel jacks with column/row grid positions (2x2 audio in/out grids), replacing an incomplete 5-entry list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5c7a479 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds optional ChangesIO Position Enrichment
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant EnrichIO
participant HardwareYAML
Operator->>EnrichIO: run pnpm enrich-io <slug>
EnrichIO->>HardwareYAML: parse and validate io entries
EnrichIO-->>Operator: prompt for columnPosition and rowPosition
Operator->>EnrichIO: enter, clear, or update values
EnrichIO->>HardwareYAML: write ordered position fields
HardwareYAML-->>Operator: updated YAML and change summary
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 `@data/hardware/eventide-audio-h90-harmonizer.yaml`:
- Around line 143-160: Update the MIDI In and MIDI Out/Thru entries in the H90
hardware definition so their position metadata uses the appropriate physical
side edge (Left or Right) rather than Top, while preserving their existing
connection and layout metadata.
- Around line 18-23: Reorder the hardware I/O fields in each affected entry so
the required keys remain contiguous: name, signalFlow, category, type,
connection, maxConnections, and position. Move connectorDetail and other
optional fields after position and the ordering fields, consistently updating
all listed entries.
- Around line 13-100: Update the audio jack definitions for Input 1, Input 2,
Input 3, Input 4, Output 1, Output 2, Output 3, and Output 4 so their type
metadata represents both selectable instrument and line levels rather than
hard-coding Input 1–2 as instrument and the others as line; preserve the
existing connector, routing, and positional fields.
In `@scripts/enrich-io.ts`:
- Around line 143-149: Validate slugArg against the documented safe slug format
and reject any traversal characters or path separators before the path.join call
in the enrichment entrypoint. Only construct the hardware YAML path after
validation, preserving the existing error-and-exit behavior for invalid slugs
and missing files.
In `@scripts/generate-context.ts`:
- Around line 282-285: Update the rowPosition documentation in the generated
context description to use the source convention’s single, unambiguous axis;
remove the “front-to-back” wording and explicitly define row order consistently
for all edge orientations, including Top/Bottom. Keep the columnPosition and
single-row guidance aligned with this convention.
🪄 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: 3b076638-3f36-4805-8693-b7be2c7f1c3c
📒 Files selected for processing (7)
.changeset/io-positions-enrichment.mdCLAUDE.mddata/hardware/eventide-audio-h90-harmonizer.yamlpackage.jsonschema/CONTEXT.mdscripts/enrich-io.tsscripts/generate-context.ts
The H90's inputs and outputs can each be toggled between instrument and line level in software (indicated by the rear-panel "Line Lvl" LEDs). Normalize all four inputs to `type: instrument` and all four outputs to `type: line` as the representative defaults, and add a per-port description noting the level is switchable. Also describe the insert/dual-path role of Inputs/Outputs 3–4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- enrich-io.ts: reject slugs that aren't the documented safe format (SLUG_PATTERN) before path.join, preventing path traversal. - Docs: define rowPosition with a single unambiguous axis (top-to-bottom as viewed head-on), dropping the contradictory "front-to-back" wording, in generate-context.ts / CONTEXT.md and the enrich-io.ts header. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per confirmation, the H90's MIDI In and Out/Thru DIN jacks are on the left side of the pedal, not the rear (Top) edge with the audio I/O. Move both to position: Left as their own edge (columns 1-2, row 1) and update the io layout comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Context
Starts #212 — spatial ordering of hardware I/O ports (
columnPosition/rowPosition) so the Studio setup graph can render port layouts. The schema, validator, and SQLite build already supported these fields; what was missing was a documented convention, a tool to assign them, and real data. This PR adds all three, using the Eventide H90 as the validation case.What's in here
1. Convention — documented in
schema/CONTEXT.md(viagenerate-context.ts) andCLAUDE.md:columnPosition: 1-based left-to-right perpositionedge (column 1 = leftmost).rowPosition: 1-based top-to-bottom (row 1 = topmost). Stacked ports share a column, differ by row.position.2. Tool — new
pnpm enrich-io <slug> [--dry-run] [--open]:readline, no new deps), reads lines via readline's async iterator so it works with both interactive typing and piped input.yamlDocument API, preserving comments/formatting and inserting the keys in canonical order.3. H90 backfill/correction — the entry's I/O was incomplete (5 of 14 jacks; missing all audio ins/outs and MIDI Out) and mis-positioned (
Bottom). Rewritten to all 14 discrete rear-panel jacks, one entry per physical jack (maxConnections: 1), confirmed against the H90 Quick Reference Guide's rear-panel diagram:Verification
pnpm validate✅ (no new warnings),pnpm typecheck✅,pnpm lint✅pnpm build→ confirmedhardware_io.column_position/row_positionpopulate for all 14 H90 portsenrich-iosmoke-tested: all-Enter → no changes; dry-run reports without writing; real write preserves formatting🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
columnPosition/rowPositionmetadata to control hardware IO ordering (left-to-right, top-to-bottom).pnpm enrich-io <slug>to set/update IO positions and write changes back to YAML (supports--dry-run, and optional URL opening).Bug Fixes
Documentation
ioentry maps to a single physical jack.