Skip to content

fix(parser): recover XML list items with mismatched closing tags - #495

Merged
possiblyneal merged 2 commits into
mainfrom
fix/472-xml-list-items
Nov 21, 2026
Merged

possiblyneal merged 2 commits into
mainfrom
fix/472-xml-list-items

Conversation

@possiblyneal

@possiblyneal possiblyneal commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Intent

Closes #472

Recover separate list items when a model closes one with the wrong tag, so adjacent items do not fuse and a trailing mismatched close does not become stored text.

Read first

  • src/prompts/xml.ts:53 — list parsing shared by Summary, Observation compression, and consolidation.
  • test/xml.test.ts — malformed items, nested markup, and opaque XML sections.

Decisions

  • Recover a malformed item at the next opener or parent boundary, while preserving inline markup in correctly closed items.

Out of scope

  • No migration or re-summarization of stored records.

Verified

  • npm run build, npm run skills:check, npm run typecheck, npm test, npm run eval:gate, and npm run eval:gate:rules passed (3,222 tests, one skipped) in the current-base checkout; generated hooks were unchanged.
  • The prior read-only check described in Session Summaries store stray XML tags in their fields #472 reparsed reconstructed fragments from a copy of the store: findings fell from 59 of 1,801 Summaries to zero in those fragments.

Not verified

  • Original model replies were not retained, so the fragment check was not an end-to-end re-summarization.

Merge danger

Door: A revert restores the previous parser for future replies; it does not rewrite any records produced in the meantime.

Blast radius: List fields in newly parsed Summaries, Observation compression, and consolidation.

A model can close one list item with another tag, causing the parser to\nfuse it with the next item or drop it entirely. Keep adjacent items\nseparate without stripping markup from correctly closed items.

Refs: #472
Generated-By: gpt-6.2-sol
Only real child delimiters should split items. Keep nested content\nand recover a mismatched close even before an inter-item comment.

Generated-By: gpt-6.2-sol
@possiblyneal

Copy link
Copy Markdown
Owner Author

Code review: standard scan, clean.

Axes: Standards+Spec, Correctness/Logic

Reviewed-Head: 9ac417b

@possiblyneal
possiblyneal merged commit f2a8f10 into main Nov 21, 2026
3 checks passed
@possiblyneal
possiblyneal deleted the fix/472-xml-list-items branch November 21, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session Summaries store stray XML tags in their fields

1 participant