Skip to content

fix: count design periods at their actual deadlines - #3

Draft
1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/design-clock-boundaries
Draft

1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/design-clock-boundaries

Conversation

@1932819331hy-debug

Copy link
Copy Markdown

Summary

 Design-clock period counts near a floating-point boundary
- trust floor(elapsed / rounded period duration)
+ check the adjacent deadlines using the existing intendedEnd calculation

Fix both sides of an ordinary fractional-rate boundary:

  • At 200 ms/block, five 1003-block periods take 1003 seconds. The report previously counted only four expected periods while reporting zero drift.
  • At 150 ms/block and three blocks/period, a schedule starting at second 1 has its hundredth deadline at second 46. The immediately preceding representable timestamp previously counted that period too early.

Check the next and already-counted deadlines without an epsilon or loop. Keep the existing intendedEnd arithmetic, input rules, RPC behavior and other report fields unchanged.

Evidence

  • Before: the same 22 new native tests have 11 passes / 11 assertion failures on main 13184ff111532c172f37d54d59f00e7eea6b9a23.
    After: all 22 pass; native npm test passes 45/45.
  • Independent AI-assisted review passes 44/44 tests, including both public entry points, the timestamp immediately before/at/after a deadline, fractional and zero origins, caps and unchanged fields. Eight deliberately broken variants are detected.
  • Local composition with fix: reject unsafe schedule block counts before projection #1 and fix: reject primitive RPC responses without retrying #2 passes 72/72 in both application orders, producing the same tree. Their branches and scopes are unchanged.
  • The independent review ran 32 commands. Its 12 nonzero outcomes are retained and classified: two baseline reproductions, eight negative variants, the offline-guard self-test, and the decimal diagnostic below.

Numerical limit: the broader decimal-millisecond diagnostic still fails with 768 discrepancies among 37,800 cases at low/zero origins. It compares independently rounded decimal totals with the library's existing binary operation order. This patch preserves the observable intendedEnd convention. The separate reported-deadline consistency sample passes, but this is not a full-domain precision claim.

All execution used Node 24.22.1 and synthetic in-memory transport. Node 18/20/22, other operating systems, live RPC, actual CLI/Action execution and hosted CI remain unverified. Build, lint and typecheck scripts are not configured.

AI assistance was used for implementation, testing and independent review. This is a source-backed contract repair, not completion of a separate maintainer issue.

Merge Danger

Door: Two-way. A localized arithmetic correction with no migration.

Blast Radius: Reporting.

Expected-period and periods-ahead counts can change by one at the demonstrated boundaries. Deadline values and numeric policy are unchanged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant