Commit Graph

47 Commits

Author SHA1 Message Date
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
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 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
jaxperro 16d8deb878 docs: tape-era findings + research silo across FINDINGS/HANDOFF/README
FINDINGS: 'The tape era opens' section (sharp screen 742/742 proxy
validation, Study A identity-null, Study B winner's curse, crater refill
clock) + scorecard rows for the two forward-window studies + research/ in
repo layout. HANDOFF: #16/#17 in the open queue, research silo + nightly
launchd in snapshot/ops. README: research/ directory row.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 18:39:19 -04:00
jaxperro 377192c4bf copybot: per-niche FAK re-quote waits from measured crater-refill times
The flat 10s retry was calibrated to nothing; the tape now says craters
refill at very different speeds (research requote_timing, 775k crater
prints): crypto 94% within 4s, esports 83% within 10s, sports only 70% at
10s but 76% by 25s, geo/politics tails run minutes (price guard is the
protection there, not the retry). Waits move to FAK_RETRY_NICHE_DEFAULT
{crypto 4, esports 10, sports/geo/politics/other 25}, classified by the
validated research niche patterns (esports before sports so 'LoL: A vs B'
doesn't fall through on ' vs '). cfg fak_retry_niche_s overrides per key;
fak_retry_s stays the fallback (tennis: no measurement yet) and 0 still
disables the feature. Paper-parity: same map both bots. test t8 covers the
map, first-match classing, fallback, and config override.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 17:45:32 -04:00
jaxperro 01687f4a44 copybot: one-shot 10s re-quote retry for FAK no-match OPENs
'no orders found to match with FAK order' is the #1 miss class (13 of the
last 48h's misses) — the copy lands in the crater the sharp just swept,
before makers requote. Instead of recording the miss at the first
rejection, hand the OPEN to Copybot.fak_requote_retry: sleep fak_retry_s
(default 10, 0 disables) OUTSIDE the bot lock, then re-run the whole gated
buy path (fresh quote, price guard, depth gate) exactly once, mirroring
the webhook call site's fill drain so a retry fill books lag + bet rows.
A second rejection records the miss tagged 'twice (re-quote retry)'.
Paper-parity: the hook is installed in both modes, and PaperExecutor's
FAK model re-decides on the fresh book. tests/test_fak_retry.py covers
hook scheduling, no-double-count sizing (their_size=0 re-entry), ADD and
non-FAK bypasses, and the end-to-end retry thread.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 14:52:16 -04:00
jaxperro 4d37008462 handoff: 2026-07-19 issue burndown — 10 closed, #4 reopened (redeem builder-key), snapshot current 2026-07-19 17:08:26 -04:00
jaxperro 595a63dc5b handoff: webhook rotation done (#3) 2026-07-19 16:38:26 -04:00
jaxperro 58374e36ca docs: README diagram/table + HANDOFF snapshot — full firehose, dual-socket capture, download-gated retention, 25GB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 16:08:28 -04:00
jaxperro 6fe5133a8a handoff → GitHub Issues: queue migrated (14 seed issues, labels, milestones); narrative frozen in HANDOFF_ARCHIVE; living doc slimmed to boundary+snapshot+ops
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 15:21:00 -04:00
jaxperro 9a894ea9a0 valuebot post-mortem: killed on criterion — 1W/993L (0.075x), sub-2¢ edge refuted in the current era; app destroyed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 14:16:07 -04:00
jaxperro baa4182343 audit hardening: book fully serialized, chain-gated sweep, boot-id single-writer guard, TLS on user-ws, atomic valuebot state, hot-path throttle, newest-kept seen_tx, daily lock, ingest txn, AIcAIc pin
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 14:07:43 -04:00
jaxperro cdaf9a048d docs: rev 15 — tape pipeline, valuebot v0.1 barbell, bench rev 5, reconcile day; recorder row in README
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 13:51:02 -04:00
jaxperro 2785d1ea13 retire the depth gate's spread skip — lag-era relic blocking informed in-play copies (12W/5L would-be); stake cap + dust skip stay
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 12:33:57 -04:00
jaxperro fb68660bab handoff: correct the rebase record — deposit in bankroll only, invariant documented
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 21:55:28 -04:00
jaxperro e6e13dc64d live mirrors paper exactly (user directive): max_price 0.99, floors synced, dead follow block removed; docs sweep + gotcha 15 corollary
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 21:41:24 -04:00
jaxperro f021e1fe5e edge.py: the bankroll-decision number — parity-era edge vs measured fee hurdle, daily row + digest footer
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 18:49:48 -04:00
jaxperro 43d26b4704 follow set rev 4: AIcAIc re-added (EWC catalyst, +22% forward since drop); bench Vahan88/EdwardIN not promoted
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 17:22:55 -04:00
jaxperro 646139dfa3 paper FAK parity: no ask inside the protected band -> honest miss, not a pretend fill
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 23:48:58 -04:00
jaxperro 50fc76781a chain seed: the code for 5e97b13 — fills_from_tx + hint_txs funnel (autostash dropped it from the prior commit)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 00:10:03 -04:00
jaxperro 00d53f84ad HANDOFF rev 11: RTDS-seed lag fix, tick-conform prices, floor_pin audit, operating boundary
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 17:12:26 -04:00
jaxperro a0baeaf37a HANDOFF rev 10: depth gate, guard validated, clob_user own-fill push
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 23:30:11 -04:00
jaxperro c94588a588 HANDOFF rev 9: RTDS both books, oversell+H3 fixed, clone-guard verified
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:07:13 -04:00
jaxperro 3784b288cd hardening trio: exit-retry (1.6), RTDS shadow ledger, boot clone-guard
- failed mirror-exits queue for up to 10 heartbeat retries (recovered
  exits ping Discord; exhaustion pages ⚠ EXIT STUCK and the position
  rides knowingly; in-play holds hand to the pending registry). 3 stub
  paths pass incl. the 1.6 spec's fail-fail-fill.
- every RTDS Set E detection appends a durable shadow-ledger row
  (lat_s + which trigger won) that rides the publish commit — the 24h
  go/no-go data for flipping RTDS on the live app.
- start.sh verifies the boot clone's HEAD against the GitHub API and
  re-clones stale replicas (bit twice today).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:43:22 -04:00
jaxperro 0143275c01 HANDOFF rev 8: RTDS T0 shadow run live on paper
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:28:04 -04:00
jaxperro 9d9a43269a HANDOFF rev 7: paper-parity retune live (caps off, 4%, abs guard, pending registry)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 17:20:54 -04:00
jaxperro a938febdc1 docs: HANDOFF rev 6 + gotcha 17 (delayed-fill incident, disarm state)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:25:52 -04:00
jaxperro b82e6d1b12 HANDOFF rev 5.1: live app on push mode (own webhook, watchdog wired)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 01:47:03 -04:00
jaxperro ca6661cb94 docs+cleanup: HANDOFF rev 5 (placement proven), gotcha 16, key self-revoke
Critical path closed: bridge conversion ($24.73→pUSD, fee-free), executor
ported and round-trip proven ($5 FAK both legs), armed bot restarted clean.
README gains gotcha 16 (pUSD stack: paused native-USDC onramp, bridge is
the sanctioned conversion, builder-key revocation semantics) + bridge/
relayer data-source rows. Probe & wrap scripts atexit-revoke their builder
keys (9 inert ones accumulated during bring-up).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 01:19:57 -04:00
jaxperro 3a82c81484 HANDOFF rev 4: full rewrite for session handoff — critical path is the wrap + executor port
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 20:50:32 -04:00
jaxperro c8fdcf44a3 HANDOFF: live placement — wrap step is the sole remaining gap; funds safe; ts-sdk read next
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 20:44:54 -04:00
jaxperro 0f670d44d0 HANDOFF: live placement root-caused — archived client + wallet architecture; deposit wallet deployed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 20:23:17 -04:00
jaxperro 75a93954ec HANDOFF: worker ARMED/LIVE at $24.73; venue fork resolved (.com funded)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 13:56:02 -04:00
jaxperro 1b616dc733 HANDOFF: morning forensics — paper drift residual −11.32 after truth restore
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 13:53:52 -04:00
jaxperro 1863eb3186 HANDOFF: venue fork — $32 landed on polymarket.us; live worker parked unarmed pending decision
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 23:48:26 -04:00
jaxperro aa4af0e9ec HANDOFF: wwf-copybot-live built, unarmed — Phase 2 funding is the gate
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 23:23:51 -04:00
jaxperro c948f0f413 ETHERSCAN_MIGRATION.md: phased plan for true resolution time through the stack
Chain-sweep backfill (784k conds ≈ ~1k calls, not 8 days of per-cond
queries) → shadow audit → consumer flips shallowest-to-deepest →
trust.py simplification last. Ground rules codify the 2026-07-08
alignment-audit discipline: overlay never rewrite, one flip per day,
never coupled with follow-set changes, calibration continuity notes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 18:28:28 -04:00
jaxperro 05d8f1b4e3 HANDOFF: 0xbadaf319 exposed as two-sided arb flow — top of demotion watch list
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 18:14:10 -04:00
jaxperro 43de3845a7 payouts: exact on-chain resolution timestamps via Etherscan V2 (resolution_time)
CTF ConditionResolution logs, full-range topic query (Alchemy free tier
caps getLogs at 10 blocks), cached forever in resolution_times. Verified:
Brewers Jul-7 market truly resolved 2026-07-08 04:51 — the cached
endDate-metadata res_t was 29h wrong; Kruto's sell provably 365 min
pre-resolution. Key = etherscan_key (gitignored config). Migration of
trust/validate/portfolio onto true res_t queued in HANDOFF.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 18:05:21 -04:00
jaxperro 3f4e01ec45 docs: watchdog + caffeinate + engine relocation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 17:44:56 -04:00
jaxperro 63eda48aa7 HANDOFF: Alchemy key rotated — no standing to-dos remain
Old app (leaked key ...OdWgOi) deleted, new app wwf-rpc-2026-07
(...w0BxV5) wired into config.json + ALCHEMY_RPC_URL secret. Old key
verified dead (401), new key live, bot copying, Notify webhook intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 17:27:34 -04:00
jaxperro 997d78a34b HANDOFF: Railway deleted — Alchemy key rotation is the last standing to-do
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 17:10:18 -04:00
jaxperro d45255c48e cleanup + calibration tracker
- Railway project magnificent-kindness DELETED (soft-delete, purges
  2026-07-10) — retired-infra fully gone; requirements.txt loses its
  Railway-detection rationale (stdlib core, optional extras noted).
- tests/test_check_book.py: the Option A orphan-fix regression harness
  moves into the repo (was session-local); 6 cases, no network/config.
- daily.sh: calibration step — one row/day of live-book vs backtest
  equity to live/history/calibration.csv, the series that sizes real
  money (day-zero row seeded: live $1,000 vs model $22,027).
- config.json.bak (untracked, stale copy of the leaked Alchemy key)
  deleted locally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 17:09:46 -04:00
jaxperro a690323f68 docs: 2026-07-08 full-day sync — alignment audit, Set E, refund harvesters, calibration reset
README: Set E + fresh-book framing in 'system today', /live page in the
dashboard row, --bank in the ops table, book-reset procedure row, gotchas
12-15 (three cache cursors, res_t is endDate metadata / price is the sold
discriminator / redeemable is resolution truth, refund-harvester
archetype, single-writer state-surgery rule). FINDINGS: three new
sections — aligning the three books (7/9 cross-check, honest 29.1k->17.4k,
Set E selection), the refund harvesters, the calibration experiment
(in-sample warning + bank-size ceiling effect). HANDOFF rev 3: fresh
pickup with watch-list, rejected-with-evidence list, Phase 2 framing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 17:02:33 -04:00
jaxperro bc81b93575 HANDOFF: Set E deployed (7 wallets, aligned-replay selection)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 12:20:49 -04:00
jaxperro 87dba1a1f8 HANDOFF.md: Phase 1 complete — orphan seam closed (Option A), 1.3 + 1.8 done; next is Phase 2 funding (user)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 22:59:37 -04:00
jaxperro 31c9931e57 HANDOFF.md: session pickup — orphan/ledger proper fix + Phase 1 remaining (1.3, 1.8)
Self-contained handoff for a fresh session: current state (Set D live, honest
P&L, ledger reconciled), the orphan/cash-debit root-cause with the proper fix
(Option A surgical: record every drained buy fill + invariant assert; Option B
architectural: derive cash from the book), Phase 1 status (6/8 done; 1.3 worker
deps + 1.8 live-money dashboard remain), and standing to-dos (rotate Alchemy
key, delete Railway).

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