Files
hkuds--openharness/tests/test_memory
Ziming Wang ac582c7cf5 fix(memory): parse YAML frontmatter in scan and improve search relevance (#12)
* fix(memory): parse YAML frontmatter in scan and improve search relevance

The memory scanner previously treated the first non-empty line as the
description, returning raw "---" for files with YAML frontmatter.  This
broke search matching because the title and description fields—the only
fields the search function inspected—contained no meaningful content.

Changes:
- Parse name/description/type from YAML frontmatter in scan, consistent
  with the existing skill loader pattern.
- Add body_preview and memory_type fields to MemoryHeader so downstream
  consumers can leverage structured metadata.
- Search now matches against body content in addition to metadata, with
  metadata hits weighted 2x for relevance ordering.
- Tokenizer handles CJK characters for multilingual memory queries.
- Eight new tests covering frontmatter parsing, search relevance ranking,
  body content matching, and CJK tokenization.

* fix: address review feedback on memory scan and search

- Exclude description line from body_preview for non-frontmatter files
  to prevent double-counting in search scoring (meta 2x + body 1x).
- Guard fallback description against '---' delimiters from malformed
  frontmatter, consistent with skills/loader.py behavior.
- Rename CJK→Han in tokenizer docstring and variable names to reflect
  that only Han ideographs are tokenized individually (kana/hangul
  excluded by design as single characters lack lexical meaning).
- Fix CHANGELOG section ordering so existing Added entries stay under
  their original heading.
- Add tests for malformed frontmatter and body_preview exclusion.
2026-04-04 17:57:43 +08:00
..