kin: KIN-129-debugger

This commit is contained in:
Gros Frumos 2026-03-18 22:28:16 +02:00
parent f1c868e335
commit b39b3d8c6b
2 changed files with 8 additions and 1 deletions

View file

@ -45,6 +45,12 @@ def _build_claude_env() -> dict:
Also resolves ~/.nvm/versions/node/*/bin globs that launchctl may not expand. Also resolves ~/.nvm/versions/node/*/bin globs that launchctl may not expand.
""" """
env = os.environ.copy() env = os.environ.copy()
# Propagate canonical DB path to agent subprocesses so they don't fall back
# to module-relative path (which breaks in worktrees — KIN-129).
if "KIN_DB_PATH" not in env:
env["KIN_DB_PATH"] = str(Path.home() / ".kin" / "kin.db")
existing = env.get("PATH", "").split(":") existing = env.get("PATH", "").split(":")
extra = list(_EXTRA_PATH_DIRS) extra = list(_EXTRA_PATH_DIRS)

View file

@ -3,10 +3,11 @@ Kin — SQLite database schema and connection management.
All tables from DESIGN.md section 3.5 State Management. All tables from DESIGN.md section 3.5 State Management.
""" """
import os
import sqlite3 import sqlite3
from pathlib import Path from pathlib import Path
DB_PATH = Path(__file__).parent.parent / "kin.db" DB_PATH = Path(os.environ.get("KIN_DB_PATH") or (Path.home() / ".kin" / "kin.db"))
SCHEMA = """ SCHEMA = """
-- Проекты (центральный реестр) -- Проекты (центральный реестр)