piker/ai/prompt-io/claude/20260610T170859Z_75cefe10_p...

1.7 KiB
Raw Blame History

NOTE: diff-ref mode entry (code committed in the same commit as this log); backfilled from the live dev session transcript per the /prompt-io skill rules.

git log -1 -p --follow -- piker/config.py

Generated: config._maybe_use_test_dir() — lazily reads piker_test_dir from tractor.runtime._state._runtime_vars['piker_vars'] (pre-loaded by open_piker_runtime() from the tests.conftest._open_test_pikerd() overrides) and calls _override_config_dir() when set. Hooked at the top of get_conf_dir(); get_conf_path() and load()s dir-creation rerouted through get_conf_dir().

git log -1 -p --follow -- piker/accounting/_ledger.py git log -1 -p --follow -- piker/accounting/_pos.py

Generated: ledger/account dir derivation switched from the config._config_dir module global to config.get_conf_dir() + mkdir(parents=True, exist_ok=True) for nested tmp-dir creation.

Key diagnostic reasoning (verbatim from session):

The old (commented-out) get_app_dir() override gated on 'pytest' in sys.modules which can NEVER work in spawned subactors (fresh procs, no pytest import); as a result test paperboi/daemon actors were writing into the users REAL ~/.config/piker/accounting/ files. Evidence: account.kraken.paper.toml gained a single 0.001 xbtusdt clear stamped 2026-06-09T18:47Z (a test fill), and trades_kraken_paper.toml (252B) contained only that fill. The resolution must be checked lazily at config-path access time (NOT import time) since sub-actors only receive runtime-vars once their tractor runtime has fully booted.