P1: before the tag
An appendix to the milestone.
P1: before the first tag
-
The shipped text points back into nife. Finding: the template's
standalonecounts four milestone citations, nine paths into the nife tree, four section citations, seven provenance-block lines and one line naming the architect. The root//!block quotes the architect's answer and names the person. The item docs citenotes/ntp.md,notes/ntp/the-era-pivot.md,notes/ntp/what-is-proved.md,notes/undefined-behavior.md,notes/mutation-testing.md,notes/verification.md,script/verify,measured_boot, milestones 51 and 211 and a pull request number, and speak of "the clock service" as though the reader knew which one. Evidence:Cargo.tomllines 7 to 13.src/lib.rslines 3, 9, 11 to 15, 53, 56, 67, 80, 93, 201, 326, 547, 690, 827 to 832, 1124, 1183.src/verification.rslines 10 and 122. Change: the move strips everyName:block, as ruled. Confirm the strip reaches the//!form at line 11, which is a paragraph of the crate root and not a///block (unverified). Rewrite each remaining citation to point at the README ordocs/, and "the clock service" to "the caller that owns the clock". TheCargo.tomlcomment becomes thedescription. Door: two-way. Effort: S. -
The crate does not say it is safe Rust. Finding: no
unsafeanywhere (unsafe_scanpasses), but no#![forbid(unsafe_code)]. The forbid makes the claim the compiler's, and it is the form the template's fuzz opt-in reads without a scan. Evidence:src/lib.rsline 17. Change:#![forbid(unsafe_code)]under#![no_std]. Then opt the repository into the weekly fuzz (public-crash-inputs: true, which the template allows only for a crate with nounsafe). Add onefuzz/target that feeds arbitrary bytes and three arbitrary timestamps toQuery::accept. The target asserts the Kani harness's coherence conditions on anOk. Kani already covers the domain. The fuzz target exercises the compiled code on a hosted runner at no cost to a person. Door: two-way. Effort: S. -
The exhaustive sweep depends on a workspace profile override that does not move. Finding:
every_nanosecond_survives_the_round_tripruns the conversion on all 10^9 inputs and is quick only because the workspace manifest setsopt-level = 2for this package. Measured on a Linux host with 80 cores, the test takes under 2 s at that level and about 25 s atopt-level = 0. In the new repositorycheck / testsruns it once,check / mutation-diffand the weeklymutationrun it once per mutant (185 mutants), andweekly / mirialready takes the strided path. Evidence:Cargo.toml(workspace) lines 284 to 290.src/lib.rslines 826 to 854. Change: carry the optimization in the crate's own manifest ([profile.test] opt-level = 2, or[profile.dev.package.network_time_protocol]since the crate is its own workspace root). Coverage holds at that level:cargo llvm-covwith the override reports 485 of 495 lines ofsrc/lib.rs, 97 per cent, over the template's floor of 85. Were it to fall under the floor, the full sweep would move behind a feature or an environment variable, run inproofsbeside Kani, and the default test would walk the same prime stride Miri does. Door: two-way. Effort: S. -
The surviving mutants need the exemptions file. Finding: five mutants survive and nife's triage calls each equivalent (
|to^over disjoint bits inPacket::to_bytestwice,Timestamp::from_unixand the low-bit randomizer;%to+infrom_unixwhere theas u32truncation makes the two agree). The template'smutation / mutationfails on one survivor unless.github/mutants-exemptslists it with a reason, andrelease / gatereads that verdict. Evidence:notes/project-metrics/mutation-census.csvlatest row.mutation-triage.csvlines 592 to 595. Change: an exemptions file carrying the five with the triage's reasons. Or, for the four|/^survivors, a test that sets overlapping bits through the public surface is impossible by construction, so the exemption is the honest record. Door: two-way. Effort: XS. -
The totality claim has a hole a caller can construct. Finding:
Interval's documentation says "there is no input, however absurd, on which it panics", and that holds for every intervalsinceandacceptproduce (each fits in 64 bits).Interval::from_ticksis public and takes anyi128, andnanosecondsandmicrosecondsmultiply by 10^9 and 10^6 before dividing, so an interval above about 1.7 × 10^29 ticks overflows: a panic in a debug build and a wrapped answer in release. Reasoned, not run. Evidence:src/lib.rslines 302 to 335. Change: eithersaturating_mulin both accessors, or narrow the public constructor toi64ticks (the widest value the crate ever produces) and keepi128as the private accumulator. The second is cleaner and is what the type's documentation already argues. A Kani harness overfrom_ticks(any i64).nanoseconds()then proves the accessor total. Door:from_ticks's parameter type is a public signature, two-way today. Effort: XS. -
Two checks the RFC's reference implementation makes are absent or differ. Finding: RFC 5905 Appendix A's
packet()refusesrootdelay / 2 + rootdisp >= MAXDISP. The crate refuses> MAXIMUM_ROOT_DISTANCE, so a root distance of exactly 16 s passes here and not there (the testa_server_claiming_an_impossible_root_distance_is_refusedpins the crate's choice). The same routine refusesreftime > xmt, a reference timestamp later than the transmit timestamp. The crate does not look atreferenceat all. Both verified against the RFC text. Evidence:src/lib.rslines 716 to 718 and 435 to 441. Change: match the RFC's>=and say so in the constant's documentation. AddReject::ReferenceAfterTransmitwith a modular comparison throughsince, a test and a line in theacceptdocumentation's list. Both are cheap and both close a gap a stranger comparing against the RFC will find. Door: a newRejectvariant is a public enum change, two-way today. Effort: XS. -
The replay test is the caller's, and the documentation does not say so. Finding: RFC 5905's
receive()drops a packet whose transmit timestamp equals the last one accepted. The crate is stateless, so this test cannot live here. A caller that reuses aQueryacross attempts, or runs long, owns it. nife's client draws a fresh nonce per attempt, so a replay fails the origin check there, and nothing says that a different caller must do the same. Evidence:src/lib.rslines 681 to 690.components/src/network_time_client.rsline 153. Change: one paragraph onQuery::acceptand in the README's BUGS: aQueryis for one request. A reply to an earlierQueryfails the origin check, and a caller that keeps one nonce across requests must refuse a repeatedtransmititself. Door: two-way. Effort: XS. -
A missing proof: nothing shows
acceptever accepts. Finding: Anacceptthat refuses every packet satisfiesaccepting_is_total_and_a_sample_is_coherent. Unit tests pin the acceptance path on one hand-assembled reply and one rollover case. Tests cover the offset and delay values, and no proof does. Evidence:src/verification.rslines 106 to 138. Change: a harnessa_consistent_exchange_is_accepted. It takes symbolic T1 to T4, constrained so that the modular differences are non-negative and the server turnaround stays within the round trip. It builds a packet from them with version 4, mode 4, stratum in 1 to 15, a non-zero transmit and a root distance under the maximum. AssertOk,delay.ticks() == (T4 - T1) - (T3 - T2)andoffset.ticks() == ((T2 - T1) + (T3 - T4)) / 2in wrappingi64arithmetic. Its falsification patch turns the stratum>into>=. Kani handles this in seconds since it is addition. Door: two-way. Effort: S.