You are a senior code reviewer. Review the following code changes.

## Specification

No specification provided. Focus on correctness, tests, and integration.





## Code Changes

```diff
diff --git a/expert_build/propose.py b/expert_build/propose.py
index d38db8a..113dfea 100644
--- a/expert_build/propose.py
+++ b/expert_build/propose.py
@@ -332,6 +332,9 @@ def cmd_propose_beliefs(args):
                 for line in content[3:end].splitlines():
                     if line.startswith("source_url:"):
                         source_url = line.split(":", 1)[1].strip()
+                    elif line.startswith("source:"):
+                        if not source_url:
+                            source_url = line.split(":", 1)[1].strip()
         header = f"--- FILE: {entry_path}"
         if source_url:
             header += f" | SOURCE_URL: {source_url}"
diff --git a/expert_build/summarize.py b/expert_build/summarize.py
index e0d6e0b..e88ef7a 100644
--- a/expert_build/summarize.py
+++ b/expert_build/summarize.py
@@ -1,8 +1,8 @@
 """Summarize source documents into entries using an LLM."""
 
 import re
-import subprocess
 import sys
+from datetime import date
 from pathlib import Path
 
 from .llm import check_model_available, invoke_sync
@@ -63,6 +63,9 @@ def cmd_summarize(args):
                 for line in frontmatter.splitlines():
                     if line.startswith("source_url:"):
                         source_url = line.split(":", 1)[1].strip()
+                    elif line.startswith("source:"):
+                        if not source_url:
+                            source_url = line.split(":", 1)[1].strip()
                     elif line.startswith("source_id:"):
                         source_id = line.split(":", 1)[1].strip()
                 content = content[end + 3:].strip()
@@ -96,41 +99,21 @@ def cmd_summarize(args):
         title = title_match.group(1) if title_match else source_path.stem.replace("-", " ").title()
         topic = source_path.stem
 
-        # Create entry via entry CLI
-        entry_path = None
-        try:
-            result = subprocess.run(
-                ["entry", "create", topic, title, "--content", summary],
-                capture_output=True, text=True,
-            )
-            if result.returncode == 0:
-                entry_path = result.stdout.strip().replace("Created ", "")
-                print(f"  -> {result.stdout.strip()}")
-            else:
-                # Try alternative invocation
-                result = subprocess.run(
-                    ["entry", "create", topic, title],
-                    input=summary,
-                    capture_output=True, text=True,
-                )
-                if result.returncode == 0:
-                    entry_path = result.stdout.strip().replace("Created ", "")
-                    print(f"  -> {result.stdout.strip()}")
-                else:
-                    print(f"  WARN: entry create failed: {result.stderr.strip()}")
-        except FileNotFoundError:
-            print("  ERROR: entry CLI not found. Install with: uv tool install entry")
-            sys.exit(1)
-
-        # Prepend source provenance frontmatter to the entry file
-        if entry_path and source_url:
-            ep = Path(entry_path)
-            if ep.exists():
-                fm = f"---\nsource_url: {source_url}\n"
-                if source_id:
-                    fm += f"source_id: {source_id}\n"
-                fm += "---\n\n"
-                ep.write_text(fm + ep.read_text())
+        # Write entry directly with provenance frontmatter
+        today = date.today()
+        entry_dir = Path("entries") / str(today.year) / f"{today.month:02d}" / f"{today.day:02d}"
+        entry_dir.mkdir(parents=True, exist_ok=True)
+        entry_path = entry_dir / f"{topic}.md"
+
+        fm_lines = [f"source: {source_path}"]
+        if source_url:
+            fm_lines.append(f"source_url: {source_url}")
+        if source_id:
+            fm_lines.append(f"source_id: {source_id}")
+        frontmatter = "---\n" + "\n".join(fm_lines) + "\n---\n\n"
+
+        entry_path.write_text(frontmatter + summary + "\n")
+        print(f"  -> Created {entry_path}")
 
         # Record as done
         with manifest.open("a") as f:
diff --git a/tests/test_summarize.py b/tests/test_summarize.py
index 5d4d0c1..ff3457d 100644
--- a/tests/test_summarize.py
+++ b/tests/test_summarize.py
@@ -2,7 +2,7 @@
 
 import types
 from pathlib import Path
-from unittest.mock import patch, MagicMock
+from unittest.mock import patch
 
 import pytest
 
@@ -33,6 +33,13 @@ def make_args(input_dir, model="test-model", limit=None):
     return types.SimpleNamespace(input_dir=str(input_dir), model=model, limit=limit)
 
 
+def _find_entry(work_dir):
+    """Find the generated entry file under entries/."""
+    entries = list((work_dir / "entries").rglob("*.md"))
+    assert len(entries) == 1, f"Expected 1 entry, found {len(entries)}: {entries}"
+    return entries[0]
+
+
 # --- File discovery tests ---
 
 def test_discovers_md_files(source_dir, work_dir):
@@ -40,12 +47,11 @@ def test_discovers_md_files(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Topic Title\nSummary"), \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/doc.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Topic Title\nSummary"):
         cmd_summarize(args)
 
-    assert mock_run.called
+    entry = _find_entry(work_dir)
+    assert "Summary" in entry.read_text()
 
 
 def test_discovers_py_files(source_dir, work_dir):
@@ -53,12 +59,11 @@ def test_discovers_py_files(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Module\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/module.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Module\nSummary"):
         cmd_summarize(args)
 
-    assert mock_llm.called
+    entry = _find_entry(work_dir)
+    assert "Summary" in entry.read_text()
 
 
 def test_discovers_both_md_and_py(source_dir, work_dir):
@@ -66,14 +71,13 @@ def test_discovers_both_md_and_py(source_dir, work_dir):
     (source_dir / "beta.py").write_text("x = 1")
     args = make_args(source_dir)
 
-    calls = []
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/x.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary") as mock_llm:
         cmd_summarize(args)
 
     assert mock_llm.call_count == 2
+    entries = list((work_dir / "entries").rglob("*.md"))
+    assert len(entries) == 2
 
 
 def test_ignores_other_extensions(source_dir, work_dir):
@@ -95,9 +99,7 @@ def test_uses_summarize_code_for_py(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Module\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/module.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Module\nSummary") as mock_llm:
         cmd_summarize(args)
 
     prompt = mock_llm.call_args[0][0]
@@ -109,9 +111,7 @@ def test_uses_summarize_for_md(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Doc Title\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/doc.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Doc Title\nSummary") as mock_llm:
         cmd_summarize(args)
 
     prompt = mock_llm.call_args[0][0]
@@ -125,9 +125,7 @@ def test_truncation_warning_for_large_file(source_dir, work_dir, capsys):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Big Doc\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/big.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Big Doc\nSummary"):
         cmd_summarize(args)
 
     captured = capsys.readouterr()
@@ -140,9 +138,7 @@ def test_truncation_content_is_capped(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Big\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/big.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Big\nSummary") as mock_llm:
         cmd_summarize(args)
 
     prompt = mock_llm.call_args[0][0]
@@ -155,9 +151,7 @@ def test_no_truncation_warning_for_small_file(source_dir, work_dir, capsys):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Small\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/small.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Small\nSummary"):
         cmd_summarize(args)
 
     captured = capsys.readouterr()
@@ -184,9 +178,7 @@ def test_manifest_records_processed_file(source_dir, work_dir):
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary"), \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/doc.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary"):
         cmd_summarize(args)
 
     manifest = work_dir / ".summarized"
@@ -197,14 +189,26 @@ def test_manifest_records_processed_file(source_dir, work_dir):
 # --- Frontmatter stripping tests ---
 
 def test_strips_frontmatter_before_summarizing(source_dir, work_dir):
+    content = "---\nsource: https://example.com\n---\n\nActual content here"
+    (source_dir / "doc.md").write_text(content)
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary") as mock_llm:
+        cmd_summarize(args)
+
+    prompt = mock_llm.call_args[0][0]
+    assert "source:" not in prompt
+    assert "Actual content here" in prompt
+
+
+def test_strips_source_url_frontmatter(source_dir, work_dir):
     content = "---\nsource_url: https://example.com\n---\n\nActual content here"
     (source_dir / "doc.md").write_text(content)
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
-         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary") as mock_llm, \
-         patch("subprocess.run") as mock_run:
-        mock_run.return_value = MagicMock(returncode=0, stdout="Created entries/doc.md", stderr="")
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary") as mock_llm:
         cmd_summarize(args)
 
     prompt = mock_llm.call_args[0][0]
@@ -213,7 +217,7 @@ def test_strips_frontmatter_before_summarizing(source_dir, work_dir):
 
 
 def test_skips_empty_content_after_frontmatter(source_dir, work_dir, capsys):
-    (source_dir / "empty.md").write_text("---\nsource_url: https://example.com\n---\n\n")
+    (source_dir / "empty.md").write_text("---\nsource: https://example.com\n---\n\n")
     args = make_args(source_dir)
 
     with patch("expert_build.summarize.check_model_available", return_value=True), \
@@ -225,6 +229,83 @@ def test_skips_empty_content_after_frontmatter(source_dir, work_dir, capsys):
     assert "SKIP" in captured.out
 
 
+# --- Provenance frontmatter tests ---
+
+def test_entry_has_source_frontmatter(source_dir, work_dir):
+    """Generated entry includes source path in frontmatter."""
+    (source_dir / "doc.md").write_text("# Hello\nContent")
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary"):
+        cmd_summarize(args)
+
+    entry = _find_entry(work_dir)
+    content = entry.read_text()
+    assert content.startswith("---\n")
+    assert f"source: {source_dir}/doc.md" in content
+
+
+def test_entry_has_source_url_from_fetch_frontmatter(source_dir, work_dir):
+    """source: URL from fetch-docs frontmatter propagates as source_url."""
+    fm = "---\nsource: https://example.com/docs/page\nfetched: 2026-06-04\n---\n\nDoc content"
+    (source_dir / "page.md").write_text(fm)
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## Page\nSummary"):
+        cmd_summarize(args)
+
+    entry = _find_entry(work_dir)
+    content = entry.read_text()
+    assert "source_url: https://example.com/docs/page" in content
+
+
+def test_entry_has_source_id_when_present(source_dir, work_dir):
+    """source_id propagates from source frontmatter to entry."""
+    fm = "---\nsource_url: https://example.com\nsource_id: abc123\n---\n\nContent"
+    (source_dir / "doc.md").write_text(fm)
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary"):
+        cmd_summarize(args)
+
+    entry = _find_entry(work_dir)
+    content = entry.read_text()
+    assert "source_url: https://example.com" in content
+    assert "source_id: abc123" in content
+
+
+def test_entry_contains_llm_summary(source_dir, work_dir):
+    """The LLM summary is written as the entry body."""
+    (source_dir / "doc.md").write_text("# Hello\nContent")
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## My Title\nDetailed summary here"):
+        cmd_summarize(args)
+
+    entry = _find_entry(work_dir)
+    content = entry.read_text()
+    assert "Detailed summary here" in content
+
+
+def test_entry_directory_structure(source_dir, work_dir):
+    """Entries are written to entries/YYYY/MM/DD/topic.md."""
+    (source_dir / "my-topic.md").write_text("# Topic\nContent")
+    args = make_args(source_dir)
+
+    with patch("expert_build.summarize.check_model_available", return_value=True), \
+         patch("expert_build.summarize.invoke_sync", return_value="## Title\nSummary"):
+        cmd_summarize(args)
+
+    entry = _find_entry(work_dir)
+    assert entry.name == "my-topic.md"
+    parts = entry.relative_to(work_dir).parts
+    assert parts[0] == "entries"
+
+
 # --- Prompt template tests ---
 
 def test_summarize_template_requests_descriptive_title():

```



