methodproof 0.7.35__tar.gz → 0.7.36__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. {methodproof-0.7.35 → methodproof-0.7.36}/CHANGELOG.md +12 -0
  2. {methodproof-0.7.35 → methodproof-0.7.36}/PKG-INFO +1 -1
  3. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/cli.py +78 -11
  4. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/start.py +79 -15
  5. {methodproof-0.7.35 → methodproof-0.7.36}/pyproject.toml +1 -1
  6. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_start.py +5 -2
  7. {methodproof-0.7.35 → methodproof-0.7.36}/.github/workflows/ci.yml +0 -0
  8. {methodproof-0.7.35 → methodproof-0.7.36}/.gitignore +0 -0
  9. {methodproof-0.7.35 → methodproof-0.7.36}/LICENSE +0 -0
  10. {methodproof-0.7.35 → methodproof-0.7.36}/README.md +0 -0
  11. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/__init__.py +0 -0
  12. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/__main__.py +0 -0
  13. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/_daemon.py +0 -0
  14. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/agents/__init__.py +0 -0
  15. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/agents/base.py +0 -0
  16. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/agents/music.py +0 -0
  17. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/agents/terminal.py +0 -0
  18. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/agents/watcher.py +0 -0
  19. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/analysis.py +0 -0
  20. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/binding.py +0 -0
  21. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/bip39.py +0 -0
  22. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/bridge.py +0 -0
  23. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/config.py +0 -0
  24. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/crypto.py +0 -0
  25. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/e2e.py +0 -0
  26. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/graph.py +0 -0
  27. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hook.py +0 -0
  28. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/__init__.py +0 -0
  29. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/claude_code.py +0 -0
  30. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/claude_code.sh +0 -0
  31. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/cline_hook.sh +0 -0
  32. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/codex_hook.sh +0 -0
  33. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/gemini_hook.sh +0 -0
  34. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/install.py +0 -0
  35. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/kiro_hook.sh +0 -0
  36. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/mcp_register.py +0 -0
  37. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/openclaw/HOOK.md +0 -0
  38. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/openclaw/handler.ts +0 -0
  39. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/openclaw_install.py +0 -0
  40. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/opencode_plugin.js +0 -0
  41. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/hooks/wrappers.py +0 -0
  42. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/integrity.py +0 -0
  43. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/kdf.py +0 -0
  44. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/keychain.py +0 -0
  45. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/live.py +0 -0
  46. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/lock.py +0 -0
  47. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/mcp.py +0 -0
  48. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/migrate_db.py +0 -0
  49. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/proxy.py +0 -0
  50. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/proxy_daemon.py +0 -0
  51. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/repos.py +0 -0
  52. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/skills/methodproof/SKILL.md +0 -0
  53. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/store.py +0 -0
  54. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/sync.py +0 -0
  55. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/__init__.py +0 -0
  56. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/consent.py +0 -0
  57. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/init.py +0 -0
  58. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/log.py +0 -0
  59. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/login_success.py +0 -0
  60. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/review.py +0 -0
  61. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/status.py +0 -0
  62. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/tui/theme.py +0 -0
  63. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/viewer.py +0 -0
  64. {methodproof-0.7.35 → methodproof-0.7.36}/methodproof/wordlist.py +0 -0
  65. {methodproof-0.7.35 → methodproof-0.7.36}/test_windows_compat.py +0 -0
  66. {methodproof-0.7.35 → methodproof-0.7.36}/tests/__init__.py +0 -0
  67. {methodproof-0.7.35 → methodproof-0.7.36}/tests/conftest.py +0 -0
  68. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_analysis.py +0 -0
  69. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_auth.py +0 -0
  70. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_config.py +0 -0
  71. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_helpers.py +0 -0
  72. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_session.py +0 -0
  73. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_share.py +0 -0
  74. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_cli_update.py +0 -0
  75. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_e2e_integration.py +0 -0
  76. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_graph.py +0 -0
  77. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_hooks.py +0 -0
  78. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_live.py +0 -0
  79. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_openclaw_hooks.py +0 -0
  80. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_profiles.py +0 -0
  81. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_security.py +0 -0
  82. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_store.py +0 -0
  83. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_sync.py +0 -0
  84. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_viewer.py +0 -0
  85. {methodproof-0.7.35 → methodproof-0.7.36}/tests/test_wrappers.py +0 -0
  86. {methodproof-0.7.35 → methodproof-0.7.36}/uv.lock +0 -0
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.36] — 2026-04-12
4
+
5
+ ### Added
6
+ - **`mp connect [session_id]`** — attach TUI to an active recording session. Defaults to the current active session. `mp start` with an active session now auto-connects instead of erroring.
7
+ - **Source tracking in TUI** — events display which AI tool session generated them (e.g. `claude`, `codex`). Session bar shows source name and conversation number (`claude #2`). Tracks across multiple AI sessions within one `mp start`.
8
+ - **End session from TUI (`x`)** — confirmation prompt (`y`/`n`) to stop the session and finalize from within the TUI. `q` now exits the TUI without stopping the daemon — reconnect later with `mp connect`.
9
+
10
+ ### Fixed
11
+ - **Tree indentation invisible** — `gold_ember` (`#3d3118`) was near-invisible on dark background; switched to `gold_aged` (`#9a7b3a`).
12
+ - **Orphan tool_call events showed no tree** — `tool_call` after `agent_turn_end`/`agent_complete` fell through to flat rendering. Now implicitly opens a new chain.
13
+ - **`tool_name` field empty in TUI** — hook events store the tool name in `tool` not `tool_name`; formatters now check both fields.
14
+
3
15
  ## [0.7.35] — 2026-04-12
