feat: consolidate course into 21 lessons

This commit is contained in:
Haoran
2026-07-31 03:15:58 +08:00
parent 4bc33ec858
commit 2d69019342
200 changed files with 7338 additions and 10829 deletions

View File

@@ -36,7 +36,7 @@ def run_lesson(script: Path, *args: str) -> str:
def test_workflow_runtime_resumes_from_journal(tmp_path: Path) -> None:
script = tmp_path / "code.py"
shutil.copy2(ROOT / "s21_workflow_runtime" / "code.py", script)
shutil.copy2(ROOT / "s20_workflow_runtime" / "code.py", script)
first = run_lesson(script)
resumed = run_lesson(script, "resume")
@@ -49,7 +49,7 @@ def test_workflow_runtime_resumes_from_journal(tmp_path: Path) -> None:
def test_workflow_runtime_rejects_unsafe_artifact_names() -> None:
workflow = load_lesson(
"workflow_name_test", ROOT / "s21_workflow_runtime" / "code.py"
"workflow_name_test", ROOT / "s20_workflow_runtime" / "code.py"
)
for name in ("../escape", "../../escape", "nested/name"):
@@ -61,7 +61,7 @@ def test_workflow_runtime_enforces_budget_and_shared_agent_cap(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
workflow = load_lesson(
"workflow_limit_test", ROOT / "s21_workflow_runtime" / "code.py"
"workflow_limit_test", ROOT / "s20_workflow_runtime" / "code.py"
)
budget = workflow.Budget(total=1)
with pytest.raises(workflow.WorkflowInputError):
@@ -105,7 +105,7 @@ def test_workflow_runtime_enforces_budget_and_shared_agent_cap(
def test_workflow_runtime_rejects_corrupt_resume_journal(tmp_path: Path) -> None:
workflow = load_lesson(
"workflow_journal_test", ROOT / "s21_workflow_runtime" / "code.py"
"workflow_journal_test", ROOT / "s20_workflow_runtime" / "code.py"
)
run_id = "wf_corrupt_0001"
(tmp_path / f"{run_id}.journal.jsonl").write_text("{not-json}\n")
@@ -118,7 +118,7 @@ def test_goal_loop_requires_trusted_evidence_and_has_a_budget(
tmp_path: Path,
) -> None:
script = tmp_path / "code.py"
shutil.copy2(ROOT / "s22_goal_loop" / "code.py", script)
shutil.copy2(ROOT / "s21_goal_loop" / "code.py", script)
output = run_lesson(script)
@@ -128,7 +128,7 @@ def test_goal_loop_requires_trusted_evidence_and_has_a_budget(
def test_goal_loop_separates_user_input_from_host_evidence() -> None:
goal_loop = load_lesson("goal_trust_test", ROOT / "s22_goal_loop" / "code.py")
goal_loop = load_lesson("goal_trust_test", ROOT / "s21_goal_loop" / "code.py")
session = goal_loop.Session()
assert session.submit("/goal until tests passed") == "continuing"