-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
Deferred from PACT v3 Phase D. Tracked for v3.1+.
Description
The verify-protocol-extracts.sh script uses hardcoded line ranges (e.g., sed -n '1303,1459p') to extract protocol sections from pact-protocols.md and compare them against source files. This is brittle — any content change above a section shifts all downstream line numbers, requiring manual updates.
Replace with section-header-based extraction that finds sections by their markdown heading (e.g., ## Scope Contract) and extracts content between headings. This would:
- Eliminate line-range maintenance on every protocol change
- Make the verification script resilient to content additions/removals
- Reduce the most common PR friction point (updating line ranges)
Current State
- 16 protocol extracts verified via line ranges
- Line ranges must be manually updated whenever protocol content changes (happened in Phase C, D, and E)
- The script otherwise works reliably — this is a maintainability improvement, not a bug fix
Implementation Notes
- Could use
awkorsedwith heading pattern matching - Need to handle nested headings (sections contain
###subsections) - The
---separator between sections is a reliable boundary marker - Must preserve the byte-for-byte comparison behavior
Priority
Medium — reduces ongoing maintenance burden.
References
scripts/verify-protocol-extracts.shpact-plugin/protocols/pact-protocols.md
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request