docs: address thesis review nits

This commit is contained in:
lda
2026-06-14 18:19:45 +07:00 Verified
parent 8180847195
commit 38f4ed769e
7 changed files with 95 additions and 20 deletions
+12 -4
View File
@@ -1,24 +1,32 @@
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def markdown_links(text: str) -> set[str]:
"""Return inline Markdown link hrefs from docs smoke-test files."""
return set(re.findall(r"(?<!!)\[[^\]]+\]\(([^)]+)\)", text))
def test_big_doc_links_case_study_and_evidence_index() -> None:
doc = (ROOT / "docs" / "add" / "system-design-implementation.md").read_text(
encoding="utf-8"
)
links = markdown_links(doc)
assert "examples/report_workflow" in doc
assert "docs/add/evidence-index.md" in doc or "evidence-index.md" in doc
assert "evidence-index.md" in links
assert any(link.startswith("../../examples/report_workflow") for link in links)
def test_project_map_links_big_doc() -> None:
project_map = (ROOT / "docs" / "project_map.md").read_text(encoding="utf-8")
links = markdown_links(project_map)
assert "system-design-implementation.md" in project_map
assert "evidence-index.md" in project_map
assert any(link.endswith("system-design-implementation.md") for link in links)
assert any(link.endswith("evidence-index.md") for link in links)
def test_big_doc_keeps_mcp_as_source_family() -> None:
@@ -4,12 +4,44 @@ from pathlib import Path
import pytest
from examples.report_workflow.ops import (
ActionItem,
ExtractInput,
MarkdownInput,
ReadInput,
ReportOutput,
_extract_report,
_read_notes,
_render_markdown_report,
)
from wf_config import load_workflow_config
from wf_server.config import build_workflow_server_from_workflow_config
EXAMPLE_DIR = Path(__file__).resolve().parents[2] / "examples" / "report_workflow"
def test_report_workflow_read_notes_rejects_paths_outside_example() -> None:
with pytest.raises(ValueError, match="inside the example"):
_read_notes(ReadInput(path="../pyproject.toml"))
def test_report_workflow_markdown_renderer_round_trips_through_extractor() -> None:
report = ReportOutput(
title="Weekly Project Update",
summary="Demo summary.",
action_items=[
ActionItem(owner="Alice", task="Prepare demo config", due="Friday")
],
risks=["Quota is low"],
followups=["Render Markdown"],
)
rendered = _render_markdown_report(MarkdownInput(report=report))
extracted = _extract_report(ExtractInput(text=rendered.markdown))
assert extracted == report
@pytest.mark.asyncio
async def test_report_workflow_python_source_loads_and_calls_capability(
tmp_path,