> ## Continuous-process anchor
>
> This spec describes an instance of one of the retired-script themes
> documented in docs/design/retired_scripts_patterns.md. Before
> implementing, read:
>
> 1. The "Design principles for continuous processes" section of that
> atlas — every principle is load-bearing. In particular:
> - LLMs for semantic judgment; rules for syntactic validation.
> - Gap-predicate driven, not calendar-driven.
> - Idempotent + version-stamped + observable.
> - No hardcoded entity lists, keyword lists, or canonical-name tables.
> - Three surfaces: FastAPI + orchestra + MCP.
> - Progressive improvement via outcome-feedback loop.
> 2. The theme entry in the atlas matching this task's capability:
> EX1 (pick the closest from Atlas A1–A7, Agora AG1–AG5,
> Exchange EX1–EX4, Forge F1–F2, Senate S1–S8, Cross-cutting X1–X2).
> 3. If the theme is not yet rebuilt as a continuous process, follow
> docs/planning/specs/rebuild_theme_template_spec.md to scaffold it
> BEFORE doing the per-instance work.
>
> **Specific scripts named below in this spec are retired and must not
> be rebuilt as one-offs.** Implement (or extend) the corresponding
> continuous process instead.
Quest: Economics Priority: P76 Status: open
CI: Snapshot hypothesis prices for price history
python3 ci_snapshot_prices.pyThis task is part of the Economics quest (Cross-cutting layer). It contributes to the broader goal of building out SciDEX's cross-cutting capabilities.
ci_snapshot_prices.py, migrations/add_price_history.py, and checked live schema in postgresql://scidex. Confirmed script depended on price_history.item_type/item_id columns that are not guaranteed by repository migrations.ci_snapshot_prices.py by introspecting PRAGMA table_info(price_history) and selecting insert shape based on column availability (with/without item_type and item_id). Tested with:timeout 120 python3 ci_snapshot_prices.py → skip logic works (<3h since last snapshot)timeout 120 python3 -m py_compile ci_snapshot_prices.py → passtimeout 120 curl http://localhost:8000/api/status → JSON returnedtimeout 120 page checks on /, /exchange, /gaps, /graph, /analyses/, /atlas.html, /how.html → 200/3xxtimeout 120 scidex status → api/nginx healthytimeout 300 python3 link_checker.py → completed; reported 3 pre-existing broken links tied to debates route 500sprice_history schema variants and safe for recurring execution.
price_history table already has ci_snapshot entries (2068 rows, last at 10:11 UTC). The DB shows snapshots record market_price as price and composite_score as score with event_type='snapshot', event_source='ci_snapshot'. Will create ci_snapshot_prices.py to be run every 6h by Orchestra. Script avoids duplicate snapshots within 3h window.item_type and item_id columns to price_history table via ALTER TABLE. Script ci_snapshot_prices.py already existed and was functional. Successfully snapshotted 180 hypothesis prices. Verified skip logic works correctly (skips if last snapshot < 3h ago). Script ready for recurring execution by Orchestra every 6h.python3 ci_snapshot_prices.py → success, 292 hypotheses snapshottedpython3 ci_snapshot_prices.py → skipped (last snapshot 2.4h ago, < 3h threshold)python3 ci_snapshot_prices.py → success, 333 hypotheses snapshottedpython3 ci_snapshot_prices.py → success, 333 hypotheses snapshottedtimeout 120 python3 ci_snapshot_prices.py in task worktreepython3 ci_snapshot_prices.py → skipped (last snapshot 0.1h ago, < 3h threshold) — rate limiting working correctlytimeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.0h ago, < 3h threshold) — rate limiting working correctlytimeout 120 python3 ci_snapshot_prices.py in the task worktree2026-04-10T03:17:26Zci_snapshot rowstimeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.2h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → success, 335 hypotheses snapshottedtimeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.0h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 30 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)timeout 30 python3 ci_snapshot_prices.py → skipped (last snapshot 2.1h ago, < 3h threshold)python3 ci_snapshot_prices.py → skipped (last snapshot 2.2h ago, < 3h threshold)python3 ci_snapshot_prices.py → skipped (last snapshot 2.2h ago, < 3h threshold)python3 ci_snapshot_prices.py → skipped (last snapshot 2.2h ago, < 3h threshold)timeout 120 python3 ci_snapshot_prices.py → skipped (last snapshot 2.4h ago, < 3h threshold)python3 ci_snapshot_prices.py → success, 343 hypotheses snapshottedpython3 ci_snapshot_prices.py → success, 355 hypotheses snapshottedscripts/ci_snapshot_prices.py to use immutable read-only connections and batched column reads for WAL resilienceci_snapshot_prices.py was missing from repo (referenced in past work logs but never committed or lost)sqlite3 connections instead of scidex.core.database factory (which triggers the malformed error with large result sets)python3 ci_snapshot_prices.py → SKIPPED (last snapshot 0.4h ago, < 2h threshold) — rate limiting working correctlyfatal: Authentication failed for 'https://github.com/SciDEX-AI/SciDEX.git/' — GitHub token has expired or lacks write permission for this repo. Infrastructure issue, not code quality. Code: ae08eccbe (PostgreSQL fix) and 2564caca3 (work log update) are both committed on branch.{
"requirements": {
"coding": 7,
"reasoning": 6,
"analysis": 6
},
"completion_shas": [
"d081acf53efa6ae29140156668383bf23e96913d",
"3bd6b88fad7b088146e19c85b5d608ae15b155fd",
"c479cbf9d07ab0a4ddf2a4e6452fe5cd0868a1ac",
"014985be8beb215ed68b82e45cf6689a0dc836a3",
"861efc8aa4c305b2015f4cf80e1dc4ad05899385",
"53fe1c74ae24e43c5cb4aec41c9043d8b38ba7dd",
"88cf62829abfbc85d8989609d94d651c3c4fb3a5",
"a6b3c1467b0c5ee9922eec6818a1b7ed48e90d1f",
"894701529f826f8d5944c14e7fb16b3584518a39",
"48533b3ff6f14872ee841adca24b38c3bb247e09",
"da765fd2fc9d94e6d85dc3961447f41f0ceacf68",
"ac8f6f737e573fbc2c695fa04d4d52ada1116bb8",
"84ea5e8788ecf128b8dc1a9a6f1ace6bb1078669",
"af142031c7abd5df4a93087e67d5ef6a41993f6b",
"908bd93a104d5836e09ca16f8a1b2ee884c111a9",
"26c89d706c27f94edfc80826d8311d1233b5a550",
"6a7e06648b82d25eacc3cc75dcc62a75169a1e5c",
"3dc252871978782e514c07b6d84c2fe7d4cc9692",
"36ab5d24aa29c5d38b8d3c74a218c4bb8d8d077a",
"04fa442835c4ca61e86578d2eb8d801cbd6b38ed",
"66c112a59940f7d4ad0e5cff763499a497310b24",
"6f3a9b182023df9d2558671cc222a9e661385c99",
"c7cea8e7c0b20c765ea77fa369178a6ea0db9095",
"fa12a672d2932aa9bd20a5810536d4794d23a6b6",
"8b641ff65cd586691fe0663ec8e27de859023d7d",
"9196f3d0b81ab5f106bccb01455cadd6fa174263",
"cd0b1cb00977a1c756535d70b8cb980afa0f4d40",
"17d6a70b4d36d046b2c80df5b50fa33959f59037",
"35e784fc0264e81069187b6ce0c996d0fdd9e74a",
"55aa40bf9d3e9906805da5d0c231e1f2fb02e224",
"c7e012352153d155bcef352fe7e43156e011e559",
"f1e997953be672242e7e0c0e2b61f9c74aef927e",
"c24a060f9772a16b834e1b5b741c2c5d9c8c3adc",
"f29548a469cfaff2533d27ca3359f9ee0be293d4",
"b2e896f3073f50a1786b2000c9748fcb66719e81",
"0622a3a9399fc9742732cd19f1cf4123ccb838c4",
"2685085637ba06f7896f372b320be77ec0fac4fb",
"aff723fd6b6bb18687389c48d0d583d69039ff94",
"d985b64ad53cfdac2aaadb74efd85a0c51918dbc",
"a3cec926f04497fb51b01f36731304c6e1972780"
],
"completion_shas_checked_at": "2026-04-13T05:38:22.838912+00:00",
"completion_shas_missing": [
"e35275662c936696a35bc6c2475e1293bbb1caa9",
"cd01ec8d25c234e51bdaf05b6b4d635ff519b38b",
"d053448e94e167db2198a6dca53ad36058cff6d3",
"fe4f5ed32c52bc135fa6f9765dfbe530317d9f73",
"cc45d905597540b3979884ee7525869bebab0da7",
"8a832749ac5d63f3268469e32a8ab9b447c6771c",
"c765bbcec5e55053dfcc9293d1257482673c144d"
],
"_stall_skip_providers": [
"glm"
]
}