Skip to content

fix: frontmatter delimiter trailing-whitespace + consolidate lint scanner (iss-69) - #36

Merged
REPPL merged 3 commits into
mainfrom
auto/iss-69-frontmatter
Jul 12, 2026
Merged

fix: frontmatter delimiter trailing-whitespace + consolidate lint scanner (iss-69)#36
REPPL merged 3 commits into
mainfrom
auto/iss-69-frontmatter

Conversation

@REPPL

@REPPL REPPL commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Resolves iss-69 (native ledger).

Fix (C5)

frontmatter.Fields compared a delimiter line against exactly ---, so a closing --- (trailing space or tab) went unrecognised and every body line after it was misread as a frontmatter field. It now trims trailing spaces/tabs (not just CR) before both the opening and closing delimiter comparisons. TDD: TestFieldsToleratesDelimiterTrailingSpace (fails on revert).

Refactor (seed1a — separate commit, behaviour-preserving)

record-lint carried its own frontmatterFields/fmKeyRe scanner — logic- and regex-identical to frontmatter.Fields, including the same delimiter bug. It is now a thin adapter over the canonical scanner (keeping lint's local fmField shape, so no call-site churn), so the primitive lives in one place and lint inherits the fix. lint tests + record-lint green.

Deferred (seed1b)

memory.parseFrontmatter is a full nested-YAML parser (map[string]any with nested maps like source:) — a genuinely different primitive from the flat top-level scanner. Folding it in would require widening frontmatter to nested parsing (a new capability, not a refactor). intent's in-place writer scanner is likewise a separate concern, flagged for a future consolidation pass.

make preflight + make record-lint green. Reviewed: ruthless-reviewer SHIP (not a trust boundary, so no security review); both its NICE-TO-HAVEs (package-doc accuracy, the deferral rationale) applied.

Assisted-by: Claude:claude-opus-4-8

REPPL added 3 commits July 12, 2026 12:07
Fields compared a delimiter line against exactly '---', so a closing '--- '
(trailing space or tab) was not recognised as the close and every body line
after it leaked in as a frontmatter field. Trim trailing spaces/tabs (not just
CR) before both the opening and closing delimiter comparisons.

Assisted-by: Claude:claude-opus-4-8
…er (iss-69)

lint carried its own copy of the frontmatter line-scanner (frontmatterFields +
fmKeyRe) — logic- and regex-identical to internal/core/frontmatter.Fields,
including the same trailing-whitespace delimiter bug just fixed. frontmatterFields
is now a thin adapter over the canonical scanner (keeping lint's local fmField
shape, so no call site changes), so the primitive lives in ONE place and lint
inherits the delimiter fix. Behaviour-preserving; lint tests + record-lint green.

Memory's parseFrontmatter is deliberately NOT consolidated here: it is a full
nested-YAML parser (map[string]any with nested maps like source:), a genuinely
different primitive from the flat top-level scanner — folding it in would require
widening frontmatter to nested parsing (a new capability, not a refactor).

Assisted-by: Claude:claude-opus-4-8
Assisted-by: Claude:claude-opus-4-8
@REPPL
REPPL merged commit 34fe6cf into main Jul 12, 2026
12 checks passed
@REPPL
REPPL deleted the auto/iss-69-frontmatter branch July 12, 2026 11:15
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.

1 participant