odysseus/services/memory
ashvinctrl ff2138d837 fix(skills): stop SKILL.md frontmatter escapes compounding on every save
_emit_scalar quotes a frontmatter scalar with json.dumps when it holds
punctuation that would change how the line reads back. _parse_scalar undid that
with a bare raw[1:-1]: it stripped the quotes but never decoded the escapes. So
a description containing ü was written as the escape sequence \u00fc, read
back with that escape still sitting literally in the value, and re-escaped on
the next save. The backslash run doubles every save, so a non-English skill
description degrades into backslash noise after a few edits, and the escapes are
shown verbatim in the skills list and the /skills catalog.

This is not limited to non-ASCII. Any description containing a quote takes the
same path, since the quote is itself what forces the quoted form.

Make the two halves symmetric: emit with ensure_ascii=False, since SKILL.md is
UTF-8 at both ends (skills.py reads it, atomic_write_text writes it) and the
ASCII-escaped form bought nothing; and parse double-quoted scalars with
json.loads, falling back to the previous literal reading when the value is not
valid JSON. Files already corrupted heal one level per load.

ensure_ascii=False on its own would open a smaller hole. json.dumps escapes
every C0 control character but passes NEL, LINE SEPARATOR and PARAGRAPH
SEPARATOR through literally, and parse_frontmatter reads one scalar per line via
str.splitlines(), which breaks on all three. Re-escape those three, and add them
plus the remaining splitlines characters to the set that forces a quoted scalar,
so none of them can reach the file bare.
2026-08-03 22:50:52 +05:30
..
__init__.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
memory.py refactor(memory): canonicalize memory imports (#50) 2026-06-04 05:31:15 +01:00
memory_extractor.py fix(memory): make auto-memory extraction reliable for reasoning models (#3190) 2026-06-08 19:57:44 +02:00
memory_vector.py refactor(memory): canonicalize memory imports (#50) 2026-06-04 05:31:15 +01:00
service.py refactor(constants): single source of truth for data dir (#3368) 2026-06-08 09:58:52 +02:00
skill_extractor.py fix(memory): reject ambiguous multi-object outputs during skill extraction (#3985) 2026-06-15 10:44:43 +00:00
skill_format.py fix(skills): stop SKILL.md frontmatter escapes compounding on every save 2026-08-03 22:50:52 +05:30
skill_importer.py fix(skills): block private SSRF targets and revalidate redirects in importer (#5261) 2026-07-14 08:33:10 -06:00
skills.py fix(agent): skill-prescribed tools never reach the model's schema list (#4008) 2026-06-15 20:32:43 +09:00