Fountain Coach logoFOUNTAIN COACHMIDI2 · MACHINE-READABLE SPECIFICATION
FCIS · MIDI2 · PUBLISHED PROJECTION

MIDI 2.0 Gap Closure Tracker

Last Updated: 2025-12-16
Related Documents:

  • comprehensive-spec-audit-report.md - Full audit analysis
  • spec-audit.md - Page-level spec references
  • conformance-checklist.md - Implementation status
  • legacy/midi2-js-gap-plan.md - TypeScript gap plan

Status Legend

  • 🔴 Not Started - Gap identified but no work begun
  • 🟡 In Progress - Active development
  • 🟢 Complete - Gap closed and validated
  • ⏸️ Blocked - Waiting on external dependency

High Priority Gaps (Critical Path)

Gap 2.2.1: Property Exchange Subscription Lifecycle

Status: 🟢 Complete
Priority: High | Effort: 5-7 days | Target Sprint: 1

Spec Reference: M2-103-UM v1.2, Tables 43-47 (p.42-43)

Current State:

  • ✅ Schema fields captured (MidiCiPropertyExchangeBody.subscriptionCommand)
  • ✅ TS and Swift subscription managers implement start/partial/full/notify/end lifecycle with flow-control ACK/NAK, resource checks, chunk order enforcement, exponential backoff + retry-capped timeout (408), and tests
  • ✅ Backoff/retransmit policy implemented at helper level; higher-level retry wiring remains optional

Acceptance Criteria:

Implementation Steps:

  1. Design subscription state machine
  2. Implement SubscriptionTracker class (Swift) / module (TS)
  3. Add flow-control ACK/NAK message handlers
  4. Implement chunk validation and retransmit
  5. Add resource capability checking
  6. Create test fixtures from M2-103-UM Tables 43-47
  7. Update PropertyExchange.swift and pe-subscriptions.ts

Files to Modify:

  • Swift: Sources/MIDI2CI/PropertyExchange.swift
  • TypeScript: midi2.js/src/pe-subscriptions.ts
  • Tests: Add PropertyExchangeSubscriptionTests.swift and update pe-subscriptions.test.ts

Dependencies: None


Gap 2.2.3: Process Inquiry Runtime Validation

Status: 🟢 Complete
Priority: Medium | Effort: 1-2 days | Target Sprint: 2

Spec Reference: M2-101-UM v1.2, Table 40-42 (p.59-60)

Current State:

  • Device ID scope validation enforced in ProcessInquirySession.
  • Message Report replies clamp to supported filters and drop unsupported keys.
  • Tests cover capability inquiry, message report clamping, and invalid device IDs.

Acceptance Criteria:

Files Modified:

  • Swift: Sources/MIDI2CI/ProcessInquirySession.swift
  • Tests: Tests/MIDI2Tests/ProcessInquirySessionTests.swift

Dependencies: None


Gap 4.2.1: Function Block Descriptor Details

Status: 🟢 Complete
Priority: High | Effort: 4-5 days | Target Sprint: 1

Spec Reference: M2-104-UM v1.1.2, Figure 22 (p.40), Appendix I (p.122)

Current State:

  • ✅ Typed FunctionBlockInfoNotification with direction/bandwidth/active/uiHints validation and reserved-bit checks; round-trip tests in StreamMappingTests.
  • GroupTerminalBlocks encodes/decodes function block info; ranges enforced.
  • ✅ UI hints captured (TS + Swift, schema bridge).
  • ✅ Discovery/response flow covered by Function Block info encoding/decoding.
  • ✅ Profile associations stored in negotiation layer (metadata map); demos update map on profile enable/disable; VRT-Protocol fixture added.

Acceptance Criteria:

Implementation Steps:

  1. Add Direction and Bandwidth enums
  2. Extend FunctionBlockMessage bit field parsing
  3. Add validation for reserved values
  4. Implement discovery request/response handling
  5. Create profile-FB association logic
  6. Add comprehensive tests per Figure 22
  7. Update schema documentation

Files to Modify:

  • Swift: Sources/MIDI2/Stream/FunctionBlockMessage.swift
  • Swift: Sources/MIDI2/Stream/FunctionBlockDiscovery.swift
  • TypeScript: Schema bridge for OpenAPI types
  • Tests: Tests/MIDI2Tests/StreamFunctionBlockDiscoveryTests.swift
  • Schema: midi2.full.closed.schema.json (add direction/bandwidth/active)