4
16
 
5
17
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: methodproof
3
- Version: 0.7.35
3
+ Version: 0.7.36
4
4
  Summary: See how you code. Capture and visualize your engineering process.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1098,9 +1098,11 @@ def cmd_start(args: argparse.Namespace) -> None:
1098
1098
 
1099
1099
  if cfg.get("active_session"):
1100
1100
  if _is_daemon_alive():
1101
- print(f"Session active: {cfg['active_session'][:8]}")
1102
- print("Run `methodproof stop` first.")
1103
- sys.exit(1)
1101
+ sid = cfg["active_session"]
1102
+ print(f" Session {sid[:8]} already active. Connecting...")
1103
+ args.session_id = None # connect resolves from config
1104
+ cmd_connect(args)
1105
+ return
1104
1106
  stale_sid = cfg["active_session"]
1105
1107
  _log_step(f"Cleaning stale session {stale_sid[:8]}")
1106
1108
  store.complete_session(stale_sid)
@@ -1301,7 +1303,9 @@ def cmd_start(args: argparse.Namespace) -> None:
1301
1303
  if _resolve_ui(args, cfg):
1302
1304
  session = store.get_session(sid)
1303
1305
  from methodproof.tui.start import run as tui_start
1304
- tui_start(sid, session)
1306
+ result = tui_start(sid, session)
1307
+ if result == "end_session":
1308
+ cmd_stop(args)
1305
1309
  return
1306
1310
  print("Run `mp stop` to finish.")
1307
1311
  return
@@ -1444,6 +1448,33 @@ def cmd_stop(args: argparse.Namespace) -> None:
1444
1448
  _print_summary(session, stats, cfg)
1445
1449
 
1446
1450
 
1451
+ def cmd_connect(args: argparse.Namespace) -> None:
1452
+ """Attach TUI to an active recording session."""
1453
+ cfg = config.load()
1454
+ sid = getattr(args, "session_id", None)
1455
+ if sid:
1456
+ # Resolve prefix
1457
+ sessions = store.list_sessions()
1458
+ match = [s for s in sessions if s["id"].startswith(sid)]
1459
+ if not match:
1460
+ print(f"No session matching '{sid}'")
1461
+ sys.exit(1)
1462
+ sid = match[0]["id"]
1463
+ else:
1464
+ sid = cfg.get("active_session")
1465
+ if not sid:
1466
+ print("No active session. Run `mp start` first.")
1467
+ sys.exit(1)
1468
+ session = store.get_session(sid)
1469
+ if not session:
1470
+ print(f"Session {sid[:8]} not found.")
1471
+ sys.exit(1)
1472
+ from methodproof.tui.start import run as tui_start
1473
+ result = tui_start(sid, session)
1474
+ if result == "end_session":
1475
+ cmd_stop(args)
1476
+
1477
+
1447
1478
  def cmd_view(args: argparse.Namespace) -> None:
