Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/test_build_workflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import shutil
import subprocess
from pathlib import Path
Expand Down Expand Up @@ -209,7 +210,8 @@ def test_queued_build_uses_harness_prompt_and_records_build_operation(
assert adapter.requests[0].agent is HarnessAgentKind.BUILD
assert adapter.requests[0].prompt.startswith("Runtime context:\n{")
assert "Build Operation" not in adapter.requests[0].prompt
assert f'"manual_root": "{repo}/almanac/manual"' in adapter.requests[0].prompt
manual_root = json.dumps(str(repo / "almanac" / "manual"))
assert f'"manual_root": {manual_root}' in adapter.requests[0].prompt
assert '"manual_documents"' not in adapter.requests[0].prompt
assert "Write the smallest useful first wiki." in adapter.requests[0].prompt

Expand Down
7 changes: 5 additions & 2 deletions tests/test_tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_tag_adds_topic_preserves_body_and_frontmatter_comment(
page.write_text(
f"---\ntitle: Auth Flow\n# keep this comment\ntopics: [auth]\n---\n{body}",
encoding="utf-8",
newline="",
)
app = create_app(
AppConfig(database_path=isolated_home / ".codealmanac/codealmanac.db")
Expand Down Expand Up @@ -43,6 +44,7 @@ def test_untag_removes_topic_and_allows_orphan_page(
page.write_text(
"---\ntitle: Auth Flow\ntopics: [auth]\n---\n# Auth Flow\n",
encoding="utf-8",
newline="",
)
app = create_app(
AppConfig(database_path=isolated_home / ".codealmanac/codealmanac.db")
Expand All @@ -63,7 +65,7 @@ def test_tag_adds_frontmatter_when_page_has_none(
):
repo = make_repo(tmp_path)
page = repo / "almanac/note.md"
page.write_text("# Note\n\nBody.\n", encoding="utf-8")
page.write_text("# Note\n\nBody.\n", encoding="utf-8", newline="")
app = create_app(
AppConfig(database_path=isolated_home / ".codealmanac/codealmanac.db")
)
Expand All @@ -81,7 +83,7 @@ def test_tag_handles_frontmatter_closing_fence_at_eof(
):
repo = make_repo(tmp_path)
page = repo / "almanac/note.md"
page.write_text("---\ntitle: Note\n---", encoding="utf-8")
page.write_text("---\ntitle: Note\n---", encoding="utf-8", newline="")
app = create_app(
AppConfig(database_path=isolated_home / ".codealmanac/codealmanac.db")
)
Expand All @@ -104,6 +106,7 @@ def test_tag_preserves_crlf_frontmatter_and_body(
page.write_text(
f"---\r\ntitle: Auth Flow\r\ntopics:\r\n - auth\r\n---\r\n{body}",
encoding="utf-8",
newline="",
)
app = create_app(
AppConfig(database_path=isolated_home / ".codealmanac/codealmanac.db")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_transcript_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def test_claude_transcript_discovery_reads_metadata_and_skips_subagents(
projects.mkdir(parents=True)
transcript = projects / "session.jsonl"
transcript.write_text(
f'{{"sessionId":"claude-1","cwd":"{repo}"}}\n',
json.dumps({"sessionId": "claude-1", "cwd": str(repo)}) + "\n",
encoding="utf-8",
)
subagents = projects / "subagents"
subagents.mkdir()
(subagents / "session.jsonl").write_text(
f'{{"sessionId":"claude-2","cwd":"{repo}"}}\n',
json.dumps({"sessionId": "claude-2", "cwd": str(repo)}) + "\n",
encoding="utf-8",
)

Expand Down