Skip to content

[governance] DG-R: register ADR-0074 Amendment 3 (R03, R04): close every live day from the archive, unattended #540

Open

Description

@NeoNix-Lab

Governance-only reconciliation

This issue is governance-only: it authorizes the mutation of SCOPE.md, docs/product/ROADMAP.md, docs/product/CAPABILITY_MAP.md, docs/product/CAPABILITY_DAG.md and docs/architecture/OPEN_DECISIONS.md, and of nothing else. Branch governance/issue-<this issue>-... from implement/dgr-closure (the integration branch cut from main); the pull request targets implement/dgr-closure, never main.

Parent: design gate #538 (ADR-0074 Amendment 3, PR #539); precedent: #518 for #515 (DG-R, atoms R01 and R02).

Start gate

  1. PR ADR-0074 Amendment 3: bring to the main line and record the acceptance (#538) #541 (Amendment 3 on implement/dgr-closure, with its acceptance record in A3.13) is merged. PR docs(adr): ADR-0074 Amendment 3 (PROPOSED), close every live day from the archive, unattended, whole allow-list (#538) #539 had merged the proposal into implement/fid, a wave already promoted to main; ADR-0074 Amendment 3: bring to the main line and record the acceptance (#538) #541 moves it onto the main line. Do not register anything as authorized before ADR-0074 Amendment 3: bring to the main line and record the acceptance (#538) #541 is merged.
  2. The branch is cut from the current implement/dgr-closure.

Why

ADR-0074 Amendment 3 decides how a closed live day made of cycles slices is verified against the Bybit archive and, when incomplete, replaced by it, and that this runs unattended for every instrument of the allow-list. It is not in the planning documents. Measured on homelab (operator-reported): in cycles mode 33.2% (2026-10-24) and 34.4% (2026-10-25) of the day lies in uncovered gaps; no archive file was on the server, so the share of trades actually lost on those days is not measured.

Required output

  1. CAPABILITY_DAG.md: two new atoms registered directly as FROZEN/MISSING in section R (gate DG-R, already registered by [governance] DG-R: register ADR-0074 Amendment 2 (R01, R02) and reconcile O01 with ADR-0075 Amendment 1 #518), plus a gate paragraph; counts recomputed by script from the tables at the time of the change (do not copy any number from this issue); no existing atom changes state:
    • R03 slice-day closure v1 (ADR-0074 A3.2 to A3.7): plan, retire every slice with the R01 reassessment, import dt=<day>/seg=000000.000 through S13/S14, verify in full and through the DataGateway, for closed UTC days made of slice partitions; conservation by (exchange_ts, trade_id) with full-field equality; the refusals of A3.3; and the overlap guard of A3.6 added to the R02 plan (a valid partition of an adjacent day that overlaps the day). Requires R01, R02, O01; unlocks R04.
    • R04 unattended closure run v1 (ADR-0074 A3.12): a timer-started run, hourly, taking a day from 12:00 UTC of the following day; per day verify-only / replace the whole day / mark invalid and retry; 23 attempts then the day is marked invalid and abandoned (a reopen line restores it); the signals and the attempt count are lines appended to a JSON-lines log; the run is a separate process that never blocks the live service (lock timeouts, one object per transaction, pacing, CPU/memory limits, wall-clock limit). Requires R03.
  2. CAPABILITY_MAP.md, ROADMAP.md, OPEN_DECISIONS.md: the same registration; the open follow-ups as listed under Not decided here below.
  3. SCOPE.md: extend Part D (DG-R) with the two atoms, their start gates and acceptance, authority (ADR-0074 A3), baseline, non-claims, exit criteria, out of scope. R03 and R04 are post-version work and must not block O02, O03 or any other exit criterion.
  4. SCOPE.md Part D: record the decisions already taken by the maintainer on 2026-10-27/28, so no implementation reopens them: every instrument of the allow-list; unattended; validity of a day decided only by the archive verification within 23 attempts; long-gap records do not decide validity and ADR-0044 is not amended; the retired slices of a day closed from the archive carry no retention duty and the run deletes nothing (ADR-0049 unchanged).
  5. Baseline: record the state of R01 and R02 as it is on the base branch when the branch is cut, without judging it.
  6. Explicit non-claims: nothing of R03 or R04 is implemented; no slice day has been closed from the archive; the 2026-10-26 replacement of nine legacy days is recorded as evidence and is not a precedent; the gap figures above are operator-reported and are not an audit; the share of trades lost on 2026-10-24/25 is not measured; the publication time of the archive file is not measured (it is not known whether the file of the previous day exists at 12:00 UTC); the live service remains in cycles mode and the switch to the continuous session is not part of this work; no deployment, no timer installed.

Not decided here (to register as open follow-ups, not as blockers)

  • Whether the archive file of the previous day exists at 12:00 UTC (first hour of the timer).
  • The directories moved aside on 2026-10-26 and the catalog dump: who keeps them and for how long (ADR-0049).
  • Whether a complete live day may ever be replaced (proposed: never).
  • Whether the explicit-gap state of the live service caused by an open long-gap record should ever end, and a rule for a record that crosses a midnight.
  • The measured bound on the live publication latency during a closure (a required measurement of R04, A3.11 item 5).

Verification

python tools/run_tests.py (known failures on Windows: test_promote_main_v1, the OpenSSL-dependent tests); python tools/check_markdown_links.py; git diff --check; python tools/workflow.py preflight --base implement/dgr-closure; the counts recomputed from the DAG tables by script.

Out of scope

Any code or ADR change; the implementation of R03 and R04; an amendment of ADR-0044 or ADR-0049; crediting any atom; running anything on the server; the switch of the service to continuous; promotion into main.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions