fix(reliability): preserve diagnostic event chronology - #5572
Open
catwithtudou wants to merge 3 commits into
Open
catwithtudou wants to merge 3 commits into
catwithtudou wants to merge 3 commits into
Conversation
Signed-off-by: catwithtudou <42607255+catwithtudou@users.noreply.github.com>
Signed-off-by: catwithtudou <42607255+catwithtudou@users.noreply.github.com>
Signed-off-by: catwithtudou <42607255+catwithtudou@users.noreply.github.com>
catwithtudou
marked this pull request as ready for review
October 4, 2026 12:09
This branch has not been deployed
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.
Goal And Delivered Outcome
Fix a reproduced reliability-diagnostics readback defect: accepted timezone-aware timestamps were sorted as text. An error at
12:00+02:00, recovery at10:01Z, and successful turn end at10:02Zconsequently appeared errored and unrecovered, with reversed receipt bounds. They now read back as idle, recovered, and chronologically bounded, while preserving the original ledger bytes.main, investigated at6f5505ee6b860c4994e959465736c59001d44399.Author Declaration
Implemented against
Specification:
loopx/capabilities/reliability_diagnostics/README.mdat baseline6f5505ee6, “Observer envelope” and “Diagnostic projection”: timezone-aware ISO-8601 input; stage from the last event; recovery following a completed step/non-error turn end; stall relative to--as-of.observed_at_microsecondsandLedgerReading.ordered_envelopes; independent offset, fraction, and equal-instant vectorsSelf-check: reviewed both callers of the ordering property, the accepted timestamp parser, current related PRs, and the capability contract. A first implementation using only
datetimefailed independent review because it truncated accepted submicrosecond precision; the final implementation retains it using standard-library rational arithmetic. Standards and specification review have no remaining findings.Scope And Continuation
Complete within this scope. Reuse the existing Python diagnostic data adapter rather than add a parallel TypeScript owner or perform an unrelated language migration. The related simplification is one shared time interpretation for sorting and deltas; no new dependency, migration, activation, schema, or authority change.
Rollback restores readback logic; no persisted data is rewritten. No successor issue is needed for this bounded defect.
Validation
c848353251c9dd7058c091f4cd40e9b2f52db423for final focused tests and premerge; broader-run provenance is stated below.6f5505ee6; later main30efccd6cchanges unrelated Lark material and does not touch this repair.tests/capabilities/test_reliability_diagnostics*.pyfiles: 162 passed on final head.dsh-shadow-observer-fixture-smoke.pyandledger-retention-smoke.pypass; CLI regression covers ingest, receipt, combined status, recovery, and unchanged ledger bytes.git diff --check, and public-boundary scan.examples/control_plane/cli-output-budget-regression-smoke.py; risk-basedloopx canary premerge --from-git-diff --git-diff-base 6f5505ee6: 19/19 selected checks passed.no-any-returnerrors in envelope_sequenceand intake_count; identical errors reproduce on unchanged base. Configured repository mypy passes.Full-run failure disposition: 78 failing cases also fail on unchanged
6f5505ee6, across existing control-plane contracts, collaboration, inventory, configuration backup, UTF-8 policy, and recovery. Related upstream repair work includes #5533 and the inventory fix #5548; this PR does not claim those branches repair every observed failure. The other 37 cases pass in isolation on both base and final head; their full-run failure cause is unresolved. The full suite is therefore not green, and an exact-final-head complete rerun was not performed. No unrelated tests were disabled or expectations relaxed.Canonical public-fixture CLI JSON is byte-identical between unchanged base and final head. The intended changed cases are demonstrated by the independently expected chronology regressions above.
Coverage: default-off producer behavior and public consumers retain their existing validation; new regressions check event order, recovery, stall age/gaps, equal-time session/sequence ties, exact fractional precision, and byte-preserving readback. No claim that all upstream integration checks are green or the parent RFC is complete.
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Observer-first reliability diagnostics: correct existing passive readback. No live deployment or parent-RFC completion claim.
Shared-authority RFC fixture impact
N/A: no shared-authority provider, promotion, routing, or compatibility projection changes.
Boundary Checklist