Rename Paths.projects and Session.projects to claude_code_transcripts #125
@@ -23,9 +23,9 @@ def locations(home):
|
|||||||
return home / ".claude.json", home / ".claude" / "cache" / "model-catalog", home / ".claude" / "projects"
|
return home / ".claude.json", home / ".claude" / "cache" / "model-catalog", home / ".claude" / "projects"
|
||||||
|
|
||||||
|
|
||||||
# <projects>/-home-me-code-log/<session id>.jsonl
|
# <claude_code_transcripts>/-home-me-code-log/<session id>.jsonl
|
||||||
def transcript_path(projects, session_id):
|
def transcript_path(claude_code_transcripts, session_id):
|
||||||
hit = glob.glob(os.path.join(glob.escape(str(projects)), "*", f"{session_id}.jsonl"))
|
hit = glob.glob(os.path.join(glob.escape(str(claude_code_transcripts)), "*", f"{session_id}.jsonl"))
|
||||||
return hit[0] if hit else ""
|
return hit[0] if hit else ""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,19 +13,19 @@ NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
|
|||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True)
|
||||||
class Session:
|
class Session:
|
||||||
id: uuid.UUID
|
id: uuid.UUID
|
||||||
|
claude_code_transcripts: pathlib.Path
|
||||||
name: str
|
name: str
|
||||||
projects: pathlib.Path
|
|
||||||
|
|
||||||
|
|
||||||
def session_for(project, paths):
|
def session_for(project, paths):
|
||||||
"""Exists while its transcript does."""
|
"""Exists while its transcript does."""
|
||||||
# "A " is the human's cue in the session picker that the session is the loop's.
|
# "A " is the human's cue in the session picker that the session is the loop's.
|
||||||
name = f"A {project} loop-claude"
|
name = f"A {project} loop-claude"
|
||||||
return Session(uuid.uuid5(NAMESPACE, name), name, paths.projects)
|
return Session(id=uuid.uuid5(NAMESPACE, name), claude_code_transcripts=paths.claude_code_transcripts, name=name)
|
||||||
|
|
||||||
|
|
||||||
def transcript_file(session):
|
def transcript_file(session):
|
||||||
return transcript_path(session.projects, session.id)
|
return transcript_path(session.claude_code_transcripts, session.id)
|
||||||
|
|
||||||
|
|
||||||
def delete_session(session):
|
def delete_session(session):
|
||||||
|
|||||||
@@ -7,21 +7,21 @@ from loop_claude.claude_code.formats import locations
|
|||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True)
|
||||||
class Paths:
|
class Paths:
|
||||||
archive: pathlib.Path
|
archive: pathlib.Path
|
||||||
|
claude_code_transcripts: pathlib.Path
|
||||||
claude_json: pathlib.Path
|
claude_json: pathlib.Path
|
||||||
code: pathlib.Path
|
code: pathlib.Path
|
||||||
model_catalog: pathlib.Path
|
model_catalog: pathlib.Path
|
||||||
models_file: pathlib.Path
|
models_file: pathlib.Path
|
||||||
projects: pathlib.Path
|
|
||||||
|
|
||||||
|
|
||||||
def paths_from(home, env):
|
def paths_from(home, env):
|
||||||
claude = home / ".claude"
|
claude = home / ".claude"
|
||||||
claude_json, model_catalog, projects = locations(home)
|
claude_json, model_catalog, claude_code_transcripts = locations(home)
|
||||||
return Paths(
|
return Paths(
|
||||||
archive=pathlib.Path(env["LOOP_CLAUDE_TRANSCRIPTS"]).expanduser() if env.get("LOOP_CLAUDE_TRANSCRIPTS") else claude / "loop-claude-transcripts",
|
archive=pathlib.Path(env["LOOP_CLAUDE_TRANSCRIPTS"]).expanduser() if env.get("LOOP_CLAUDE_TRANSCRIPTS") else claude / "loop-claude-transcripts",
|
||||||
|
claude_code_transcripts=claude_code_transcripts,
|
||||||
claude_json=claude_json,
|
claude_json=claude_json,
|
||||||
code=home / "code",
|
code=home / "code",
|
||||||
model_catalog=model_catalog,
|
model_catalog=model_catalog,
|
||||||
models_file=claude / "loop-claude-models.json",
|
models_file=claude / "loop-claude-models.json",
|
||||||
projects=projects,
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens
|
|||||||
|
|
||||||
The places the panel on `rebuild` at 7f9de5c named (`docs/decisions.md`), capping dimension first:
|
The places the panel on `rebuild` at 7f9de5c named (`docs/decisions.md`), capping dimension first:
|
||||||
|
|
||||||
- **Give `project` one meaning: rename `Paths.projects` and `Session.projects` for Claude Code's transcript directory.** Two seats: it also names the package, the key and `~/.claude.json`'s object.
|
|
||||||
- **Name `human.py` for the exit-2 stops it holds.** One seat looked there for the prompts, which live in `models.py` and `interrupt.py`.
|
- **Name `human.py` for the exit-2 stops it holds.** One seat looked there for the prompts, which live in `models.py` and `interrupt.py`.
|
||||||
- **Score `rebuild` with the four-seat panel at 7.0 or above on every dimension and the overall, none below the last run, and open its PR into main for the human.** ⚠️ Leave that PR ready and unmerged: only the human merges it, after approving the whole rebuild. A dimension under the floor gets its places filed above this item.
|
- **Score `rebuild` with the four-seat panel at 7.0 or above on every dimension and the overall, none below the last run, and open its PR into main for the human.** ⚠️ Leave that PR ready and unmerged: only the human merges it, after approving the whole rebuild. A dimension under the floor gets its places filed above this item.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user