File size: 1,671 Bytes
d659d2d
 
e12a049
 
d659d2d
 
 
 
 
 
 
e12a049
d659d2d
 
 
9eec184
d659d2d
 
 
 
 
 
 
 
 
 
 
 
 
 
ded41ce
 
d659d2d
 
9e8a876
a3e1f0c
 
 
d659d2d
902a11f
36ed450
 
a3e1f0c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from pathlib import Path

from tests.helpers import load_test_index

from hackathon_advisor.agent import AdvisorEngine
from hackathon_advisor.data import ProjectIndex
from hackathon_advisor.field_notes import build_field_notes_markdown
from hackathon_advisor.trace_export import trace_metadata


def test_field_notes_markdown_contains_session_decisions() -> None:
    index = load_test_index()
    engine = AdvisorEngine(index)
    state = {
        "profile": {"skills": "frontend prototyping"},
        "goals": ["Field Notes"],
    }
    first = engine.turn("A local-first archive cartographer for family photos", state)
    planned = engine.turn("make a build plan", first.state)

    markdown = build_field_notes_markdown(
        planned.state,
        {
            **trace_metadata(index),
            "project_count": len(index.projects),
        },
    )

    assert "# Hackathon Advisor Field Notes" in markdown
    assert "frontend prototyping" in markdown
    assert "Goals: Build notes" in markdown
    assert "Targets: Field Notes" not in markdown
    assert "A local-first archive cartographer for family photos" in markdown
    assert "## Build Plan" in markdown
    assert "Write build notes from the exact decisions" in markdown
    assert "## Session Decisions" in markdown
    assert "### Decision 2" in markdown
    assert "Recorded action: `make_plan`" in markdown
    assert "Closest cited Spaces" in markdown
    assert "Page " in markdown
    assert "## Wood Map" in markdown
    assert "echo score" in markdown
    assert "## Turn Trace" not in markdown
    assert "Planner call" not in markdown
    assert "tool trace" not in markdown.lower()