Files
computer-playbook/cli/meta/cache/__main__.py
T
kevinveenbirkenbachandClaude Opus 5 0d2fadce0c feat(cache): serve every checkout's own cache declarations
A checkout that declared a new cache host rendered the artefacts and reached nothing: the Nexus proxy repository, the frontend's leaf certificate and the nginx upstream map all live in the running stack, which only the owning checkout set up. cache-apply installs all three and reloads the frontend, and compose up runs it for a checkout that merely joins the network, so the manual call is left for a declaration changed between two bring-ups.

The map source is no longer selectable. INFINITO_CACHE_CONF_SOURCE existed to let a worktree read the primary checkout's map instead of its own, but the frontend mounts one map and the install replaces it, so the checkout that applied last wins either way: the knob chose which file to point at, never who prevailed. Dropping it also retires the git subprocess that resolved the owning checkout on every env build.

Two checkouts sharing a stack therefore overwrite each other's map, which the documentation now states instead of implying a selector could prevent it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-03 21:40:34 +02:00

38 lines
922 B
Python

"""CLI entry: `python -m cli.meta.cache` (run by `make dotenv`)."""
from __future__ import annotations
import os
import sys
from pathlib import Path
from utils.cache.render import render_artifacts
from utils.env.handlers.infinito.cache.conf import KEY, RELATIVE
from . import PROJECT_ROOT as REPO_ROOT
def _conf_path() -> Path:
"""Return where the frontend's upstream map belongs.
`.env` carries it once `make dotenv` has run; before that, fall back to
the same checkout the handler would have chosen.
"""
configured = os.environ.get(KEY, "").strip()
if configured:
return Path(configured)
return REPO_ROOT / RELATIVE
def main() -> int:
written = render_artifacts(REPO_ROOT, _conf_path())
print(
f"Rendered {len(written)} cache file(s) from the cache: declarations",
file=sys.stderr,
)
return 0
if __name__ == "__main__":
sys.exit(main())