## Instructions

For each significant change (new file, modified function, etc.), provide a structured verdict.

Use this exact format for each change:

### <file_path or file_path:function_name>
VERDICT: PASS | CONCERN | BLOCK
CORRECTNESS: VALID | QUESTIONABLE | BROKEN
SPEC_COMPLIANCE: MEETS | PARTIAL | VIOLATES | N/A
ISSUE_COMPLIANCE: ADDRESSES | PARTIAL | UNRELATED | N/A
BELIEF_COMPLIANCE: CONSISTENT | VIOLATES | N/A
TEST_COVERAGE: COVERED | PARTIAL | UNTESTED
INTEGRATION: WIRED | PARTIAL | MISSING
REASONING: <brief explanation of your assessment>
---

## Review Criteria

1. **CORRECTNESS**: Does the code do what it claims? Is the logic sound?
   - VALID: Logic is correct, no bugs apparent
   - QUESTIONABLE: Logic may have edge cases or unclear behavior
   - BROKEN: Clear bugs or incorrect behavior

2. **SPEC_COMPLIANCE**: Does it meet MUST requirements from the spec?
   - MEETS: All relevant spec requirements satisfied
   - PARTIAL: Some requirements met, others missing or incomplete
   - VIOLATES: Contradicts spec requirements
   - N/A: No spec provided or not applicable

