Repository navigation
test(nodes): pin raised-interval guard and repeated cut, document false change (#270) - #292
Conversation
…nd (#270) Follow-ups N1, N2 and N5 from the round-2 review of #247. Each new case pins behaviour that no test held, so a mutant survived: - N1: a 12 h series ending in gaps of 24, 12, 24, 24 h stays 12 h. A 1x gap among the newest 3 fitting gaps breaks the raised run (mutant R2, which skips it, read 24 h). - N2: zero-hop 60 -> 120 -> 240 min and flood 12 -> 24 -> 47 h give the final interval (mutant R1, which cuts once, read the middle one). - N5: the zero-hop 2-min candidate band is 120 s +-10 %: 108 and 132 s give 120 s, 107 and 133 s give none (mutant C1, +-20 %, read 107 s and 133 s). The 54 min and 2.7 h edges are pinned as well. - N3: _FalseChange pins the documented trade-off: three heard gaps at the same multiple read as k x at medium on 4 adverts, an outage gap does not break the run, and the next 1x gap does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or (#270) Review N3 and N5 on #247: the OpenAPI NodeAdvertIntervals description says "the median of the fitting gaps" while the estimator takes the median of gap/k, and docs/api-spec.md does not mention the false-change trade-off of the raised-interval rule. The test checks both, with the _FalseChange examples. It fails until the docs are fixed. Also drops the trailing blank line the previous commit left (gofmt). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#270) - docs/api-spec.md: a "Known trade-off: false change" bullet next to the sparse-coverage limitation. An unchanged interval whose newest 3 heard gaps share a multiple k reads as k x at medium on 4 adverts, until the next gap at the interval itself. - openapi.go: NodeAdvertIntervals says the median of gap/k, as the estimator does and the docs already said. - The MedianNotMean test comment says gap/k too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rapport — CS-pve-agent2 PR#292 #270 — head 785792bStatus: All five items from #270 are done (N1, N2, N5 tests; N3 docs; N5 OpenAPI text). Each mutant survives the master tests and dies on this branch, and CI is green on Evidence tags: [T] test or run output in this session, [A] analysis or reading of source, [K] known context from earlier issues and PRs. Requirements
The mutant runs used The docs examples and the outage claim come from the round-2 review on #247 [K], and F7/N4 belong to M2 on #245, with no code change here [K]. The optional N3 idea, " Local runs [T]
The server was stopped by pid, and its port was confirmed free. A first local run with the default 10 min CI on
|
| Job | Result |
|---|---|
| Go Build & Test | pass (23m10s) |
| Playwright E2E Tests | pass (20m58s) |
| Build & Publish Docker Image | pass |
| Release Artifacts | skipping |
| Publish Badges & Summary | skipping |
| Deploy Staging | skipping |
There were no re-runs, and the known flaky test (#271) did not fail.
Invariants [T][A]
cmd/serverstays read-only: no write statement and no RW connection in the diff.- No new
map[string]interface{}in the added lines. - No frontend or colour change.
.github/is unchanged: fork guards are 9 indeploy.ymland 1 inrelease-fast-path.yml.- No runtime or performance change, since only tests, the OpenAPI text and the docs changed.
Remaining issues
- Commit message slip [T]. The
785792bbmessage says it changes theMedianNotMeantest comment, but that edit is in082c26b2. Also,082c26b2left a trailing blank line, whiche6209c41removes. History is not rewritten, and the PR description notes both. - Local full-suite timing [T]. I created the commits while the local full Go run was in progress, after its compile step. The full suites on the exact head ran in CI, and they are green.
- Not merged or marked ready, as instructed.
Review — CS-MacBook PR#292 — head 785792bDom: APPROVE with nits Independent, read-only review. Verified on the merged tree Findings
No correctness, scope or safety issue found. Point-by-point1. Requirements each have a test, red-before → green-after. [T][A]
Optional N3 ("report 2. Scope. [T][A] Diff touches only 3. Docs match code. [T] Tests I ran [T]
Mutants I ran [T] (own, against the merged tree)
Note: my first R2 attempt (dropping Edge case I added and ran [T]The docs claim "a reboot advert between the 2× gaps" does not break the run, but Not verified / relied on CI
CI on |
Relates to #270
Follow-ups N1, N2, N3 and N5 from the round-2 review of #247 (#245 M1). Tests and docs only: the estimator in
cmd/server/advert_intervals.gois unchanged.Plan
advertIntervalRaised_RaisedIntervalcase: 12 h series ending in gaps 24, 12, 24, 24 h → 12 h high (17/16)for best > 0)_RaisedIntervalcases: zero-hop 60 → 120 → 240 min → 240 min, flood 12 → 24 → 47 h → 47 h (both high, 7/6)ifinstead offor)_CandidateBandEdges: 108 s and 132 s give 120 s; 107 s and 133 s give none. Also pins the 54 min zero-hop and 2.7 h flood edges onadvertIntervalCandidateOKdocs/api-spec.md, next to the sparse-coverage limitation._FalseChangepins its examples (60 → 120 min, 47 → 94 h, 120 min with 3× gaps → 360 min, all medium 4/3). It also pins that an outage gap does not break the run and that the next 1× gap doesNodeAdvertIntervalsnow says the median of gap/k, as the code and docs do._DocsMatchCodechecks the OpenAPI text and the docs sectionF7/N4 belong to M2 (#245) and need no code here. The optional "report
lowwhile the estimate rests on a short post-change segment" from N3 is not done. It would change the confidence rules, so it is better decided with M2.Commits
082c26b2test: pins for N1, N2, N5 and the N3 behaviour (green on master code: these are behaviour pins).e6209c41test:_DocsMatchCode, red until the docs are fixed.785792bbdocs: the api-spec bullet and the OpenAPI text._DocsMatchCodeturns green.Note: the commit 3 message says it changes the
MedianNotMeantest comment ("median of gap/k"). That edit actually landed in commit 1. Commit 1 also left a trailing blank line in the test file, which commit 2 removes. History is not rewritten.Tests
cd cmd/server && go test ./...andcd cmd/ingestor && go test ./....sh test-all.sh: 221/221 files.node test-frontend-helpers.js: 707/0.e2e-fixture.db, prepared as in CI (freshen, inline seed, migrate, seeds 2073/199/245):test-issue-245-advert-intervals-e2e.js7/7,test-issue-2073-recent-adverts-e2e.js10/10.TestEstimateAdvertInterval*,TestSnapAdvertInterval,TestNodeAdvertIntervals*,TestAdvertIntervalSamples*,TestNodeDetail_AdvertIntervals,TestOpenAPI*andTestAdvertIntervals_*. Each survives the master test file and dies with this branch's.Invariants
cmd/serverstays read-only (no write in the diff), and there is no newmap[string]interface{}.scripts/check-xss-sinks.sh --diff origin/masterhas nothing to scan, and no colours change..github/is unchanged: fork guards are 9 indeploy.ymland 1 inrelease-fast-path.yml.🤖 Generated with Claude Code