scripts/paths.py
scripts/paths.pyBrowse 56 files
523 tokens
2,151 bytes
Token encoding: o200k_base
Snapshot 24fd22b
← Back to SKILL.md
1"""Filesystem paths for the unbroker skill (stdlib only).2 3All per-subject data lives under PDD_DATA_DIR (default: $HERMES_HOME/unbroker),4which is the same trust boundary Hermes uses for .env and OAuth tokens.5"""6from __future__ import annotations7 8import os9from pathlib import Path10 11 12def hermes_home() -> Path:13 return Path(os.environ.get("HERMES_HOME") or (Path.home() / ".hermes"))14 15 16def data_dir() -> Path:17 override = os.environ.get("PDD_DATA_DIR")18 return Path(override) if override else hermes_home() / "unbroker"19 20 21def config_path() -> Path:22 return data_dir() / "config.json"23 24 25def subjects_dir() -> Path:26 return data_dir() / "subjects"27 28 29def subject_dir(subject_id: str) -> Path:30 return subjects_dir() / subject_id31 32 33def dossier_path(subject_id: str) -> Path:34 return subject_dir(subject_id) / "dossier.json"35 36 37def ledger_path(subject_id: str) -> Path:38 return subject_dir(subject_id) / "ledger.json"39 40 41def audit_path(subject_id: str) -> Path:42 return subject_dir(subject_id) / "audit.jsonl"43 44 45def evidence_dir(subject_id: str) -> Path:46 return subject_dir(subject_id) / "evidence"47 48 49def skill_root() -> Path:50 """The skill directory (parent of scripts/)."""51 return Path(__file__).resolve().parent.parent52 53 54def brokers_dir() -> Path:55 return skill_root() / "references" / "brokers"56 57 58def brokers_cache_path() -> Path:59 """Live broker snapshot pulled from BADBOOL (merged under the curated DB)."""60 return data_dir() / "brokers-cache" / "badbool.json"61 62 63def registry_cache_path() -> Path:64 """CA Data Broker Registry snapshot (separate coverage lane; DROP/email, not scanned)."""65 return data_dir() / "brokers-cache" / "ca-registry.json"66 67 68def age_identity_path() -> Path:69 """age identity (private key) used for at-rest encryption when enabled.70 71 Defaults beside the data; point PDD_AGE_IDENTITY at a separate volume/token72 for real key separation from the encrypted data.73 """74 override = os.environ.get("PDD_AGE_IDENTITY")75 return Path(override) if override else data_dir() / "age-identity.txt"76 77 78def templates_dir() -> Path:79 return skill_root() / "templates"80