3. **ISSUE_COMPLIANCE** (only when an issue is provided): Do the changes address the problem or feature described in the issue?
   - ADDRESSES: Changes directly solve the issue's stated problem or implement the requested feature
   - PARTIAL: Changes partially address the issue but leave some aspects unresolved
   - UNRELATED: Changes do not appear related to the issue
   - N/A: No issue provided

4. **TEST_COVERAGE**: Are there tests for the new/changed code?
   - COVERED: Tests exist and cover the changes
   - PARTIAL: Some tests exist but coverage is incomplete
   - UNTESTED: No tests for the changes

5. **INTEGRATION**: Are callers updated? Is the feature usable end-to-end?
   - WIRED: Feature is fully integrated and usable
   - PARTIAL: Interface exists but callers not updated, or integration incomplete
   - MISSING: No integration with existing code

6. **BELIEF_COMPLIANCE** (only when beliefs are provided): Do the changes respect known architectural invariants, contracts, and rules?
   - CONSISTENT: Changes align with or reinforce known beliefs
   - VIOLATES: Changes contradict a specific belief — cite the belief ID
   - N/A: No beliefs provided or no relevant beliefs apply

## Verdict Guidelines

- **BLOCK**: Security issues, broken functionality, spec violations, or missing critical integration
- **CONCERN**: Missing tests, partial integration, questionable patterns, or unclear logic
- **PASS**: Correct, tested, well-integrated code

## Important

- Full function bodies for modified functions may be available in the observations section — use them to verify the complete logic, not just the diff hunks
- Related test files (prefixed with ``related_test:``) may be included in observations — check whether existing test assertions still match modified return types, signatures, or behavior. Flag any test that would break due to the changes
- If duplicate test coverage is detected (multiple test files covering the same source), note it in your review
- Focus on actual issues, not style preferences
- If a method signature is added but callers aren't updated, that's PARTIAL integration
- Be specific in reasoning - reference line numbers or function names
- When in doubt, use CONCERN rather than PASS

## Self-Review

After completing your review, add a brief self-assessment:

### SELF_REVIEW
LIMITATIONS: <what context were you missing that affected review quality?>
---

Examples of limitations:
- "Could not see full class to verify no other methods access the modified field"
- "Test file not included in diff - cannot verify coverage claims"
- "Spec file referenced but not provided"


## Feature Requests

If this review tool could be improved to help you do a better job, suggest features:

### FEATURE_REQUESTS
- <suggestion 1>
- <suggestion 2>
---

Examples:
- "Include full file context for modified functions, not just diff hunks"
- "Show callers of modified methods to verify integration"
- "Include test file alongside implementation changes"

Only include this section if you have specific suggestions. Skip if none.