Dependencies: None


Gap 4.2.2: GTB Negotiation Semantics

Status: 🟢 Complete
Priority: High | Effort: 4-5 days | Target Sprint: 2

Spec Reference: M2-104-UM v1.1.2, Appendix I (p.122)

Current State:

  • ✅ GTB structure defined (GroupTerminalBlocks.swift) with overlap/coverage validation and runtime enforcement helpers (Swift + TS)
  • ✅ Spec-driven GTB context source documented (docs/gtb-context-source.md) with loaders (GtbDescriptor.load, loadGtbDescriptorFromJson) and sample config (docs/config/gtb.context.json)
  • ✅ MT=0xF/0x0 reception restrictions enforced via GTB allowed-MT guards (Swift UMP/word guards; TS decoder/dispatch/raw-word guards)
  • ✅ GTB-Function Block overlap policy documented (docs/gtb-overlap-policy.md); allow-overlap escape hatch supported in validators and negotiation sessions
  • ✅ GTB protocol/ingestion scheme documented (docs/gtb-protocol-negotiation-scheme.md) with helper APIs (negotiateGtbContext, guardIngress/guardOutgoing)
  • ✅ VRT-Protocol fixtures/tests for GTB overlap and MT blocking (docs/vrt-protocol/stream/gtb_overlap.json, gtb_block_mt.json, gtb_block_utility.json)
  • ✅ Demo runtime (midi2device) loads GTB config when present and applies ingress/egress GTB guards

Acceptance Criteria:

Implementation Steps:

  1. Document GTB-FB overlap rules from Appendix I
  2. Add GTB validation against Function Block configuration
  3. Implement message type reception restrictions
  4. Add protocol negotiation state machine for GTB
  5. Create test scenarios from Appendix I examples
  6. Update runtime documentation

Files to Modify:

  • Swift: Sources/MIDI2/Stream/GroupTerminalBlocks.swift
  • Swift: Add Sources/MIDI2/Stream/GTBNegotiation.swift (new)
  • Tests: Tests/MIDI2Tests/GroupTerminalBlocksTests.swift
  • Docs: Add GTB negotiation guide (notes started)

Dependencies: Gap 4.2.1 (Function Block details)


Medium Priority Gaps (Sprint 2-4)

Gap 4.2.3: Stream Configuration Semantics

Status: 🟢 Complete
Priority: Medium | Effort: 3-4 days | Target Sprint: 2

Spec Reference: M2-104-UM v1.1.2, Figures 18/19 (p.37-38), Section 7.2.2.3 (p.45)

Current State:

  • ✅ Protocol bits defined (0x01 MIDI 1.0, 0x02 MIDI 2.0)
  • ✅ JR Tx/Rx flags in schema
  • ✅ JR fallback + protocol switching with stateful negotiation (negotiateStreamConfig)
  • ✅ Mismatch policy + shouldNotifyPeer surfaced for when to emit notifications (mismatch/protocol switch/first config/forced)
  • ✅ Tests cover downgrade, JR fallback, repeated-request idempotence, and protocol switch notification policy
  • ✅ Design doc: docs/stream-config-negotiation.md

Acceptance Criteria:

Implementation Steps:

  1. Implement JR capability checking
  2. Add JR fallback to non-timestamped mode
  3. Implement protocol switching state machine
  4. Add Stream Config Notification generation
  5. Create negotiation test scenarios
  6. Document negotiation patterns

Files to Modify:

  • Swift: Sources/MIDI2/Stream/StreamConfigurationMessage.swift
  • Swift: Add Sources/MIDI2/Stream/NegotiationSession.swift updates
  • Tests: Add negotiation test cases

Dependencies: None


Gap 8.2.3: Negative Test Coverage Expansion

Status: 🟡 In Progress
Priority: Medium | Effort: 4-5 days | Target Sprint: 3

Spec Reference: M2-104-UM v1.1.2 (reserved values throughout)

