unrip/src/lib
philipp 691c98a62d
All checks were successful
deploy / deploy (push) Successful in 52s
fix: prune non-successful detail tables unconditionally when rollup watermark is stale
Same pattern as the raw quotes fix (previous commit), now extended to all
detail tables: swap_demand_events, trade_decisions, execute_trade_commands,
trade_execution_results, quote_outcome_attributions. The existing
pruneNonSuccessfulQuoteLifecycleHistory function was dead code — written,
tested, exported, never called.

Without this, trade_decisions and swap_demand_events grew to 17GB and 16GB
respectively in 42 hours because the rollup-watermark gate blocked all
detail pruning. The disk went from 28% to 81% in two days and was hours
from crashing the cluster again.

Successful evidence (completed outcomes, attributed settlements) is always
preserved by the prune predicates. Only non-successful detail older than
the retention window is pruned.

Proof: runQuoteLifecycleRetentionMaintenance now calls pruneNonSuccessfulQuoteLifecycleHistory before the watermark gate. All 313 tests pass. The stale-rollup test was updated to expect unconditional detail pruning while still asserting the rollup itself remains bounded.

Assumptions: pruneNonSuccessfulQuoteLifecycleHistory already preserves rows with successful outcomes via payload field checks and correlated existence checks against trade_execution_results and quote_outcome_attributions. Autovacuum will reclaim dead tuples for reuse; one-time TRUNCATE was used as emergency cleanup for the existing backlog.

Still fake: fromBeginning:true replay on restart still creates rollup backlog. local-path PVC sizes are not enforced (platform issue). No disk monitoring (platform issue). Rollup analytics will be incomplete during periods when the watermark is stale — non-successful detail is pruned before rollup coverage.
2026-06-24 12:40:29 +02:00
..
config.mjs Move trading config into Postgres 2026-05-12 21:34:58 +02:00
env.mjs refactor: isolate unrip project into projects folder 2026-03-29 14:33:19 +02:00
http.mjs Implement funded NEAR Intents trade loop 2026-04-02 10:01:15 +02:00
market-data.mjs Add BTC USDC price route 2026-05-13 15:18:38 +02:00
postgres.mjs fix: prune non-successful detail tables unconditionally when rollup watermark is stale 2026-06-24 12:40:29 +02:00