Skip to content

feat: add configurable liveness timing with safe deadlines - #1

Merged
NicolasDP merged 1 commit into
mainfrom
codex/configurable-timing
Aug 31, 2026
Merged

feat: add configurable liveness timing with safe deadlines#1
NicolasDP merged 1 commit into
mainfrom
codex/configurable-timing

Conversation

@NicolasDP

Copy link
Copy Markdown
Contributor

Summary

  • add a validated, endpoint-wide TimingProfile for established-session
    passive keepalive and dead-peer timing
  • preserve the exact v1 defaults (10s keepalive / 25s dead timeout) and
    stamp the profile onto both outbound and inbound connection birth paths
  • validate the coupled timing margin
    (D_eff > 2 * K_eff + K_INITIAL_RTT + 2 * SHELL_LATENESS_BOUND) and make
    persistent-keepalive validation use the connection's effective dead timeout
  • make monotonic deadline arithmetic checked end to end across endpoint,
    connection, recovery, close, ACK, guard/introduction, and test-util timers
  • represent deadlines beyond the platform clock horizon as logically enabled
    but unannounced, so they cannot panic, wrap, clamp, saturate, or fire early;
    later state transitions recompute them
  • document rulings 282-284 and add independent public, flow, and near-horizon
    regression coverage

Compatibility

  • no wire-format, handshake, cryptography, or negotiation changes
  • existing applications retain the exact v1 timing behavior unless they
    explicitly install a custom profile
  • asymmetric profiles remain wire-compatible, although peers may reach local
    liveness verdicts at different times
  • all non-liveness protocol timers remain fixed

Verification

  • cargo fmt --all -- --check
  • cargo check --all-targets --all-features
  • cargo build --all-features --all-targets
  • cargo clippy --all-targets --all-features -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
  • cargo test
  • cargo test --all-features
  • cargo test --release --all-features
  • cargo +1.96.0 check --all-features --all-targets
  • cargo deny check
  • git diff --check

All gates pass. cargo deny reports only the pre-existing non-failing
duplicate-syn and unmatched license-allowance warnings.

@NicolasDP
NicolasDP merged commit dd16db7 into main Aug 31, 2026
10 checks passed
@NicolasDP
NicolasDP deleted the codex/configurable-timing branch August 31, 2026 13:59
NicolasDP added a commit that referenced this pull request Aug 31, 2026
Rulings 282-284's implementation went through a high-effort adversarial
review after merge; ten findings survived verification. Two rulings
discharge them, both taken by the maintainer on 2026/08/31.

Ruling 285 — the unreachable-deadline residue at the three arm-once
timer sites (contested verdict, CloseLinger, guard exemptions) is priced
and accepted: no behavior change, the consequence documented at each
site, and sync_liveness_timer's "quiet, not immortal" claim scoped to
representable anchors with the horizon window stated.

Ruling 286 — the round's record corrected:
- the false rule-6 independence attestations (three sites) now state the
  true provenance; an isolated no-repo agent re-derived ruling 283's
  construction boundaries from the ruling text alone and confirmed the
  implementation on every checkable point;
- that re-derivation found ruling 283's named 1 s/3 s profile pinned
  nowhere (167 ms of margin) — both short application profiles are now
  pinned;
- the default profile must pass its own try_new (V1 was never routed
  through validation, so a constants edit could ship a rejected default
  with every gate green);
- SPEC.md's amendment-table row 282 gains the sixteen unlisted sections
  of its blast radius, including §6.8's now profile-dependent
  restart-resolution bound, with the correction recorded as row 286;
- shell::Connection::new is total again (the driver passes the profile
  read off the live core it already holds; clone_handle delegates,
  un-duplicating the handle accounting);
- RttEstimator's arithmetic_reachable latch deleted — provably
  untrippable (x*3/4 + y/4 and x*7/8 + y/8 are bounded by max(x, y)
  under floor rounding), its named test's Nones come from
  loss_delay/pto_interval's own checked arithmetic;
- ConnSeed's bare-[u8; 32] conversion is #[cfg(test)]: production birth
  paths go through mint_conn_seed, and an untyped third path minting v1
  defaults on a configured endpoint contradicts §5.7.

Open, deliberately: try_new's error precedence when both the floor and
the relation are violated is ratified nowhere (flagged in ruling 286),
and the review's six confirmed-but-cut cleanups are unaddressed.

All nine release gates green on this tree, including MSRV 1.96 and
cargo deny.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sunYH6Lwd3RaezngpD8TR
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