theseus: add 5 Nous Research source archives #2514

Closed
theseus wants to merge 7 commits from theseus/nous-research-sources into main
Showing only changes of commit 8118bf17b4 - Show all commits

View file

@ -535,8 +535,8 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str,
field_re = re.compile(rf"^{edge_type}:\s*$", re.MULTILINE)
inline_re = re.compile(rf'^{edge_type}:\s*\[', re.MULTILINE)
entry_line = f' - "{orphan_title}"'
rw_line = f' - "{orphan_title}|{edge_type}|{date_str}"'
entry_line = f'- {orphan_title}'
rw_line = f'- {orphan_title}|{edge_type}|{date_str}'
if field_re.search(fm_text):
# Multi-line list exists — find end of list, append
@ -548,7 +548,7 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str,
new_lines.append(line)
if re.match(rf"^{edge_type}:\s*$", line):
in_field = True
elif in_field and not line.startswith(" -"):
elif in_field and not line.startswith(("- ", " -")):
# End of list — insert before this line
new_lines.insert(-1, entry_line)
in_field = False
@ -576,7 +576,7 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str,
new_lines.append(line)
if re.match(r"^reweave_edges:\s*$", line):
in_rw = True
elif in_rw and not line.startswith(" -"):
elif in_rw and not line.startswith(("- ", " -")):
new_lines.insert(-1, rw_line)
in_rw = False
inserted_rw = True