Bill a turn to the node that asked, not the node that generated

Every turn runs on the AI owner now, so the ledger's per-host column had
collapsed to a single name and the fleet breakdown said nothing. The asking
node travels with the request and is validated before it is written, which
also retires ai_token_sync.sh — a partner ledger is empty by construction.
This commit is contained in:
Gmer4Lfe
2026-08-20 20:04:08 -04:00
parent 0621f66889
commit 111c70d6b4
4 changed files with 46 additions and 15 deletions
+7 -7
View File
@@ -471,7 +471,6 @@
# to 1 day). 30min was true "always fresh" but had no consumer that needed it that often.
"Arrs_Stack/arr_cache_prefill.sh ARR_PREFILL_WAIT_MINUTES=1" # keep the shared arr tracked-data cache fresh
"Arrs_Stack/arrs_failed_stalled_recovery.sh" # blocklist + re-search failed/stalled arr queue items
"AI/ai_token_sync.sh" # pull partner AI token ledgers into the tmpfs cache
)
# arr_sync.sh runs as a fixed first step in intermediate_sync_maintenance.sh — not listed here.
# It is controlled by ARR_SYNC_ENABLED (see Arr Sync section above).
@@ -1966,12 +1965,13 @@
AI_TOKEN_DB="${AI_DATA_DIR}/ai_token_history.db"
AI_TOKEN_RETAIN_ROWS=20000 # oldest rows dropped past this — years of ordinary use
# AI/ai_token_sync.sh pulls each partner's ledger into the tmpfs cache the tab reads, so the
# fleet total is a fleet total. Same trick conf_sync.sh uses for partner confs, minus the push:
# nothing here is needed by anyone else, so the reader fetches its own data and controls its
# own freshness. An unreachable partner is a quiet skip, not a warning — a partner is expected
# to be down for long stretches, and a four-hourly warn trains you to ignore the script.
AI_TOKEN_SYNC_ENABLED=true
# AI/ai_token_sync.sh pulled each partner's ledger into a tmpfs cache so the fleet total was a
# fleet total. The mesh shares one AI now: every turn generates on the owner and is recorded
# there against the node that asked, so the owner's own ledger already holds the whole fleet and
# a partner ledger is empty by construction. Left off the schedule rather than deleted — the
# reader still merges any cache from before the change, which describes real turns.
AI_TOKEN_SYNC_ENABLED=false
# ━━━ AI Feature Toggles ━━━
# Tier 1 is narration — it cannot change a decision. Tier 2 adds context to a decision a script