1448
1479
  session = _resolve_session(args.session_id)
1449
1480
  from methodproof.viewer import view
@@ -1782,18 +1813,51 @@ def cmd_push(args: argparse.Namespace) -> None:
1782
1813
  local = getattr(args, "local", False)
1783
1814
  cfg = config.load(local=local)
1784
1815
  if not cfg.get("token"):
1785
- target = "local API" if local else "platform"
1786
1816
  print(f"Run `methodproof login{' --api-url http://localhost:8000' if local else ''}` first.")
1787
1817
  sys.exit(1)
1788
1818
  from methodproof.sync import sync_research_consent
1789
1819
  sync_research_consent(cfg["token"], cfg["api_url"])
1790
1820
  cfg = config.load(local=local)
1791
- sid = args.session_id or _latest()
1792
- if not sid:
1793
- print("No sessions to push.")
1794
- sys.exit(1)
1795
- from methodproof.sync import push
1796
1821
  force = getattr(args, "force", False)
1822
+
1823
+ if args.session_id:
1824
+ _push_one(args.session_id, cfg, force=force)
1825
+ return
1826
+
1827
+ # No session_id — check for unsynced completed sessions
1828
+ unsynced = [s for s in store.list_sessions()
1829
+ if not s["synced"] and s.get("completed_at")]
1830
+ if not unsynced:
1831
+ # Fall back to latest session
1832
+ sid = _latest()
1833
+ if not sid:
1834
+ print("No sessions to push.")
1835
+ sys.exit(1)
1836
+ _push_one(sid, cfg, force=force)
1837
+ return
1838
+
1839
+ if len(unsynced) == 1:
1840
+ _push_one(unsynced[0]["id"], cfg, force=force)
1841
+ return
1842
+
1843
+ # Multiple unsynced — offer to push all
1844
+ print(f"Found {len(unsynced)} unsynced sessions:\n")
1845
+ for s in unsynced:
1846
+ events = len(store.get_events(s["id"]))
1847
+ date = s["created_at"][:10] if s.get("created_at") else "?"
1848
+ print(f" {s['id'][:8]} {date} {events} events")
1849
+ print()
1850
+ answer = input(f"Push all {len(unsynced)}? [Y/n] ").strip().lower()
1851
+ if answer in ("", "y", "yes"):
1852
+ for s in unsynced:
1853
+ _push_one(s["id"], cfg, force=force)
1854
+ print()
1855
+ else:
1856
+ print("Cancelled. Push individually with `mp push <session_id>`.")
1857
+
1858
+
1859
+ def _push_one(sid: str, cfg: dict, force: bool = False) -> None:
1860
+ from methodproof.sync import push
1797
1861
  remote_id = push(sid, cfg["token"], cfg["api_url"], force=force)
1798
1862
  app = _app_url(cfg["api_url"])
1799
1863
  print(f"Pushed {sid[:8]} → {cfg['api_url']} (private).")
@@ -2205,6 +2269,9 @@ def main() -> None:
2205
2269
  s.add_argument("--streaming", action="store_true", help="Blocking foreground — stream every captured event to stdout")
2206
2270
  _add_ui_flags(s)
2207
2271
  sub.add_parser("stop", help="Stop recording")
2272
+ cn = sub.add_parser("connect", help="Attach TUI to active session")
2273
+ cn.add_argument("session_id", nargs="?", help="Session ID prefix (defaults to active)")
2274
+ _add_ui_flags(cn)
2208
2275
  v = sub.add_parser("view", help="Inspect captured session data")
