#!/usr/bin/env bash
set -euo pipefail
# Use an empty directory. Both app servers must read this same finished sample.
# Provider authentication comes from the existing OpenCode configuration.
: "${USAGE_PROOF_DATA:?Set USAGE_PROOF_DATA to an empty isolated data directory}"
export XDG_DATA_HOME="$USAGE_PROOF_DATA"
opencode run --standalone -m anthropic/claude-haiku-5-5 --format json 'Reply with exactly: Usage proof ready. Do not use any tools.'
opencode run --standalone -m anthropic/claude-haiku-5-5 --format json 'Write a numbered list of 200 short sentences about common household objects. Each sentence must contain at least 12 words. Do not use tools.'
# On each fresh T3 server, upsert an enabled OpenCode instance using
# server.updateSettings, providerInstanceMutation.operation = upsert.
# Set usageAccess = allowed and environment.OPENCODE_DATA_DIR to
# $USAGE_PROOF_DATA/opencode. Deny usage access for unrelated default instances.
# Open /usage, choose Cost and 30 days, collapse the sidebar, and hard reload
# before loading usage-proof-driver.js (so the 7-day result is not cached).
# Start a browser recording; await runUsageProof(); capture pending state;
# call releaseUsageProof(); observe the 7-day chart; stop recording.
