Commit Graph

2984 Commits

Author SHA1 Message Date
copybot[bot] b3bbb05ca9 copybot: live paper feed [skip ci] 2026-07-21 18:19:50 +00:00
jaxperro f4cba587cc feed: lifetime wallet_pnl, last_fill, full-history companion feed
Dashboard cards were summing the rolling 100-bet window client-side —
AIcAIc read -5.62 while lifetime (both its addresses) is -15.84/10. The
feed now publishes:
- wallet_pnl: lifetime per-NAME rollup (state + spooled archives), so
  address changes and window rotation can't skew the cards
- last_fill: stamped in _drain_fills for the bot-health strip
- <feed>_full.json: EVERY bet + EVERY miss ever (state + archives),
  written under the same change-gate, published alongside
Misses now spool to copybot_missed_archive.*.jsonl instead of silent
deletion at the 200 cap (settled rows spool first — open misses must stay
in state for the missed-settle resolver); state was at 199/200, nothing
lost. Archives join the publish set so history survives machine loss.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:19:20 -04:00
copybot[bot] 8add61be3b copybot: live paper feed [skip ci] 2026-07-21 17:36:27 +00:00
copybot[bot] 935db9a906 copybot: live paper feed [skip ci] 2026-07-21 17:35:45 +00:00
jaxperro c8118a093e research: forward ledger 2026-07-21 [skip ci] 2026-07-21 13:21:59 -04:00
jaxperro 3f696a2aca research: nightly lock uses an absolute path
First run exited 1 after a successful score: the exit trap's relative
rmdir ran from the repo root (post-cd) — wrong dir, stale lock left in
research/, every future night would have skipped itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 13:09:20 -04:00
jaxperro 8edccda58a docs: stage-0 coherence pass across README/HANDOFF/recorder/research
- README: recorder row + architecture diagram reflect fold->parquet->
  15-min mirror (and research/ joins the diagram); cheat-sheet gains a
  'sync the tape now' row
- HANDOFF: snapshot dated 2026-07-21, launchd roster (tape-sync +
  research-nightly wait behavior), #15 back in the open queue, tape ops
  line in quick-reference
- recorder/README: ops block (sync_tape + fold health, deploy gap note),
  storage economics (/mo, mirror as Stage-1 feedstock)
- research/README: nightly.sh wait-for-fresh-tape semantics
- live/tape_sharps.json: refreshed 4-day chain-validated screen (the
  smoke run had briefly left a chain-less version)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 13:07:31 -04:00
jaxperro e3e05d62d1 research: forward ledger 2026-07-21 [skip ci] 2026-07-21 13:06:26 -04:00
copybot[bot] b5166630fd copybot: live paper feed [skip ci] 2026-07-21 17:06:05 +00:00
copybot[bot] 9b17928b27 copybot: live paper feed [skip ci] 2026-07-21 17:04:37 +00:00
copybot[bot] 56cefc80f0 copybot: live paper feed [skip ci] 2026-07-21 17:04:37 +00:00
jaxperro c18de39b71 research: set-replay harness — sweep wallet-set compositions over the tape
Replays candidate sets through the engine's mirrored mechanics (stake rule
+ DD halving + their-shares ceiling + one-market-one-stake adds + all-or-
nothing cash gate + proportional sell mirror, copytrade.py cited) with the
calibrated sim fill model and tape proxy-resolution. Per-wallet conviction
floors from the paper config's pinned p80s (candidates without pins get
tape-p80, same rule). Outputs per-set×bankroll: realized/open, deployment
stats, miss families (capital/crater/band), capital-miss hypothetical P&L,
per-wallet realized, and --loo leave-one-out marginals at $1k.

Validated against the real paper book on the same window: 33 replay opens
vs 26 real (backfill bias documented — pre-tape positions' adds replay as
opens), capital misses 0 vs 0, peak deploy 62% vs the era's 74%, mean
deployed $297 vs ~$360. SEARCH TOOL ONLY per the silo README — verdicts
stay with forward_ledger.jsonl.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 12:54:35 -04:00
jaxperro 5c8ee5961b stage-0 warehouse: recorder folds its own tape to parquet; Mac mirrors every 15 min
The nightly Mac-coupled bulk ingest was the fragile link (today: Mac slept
through 08:00, the pipeline started 09:31, and the sftp bulk pull wedged in
timeout cascades holding the db lock — digest blocked behind it). Stage 0
moves the fold onto the box and reduces the Mac to an incremental mirror:

