Repository navigation
Description
Design gate (ADR proposal, no implementation)
Ordinary design work: do not edit SCOPE.md, ROADMAP.md, CAPABILITY_MAP.md, CAPABILITY_DAG.md or OPEN_DECISIONS.md. The scope is registered by a governance issue after the ADR is accepted, as for #515 / #518 / #520. This issue is design only: it is not execution authority and changes no data.
Problem and measured evidence
The live ingest of BTCUSDT still runs in cycles mode (the default; continuous, O02, is merged but has never run against the real provider, and the one-hour run of O03 was not performed). In cycles mode every closed live day is incomplete and cannot be read under strict coverage. This is the defect recorded in #504 (27.2% of the trades of 2026-10-20 missing against the archive), now measured on the O01 slices that replaced the old cycle revisions.
Operator-reported homelab evidence (read-only catalog queries, 2026-10-26, kind='trades', instrument='BTCUSDT', state valid):
| day | slices | rows | gaps between consecutive slices | uncovered seconds | longest gap |
|---|---|---|---|---|---|
| 2026-10-24 | 3 327 | 749 441 | 3 326 | 28 718.2 | 299.5 s |
| 2026-10-25 | n/a | n/a | 3 333 | 29 681.6 | 31.0 s |
For 2026-10-24 the gap distribution is: 3 324 gaps of at most 30 s (about 9 s each, a regular cycle of about 26 s), one between 30 and 120 s, one between 120 and 300 s. The two longer gaps are consistent with restarts and cut-overs of the service; the 3 324 short ones are the pause between two cycles, which is neither reconciled (steady state reconciles only at start, restart or after a cycle that proved nothing, live_ingest_server) nor declared as coverage (LIVE_INGEST_SERVER_DEPLOYMENT.md: a read across the pause is refused under strict). 2026-10-25 had no restart and shows the same pattern (3 333 gaps, none above 31 s). The share of trades actually lost on these two days has not been measured against the archive yet (the archive files of 2026-10-24 and 2026-10-25 are not on the server); #504 measured 27.2% on a day of the previous publication.
Until the service runs continuous, every live day must be closed from the Bybit archive to be usable. On 2026-10-26 the maintainer replaced the damaged period by hand, outside the ADR-0074 Amendment 2 guarantees: catalog dump /srv/marketdata/backups/catalog-before-replace-20261026.dump, 85 684 trades catalog rows of 2026-09-23 and 2026-09-25 .. 2026-10-23 deleted in one transaction by an untracked operator script, the day directories renamed into /srv/marketdata/replaced/BTCUSDT-trades-20261026/, then the 30 days imported again with tools/import_bybit_archive_day.py (30 valid, 0 refused); 2026-09-24 had been rebuilt earlier by R02. The result is contiguous valid coverage 2026-09-20 .. 2026-10-23 (SQL check). The 12 open long-gap record files in the dataset root were left in place. R02 could not do this: it refuses live slices, open long-gap records, lost manifests and a day whose predecessor overlaps (ADR-0074 A2).
The same closure will be needed for 2026-10-24 now, for 2026-10-25 and every following day while the mode is cycles.
Authorized output
Append a PROPOSED Amendment 3 to docs/decisions/ADR-0074-multi-instrument-bybit-linear-trades-v1.md, cross-amending ADR-0075 section 7 where it excludes the consolidation of slices and the rebuild of damaged days. Preserve accepted text and frozen contracts. Target implement/fid. This issue authorizes the amendment proposal and its design review only, not governance reconciliation, runtime implementation, data mutation, deployment, acceptance of the proposal or merge.
Required decisions
- Scope of a closure. Explicitly named, closed UTC days of the
tradesdataset ofBTCUSDTwhose live partitions are slicesdt=<day>/seg=...; whether other instruments are in scope; the rule for "closed" (the operator script usedday < date(now - 24 h)) and for the archive being published; no automatic broadening of the day set. - Mechanism. Whether a live day is retired by the A2 path generalised to slices (R01-style reassessment to
invalid, then the archive import) or may be removed from the catalog. The one-off used a catalogDELETEwith a dump, which A2 forbids ("no automatic deletion, catalog reset"); the amendment must say what is acceptable, what evidence is preserved, and how a crash between the retire and the import is recovered (the day must never be left with neither version readable without a typed state). - Trigger. Explicit operator command only, or a scheduled run after the UTC day closes and the archive is published; if scheduled, the refusals that stop it (archive absent, archive hash differs from a previous observation, live checkpoint bound to a slice of the day, a
writingpartition, a count that differs from the plan). - Provenance. A closed live day replaced by the archive changes the source of the day from the live WebSocket to the archive. Whether that is allowed when the live day is complete (after
continuous), only when it is incomplete, or never; how the source observation time and the producing commit are recorded without backdating availability. - Open long-gap records and manifests. Supersession of the long-gap record files of replaced days (the
load_open_long_gap_recordsinput of the live service) and the lost legacy manifests (R02 refused 11 days for a hash mismatch); whether the manifest may be regenerated from catalog fields and accepted only on a byte-identical hash. - Boundary and overlap. The predecessor-overlap rule that R02's plan does not check (a day whose predecessor crosses midnight and is itself blocked), and a day that mixes legacy revisions and slices.
- Relation to
continuous(O02/O03). Whether, once the service runscontinuous, the archive becomes a daily verification (the O03 evidence tool compares slices with the archive) instead of a replacement, so this closure is a bounded transitional procedure, not a permanent part of the live path. - Retention. The directories moved aside and the catalog dumps: who keeps them, for how long, and how they relate to
operations/retention.py.
Out of scope
- Running the one-hour real-provider test or switching the service to
continuous(decision (1) of the DG-N/DG-O closeout). - Consolidation of slices into a day partition (ADR-0075 item 7) other than by archive closure.
- Any change to the live ingest, the checkpoint or the gateway.
- Execution on the server.
Acceptance
- A PROPOSED Amendment 3 in ADR-0074 answering decisions 1 to 8, citing the evidence above, with the failure modes it closes and those it leaves open.
- The design review of the amendment; acceptance and the governance registration of the atoms stay with the maintainer and a separate governance issue.
Refs #504, #515, #518, #520, #527.
🤖 Generated with Claude Code
Activity
docs(adr): Amendment 3 covers the whole allow-list and runs unattended (
NeoNix-Lab commentedon Oct 27, 2026
Maintainer's requirement, 2026-10-27 (relayed in the session): the system must cover every instrument of the allow-list, run unattended, and close every day well, so that no day is repaired by hand again. This widens decisions 1 (scope) and 3 (trigger) of this issue: PR #539 now proposes a daily unattended run over the whole allow-list (A3.12) instead of an operator-only BTCUSDT closure. The unattended run closes what is behind; it does not make the current day complete, which is the job of the continuous session (O02). A permanent fix therefore needs both, and an amendment of ADR-0044 for the open long-gap records (A3.10, item 2).
🤖 Generated with Claude Code
docs(adr): Amendment 3 runs at 12:00 UTC with replace-or-mark-invalid…
docs(adr): Amendment 3 retries hourly and never blocks the live servi…
docs(adr): Amendment 3 abandons a day after 23 attempts and signals t…
docs(adr): Amendment 3 decides day validity by archive verification, …
docs(adr): Amendment 3 attaches no retention duty to slices retired b…
Merge pull request #539 from NeoNix-Lab/agent/issue-538-adr-0074-amen…
github-actions commentedon Oct 28, 2026
Automatically closed by PR #539 merged into
implement/fid.Merge pull request #541 from NeoNix-Lab/agent/issue-538-a3-on-dgr-clo…