2209
2276
  v.add_argument("session_id", nargs="?")
2210
2277
  l_log = sub.add_parser("log", help="List sessions")
@@ -2287,7 +2354,7 @@ def main() -> None:
2287
2354
 
2288
2355
  args = p.parse_args()
2289
2356
  cmds = {
2290
- "init": cmd_init, "start": cmd_start, "stop": cmd_stop,
2357
+ "init": cmd_init, "start": cmd_start, "stop": cmd_stop, "connect": cmd_connect,
2291
2358
  "view": cmd_view, "log": cmd_log, "status": cmd_status,
2292
2359
  "login": cmd_login, "logout": cmd_logout, "accounts": cmd_accounts, "switch": cmd_switch,
2293
2360
  "push": cmd_push, "tag": cmd_tag, "publish": cmd_publish,
@@ -197,6 +197,11 @@ class _TreeTracker:
197
197
  return "├ ", True
198
198
  self._in_chain = False
199
199
  return " ", True
200
+ # Not in chain — tool_call starts one implicitly (orphan after closer)
201
+ if etype in self._INNERS:
202
+ self._in_chain = True
203
+ self._collapse_count = 0
204
+ return "├ ", True
200
205
  return " ", True
201
206
 
202
207
 
@@ -255,15 +260,15 @@ def _fmt_meta(ev: dict) -> str:
255
260
 
256
261
  # Hook lifecycle — tool call / result
257
262
  if etype == "tool_call":
258
- name = meta.get("tool_name", "")
263
+ name = meta.get("tool_name") or meta.get("tool", "")
259
264
  preview = (meta.get("tool_input_preview") or "")[:60]
260
265
  return f"{name} {preview}".strip()
261
266
  if etype == "tool_result":
262
- name = meta.get("tool_name", "")
267
+ name = meta.get("tool_name") or meta.get("tool", "")
263
268
  ok = "✓" if meta.get("success", True) else "✗"
264
269
  return f"{name} {ok}"
265
270
  if etype == "tool_failure":
266
- name = meta.get("tool_name", "")
271
+ name = meta.get("tool_name") or meta.get("tool", "")
267
272
  err = (meta.get("error") or "")[:40]
268
273
  return f"{name} ✗ {err}".strip()
269
274
 
@@ -392,14 +397,40 @@ class _DetailScreen(Screen[None]):
392
397
  self.app.pop_screen()
393
398
 
394
399
 
400
+ class _ConfirmEndScreen(Screen[bool]):
401
+ """Confirm session end."""
402
+
403
+ BINDINGS = [
404
+ Binding("y", "confirm", "yes"),
405
+ Binding("n", "cancel", "no"),
406
+ Binding("escape", "cancel", "cancel"),
407
+ ]
408
+
409
+ def compose(self) -> ComposeResult:
410
+ P = ACTIVE
411
+ yield Static(
412
+ f"\n [{P.red}]End this session?[/{P.red}]\n\n"
413
+ f" [{P.dim}]This will stop all capture agents and finalize the session.[/{P.dim}]\n\n"
414
+ f" [{P.gold}]y[/{P.gold}] [{P.dim}]confirm[/{P.dim}] "
415
+ f"[{P.gold}]n[/{P.gold}] [{P.dim}]cancel[/{P.dim}]",
416
+ )
417
+
418
+ def action_confirm(self) -> None:
419
+ self.dismiss(True)
420
+
421
+ def action_cancel(self) -> None:
422
+ self.dismiss(False)
423
+
424
+
395
425
  # ── App ──────────────────────────────────────────────────────────────
396
- class StartApp(App[None]):
426
+ class StartApp(App[str | None]):
397
427
  """Live session view — tails the active session's events."""
398
428
 
399
429
  TITLE = "methodproof — mp start"
400
430
  CSS = _CSS
401
431
  BINDINGS = [
402
- Binding("q", "stop_session", "stop"),
432
+ Binding("q", "exit_tui", "exit"),
433
+ Binding("x", "end_session", "end session"),
403
434
  Binding("p", "pause", "pause"),
404
435
  Binding("j", "toggle_journal", "journal"),
405
436
  Binding("f", "cycle_filter", "filter"),
@@ -438,6 +469,10 @@ class StartApp(App[None]):
438
469
  self._last_event_ts: float = 0.0
439
470
  self._recent_files: list[str] = []
440
471
  self._recent_tools: list[str] = []
472
+ # Source tracking: which AI tool session is active
473
+ self._active_source: str = "" # e.g. "claude", "codex", "gemini"
474
+ self._source_session_id: str = "" # short id of the AI session
475
+ self._source_count: int = 0 # how many AI sessions so far
441
476
 
442
477
  def compose(self) -> ComposeResult:
443
478
  yield Header(show_clock=False)
@@ -518,10 +553,13 @@ class StartApp(App[None]):
518
553
  badge_str = f" {badge_str}"
519
554
 
520
555
  ev = f" {self._event_count} ev" if self._event_count else ""
556
+ src = ""
557
+ if self._active_source:
558
+ src = f" · [{P.purple_muted}]{self._active_source} #{self._source_count}[/{P.purple_muted}]"
521
559
  self.query_one("#session-bar", Static).update(
522
560
  f" session: [{P.gold}]{sid}[/{P.gold}] · {watch_dir}"
523
561
  f" · [{P.green}]●[/{P.green}] {h:02d}:{m:02d}:{s:02d}"
524
- f"{ev}{badge_str} · [{P.purple}]{self._account_type}[/{P.purple}]"
562
+ f"{ev}{src}{badge_str} · [{P.purple}]{self._account_type}[/{P.purple}]"
525
563
  )
526
564
 
527
565
  # ── Event poll: Layers B + E + A ─────────────────────────────
@@ -544,6 +582,17 @@ class StartApp(App[None]):
544
582
  self._last_event = ev
545
583
  ev_ts = ev.get("ts", time.time())
546
584
 
585
+ # Source tracking: detect AI session boundaries
586
+ if etype.endswith("_session_start"):
587
+ self._active_source = etype.replace("_session_start", "")
588
+ ev_meta_src = ev.get("metadata") or {}
589
+ sid_field = ev_meta_src.get("session_id") or ev_meta_src.get("claude_session_id", "")
590
+ self._source_session_id = str(sid_field)[:8]
591
+ self._source_count += 1
592
+ elif etype.endswith("_session_end"):
593
+ self._active_source = ""
594
+ self._source_session_id = ""
595
+
547
596
  # Quiet mode: skip dim events
548
597
  if self._quiet_mode and etype in _DIM_TYPES:
549
598
  self._stats[etype] = self._stats.get(etype, 0) + 1
@@ -572,7 +621,7 @@ class StartApp(App[None]):
572
621
  self._recent_files.append(path)
573
622
  if len(self._recent_files) > 10:
574
623
  self._recent_files.pop(0)
575
- tool = ev_meta.get("tool_name")
624
+ tool = ev_meta.get("tool_name") or ev_meta.get("tool")
576
625
  if tool and etype in ("tool_call", "tool_result"):
577
626
  if tool not in self._recent_tools:
578
627
  self._recent_tools.append(tool)
@@ -585,16 +634,20 @@ class StartApp(App[None]):
585
634
  self._event_count += 1
586
635
  continue
587
636
 
637
+ # Source tag
638
+ src_tag = ""
639
+ if self._active_source:
640
+ src_tag = f"[{P.purple_muted}]{self._active_source}[/{P.purple_muted}] "
641
+
588
642
  # Search highlight
589
643
  line_plain = f"{etype} {meta}"
590
644
  if self._search_query and self._search_query.lower() not in line_plain.lower():
591
- # Still render but dimmed
592
645
  feed.write(f"[{P.dim}]{ts} {prefix}{etype:<18} {meta}[/{P.dim}]")
593
646
  else:
594
- # Layer B + E: structural line with tree prefix
595
647
  feed.write(
596
648
  f"[{P.dim}]{ts}[/{P.dim}] "
597
- f"[{P.gold_ember}]{prefix}[/{P.gold_ember}]"
649
+ f"{src_tag}"
650
+ f"[{P.gold_aged}]{prefix}[/{P.gold_aged}]"
598
651
  f"[{color}]{etype:<18}[/{color}] "
599
652
  f"[{P.dim}]{meta}[/{P.dim}]"
600
653
  )
@@ -602,7 +655,7 @@ class StartApp(App[None]):
602
655
  # Layer A: journal content enrichment
603
656
  for jline in _journal_lines(ev, self._journal_mode):
604
657
  feed.write(
605
- f" [{P.gold_ember}]│[/{P.gold_ember}] "
658
+ f" [{P.gold_aged}]│[/{P.gold_aged}] "
606
659
  f"[{P.dim}]{jline}[/{P.dim}]"
607
660
  )
608
661
 
@@ -655,9 +708,19 @@ class StartApp(App[None]):
655
708
  self.set_timer(4.0, lambda: alert.remove_class("visible"))
656
709
 
657
710
  # ── Actions ──────────────────────────────────────────────────
658
- def action_stop_session(self) -> None:
711
+ def action_exit_tui(self) -> None:
712
+ """Detach TUI — daemon keeps recording."""
659
713
  self.exit(None)
660
714
 
715
+ def action_end_session(self) -> None:
716
+ """End the session (with confirmation)."""
717
+ self.push_screen(_ConfirmEndScreen(), self._on_confirm_end)
718
+
719
+ def _on_confirm_end(self, confirmed: bool) -> None:
720
+ if not confirmed:
721
+ return
722
+ self.exit("end_session")
723
+
661
724
  def action_pause(self) -> None:
662
725
  self._paused = not self._paused
663
726
 
@@ -743,6 +806,7 @@ class StartApp(App[None]):
743
806
  self._tick_timer()
744
807
 
745
808
 
746
- def run(session_id: str, session: dict) -> None:
747
- """Launch the live session view for the given session."""
748
- StartApp(session_id, session).run()
809
+ def run(session_id: str, session: dict) -> str | None:
810
+ """Launch the live session view. Returns 'end_session' if user chose to end."""
811
+ app = StartApp(session_id, session)
812
+ return app.run()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "methodproof"
3
- version = "0.7.35"
3
+ version = "0.7.36"
4
4
  description = "See how you code. Capture and visualize your engineering process."
5
5
  requires-python = ">=3.11"
6
6
  dependencies = ["watchdog>=4.0", "websocket-client>=1.7", "cryptography>=43.0", "keyring>=25.0", "textual>=0.59", "rich>=13.7"]
@@ -38,14 +38,17 @@ def test_start_auth_fails(mock_auth, mock_hook, cli_args):
38
38
 
39
39
  @patch("methodproof.cli._is_daemon_alive", return_value=True)
40
40
  @patch("methodproof.hook.is_installed", return_value=True)
41
- def test_start_session_already_active(mock_hook, mock_alive, logged_in_cfg, cli_args, make_session):
41
+ def test_start_session_already_active(mock_hook, mock_alive, logged_in_cfg, cli_args, make_session, capsys):
42
42
  logged_in_cfg()
43
43
  sid, _ = make_session()
44
44
  cfg = config.load()
45
45
  cfg["active_session"] = sid
46
46
  config.save(cfg)
47
- with pytest.raises(SystemExit):
47
+ with patch("methodproof.cli.cmd_connect") as mock_connect:
48
48
  cli.cmd_start(cli_args())
49
+ mock_connect.assert_called_once()
50
+ out = capsys.readouterr().out
51
+ assert "already active" in out
49
52
 
50
53
 
51
54
  @patch("methodproof.cli._is_daemon_alive", return_value=False)
File without changes
File without changes
File without changes
File without changes