← Back to Pull requests

fix(memory): preserve fenced code in entry boundaries #5363

Closed
unknown closed this pull request without merging on Oct 10, 2026 10:51 UTC
View on GitHub
unknown unknown commented on Sep 15, 2026 16:55 UTC
Author

Summary

Fenced Markdown examples remain part of their containing memory entry. A README template containing ## Installation no longer creates a phantom entry, truncates the editor range, or leaves half a proposal behind during approval. All four entry scanners share the fence tracker.

Metadata comments indented by four spaces or a tab are preserved as code content, so a nested example cannot replace a hand-authored entry's ID/status. An unclosed fence deliberately keeps later headings as literal content through EOF; the parser, lookup and prompt projection now have explicit coverage for that behavior.

Fixes #5361

Verification

  • Full repository build, typecheck, lint, format, Desktop/UI knip, ASF headers and diff checks passed on Node 24.18.1.

  • All 854 Core tests and 14 Host Memory coordinator tests passed, including proposal → approval → pending cleanup → prompt projection.

  • Two new indented-metadata regressions fail before this follow-up: recipes / active becomes hijack / archived. Both pass after the fix, covering parsing, editable ranges, status updates and prompt content.

  • Tests also locate the entry after a fenced block, independently scan two fenced entries, and retain later headings inside an unclosed fence. The original seven fenced-content regressions fail without the original parser repair.

  • Full Desktop E2E and the complete Runtime Host suite were not run locally.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex investigated the issue and review feedback, authored the changes and tests, and ran validation. This is an automated PR update. Commits include Signed-off-by and Generated-by trailers; final review and merge remain human decisions.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Compatibility note: hand-edited metadata indented four or more spaces, or ending in non-ASCII whitespace such as NBSP, is ignored and falls back to the heading-derived identity. App-written metadata remains at column zero and is unaffected.

    Diff: 285 lines (+213 / -72) across 3 files Reviewer: seekskyworld Review duration: 35636m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 285 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5363"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.8% (MEDIUM) · Higher = larger blast radius
    39.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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.7% · Safe to merge
    15.7%
    Repository