Skip to content

fix: match heading depths 1-6 in session-handoff validator#30

Open
CypherPoet wants to merge 1 commit intosoftaworks:mainfrom
CypherPoet:fix/session-handoff-heading-depth-validation
Open

fix: match heading depths 1-6 in session-handoff validator#30
CypherPoet wants to merge 1 commit intosoftaworks:mainfrom
CypherPoet:fix/session-handoff-heading-depth-validation

Conversation

@CypherPoet
Copy link
Copy Markdown

Summary

Fixes #21 — the session-handoff validator's heading-match regex (##?) only recognized # and ## headings. This caused ### headings (which the handoff template's own nested structure uses for "Important Context" and "Immediate Next Steps") to be flagged as missing required sections.

  • Expanded heading pattern from ##? (#{1,2}) to #{1,6} in three locations: required-section detection, recommended-section detection, and the next-section boundary used for content-length measurement.
  • Used #{{1,6}} in f-string contexts to produce the correct regex literal (bare {1,6} is interpreted as a format expression, not a quantifier).

Test plan

  • Run validate_handoff.py against the minimal reproduction case from session-handoff validator rejects valid ### headings in required sections #21 — all three required sections (Current State Summary, Important Context, Immediate Next Steps) should pass at ### depth
  • Run validate_handoff.py against a handoff using ## headings — no regression (existing behavior preserved)
  • Verify check_recommended_sections also recognizes ###+ headings

The heading-match regex `##?` only recognized `#` and `##`, causing
`###` headings (used by the handoff template's own nested structure)
to be flagged as missing. This expands the pattern to `#{1,6}` across
required-section detection, recommended-section detection, and the
next-section boundary used for content-length measurement.

Fixes softaworks#21
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.

session-handoff validator rejects valid ### headings in required sections

1 participant