← Back to Pull requests

fix: render multi-line front matter descriptions as one index line #1131

Open
Yashwanth-Kumar-Kotla opened this pull request with 38 lines diff across 3 files
View on GitHub
Yashwanth-Kumar-Kotla Yashwanth-Kumar-Kotla commented on Nov 10, 2026 17:12 UTC
Author

Description

Fixes #1130

A front matter description (or title) written as a YAML block scalar contains newlines. The index generator put it into a list item unchanged, so the entry split and extra lines showed up as separate list content. This collapses whitespace to single spaces before the value is used in an index.

Changes Made

  • usableString in src/okf/index-sync.ts now collapses runs of whitespace (including newlines) to one space and trims the result. A value that is empty after that is still treated as missing, so the missing-description report is unchanged.

  • Added a test in test/agent/index-middleware.test.ts that indexes a | page and a > page and checks each renders as one list line.

  • Added a patch changeset.
  • Testing

  • npx vitest run test/agent/index-middleware.test.ts: 36 passed.

  • With only the source change reverted and the new test kept, that test fails. With the fix restored it passes.

  • pnpm run format:check, pnpm run lint:check and pnpm test all pass (241 test files passed, 2 skipped).
  • Diff: 38 lines (+36 / -2) across 3 files Reviewer: mangeshraut712 Review duration: 17430m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.28) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.28 · 38 lines diff across 3 files
    0.28
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 1 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    89%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.219
    Real PR Conversation Timeline
    3 items
    changeset-bot[bot] changeset-bot[bot] commented on Nov 10, 2026 17:12 UTC
    Bot

    🦋 Changeset detected

    Latest commit: e734f6aa5a0b70a84f98ae7b271e6b6e7fef8dc8

    The changes in this PR will be included in the next version bump.

    <details><summary>This PR includes changesets to release 1 package</summary>

    | Name | Type |
    | -------- | ----- |
    | openwiki | Patch |

    </details>

    Not sure what this means? Click here to learn what changesets are.

    Click here if you're a maintainer who wants to add another changeset to this PR

    mangeshraut712 mangeshraut712 commented on Nov 10, 2026 17:30 UTC
    Reviewer

    Collapsing YAML block-scalar whitespace in usableString is the right fix: a | / > description must not split an index list item. The test with an injected - [Injected](...) line and a folded > description covers both scalar styles, and treating an all-whitespace value as missing keeps the missing-description report unchanged.

    One residual: the extra line is no longer a separate list item, but it is still Markdown on the same index line. The new assertion expects - [Literal](literal.md) - First line. - [Injected](elsewhere.md), so [Injected](elsewhere.md) will still render as a link in the index. If the goal was only "don't split the entry," this is fine. If the goal was also to stop front matter from injecting index links, the collapsed string still needs escaping (backslashes on [ ], or stripping list markers).

    The u flag on \s+ is appropriate for Unicode whitespace in titles and descriptions.

    Assignees
    Yashwanth-Kumar-Kotla Yashwanth-Kumar-Kotla
    Labels
    risk: low confidence: 89.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 27.8% (LOW) · Higher = larger blast radius
    27.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.1% · Lower = rushed or shallow review
    89.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3% · Safe to merge
    3%