---
{
  "n": 28,
  "title": "Every lesson replays and a visitor plays it through",
  "abstract": "",
  "refs": [],
  "seen": [
    "agent"
  ],
  "data": {
    "command": ".venv/bin/python -m pytest -q -m lessons --timeout=900 -n auto src/features/session_recording/test.py",
    "every": 0,
    "environment": "main",
    "buttons": [
      {
        "label": "Run",
        "type": "check",
        "action": "run",
        "n": 28,
        "again": true
      }
    ],
    "files": {},
    "running": {},
    "last": {
      "ok": false,
      "code": 1,
      "at": 1791696666.7453911,
      "took": 305.21,
      "steps": 3,
      "output": "        url, failed = launch(self.root, self.project)\n        until = time.time() + SERVER_STARTS\n        while not url and failed is None and time.time() < until:\n            time.sleep(0.5)\n            url = running(self.root)\n        if not url:\n>           raise Refusal(f\"the journal server did not start ({failed}): see {self.root / 'runtime' / 'viewer.log'}\")\nE           scripts.demo.session.Refusal: the journal server did not start (1): see /private/var/folders/jw/5_sm4hg92x70kql0hrg4w54c0000gn/T/pytest-of-jessegall/pytest-315/popen-gw8/test_every_lesson_script_plays0/bakery/.journal/runtime/viewer.log\n\nscripts/demo/session.py:230: Refusal\n_ test_a_visitor_plays_every_shipped_lesson_to_the_end_pressing_only_what_is_outlined _\n[gw9] darwin -- Python 3.14.7 /Users/jessegall/projects/agent-journal/.venv/bin/python\n\ntmp_path = PosixPath('/private/var/folders/jw/5_sm4hg92x70kql0hrg4w54c0000gn/T/pytest-of-jessegall/pytest-315/popen-gw9/test_a_visitor_plays_every_shi0')\n\n    @pytest.mark.lessons\n    def test_a_visitor_plays_every_shipped_lesson_to_the_end_pressing_only_what_is_outlined(tmp_path):\n        sys.path.insert(0, str(REPOSITORY))\n        from scripts.demo.record import SCENARIOS\n        site = tmp_path / \"site\"\n        subprocess.run([\"npx\", \"vite\", \"build\", \"--mode\", \"demo\", \"--outDir\", str(site), \"--emptyOutDir\"], cwd=WEB.parent, check=True, capture_output=True, timeout=600)\n        runs = [(key, page) for key in SCENARIOS for page in (\"\", \"phone.html\")]\n    \n        def play(run):\n            return subprocess.run([\"node\", str(PLAY), f\"{url}{run[1]}?speed=100&scenario={run[0]}\"], cwd=WEB.parent, capture_output=True, text=True, timeout=600)\n    \n        with served(site) as url, ThreadPoolExecutor(max_workers=4) as pool:\n            played = dict(zip(runs, pool.map(play, runs)))\n        for run, done in played.items():\n>           assert done.returncode == 0, f\"{run}: {done.stdout[-400:]} {done.stderr[-400:]}\"\nE           AssertionError: ('bakery', 'phone.html'): ts/tokens-BsUtHxQz.js:13:46)\\n    at at (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:13:109)\\n    at Ho.r.call (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:13:3600)\\n    at Vf.d [as fn] (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:9:16217)\\n    at dc.run (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:9:2153)\\n    at Y (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:9:16598)\"]}\nE              \nE           assert 1 == 0\nE            +  where 1 = CompletedProcess(args=['node', '/Users/jessegall/projects/agent-journal/src/web/demo/play.mjs', 'http://127.0.0.1:5254...sets/tokens-BsUtHxQz.js:9:2153)\\\\n    at Y (http://127.0.0.1:52549/assets/tokens-BsUtHxQz.js:9:16598)\"]}\\n', stderr='').returncode\n\nsrc/features/session_recording/test.py:233: AssertionError\n=========================== short test summary info ============================\nFAILED src/features/session_recording/test.py::test_every_lesson_script_plays_through_this_journal_without_a_hold\nFAILED src/features/session_recording/test.py::test_a_visitor_plays_every_shipped_lesson_to_the_end_pressing_only_what_is_outlined\n2 failed in 301.76s (0:05:01)",
      "report": null
    },
    "runs": [
      {
        "ok": false,
        "code": 1,
        "at": 1791696666.7453911,
        "took": 305.21
      },
      {
        "ok": false,
        "code": 1,
        "at": 1791265380.4445791,
        "took": 221.34
      }
    ]
  },
  "created": 1791011941.273856,
  "updated": 1791696971.9624681,
  "deleted": 0.0,
  "completed": 0.0,
  "outcome": "",
  "type": "check"
}
---
The lesson scripts and the visitor test, kept out of the full suite because they take minutes; run it after changing a lesson, the recorder or the demo player.
