Commit 4f496ed
committed
feat: two-step candle gap repair (auto-fill ≤24h, then Kibana) + v1.0.3 bump
Complete the v1.0.3 version bump and implement the two-step candle gap
repair in the market adapter.
## Two-Step Candle Gap Repair
File: market_adapter/core/market_adapter_service.ts
- Problem: Every missing candle queried Kibana, even when the native
incremental fetch already confirmed no trades for short gaps. Empty
Kibana responses also left writes suppressed indefinitely.
- Impact: Unnecessary Kibana load; unresolved gap state could stall
trigger/dynamic-grid writes permanently.
- Solution: Step 1 auto-fills gaps ≤24 candles (trusted no-trade
threshold) directly by synthesizing zero-volume candles — Kibana is
redundant here since native fetch already verified no trades. Step 2
queries Kibana only for gaps beyond 24 candles. If Kibana returns
empty, that IS verification of no trades, so all gaps in the queried
window are synthesized.
## Version Bump 1.0.2 → 1.0.3
- Bumped version across all manifests: package.json, package-lock.json,
claw/package.json, analysis/ama_fitting/package.json,
claw/runtimes/openclaw-plugin/package.json,
claw/runtimes/openclaw-plugin/openclaw.plugin.json,
claw/tests/test_claw_mcp_transport.ts
## Test Updates
File: tests/test_market_adapter_service.ts
- Refactored testInternalNoTradeGapsAreSynthesizedWhenKibanaReturnsNoPatchData
→ testInternalNoTradeGapsAreAutoFilledWithinTrustedThreshold
- Refactored testEmptyKibanaRepairOnlySynthesizesGapsInsideCappedRepairWindow
→ testEmptyKibanaResponseResolvesAllGapsInWindow
- Adjusted testNativeIncrementalMergesKibanaActivityInsteadOfSilence and
testKibanaGapRepairPatchesMissingCandles for new two-step flow
- Added maxNativeGapFillCandles: 0 to config objects in gap-repair tests
## Documentation
- market_adapter/README.md: documented STALE_TAIL_THRESHOLD_CANDLES
constant and full two-step gap repair flow with auto-fill and
Kibana-verified synthesis
- docs/README.md, docs/EVOLUTION.md, docs/DEXBOT_COMPARISON.md,
docs/FUND_MOVEMENT_AND_ACCOUNTING.md: version reference bumps
## Testing Notes
- npm test should pass with refactored gap repair assertions
- Key scenarios: within-threshold auto-fill, beyond-threshold Kibana
query, empty Kibana → verified no-trade synthesis1 parent 48599b2 commit 4f496ed
15 files changed
Lines changed: 130 additions & 92 deletions
File tree
- analysis/ama_fitting
- claw
- runtimes/openclaw-plugin
- tests
- docs
- market_adapter
- core
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
5 | 15 | | |
6 | 16 | | |
7 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
218 | 218 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments