feat(qt): D1 end-of-stage panel freeze — 14-factor raw baseline + manifest - #87
Merged
Merged
Conversation
qt/panel_freeze.py freezes the closing 14 factors' RAW daily panels (11 minute factors + the 3 book factors) on the eleven-factor evaluation data plane (CSI500 000905.SH, 2021-07-01..2026-06-30, cache-only) as the pre-D2 baseline for the D5 cell-by-cell reconciliation. No factor math is reimplemented: every panel is produced by calling the qt/eval_*.py runners' own loader chains with the runners' own constants, imported from the runner modules themselves; book factors go through _build_book_factors + factor.compute on the enriched panel. The frozen value is raw (pre-_process_factors). The authoritative fingerprint is a canonical content hash (sha256 over the sorted (date, symbol) index serialization + float64 raw bytes, NaN payloads collapsed, +/-0.0 kept distinct) because parquet file bytes depend on writer metadata; the file sha256 is recorded as a convenience only. Panels are written atomically (tmp + os.replace). Built-in verification: per-factor reconciliation of the processed boundary against the shipped eval_*_no_book.json data_coverage payloads (mismatch raises, the panel is never frozen), a determinism double-run (2 minute + 1 book subjects), a zero-live-call assertion on every minute loader, and a --resume mode that re-verifies existing panel files through the same processing + reconciliation instead of trusting them. Runs via python -m qt.panel_freeze (deliberately not registered in qt/cli). tests/test_panel_freeze.py (23 network-free tests) pins the hash semantics (value/index sensitivity paired with order/NaN-payload invariance), the atomic-write failure paths, manifest field completeness, and the reconciliation mismatch discipline.
…baseline docs/factors/d1_panel_freeze_manifest.md is the git-tracked authority for the frozen baseline: producing SHA 3669c90 (HEAD during both run segments; the freeze tool ran as untracked files, so the tracked tree was bit-identical to main), the data plane (CSI500 000905.SH, 2021-07-01..2026-06-30, cache-only, 10 daily endpoints at zero gap-fetches, stk_mins_live_calls=0), the provenance rule (baseline regeneration only from the pinned pre-D2 SHA, never from current code), the canonical-hash definition pointer, the two-segment run record (first segment killed by the session harness at ~60min after 12/14 panels; the resume segment re-verified those panels from file content through processing + reconciliation), the verification results (determinism double-run 3/3 across processes, eval-artifact reconciliation 6 fields x 11 factors all equal, book factors disclosed as having no coverage fields to reconcile, secret scan 0 hits), and the full 14-row table with per-factor stats and both hashes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes out step D1 of the factor-layer refactor (v3.2 §五 leg-4 / R11): freeze the 14 closing-set factors' raw value panels while factor math is still bit-identical to pre-refactor
main— the sole cell-level baseline for D5 reconciliation once D2 rewrites the math.What (+1207, 3 new files, zero existing files touched)
qt/panel_freeze.py— freeze tool, reused at D5. Zero formula re-implementation: every minute factor calls its eval runner's own_load_*_panelwith constants referenced off the runner module object; book factors go throughqt.eval_jump_amount_corr._build_book_factors(verified identical across all 11 runners). Canonical content hash (sha256 over sorted index serialization + float64 raw bytes; NaN payloads collapsed to one bit pattern, signed zeros kept distinct), atomic writes, strict--resume(panels read back from file are re-processed, re-reconciled and re-hashed — never trusted).tests/test_panel_freeze.py— 23 network-free tests incl. NaN-payload mutation evidence (asserts payload bytes differ before asserting hash equality) and a real mid-write-failure atomicity test.docs/factors/d1_panel_freeze_manifest.md— 14-row manifest: rows/date-range/symbols/NaN/mean/std + canonical & file sha256 per factor; producing SHA pinned to3669c90(run executed before commit so the tracked tree bit-equalledmain); provenance rule verbatim (baseline regeneration only from the pinned pre-D2 SHA — the structural guard against thecompare_postmerge.pyvacuous-reconciliation failure mode); honest disclosure of the two-segment run (session-limit kill at ~60min →--resume) and of the first segment's log loss (_make_loggertruncate mode — deliberately not fixed here, existing-file edits forbidden).Run evidence (panels live in gitignored
artifacts/refactor_baseline/)stk_mins_live_calls=0(raise-on-nonzero per factor), 10 daily endpoints gap-fetch all 0.Acceptance
value_epcanonical hash recomputed from disk = manifest.With this, step D1 is closed. Next: D2 (primitives + ops + factor migration — first math-touching step; provisional anchor freezes there after hand anchors pass).