Whole file

mcncarl/agent-memory-vault

The author described this change as fix: exclude frontmatter boilerplate from reconcile. It counts as a record because the checks below fail on the code as it stood at 3fcc34358 and pass on 3cc6b43fe, with nothing else changed between the two runs.

Fix saved2026-07-12
Sharing licenceMIT · LICENSE
Change size+14 1

What the code was meant to do, written into the code itself as a save note

fix: exclude frontmatter boilerplate from reconcile

The change

7979 ),
8080 ]
8181 NONCURRENT_RECONCILE_STATUSES = {"archived", "outdated", "superseded", "deleted"}
82+NONFACT_RECONCILE_TYPES = {"directory_index", "routing", "template", "open_loop"}
8283
8384
8485 @dataclass
389390 return path.stem
390391
391392
393+def without_frontmatter(text: str) -> str:
394+ if not text.startswith("---"):
395+ return text
396+ end = text.find("\n---", 3)
397+ if end == -1:
398+ return text
399+ return text[end + 4 :].lstrip("\r\n")
400+
401+
392402 def summary_from_text(text: str) -> str:
393403 for line in text.splitlines():
394404 stripped = line.strip()
397407 current_summary = text.find("## 当前有效摘要")
398408 if current_summary != -1:
399409 return text[current_summary : current_summary + 500].replace("\n", " ")
400- lines = [line.strip() for line in text.splitlines() if line.strip() and not line.startswith("---")]
410+ body = without_frontmatter(text)
411+ lines = [line.strip() for line in body.splitlines() if line.strip()]
401412 return " ".join(lines[:8])[:700]
402413
403414
590601 if row.get("path") == str(entry.path) or row.get("rel_path") == relative_to_vault(entry.path):
591602 continue
592603 if str(row.get("rel_path") or "") in declared_relations:
604+ continue
605+ if str(row.get("memory_type") or "").lower() in NONFACT_RECONCILE_TYPES:
593606 continue
594607 comparison = " ".join(
595608 str(row.get(key, ""))

The check that tells the two apart

failpass·tests/test_closeout_git_history.py::CloseoutReconcileStatusTests::test_frontmatter_boilerplate_is_not_used_as_fallback_summary
failpass·tests/test_closeout_git_history.py::CloseoutReconcileStatusTests::test_postwrite_ignores_navigation_and_template_candidates

Check file tests/test_closeout_git_history.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it3fcc34358b45a2a791679428e8520c99837497ce
Broken version dated2026-07-11
Modulescripts.agent_memory_closeout
Units changedpostwrite_reconcile, summary_from_text
Fingerprint69b051c3b50c82fd
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in mcncarl/agent-memory-vault