fix: parser accepts bracketless format, rejects project snapshots, adds durable-content prompt

P0a: Parser now accepts both - [type] text and - type text formats
P0b: Prompt adds durable-content guidance to avoid session-specific snapshots
P0c: Parser quality gate rejects exact test counts, file counts, phase progress
- Only rejects phase progress when it appears early in the string (snapshot)
- Stable config values with numbers (Admin PIN, Scrypt) still pass
- Adds 7 new tests covering bracketless parsing and snapshot rejection
This commit is contained in:
Ralph Chang
2026-04-26 16:28:55 +08:00
parent ca71c20a8f
commit f9acfd6136
3 changed files with 140 additions and 5 deletions
+9 -2
View File
@@ -89,8 +89,13 @@ function buildCompactionPrompt(privateContext: string): string {
"",
"## Relevant Files",
"",
"At the end of the summary, extract durable memory entries for future",
"sessions using these labels:",
"At the end of the summary, extract durable memory entries for future sessions.",
"Only extract facts that are likely to stay true across sessions.",
"Do not extract session-specific progress like exact test counts, file counts, or phase numbers.",
"For progress, extract the stable goal or durable milestone, not the current number.",
"For references, extract configuration values that do not usually change between sessions.",
"For feedback, extract unresolved issues or user preferences that future sessions need to know.",
"Use exactly this candidate format, including square brackets around the type:",
"",
"Memory candidates:",
"- [feedback] content",
@@ -98,6 +103,8 @@ function buildCompactionPrompt(privateContext: string): string {
"- [decision] content",
"- [reference] content",
"",
"Do not write '- project content'; write '- [project] content'.",
"",
"Background context, use this to inform the summary above.",
"Do not output this context verbatim:",
"",