Skip to content

Commit 68dc006

Browse files
JohnCCarterclaude
andcommitted
test(research): add Fib to Genesis V2 Phase 2 dummy contract
Mechanical contract/dummy test inside the Fib repo only — not a real export, not Genesis integration. New stdlib-only research/feature_contract.py validates two committed synthetic dummy CSVs against the Phase 1 schema: exact-header schema, join keys (symbol,timeframe,timestamp) non-null + unique, per-row causality known_after_ts <= timestamp over the whole reference set, knowability floor known_after_ts >= max(anchor_b)+buffer, 1H fail-closed, feature/metadata boundary asserted at import. No fib computation, no Genesis import, no fibengine runtime import, no pipeline/ML/backtest/signal/edge. confirmation_buffer unit pinned to hours (confirmation_buffer_hours). 20 tests; ruff + 426 passed + repo-bounds green. Wiki: log/handoff updated; 06-11..06-12 entries archived to post-reset part 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 750ee18 commit 68dc006

8 files changed

Lines changed: 824 additions & 119 deletions

File tree

docs/research_wiki/handoff.md

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ append-only trail lives in [log.md](log.md).
2222

2323
## Recent Changes
2424

25+
- **2026-06-16 Fib → Genesis V2 Phase 2 dummy contract test (narrow slice, DONE)**
26+
mechanical contract/dummy test **inside Fib only** (not export, not Genesis integration).
27+
`research/feature_contract.py` (stdlib) validates two committed dummy CSVs vs the Phase 1
28+
schema (join keys, causality, knowability floor, 1H + feature/metadata fail-closed). No fib
29+
computation, no Genesis touch. 20 tests; gates green. **Stopped as scoped.**
30+
[Report](reviews/btc-fib-to-genesis-v2-phase2-dummy-contract-20260616.md).
2531
- **2026-06-15 MTF confluence CP1–CP3 CLOSED + interpretation/decision note** — first atlas
2632
pack done (5 cards, 3 archetypes, all **human-approved**): c001 robust fixed-band 4-TF; c002
2733
chaining-dependent contrast (NOT tight); c004/c006/c007 zero-span exact-price 3-TF.
@@ -62,41 +68,10 @@ append-only trail lives in [log.md](log.md).
6268
in [2021-01-01, 2021-04-01), ~37 fibs). Threshold rule confirmed: local density per
6369
zone, not total fib count. Y-axis log confirmed (line 246 `monthly_fib_map.py`).
6470
Full review: [`reviews/btc-4h-tier1-map-review-20260615.md`](reviews/btc-4h-tier1-map-review-20260615.md).
65-
- **2026-06-12 4H visual confirmation Tier 1 built**`research/fourh_source_fib_map.py`
66-
renders annual combined 4H maps (366/366 drawn, 11 groups; dense 2017_h2 flagged for
67-
Tier 2). Reuses `monthly_fib_map` primitives; output gitignored. Full detail in log.md.
68-
- **2026-06-12 4H source-fib phase complete****366** manual BTC/USD 4H source fibs
69-
drawn and verified (timeframe `4h`, log scale, `tradingview_log_chamoun`, levels
70-
`[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, endpoint mapping ratio 0.0=anchor_b /
71-
1.0=anchor_a, anchor direction, log-spacing, human/manual only). Coverage
72-
**2017-01-05 → 2026-06-05**; **up=169 / down=197**. This is **source-labeling
73-
completion, not reaction-review** — visual confirmation / reaction-review is a later,
74-
separate decision. No auto-fib, no trading conclusions. 366/366 schema verification PASS.
75-
- **2026-06-12 1D reaction-review complete** — all **67** BTC/USD 1D source fibs
76-
reviewed on **4H** (expansion config, 4H history to 2017-01-01). Review window:
77-
anchor_b + 90 days (fixed horizon). **1 816** total 4H interactions.
78-
`review_windows.yaml` written; artifacts in `experiments/review/source_fib_projection/`.
79-
Summary: [`reviews/btc-1d-reaction-review-cycle-20260612.md`](reviews/btc-1d-reaction-review-cycle-20260612.md).
80-
Outliers: Jan–Feb 2022 cluster (52–65 events); Dec 2020 breakout (2 events).
81-
Batch script: `scripts/run_btc_1d_reaction_review.py`. 1H deferred (cache missing).
82-
- **2026-06-11 1D source-fib labeling complete (source-facit only)****67** manual
83-
BTC/USD 1D source fibs drawn and verified (timeframe `1d`, log scale,
84-
`tradingview_log_chamoun`, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236,
85-
endpoint mapping ratio 0.0=anchor_b / 1.0=anchor_a, anchor direction, log-spacing,
86-
human/manual only). Coverage **2017-01-05 → 2024-12-20**; **34 down / 33 up**.
87-
- **2026-06-11 1W source-fib phase complete****21/21** BTC/USD manual 1W source
88-
fibs drawn (log scale, `tradingview_log_chamoun`) and verified (profile, scale,
89-
levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, anchor direction,
90-
human/manual only). Two new research modules:
91-
- `research/weekly_source_fib_map` — combined 1W/1D/4H map (all fibs per TF).
92-
**1W/1D usable; combined 4H too compressed** for candle-level confirmation.
93-
- `research/weekly_source_fib_zoom` — per-fib windowed 4H confirmation
94-
(one chart per fib, A→B + bounded context). **Per-fib 4H usable.**
95-
Strict separation kept: **1M source**, **1M→1W projection** (`weekly_projection_map`),
96-
and **true 1W source** fibs are distinct flows; fail-closed guards reject any
97-
non-1W / non-log / wrong-profile / 0.236 / non-human fib. No auto-fib, no
98-
trading conclusions. Commits `4eb2f4b` (map + facit), `939de97` (zoom),
99-
`e379fae` (CI: format + bounds fix).
71+
- **2026-06-11→06-12 source-fib milestones (archived)** — 1W (21), 1D (67) + 4H
72+
(366→365) source phases complete, 1D 4H reaction-review (1816 interactions), 4H Tier 1
73+
maps. Full detail: [log post-reset part 1](log-archive-btc-postreset-part1.md); current
74+
counts in Verification Snapshot below.
10075
- **2026-06-08…11 (earlier milestones)** — 1M reaction-review cycle (9 fibs, 1D+4H),
10176
Addendum 2 golden-zone retirement (issue #30, added `human_highlights`), log-scale +
10277
profile fix, 1M re-label, events log-scale fix, and the BTC monthly-first reset. Full
@@ -142,7 +117,9 @@ confluence is **geometry, not edge proof** → **stop the MTF track**. **Fork wr
142117
(docs-only):** [Phase 0 prereg](reviews/btc-fib-to-genesis-v2-phase0-prereg-20260615.md) registers
143118
one falsifiable behaviour question (causal confluence zones vs placebo/naïve levels, OOS) +
144119
leakage manifest, baselines, time-split holdout, stop/go; [Phase 1 spec](reviews/btc-fib-to-genesis-v2-phase1-feature-export-spec-20260615.md)
145-
(zone+bar tables, `known_after_ts` rule) **reviewed PASS — Phase 1 closed as docs-only contract**. **Phase 2 (dummy-file test) NOT authorised** without an explicit go.
120+
(zone+bar tables, `known_after_ts` rule) **reviewed PASS — Phase 1 closed as docs-only contract**. **Phase 2 (dummy-file test) — DONE 2026-06-16** (authorised narrow slice):
121+
`research/feature_contract.py` + committed dummy CSVs prove the contract validates mechanically
122+
with no real export and no Genesis touch ([Phase 2 report](reviews/btc-fib-to-genesis-v2-phase2-dummy-contract-20260616.md)). **Stopped** — any real export or Genesis touch needs a fresh go.
146123

147124
**Deferred:** 1H source labeling — 4H is the lowest active timeframe; fetch 1H cache first
148125
(`data.fetch --timeframes 1h`). Separate decision before starting.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Research Wiki Log — BTC post-reset archive (part 1)
2+
3+
Archived entries from [log.md](log.md) to keep the active log within its size bound.
4+
Covers the **2026-06-11 → 2026-06-12** source-fib completion milestones (1M reaction-review,
5+
1W, 1D, 4H source phases + 4H Tier 1 design/maps). Append-only; do not edit.
6+
7+
## [2026-06-12] review | BTC/USD 4H visual confirmation Tier 1 — annual source-fib maps built
8+
9+
Implemented `research/fourh_source_fib_map.py` (Tier 1 of the locked design): annual
10+
combined 4H source-fib maps, fibs grouped by `anchor_a` year, dense years (>60 fibs)
11+
split into calendar half-years. Reuses `_draw_map` / `_load_fibs` / `_nearest_pos` /
12+
`_short_id` from `monthly_fib_map` unchanged; no snap (source TF == chart TF == 4h);
13+
each group windowed by its fib span `[min(anchor_a) − pad, max(anchor_b) + pad]` (not
14+
calendar boundaries, so a December fib whose anchor_b crosses into the next year still
15+
renders). Fail-closed guard adapted to `SOURCE_TF="4h"` (timeframe/profile/scale/0.236/
16+
human-manual/no candidate-auto-inferred). 14 tests in `tests/research/test_fourh_source_fib_map.py`;
17+
ruff + repo-bounds + full suite pass (one pre-existing flaky `test_synthetic_ohlcv_high_ge_low`,
18+
untouched).
19+
20+
**Run finding (real facit + cache, expansion config):** all **366/366 fibs drawn, 0
21+
skipped**, across **11 groups** — 2017 split 13 (h1) / **103 (h2)**, 2018=33, 2019=26,
22+
2020=31, 2021=55, 2022=24, 2023=17, 2024=22, 2025=34, 2026=8. Mid-density maps (e.g.
23+
2022, 2019) are cleanly scannable. **2017_h2 (~103 fibs, the Sep–Dec parabolic run)
24+
exceeds map-reviewable density → flags 2017 for Tier 2 `fourh_source_fib_zoom`.** That
25+
is the Tier-1 deliverable's signal (per design: build Tier 2 only where Tier 1 shows
26+
per-fib zoom is needed). No reaction-review, no events, no trading conclusions. Output
27+
under `experiments/review/fourh_source_fib_map/` (gitignored).
28+
29+
## [2026-06-12] decision | BTC/USD 4H visual confirmation / source-quality review — design locked
30+
31+
4H is the lowest active timeframe (1H paused). 4H source-facit locked (366 fibs,
32+
2017-01-05 → 2026-06-05, up=169/down=197, log scale, `tradingview_log_chamoun`,
33+
`[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, human/manual). Next phase: **4H visual
34+
confirmation / source-quality review** — not reaction-review, not 1H.
35+
36+
**Tier 1 (first implementation):** `fourh_source_fib_map.py` — annual combined 4H candle
37+
maps, fibs grouped by `anchor_a` year; ~10 charts (~20 PNGs); fast source-quality scan
38+
over 366 fibs without per-fib overhead. Fail-closed: `timeframe==4h`, log,
39+
`tradingview_log_chamoun`, no 0.236, human/manual, no candidate/auto/inferred.
40+
**Tier 2 (on-demand, after Tier 1):** `fourh_source_fib_zoom.py` — per-fib windowed 4H
41+
charts. Build only if Tier 1 shows per-fib zoom is needed.
42+
43+
Reactive modules (`source_fib_projection_review`, `source_fib_projection_chart`) are NOT
44+
used — no events, no `review_sample.csv`, no interactions, no trading conclusions. Full
45+
design:
46+
[btc-4h-visual-confirmation-design-20260612.md](reviews/btc-4h-visual-confirmation-design-20260612.md).
47+
48+
## [2026-06-12] review | BTC/USD 4H source-fib phase complete — 366 fibs
49+
50+
366 manual 4H source fibs drawn and verified: timeframe `4h`, log scale,
51+
`tradingview_log_chamoun`, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236,
52+
endpoint mapping (ratio 0.0=anchor_b / 1.0=anchor_a), anchor direction, log-spacing,
53+
human/manual only. Coverage **2017-01-05 → 2026-06-05**; **up=169 / down=197**.
54+
366/366 schema verification PASS (0 failures). This is **source-labeling completion,
55+
not reaction-review** — visual confirmation / reaction-review is a later, separate
56+
decision. No auto-fib, no trading conclusions. Separation preserved across 1M source /
57+
1M→1W projection / true 1W source / true 1D source / true 4H source fibs.
58+
59+
## [2026-06-11] review | BTC/USD 1D source-fib labeling complete (source-facit) — 67 fibs
60+
61+
67 manual 1D source fibs drawn and verified: timeframe `1d`, log scale,
62+
`tradingview_log_chamoun`, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236,
63+
endpoint mapping (ratio 0.0=anchor_b / 1.0=anchor_a), anchor direction, log-spacing,
64+
human/manual only. Coverage **2017-01-05 → 2024-12-20**; **34 down / 33 up**. This is
65+
**source-labeling completion, not reaction-review** — reaction-review / visual
66+
confirmation is a later, separate phase (not required for source completion). No
67+
auto-fib, no trading conclusions. Separation preserved across 1M source / 1M→1W
68+
projection / true 1W source / true 1D source fibs.
69+
70+
## [2026-06-11] review | BTC/USD 1W source-fib phase complete — 21 fibs, map + per-fib 4H zoom
71+
72+
21/21 manual 1W source fibs drawn (log scale, `tradingview_log_chamoun`) and verified
73+
(profile, scale, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, anchor direction,
74+
human/manual only). Added `research/weekly_source_fib_map` (combined 1W/1D/4H — 1W/1D
75+
usable, combined 4H too compressed) and `research/weekly_source_fib_zoom` (per-fib
76+
windowed 4H — usable). Strict separation kept between 1M source, 1M→1W projection
77+
(`weekly_projection_map`), and true 1W source fibs; fail-closed guards reject non-1W /
78+
non-log / wrong-profile / 0.236 / non-human fibs. No auto-fib, no trading conclusions.
79+
Commits `4eb2f4b`, `939de97`, `e379fae`.
80+
81+
## [2026-06-11] review | BTC/USD 1M reaction-review cycle complete — all 9 source fibs
82+
83+
All 9 human-drawn 1M source fibs reviewed through 1D + 4H using
84+
`source_fib_projection_review` + `source_fib_projection_chart` (log scale,
85+
`tradingview_log_chamoun`). Review windows confirmed in `review_windows.yaml`
86+
(anchor_b → next macro boundary; 20260101 window extends to latest cache 2026-06-08).
87+
Total: 62 1D events, 127 4H events across the full set.
88+
Summary artifact: [reviews/btc-1m-reaction-review-cycle-20260611.md](reviews/btc-1m-reaction-review-cycle-20260611.md).

docs/research_wiki/log.md

Lines changed: 17 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,23 @@ Use headings like:
1111
Types: `ingest`, `decision`, `review`, `question`, `maintenance`.
1212

1313

14-
> Older entries (2026-06-10 and earlier): [part 3](log-archive-pre-btc-reset-part3.md)
14+
> Older entries (2026-06-11→06-12 source-fib milestones):
15+
> [post-reset part 1](log-archive-btc-postreset-part1.md).
16+
> Pre-reset (2026-06-10 and earlier): [part 3](log-archive-pre-btc-reset-part3.md)
1517
> [part 2](log-archive-pre-btc-reset-part2.md)[part 1](log-archive-pre-btc-reset-part1.md)
1618
19+
## [2026-06-16] feat | Fib → Genesis V2 — Phase 2 dummy contract test (narrow slice)
20+
21+
Mechanical contract/dummy test **inside the Fib repo only** — not export, not Genesis
22+
integration. New stdlib-only `research/feature_contract.py` validates two synthetic dummy CSVs
23+
(committed under `reviews/contracts/phase2_dummy/`: 3 zones, 4 bars incl. a multi-zone row)
24+
against the Phase 1 schema: exact-header schema, join keys `(symbol,timeframe,timestamp)`
25+
non-null + unique, causality `known_after_ts <= timestamp` over the whole reference set,
26+
knowability floor `known_after_ts >= max(anchor_b)+buffer`, 1H fail-closed, feature/metadata
27+
boundary asserted at import. No fib computation, no Genesis import, no pipeline/ML/backtest/
28+
signal/edge. 20 tests; ruff + 426 passed (76%) + repo-bounds green; CLI smoke OK. **Stop after
29+
this.** [Report](reviews/btc-fib-to-genesis-v2-phase2-dummy-contract-20260616.md).
30+
1731
## [2026-06-15] review | Fib → Genesis V2 — Phase 1 closed (PASS)
1832

1933
Phase 1 feature-export spec reviewed — **verdict: PASS**; **closed as a docs-only contract**.
@@ -340,86 +354,6 @@ maps; Tier 2 per-fib zoom windows will be narrower and more readable.
340354

341355
**Next:** implement Tier 2 `fourh_source_fib_zoom.py`.
342356

343-
## [2026-06-12] review | BTC/USD 4H visual confirmation Tier 1 — annual source-fib maps built
344-
345-
Implemented `research/fourh_source_fib_map.py` (Tier 1 of the locked design): annual
346-
combined 4H source-fib maps, fibs grouped by `anchor_a` year, dense years (>60 fibs)
347-
split into calendar half-years. Reuses `_draw_map` / `_load_fibs` / `_nearest_pos` /
348-
`_short_id` from `monthly_fib_map` unchanged; no snap (source TF == chart TF == 4h);
349-
each group windowed by its fib span `[min(anchor_a) − pad, max(anchor_b) + pad]` (not
350-
calendar boundaries, so a December fib whose anchor_b crosses into the next year still
351-
renders). Fail-closed guard adapted to `SOURCE_TF="4h"` (timeframe/profile/scale/0.236/
352-
human-manual/no candidate-auto-inferred). 14 tests in `tests/research/test_fourh_source_fib_map.py`;
353-
ruff + repo-bounds + full suite pass (one pre-existing flaky `test_synthetic_ohlcv_high_ge_low`,
354-
untouched).
355-
356-
**Run finding (real facit + cache, expansion config):** all **366/366 fibs drawn, 0
357-
skipped**, across **11 groups** — 2017 split 13 (h1) / **103 (h2)**, 2018=33, 2019=26,
358-
2020=31, 2021=55, 2022=24, 2023=17, 2024=22, 2025=34, 2026=8. Mid-density maps (e.g.
359-
2022, 2019) are cleanly scannable. **2017_h2 (~103 fibs, the Sep–Dec parabolic run)
360-
exceeds map-reviewable density → flags 2017 for Tier 2 `fourh_source_fib_zoom`.** That
361-
is the Tier-1 deliverable's signal (per design: build Tier 2 only where Tier 1 shows
362-
per-fib zoom is needed). No reaction-review, no events, no trading conclusions. Output
363-
under `experiments/review/fourh_source_fib_map/` (gitignored).
364-
365-
## [2026-06-12] decision | BTC/USD 4H visual confirmation / source-quality review — design locked
366-
367-
4H is the lowest active timeframe (1H paused). 4H source-facit locked (366 fibs,
368-
2017-01-05 → 2026-06-05, up=169/down=197, log scale, `tradingview_log_chamoun`,
369-
`[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, human/manual). Next phase: **4H visual
370-
confirmation / source-quality review** — not reaction-review, not 1H.
371-
372-
**Tier 1 (first implementation):** `fourh_source_fib_map.py` — annual combined 4H candle
373-
maps, fibs grouped by `anchor_a` year; ~10 charts (~20 PNGs); fast source-quality scan
374-
over 366 fibs without per-fib overhead. Fail-closed: `timeframe==4h`, log,
375-
`tradingview_log_chamoun`, no 0.236, human/manual, no candidate/auto/inferred.
376-
**Tier 2 (on-demand, after Tier 1):** `fourh_source_fib_zoom.py` — per-fib windowed 4H
377-
charts. Build only if Tier 1 shows per-fib zoom is needed.
378-
379-
Reactive modules (`source_fib_projection_review`, `source_fib_projection_chart`) are NOT
380-
used — no events, no `review_sample.csv`, no interactions, no trading conclusions. Full
381-
design:
382-
[btc-4h-visual-confirmation-design-20260612.md](reviews/btc-4h-visual-confirmation-design-20260612.md).
383-
384-
## [2026-06-12] review | BTC/USD 4H source-fib phase complete — 366 fibs
385-
386-
366 manual 4H source fibs drawn and verified: timeframe `4h`, log scale,
387-
`tradingview_log_chamoun`, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236,
388-
endpoint mapping (ratio 0.0=anchor_b / 1.0=anchor_a), anchor direction, log-spacing,
389-
human/manual only. Coverage **2017-01-05 → 2026-06-05**; **up=169 / down=197**.
390-
366/366 schema verification PASS (0 failures). This is **source-labeling completion,
391-
not reaction-review** — visual confirmation / reaction-review is a later, separate
392-
decision. No auto-fib, no trading conclusions. Separation preserved across 1M source /
393-
1M→1W projection / true 1W source / true 1D source / true 4H source fibs.
394-
395-
## [2026-06-11] review | BTC/USD 1D source-fib labeling complete (source-facit) — 67 fibs
396-
397-
67 manual 1D source fibs drawn and verified: timeframe `1d`, log scale,
398-
`tradingview_log_chamoun`, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236,
399-
endpoint mapping (ratio 0.0=anchor_b / 1.0=anchor_a), anchor direction, log-spacing,
400-
human/manual only. Coverage **2017-01-05 → 2024-12-20**; **34 down / 33 up**. This is
401-
**source-labeling completion, not reaction-review** — reaction-review / visual
402-
confirmation is a later, separate phase (not required for source completion). No
403-
auto-fib, no trading conclusions. Separation preserved across 1M source / 1M→1W
404-
projection / true 1W source / true 1D source fibs.
405-
406-
## [2026-06-11] review | BTC/USD 1W source-fib phase complete — 21 fibs, map + per-fib 4H zoom
407-
408-
21/21 manual 1W source fibs drawn (log scale, `tradingview_log_chamoun`) and verified
409-
(profile, scale, levels `[0, 0.382, 0.5, 0.618, 0.786, 1]`, no 0.236, anchor direction,
410-
human/manual only). Added `research/weekly_source_fib_map` (combined 1W/1D/4H — 1W/1D
411-
usable, combined 4H too compressed) and `research/weekly_source_fib_zoom` (per-fib
412-
windowed 4H — usable). Strict separation kept between 1M source, 1M→1W projection
413-
(`weekly_projection_map`), and true 1W source fibs; fail-closed guards reject non-1W /
414-
non-log / wrong-profile / 0.236 / non-human fibs. No auto-fib, no trading conclusions.
415-
Commits `4eb2f4b`, `939de97`, `e379fae`.
416-
417-
## [2026-06-11] review | BTC/USD 1M reaction-review cycle complete — all 9 source fibs
418-
419-
All 9 human-drawn 1M source fibs reviewed through 1D + 4H using
420-
`source_fib_projection_review` + `source_fib_projection_chart` (log scale,
421-
`tradingview_log_chamoun`). Review windows confirmed in `review_windows.yaml`
422-
(anchor_b → next macro boundary; 20260101 window extends to latest cache 2026-06-08).
423-
Total: 62 1D events, 127 4H events across the full set.
424-
Summary artifact: [reviews/btc-1m-reaction-review-cycle-20260611.md](reviews/btc-1m-reaction-review-cycle-20260611.md).
357+
> **2026-06-11→06-12 entries** (1M reaction-review, 1W/1D/4H source phases, 4H Tier 1
358+
> design/maps) archived to [post-reset part 1](log-archive-btc-postreset-part1.md).
425359

0 commit comments

Comments
 (0)