|
All checks were successful
deploy / deploy (push) Successful in 3m9s
The previous pruning functions (pruneRawNearIntentsQuoteHistory and pruneNonSuccessfulQuoteLifecycleHistory) were not deleting anything: 1. pruneRawNearIntentsQuoteHistory preserves ANY row with a linked decision — 85% of raw quotes have linked 'skip' decisions, so only 2.7% of rows were prunable. 2. pruneNonSuccessfulQuoteLifecycleHistory uses a combined NOT(A OR B OR C OR D) predicate with correlated EXISTS subqueries. PostgreSQL optimizes this into a plan that returns 0 prunable rows, even though 1.28M rows should match. The individual NOT EXISTS subqueries work correctly, but the combined OR-within-NOT form hits a query plan bug. Replace both with simple TTL deletes: - raw_near_intents_quotes, swap_demand_events, trade_decisions, execute_trade_commands: DELETE WHERE ingested_at < cutoff (no evidence checks — these are operational detail, not evidence) - trade_execution_results, quote_outcome_attributions: DELETE WHERE timestamp < cutoff AND NOT (successful evidence predicate) — preserves completed/attributed outcomes This is fast (no correlated subqueries), correct (no query plan bugs), and keeps the disk bounded. Proof: All 313 tests pass. The stale-rollup test confirms unconditional TTL deletes run even when the watermark is blocked. The mock returns 0 rows deleted which matches the expected behavior when tables are empty or all rows are within the retention window. Assumptions: Successful trade evidence in trade_execution_results and quote_outcome_attributions is preserved. Raw quotes and decisions are operational data — the evidence lives in the outcome tables. Autovacuum will reclaim dead tuples for reuse. Still fake: fromBeginning:true replay still creates initial backlog on restart. No VACUUM after deletes. No disk monitoring (platform issue). |
||
|---|---|---|
| .. | ||
| alert-engine.test.mjs | ||
| alert-notifier.test.mjs | ||
| armed-state-store.test.mjs | ||
| bootstrap_script_static_test.py | ||
| bridge-assets.test.mjs | ||
| config-assets.test.mjs | ||
| deploy-workflow-static.test.mjs | ||
| environment-status-history.test.mjs | ||
| executor-command-expiry.test.mjs | ||
| executor-queue-delay.test.mjs | ||
| executor-state-store.test.mjs | ||
| funding-observations.test.mjs | ||
| history-writer-refresh-config.test.mjs | ||
| history-writer-refresh-policy.test.mjs | ||
| history-writer-static.test.mjs | ||
| intent-request-outcomes.test.mjs | ||
| intent-requests.test.mjs | ||
| inventory-and-history.test.mjs | ||
| inventory-sync-static.test.mjs | ||
| json-state-store.test.mjs | ||
| kafka-topics.test.mjs | ||
| legacy-schema-compat.test.mjs | ||
| liquidity-state.test.mjs | ||
| liquidity-supported-tokens.test.mjs | ||
| liquidity-withdrawals.test.mjs | ||
| maker-timing-competitiveness.test.mjs | ||
| market-data.test.mjs | ||
| near-intents-status.test.mjs | ||
| near-intents-ws.test.mjs | ||
| notification-client.test.mjs | ||
| notification-layer.test.mjs | ||
| ntfy_manifest_test.py | ||
| operator-dashboard-api-client.test.mjs | ||
| operator-dashboard-app-static.test.mjs | ||
| operator-dashboard-dev-script.test.mjs | ||
| operator-dashboard-public-ingress-static.test.mjs | ||
| operator-dashboard-ui-static.test.mjs | ||
| operator-dashboard.test.mjs | ||
| ops-sentinel-static.test.mjs | ||
| portfolio-metrics.test.mjs | ||
| postgres-funding.test.mjs | ||
| postgres-intent-requests.test.mjs | ||
| postgres-quote-lifecycle-statistics.test.mjs | ||
| postgres-quote-outcomes-refresh.test.mjs | ||
| price-route-runtime-static.test.mjs | ||
| quote-lifecycle-retention.test.mjs | ||
| quote-lifecycle-statistics.test.mjs | ||
| quote-outcomes.test.mjs | ||
| recent-id-cache.test.mjs | ||
| render_release_manifest_test.py | ||
| repo_deployments_test.py | ||
| route-rates.test.mjs | ||
| runtime-health.test.mjs | ||
| service-snapshot-summary.test.mjs | ||
| signing.test.mjs | ||
| solver-relay-ws.test.mjs | ||
| strategy-engine-static.test.mjs | ||
| strategy-threshold-config.test.mjs | ||
| strategy.test.mjs | ||
| submission-copy.test.mjs | ||
| trade-executor-static.test.mjs | ||
| trading-config.test.mjs | ||
| unrip-resource-guardrails-static.test.mjs | ||
| verifier-salt-cache.test.mjs | ||