Replace vendor/cultcache-py submodule with published PyPI dependency
CultLib's packages/cultcache-py is now published as cultcache-py==0.2.0 on PyPI (MIT), so the standalone GameCult/cultcache-py fork that Ghostlight vendored as a submodule is retired. Symbol-for-symbol and on-disk-format verification against the pinned submodule commit 9b4bbb8 found no incompatibility: every symbol tools/ghostlight_state_store.py imports (CultCache, JsonLinesBackingStore, define_document_type) and every method it calls kept its signature, and JsonLinesBackingStore's on-disk JSONL envelope fields and sort order are unchanged, confirmed by a real round-trip against Ghostlight's production state/ghostlight-state.cultcache.jsonl. tools/ghostlight_state_store.py no longer pushes vendor/cultcache-py/src onto sys.path; it imports cultcache_py directly. Since Ghostlight's session bootstrap previously depended on the submodule needing no install step, tools/requirements.txt now pins cultcache-py==0.2.0 and npm run state:bootstrap (pip install -r tools/requirements.txt, idempotent) runs as a pre-hook ahead of state:status and state:prepare-compaction; AGENTS.md's Session Bootstrap protocol and Useful Commands section call it out explicitly for the direct ghostlight_state.py CLI invocations that don't go through npm. Verified for real: `python tools/ghostlight_state.py status` and `python tools/ghostlight_prepare_compaction.py`, run from a venv with cultcache-py installed from PyPI, against Ghostlight's actual production state file (22 ok findings, 2 pre-existing unrelated warnings, exit 0 both times). Idunn's deployment/idunn/recipe.toml never declared vendor/cultcache-py in required_gitlinks (only vendor/eve) and its build/test/service steps never touch Python state tooling, so no recipe change is needed for admission. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
9574bf53d7
commit
22937b71f0
8 changed files with 35 additions and 17 deletions
|
|
@ -2,24 +2,28 @@ from __future__ import annotations
|
|||
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from cultcache_py import CultCache, JsonLinesBackingStore, define_document_type
|
||||
except ModuleNotFoundError as error:
|
||||
if error.name != "cultcache_py":
|
||||
raise
|
||||
raise SystemExit(
|
||||
"Ghostlight state tooling needs cultcache-py. Install it with "
|
||||
"`npm run state:bootstrap`, or with this interpreter directly: "
|
||||
"`python -m pip install -r tools/requirements.txt`."
|
||||
) from error
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
STATE_DIR = ROOT / "state"
|
||||
VENDOR_SRC = ROOT / "vendor" / "cultcache-py" / "src"
|
||||
CACHE_PATH = STATE_DIR / "ghostlight-state.cultcache.jsonl"
|
||||
BRANCHES_PATH = STATE_DIR / "branches.json"
|
||||
EVIDENCE_PATH = STATE_DIR / "evidence.jsonl"
|
||||
ARCHIVE_PATH = STATE_DIR / "evidence.archive.jsonl"
|
||||
|
||||
if str(VENDOR_SRC) not in sys.path:
|
||||
sys.path.insert(0, str(VENDOR_SRC))
|
||||
|
||||
from cultcache_py import CultCache, JsonLinesBackingStore, define_document_type
|
||||
|
||||
|
||||
BRANCHES_DOC = define_document_type(
|
||||
"ghostlight.branches.v0",
|
||||
|
|
|
|||
1
tools/requirements.txt
Normal file
1
tools/requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
cultcache-py==0.2.0
|
||||
Loading…
Reference in a new issue