Current State:

  • ✅ Some negative tests (Stream, SysEx8, MDS, profiles, PE compression)
  • ✅ Initial reserved-value matrix seeded (docs/negative-test-matrix.md)
  • ✅ Stream reserved-value cases added (Endpoint Info nfb > 0x20, stream config reserved bits, Function Block midi1Bandwidth=3, reserved mt bit) in Swift + TS
  • ❌ Incomplete coverage across all decoders
  • ❌ No comprehensive reserved value matrix

Acceptance Criteria:

Implementation Steps:

  1. Create comprehensive reserved value matrix from specs (started)
  2. Add negative tests for each message type (stream coverage started)
  3. Implement consistent error types/messages
  4. Add fuzzing test suite
  5. Document reserved value handling strategy

Files to Modify:

  • Tests: Tests/MIDI2Tests/NegativeTests/ (new directory)
  • Tests: midi2.js/src/__tests__/negative.test.ts (new)
  • Tests: Tests/Fuzz/ - expand fuzzing

Dependencies: None


Gap 8.2.1: Visual Baseline (VRT-Protocol) Frames

Status: 🟡 In Progress
Priority: Medium | Effort: 3-4 days | Target Sprint: 3

Spec Reference: Internal testing methodology

Current State:

  • ✅ Some VRT-Protocol baselines (JR, SysEx8 invalid cases)
  • ❌ CI message baselines incomplete
  • ❌ No automated diff tooling
  • 🟡 Added VRT-Protocol README + generator script; stream/profiles/process-inquiry/property-exchange baselines exist

Acceptance Criteria:

Implementation Steps:

  1. Create baseline JSON files in docs/vrt-protocol/
  2. Implement schema diff tool
  3. Add CI check for baseline regression
  4. Document VRT-Protocol process