- recorder/fold.py (sidecar, capture stays PID 1): closed gz segments ->
  zstd parquet /data/parquet/<fam>/date=*/segment.parquet, row-parity
  verified, manifest-logged, THEN gz deleted. Deletion invariant STRONGER:
  raw needs a verified parquet; parquet needs a Mac ACK before the disk
  guard may prune it. duckdb capped 384MB; VM 256MB -> 1GB.
- recorder/sync_tape.py (com.jaxperro.tape-sync every 15 min + daily.sh):
  manifest-driven incremental sftp pull, per-file row verify, append into
  rtds.duckdb NATIVE tables (views-over-parquet rejected: sim's per-asset
  point queries would crawl), segment-keyed idempotence shared with the
  legacy ingest.py (kept as fallback), ack back to the box.
- recorder/bootstrap_parquet.py: pre-fold history exported to the mirror,
  parity OK (13.84M trades + 3.07M aux). live/parquet/ is now the complete
  durable layer Stage 1 (MotherDuck/ClickHouse) would consume.
- research/tape.py connect(): brief retry — the 15-min sync holds the
  write lock for seconds.

First run: backlog folded in <60s on the box, 36/36 files mirrored+
verified, rtds.duckdb 13.8M -> 18.2M trades, tape age 24h+ -> ~15-45 min.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 12:46:54 -04:00
copybot[bot] 803df06944 copybot: live paper feed [skip ci] 2026-07-21 16:22:46 +00:00
jaxperro 6892aa5b1e live: daily refresh — skilled + sharp wallets [skip ci] 2026-07-21 12:19:03 -04:00
copybot[bot] 6c43d4410e copybot: live paper feed [skip ci] 2026-07-21 15:52:46 +00:00
copybot[bot] 76c7ec96ae copybot: live paper feed [skip ci] 2026-07-21 15:52:22 +00:00
copybot[bot] cf78e95db7 copybot: live paper feed [skip ci] 2026-07-21 15:50:37 +00:00
copybot[bot] 81f46edeae copybot: live paper feed [skip ci] 2026-07-21 15:50:10 +00:00
jaxperro e909c3a050 copybot: _token_market falls back to gamma's closed=true view (#18 follow-up)
Gamma's default /markets listing HIDES closed markets — the resolved
Odyssey market returns [] without &closed=true. Closed markets are
exactly the population repair_market_meta exists for (resolved-but-stuck
positions), so the gamma-only lookup left the paper book's own Odyssey
copy (178.57sh, resolved won) and its France-WC position permanently
cond-less; both verified resolving via the closed view. The fetch edge
is factored into _gamma_markets so the variant order, caching, and
error-then-fallback paths are unit-tested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 11:49:46 -04:00
copybot[bot] 935200c901 copybot: live paper feed [skip ci] 2026-07-21 15:47:57 +00:00
copybot[bot] dba34bf026 copybot: live paper feed [skip ci] 2026-07-21 15:34:47 +00:00
copybot[bot] 7497f5e867 copybot: live paper feed [skip ci] 2026-07-21 15:34:20 +00:00
copybot[bot] 85cc84de0d copybot: live paper feed [skip ci] 2026-07-21 15:32:10 +00:00
jaxperro 41ba871629 copybot: enrich metadata-less RTDS seeds + repair cond-less books each settle pass (closes #18)
Root cause of the 07-20 CASH≠CHAIN -$1.75: some markets stream RTDS
trades with empty title/outcome/conditionId; the seed stored them
verbatim, on_wallet_activity's 'tok not in self.conds' guard made the
empty value sticky, and settle_resolved's 'if not cond' skip left the
position silently unsettleable until the venue auto-redeemed it.

Three-layer fix:
- RTDS seed: when the payload lacks conditionId/title, enrich from the
  token id via _token_market (gamma, cached) before dispatch; the copy
  still goes through on a miss.
- conds write: falsy-overwrite instead of key-presence, so a later,
  richer source repairs an empty entry.
- repair_market_meta (called at the top of every settle pass, holding
  the lock): re-resolves empty conds for my_pos AND open missed entries,
  backfills position/bet/missed records, 300s per-token lookup backoff,
  and a once-per-token alarm when a position has sat unsettleable >1h.
  A repaired token settles in the SAME pass — the Odyssey bet would have
  self-healed the moment the market resolved.

The paper book currently carries 4 empty conds and both books have
cond-less open missed entries — the repair pass fixes those on the first
cycle after deploy. tests/test_meta_repair.py covers backfill, backoff,
the single alarm, recovery, and the end-to-end repair->settle un-stick;
full suite 8/8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 11:31:38 -04:00
jaxperro 01cc9e88b5 research: nightly waits for fresh tape + absolute python
2026-07-21 first firing failed two ways: launchd's bare python3 has no
duckdb (framework python does), and 09:15 preceded the sleep-delayed daily
pipeline's tape ingest, so even a clean run would have scored a stale
tape. nightly.sh now uses the framework python and polls tape max-ts until
it is <6h old (15min polls, 8h deadline, then scores anyway and logs the
staleness).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 11:26:26 -04:00
copybot[bot] 05b17c52ad copybot: live paper feed [skip ci] 2026-07-21 14:31:00 +00:00
copybot[bot] 26e2d59b8e copybot: live paper feed [skip ci] 2026-07-21 14:20:32 +00:00
copybot[bot] 0b15441ea0 copybot: live paper feed [skip ci] 2026-07-21 14:18:21 +00:00
copybot[bot] f98861b5cd copybot: live paper feed [skip ci] 2026-07-21 14:17:54 +00:00
copybot[bot] 81abef5636 copybot: live paper feed [skip ci] 2026-07-21 10:40:28 +00:00
copybot[bot] 23e00ec485 copybot: live paper feed [skip ci] 2026-07-21 10:38:58 +00:00
copybot[bot] 6539719c41 copybot: live paper feed [skip ci] 2026-07-21 10:14:19 +00:00
copybot[bot] 5b463aba43 copybot: live paper feed [skip ci] 2026-07-21 10:13:18 +00:00
copybot[bot] fe5638c096 copybot: live paper feed [skip ci] 2026-07-21 09:36:52 +00:00
copybot[bot] 7f5289527a copybot: live paper feed [skip ci] 2026-07-21 09:36:33 +00:00
copybot[bot] 02e7456ada copybot: live paper feed [skip ci] 2026-07-21 09:36:33 +00:00
copybot[bot] 40481e62d9 copybot: live paper feed [skip ci] 2026-07-21 09:12:51 +00:00
copybot[bot] 33fdd558a6 copybot: live paper feed [skip ci] 2026-07-21 05:14:05 +00:00
copybot[bot] e83739b01c copybot: live paper feed [skip ci] 2026-07-21 05:01:12 +00:00
copybot[bot] c22f37cd4b copybot: live paper feed [skip ci] 2026-07-21 05:00:46 +00:00
copybot[bot] a33e2fe1b3 copybot: live paper feed [skip ci] 2026-07-21 02:12:52 +00:00
copybot[bot] c5527ec93a copybot: live paper feed [skip ci] 2026-07-21 01:33:42 +00:00
copybot[bot] 519720fb9d copybot: live paper feed [skip ci] 2026-07-21 01:32:12 +00:00
copybot[bot] 1a34c510b1 copybot: live paper feed [skip ci] 2026-07-21 01:06:49 +00:00
copybot[bot] 14fd64279a copybot: live paper feed [skip ci] 2026-07-21 01:05:48 +00:00
copybot[bot] aebcfa2d24 copybot: live paper feed [skip ci] 2026-07-20 23:33:52 +00:00
copybot[bot] b9faf6c3f8 copybot: live paper feed [skip ci] 2026-07-20 23:20:55 +00:00
copybot[bot] f86adc4029 copybot: live paper feed [skip ci] 2026-07-20 23:02:01 +00:00
jaxperro fb631e7ba4 live: 2026-07-20 reconcile — settle empty-cond Odyssey auto-redeem, fold $0.05 rounding (refs #18)
CASH≠CHAIN -$1.75 root-caused: the 07-16 BikesAreTheBikes copy booked with
empty title/outcome/cond, so settle_resolved could never resolve it; the
venue auto-redeemed $1.694914 on-chain (tx 0x4f303e0e…) while the book
held it open. Hand-settled exactly as settle_resolved would (won @ 1.0,
pnl +$0.68, my_pos/conds cleaned, metadata backfilled from the venue
record) and folded the +$0.050314 fill-rounding remainder as an
adjustments entry (non-trading income, zeroes CASH≠CHAIN, cash credited).
Post: cash == chain $49.324270 (3 RPCs agree), raw drift +0.0003 (0.00).
Machine stopped + heartbeats watched to cessation per the HANDOFF ops
procedure; root cause filed as #18.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 19:01:22 -04:00