"""Read only this project's Grok journals; print persisted efforts, without model identifiers."""
import json, pathlib, urllib.parse
root = pathlib.Path.home() / '.grok' / 'sessions' / urllib.parse.quote(str(pathlib.Path.cwd().resolve()), safe='')
files = list(root.glob('*/chat_history.jsonl'))
if not files:
    raise SystemExit('No session journal found for this project')
f = max(files, key=lambda p: p.stat().st_mtime_ns)
turns = []
for line in f.read_text().splitlines():
    row = json.loads(line)
    if row.get('type') == 'user' and 'prompt_index' in row:
        turns.append([])
    if row.get('type') == 'assistant' and row.get('reasoning_effort') and turns:
        effort = row['reasoning_effort']
        if effort not in turns[-1]:
            turns[-1].append(effort)
for n, efforts in enumerate(turns, 1):
    if efforts:
        print(f'Turn {n}: journal reasoning_effort = {", ".join(efforts)}')