Files to Create:

  • docs/vrt-protocol/midici/*.json
  • docs/vrt-protocol/stream/*.json
  • docs/vrt-protocol/flex/*.json
  • Scripts/verify_vrt_protocol.py (new)

Dependencies: None


Gap 2.2.2: Profile Configuration Details

Status: 🟢 Complete
Priority: Medium | Effort: 2-3 days | Target Sprint: 4

Spec Reference: M2-102-U v1.1, Table 6 (p.15, 17)

Current State:

  • ✅ Basic details replies (version, channel mask)
  • ✅ PSD supported
  • ✅ Added/removed helpers
  • ✅ Negative tests expanded for details inquiries and target-less setOn handling
  • ✅ Profile detail report handling includes PSD flag, unsupported profile handling, and last-details tracking

Acceptance Criteria:

Implementation Steps:

  1. Review M2-102-U Table 6 requirements
  2. Expand ProfileSession detail handling
  3. Add profile change tracking
  4. Create negative test suite
  5. Update documentation

Files to Modify:

  • Swift: Sources/MIDI2CI/ProfileSession.swift
  • Tests: Tests/MIDI2Tests/ProfileSessionTests.swift

Dependencies: None


Gap 2.2.3: Process Inquiry Enhancement

Status: 🟢 Complete
Priority: Medium | Effort: 2-3 days | Target Sprint: 4

Spec Reference: M2-101-UM v1.2, Tables 40-42 (p.59-60)

Current State:

  • ✅ Envelopes captured
  • ✅ Session support with filter/messageDataControl validation (0/1/0x7F), device ID scope guard
  • ✅ Unsupported/invalid filter values rejected (Swift + TS)
  • ✅ TS/Swift negative coverage for malformed payloads

Acceptance Criteria:

Implementation Steps:

  1. Implement features bitmap validation
  2. Add device ID scope checking
  3. Add message data control enforcement
  4. Create test vectors from Tables 40-42
  5. Update ProcessInquirySession

Files to Modify:

  • Swift: Sources/MIDI2CI/ProcessInquirySession.swift
  • Swift: Sources/MIDI2/MidiCiProcessInquiryBody.swift
  • Tests: Add ProcessInquiry tests

Dependencies: None


Gap 2.2.4: MUID Management

Status: 🟢 Complete
Priority: Medium | Effort: 2-3 days | Target Sprint: 4

Spec Reference: M2-101-UM v1.2 (MUID allocation/discovery)

Current State:

  • MuidManager added in Swift (Sources/MIDI2CI/MuidManager.swift) and TypeScript (midi2.js/src/muid-manager.ts) with collision-avoidant allocation and reserved-value guarding.
  • ✅ Conflict detection rotates local MUID on peer collision; peer map includes TTL-based expiry/cleanup and manual release.
  • ✅ Tests cover allocation hints, conflict rotation, expiry/refresh flows (Swift MuidManagerTests, TS muid-manager.test.ts).

Acceptance Criteria:

Implementation Steps:

  1. Implement MUID allocator
  2. Add conflict detection
  3. Add timeout tracking
  4. Create lifecycle tests
  5. Document MUID strategy

Files to Modify:

  • Swift: Sources/MIDI2CI/MuidManager.swift (new)
  • Tests: Add MUID tests

Dependencies: None


Gap 4.2.4: Endpoint Info Beyond Version/Max Groups

Status: 🟢 Complete
Priority: Medium | Effort: 2 days | Target Sprint: 2

Spec Reference: M2-104-UM v1.1.2, Figure 13 (p.33)

Current State:

  • ✅ Schema has all fields defined
  • 🟢 TypeScript runtime validation/tests added (reserved bit and NFB guard) 2025-12-13
  • 🟢 Swift runtime validation/tests added 2025-12-13

Acceptance Criteria:

Implementation Steps:

  1. Add full field encoding/decoding
  2. Add reserved value validation
  3. Create test vectors
  4. Update documentation

Files to Modify:

  • Swift: Sources/MIDI2/Stream/EndpointDiscoveryMessage.swift
  • Swift: Sources/MIDI2/Stream/EndpointInfoMessage.swift
  • Swift Tests: Tests/MIDI2Tests/StreamMappingTests.swift
  • TypeScript: midi2.js/src/ump.ts (decode validation) ✅
  • TypeScript Tests: midi2.js/src/__tests__/ump.test.ts

Dependencies: None


Gap 8.2.2: Hardware Interop Tests

Status: 🔴 Not Started
Priority: Medium | Effort: High (ongoing) | Target Sprint: 5

Spec Reference: Real-world MIDI 2.0 devices

Current State:

  • ❌ No hardware interop tests

Acceptance Criteria:

Implementation Steps:

  1. Set up hardware test environment
  2. Identify reference devices
  3. Create interop test suite
  4. Run validation tests
  5. Document results and incompatibilities

Files to Create:

  • Tests/HardwareInterop/ (new directory)
  • docs/hardware-interop-results.md

Dependencies: Hardware access


Low Priority Gaps (Sprint 5+)

Gap 1.2.1: Reserved/Unsupported Status Handling

Status: 🟢 Complete
Priority: Medium | Effort: 2-3 days | Target Sprint: 5

Current State:

  • ✅ Swift + TS decoders now reject reserved/unknown statuses for Flex, System, and Channel Voice instead of yielding raw events.
  • ✅ Negative vectors added for flex unknown statuses, out-of-range channel voice values, and unsupported system statuses (Swift + TS).
  • ✅ Reserved/value matrix updated (docs/negative-test-matrix.md) to capture enforcement strategy.

Acceptance Criteria:


Gap 5.2.2: Adapter Per-Note Controller Negotiation

Status: 🔴 Not Started
Priority: Medium | Effort: 2-3 days | Target Sprint: 5

Acceptance Criteria:


Gap 5.2.1: Worker-Clock JR Projection

Status: 🔴 Not Started
Priority: Medium | Effort: 2-3 days | Target Sprint: 5

Acceptance Criteria:


Gap 3.2.1: Flex Data Edge Cases

Status: 🟢 Complete
Priority: Low | Effort: 1-2 days | Target Sprint: 5

Current State:

  • ✅ Runtime validation for tempo 16.16 range, time signature bounds, 12-byte text/ruby/lyric/chord/key payloads, and 10-byte metronome accent patterns (Swift + TS).
  • ✅ Flex decoders reject reserved/unknown statuses and bad address bytes consistently across Swift/TS.
  • ✅ Negative tests added in Swift (FlexValidationNegativeTests) and TS (flex-negative.test.ts, flex-reserved-negative.test.ts).

Acceptance Criteria:


Gap 1.2.2: UMP Format Extensions

Status: 🔴 Not Started
Priority: Low | Effort: 1 day | Target Sprint: 5

Acceptance Criteria:


Gap 6.2.1: JR Interop Testing

Status: 🔴 Not Started
Priority: Low | Effort: Medium | Target Sprint: 5

Acceptance Criteria:


Gap 7.2.1: Oversize SysEx Handling

Status: 🔴 Not Started
Priority: Low | Effort: 1 day | Target Sprint: 5

Acceptance Criteria:


Gap 9.2.1: Schema Documentation Completeness

Status: 🔴 Not Started
Priority: Low | Effort: Ongoing | Target Sprint: Ongoing

Acceptance Criteria:


Gap 9.2.2: Schema Regression CI

Status: 🔴 Not Started
Priority: Medium | Effort: 1-2 days | Target Sprint: 3

Acceptance Criteria:


Gap 10.2.1: DoD Validation

Status: 🔴 Not Started
Priority: Low | Effort: 2-3 days | Target Sprint: 5

Acceptance Criteria:


Progress Dashboard

Overall Statistics

  • Total Gaps Identified: 21
  • High Priority: 0 (all closed)
  • Medium Priority: 10
  • Low Priority: 8

Status Summary

  • Note: Updated December 15, 2025 after comprehensive audit refresh.

  • 🔴 Not Started: 8 (40%)

  • 🟡 In Progress: 2 (10%)

  • 🟢 Complete: 10 (50%)

  • ⏸️ Blocked: 0 (0%)

Completed Gaps

  • Gap 2.2.1: PE Subscription Lifecycle 🟢
  • Gap 2.2.2: Profile Configuration Details 🟢
  • Gap 2.2.3: Process Inquiry Enhancement 🟢
  • Gap 2.2.4: MUID Management 🟢
  • Gap 4.2.1: Function Block Descriptor Details 🟢
  • Gap 4.2.2: GTB Negotiation Semantics 🟢
  • Gap 4.2.3: Stream Configuration Semantics 🟢
  • Gap 4.2.4: Endpoint Info Beyond Version/Max Groups 🟢
  • Gap 1.2.1: Reserved/Unsupported Status Handling 🟢
  • Gap 3.2.1: Flex Data Edge Cases 🟢

Sprint Allocation

  • Sprint 1 (Week 1-2): 2 gaps ✅ Complete
  • Sprint 2 (Week 3-4): 3 gaps ✅ Complete
  • Sprint 3 (Week 5-6): 3 gaps 🟡 In Progress
  • Sprint 4 (Week 7-8): 3 gaps ✅ Complete
  • Sprint 5+ (Week 9+): 10 gaps 🔴 Pending

Effort Distribution

  • 1-2 days: 5 gaps (24%)
  • 2-3 days: 7 gaps (33%)
  • 3-5 days: 5 gaps (24%)
  • 5-7 days: 1 gap (5%)
  • Ongoing: 3 gaps (14%)

Update Log

Date Gap ID Status Change Notes
2025-12-15 All 📊 Audit Comprehensive documentation audit; updated status counts to reflect actual implementation state
2025-12-14 2.2.x / 4.x 🟢 Progress Schema bridge parity for MDS/stream (JS) + flex reserved/address guards; Swift Process Inquiry filter validation and PSD-aware profile details replies; tests green (npm check/test, swift test).
2025-12-13 8.2.3 🟡 Started Added reserved-value matrix + initial stream negative tests (Swift/TS)
2025-12-14 2.2.3 🟢 Complete Process Inquiry filter/messageDataControl validation; deviceId scope guard; TS+Swift negatives
2025-12-13 4.2.3 🟢 Complete Stream config mismatch policy + notification rules; negotiation state machine + tests; doc
2025-12-13 4.2.1 🟢 Complete Function Block info validation/uiHints, profile associations, discovery/name flow, VRT-Protocol fixtures
2025-12-13 4.2.1 🟡 Started Added TS/Swift validation for Function Block Info (direction/bandwidth/active + reserved bits)
2025-12-13 4.2.4 🟢 Complete Added Swift endpoint info validation + tests; TS validation already in place
2025-12-13 4.2.4 🟡 Started Added TypeScript endpoint info reserved-bit validation and Vitest coverage
2025-12-13 All 🔴 Initial Comprehensive audit completed

Maintained By: MIDI 2.0 Development Team
Review Frequency: Weekly during active sprints