Problem
Python-based Base commands can crash with a Python traceback during context creation when the Base cache/log root is not writable.
Evidence:
lib/python/base_cli/app.py:146-162 creates logs, cache, and tmp directories before configuring the logger.
lib/python/base_cli/app.py:188-200 catches Click exceptions, but not OSError from context creation.
Reproduction:
tmpdir=/private/tmp/base-unwritable-cache-review
mkdir -p "$tmpdir"
chmod 500 "$tmpdir"
BASE_CACHE_DIR="$tmpdir" basectl workspace status --workspace /tmp --format json
chmod 700 "$tmpdir"
Observed behavior:
- The command exits with a Python traceback ending in
PermissionError: [Errno 13] Permission denied.
- The failure happens before command-specific handling can explain the cache root or suggest
BASE_CACHE_DIR.
This can happen outside tests if a cache directory is root-owned, stale from a previous install path, on a locked-down workstation, or pointed at an unwritable location.
Desired outcome
Base should fail with a concise diagnostic when its runtime cache/log directories cannot be created.
Acceptance criteria
- Context creation catches cache/log/temp directory
OSError failures and returns a user-facing error without traceback.
- The message names the failing path and mentions
BASE_CACHE_DIR when the default cache root is unusable.
- Dry-run and explicit
--log-file behavior continue to respect their no-default-cache-write contract.
- Tests cover an unwritable
BASE_CACHE_DIR or equivalent injected cache root.
Problem
Python-based Base commands can crash with a Python traceback during context creation when the Base cache/log root is not writable.
Evidence:
lib/python/base_cli/app.py:146-162createslogs,cache, andtmpdirectories before configuring the logger.lib/python/base_cli/app.py:188-200catches Click exceptions, but notOSErrorfrom context creation.Reproduction:
Observed behavior:
PermissionError: [Errno 13] Permission denied.BASE_CACHE_DIR.This can happen outside tests if a cache directory is root-owned, stale from a previous install path, on a locked-down workstation, or pointed at an unwritable location.
Desired outcome
Base should fail with a concise diagnostic when its runtime cache/log directories cannot be created.
Acceptance criteria
OSErrorfailures and returns a user-facing error without traceback.BASE_CACHE_DIRwhen the default cache root is unusable.--log-filebehavior continue to respect their no-default-cache-write contract.BASE_CACHE_DIRor equivalent injected cache root.