internal/wiki/merge.go:184 is a fourth hand-rolled frontmatter-fence parser, not folded into frontmatter.Split #141

Open
opened 2026-09-23 13:07:51 +00:00 by mathias · 0 comments
Owner

Context

Found during round-1 review of PR #139 (hyperguild#138, consolidation of the three independent frontmatter-fence parsers into internal/frontmatter.Split).

internal/wiki/merge.go's parseFrontmatterBlock (around line 184) is a fourth hand-rolled HasPrefix/Index-based fence detector, structurally the same class of drift #138 was opened to close. It was not touched by #138/PR #139 because #138's own root-cause section named only three implementations (internal/mcp, internal/api, internal/frontmatter), so leaving it alone was not a #138 acceptance-criteria violation — it is out of scope for that PR, not a miss.

Recommendation

Fold internal/wiki/merge.go's parseFrontmatterBlock onto the now-canonical internal/frontmatter.Split (exported in #138/PR #139), the same way internal/api and internal/mcp were consolidated, so this fourth reimplementation cannot independently drift from the CRLF-normalization / BOM-stripping / trailing-newline-required behavior the other three now share by construction.

Source

Round-1 review finding on PR #139, carried forward per that review's explicit recommendation ("file it as a new hyperguild issue referencing #138 and this PR before closing out"). See issue #138's closing comment for the full round-1 and round-2 verification trail.

## Context Found during round-1 review of PR #139 (hyperguild#138, consolidation of the three independent frontmatter-fence parsers into `internal/frontmatter.Split`). `internal/wiki/merge.go`'s `parseFrontmatterBlock` (around line 184) is a fourth hand-rolled `HasPrefix`/`Index`-based fence detector, structurally the same class of drift #138 was opened to close. It was not touched by #138/PR #139 because #138's own root-cause section named only three implementations (`internal/mcp`, `internal/api`, `internal/frontmatter`), so leaving it alone was not a #138 acceptance-criteria violation — it is out of scope for that PR, not a miss. ## Recommendation Fold `internal/wiki/merge.go`'s `parseFrontmatterBlock` onto the now-canonical `internal/frontmatter.Split` (exported in #138/PR #139), the same way `internal/api` and `internal/mcp` were consolidated, so this fourth reimplementation cannot independently drift from the CRLF-normalization / BOM-stripping / trailing-newline-required behavior the other three now share by construction. ## Source Round-1 review finding on PR #139, carried forward per that review's explicit recommendation ("file it as a new hyperguild issue referencing #138 and this PR before closing out"). See issue #138's closing comment for the full round-1 and round-2 verification trail.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#141