some organization pass, still need to review a bunch
This commit is contained in:
@@ -35,9 +35,8 @@ def parse_ts(s: str) -> Optional[datetime.datetime]:
|
||||
|
||||
def entry_to_str(entry: dict[str, Any]) -> str:
|
||||
"""
|
||||
|
||||
Serialise a disc entry dict -> stored string.
|
||||
[C: tests/test_thinking_persistence.py:test_entry_to_str_with_thinking]
|
||||
Serialise a disc entry dict -> stored string.
|
||||
[C: tests/test_thinking_persistence.py:test_entry_to_str_with_thinking]
|
||||
"""
|
||||
ts = entry.get("ts", "")
|
||||
role = entry.get("role", "User")
|
||||
@@ -56,15 +55,14 @@ def entry_to_str(entry: dict[str, Any]) -> str:
|
||||
|
||||
def format_discussion(entries: list[dict[str, Any]]) -> str:
|
||||
"""
|
||||
Convert a list of discussion entry dicts into a single formatted string.
|
||||
Convert a list of discussion entry dicts into a single formatted string.
|
||||
"""
|
||||
return "\n\n".join([entry_to_str(e) for e in entries])
|
||||
|
||||
def str_to_entry(raw: str, roles: list[str]) -> dict[str, Any]:
|
||||
"""
|
||||
|
||||
Parse a stored string back to a disc entry dict.
|
||||
[C: tests/test_thinking_persistence.py:test_str_to_entry_with_thinking]
|
||||
Parse a stored string back to a disc entry dict.
|
||||
[C: tests/test_thinking_persistence.py:test_str_to_entry_with_thinking]
|
||||
"""
|
||||
ts = ""
|
||||
rest = raw
|
||||
@@ -492,4 +490,4 @@ def promote_take(project_dict: dict, take_id: str, new_id: str) -> None:
|
||||
|
||||
# If the take was active, update the active pointer
|
||||
if project_dict["discussion"].get("active") == take_id:
|
||||
project_dict["discussion"]["active"] = new_id
|
||||
project_dict["discussion"]["active"] = new_id
|
||||
|
||||
Reference in New Issue
Block a user