test(ingestor): pin failed-tick, NULL route type and originator exclusion (#200) - #207
Conversation
…sion (#200) Three mutants from the PR #190 review (round 2b) survived the whole cmd/ingestor suite. One test each: - X1: a neighbour-edge tick whose build fails (neighbor_edges upsert rejected) must not publish a post-build graph, so the resolved_path backfill stays not-ready and keeps its watermark. Control: once the write works again the next tick marks the graph built and the pass runs. - X3: an observation whose transmission has NULL route_type creates no observer<->last-hop edge; a flood row in the same build does. - X4: the backward chain never resolves a hop to the packet's originator, even when the originator is the only candidate adjacent to the next hop. Test-only; no production code change. Relates to #200 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rapport — CS-Minimax PR#207 #200 — head 6bd93a5Status: ready for review (draft): three tests added, each mutant red, master code green, CI green, no production change. Base Evidence tags: [T] test or CI run, [A] analysis of code, [K] taken from earlier comments, not re-run. Mutants: red and greenEach mutant was applied as a one-line edit to the head, then reverted (
The middle column reproduces the review's finding: without the new tests, all three mutants pass the whole Test design notes
Real defects foundNone. All three behaviours are correct on master; only the tests were missing. [T] Tests
CI (run 37183520330, head
|
| Job | Result |
|---|---|
| Go Build & Test | success (ingestor package ok, 135 s with coverage) [T] |
| Playwright E2E Tests | success [T] |
| Build & Publish Docker Image | success [T] |
| Release Artifacts | skipped (PR) [T] |
| Deploy Staging | skipped (PR) [T] |
| Publish Badges & Summary | skipped (PR) [T] |
Rules
- Test-only change:
cmd/serverandinternal/are untouched, and there are no writes outsidecmd/ingestor. [T] - No new
map[string]interface{}. [T] - The title and body have no closing keyword; the body starts with
Relates to #200. [T] - Mutant definitions follow the PR feat(ingestor): resolve the last hop from the observer (#188) #190 round 2b review. [K]
Generated by Claude Code
Review — CS-pve-agent2 PR#207 ingestor-test-gaps — head 6bd93a5Dom: APPROVE with nits This is an independent, read-only review. I made every mutant myself in scratch copies built with Evidence tags: [T] test or CI run, [A] analysis of the code, [K] taken from the author's report and not re-run. Findings
No blocking findings. Verification points
MutantsEach mutant was applied to a separate scratch copy of the head, and only the new tests were run against it (
On the unmodified head, all three tests are green. [T] I did not re-run the claim that these mutants survive the rest of the Tests
My reading of the timeout is that the local environment was slow, not that there is a regression. User CPU was about 33 s across a 10-minute wall clock. The test passes alone. The PR does not touch it. The author's local run and CI both completed the package. [A] Not verified
|
Relates to #200
Three mutants from the PR #190 review (round 2b, head
0f4c167a) survived the wholecmd/ingestorsuite. This PR adds one test per mutant incmd/ingestor/resolved_path_mutants_200_test.go. It changes tests only; no production code changes.Mutants and tests
33b0dfe5)neighbor_builder.gotick:if err == nil && b.caughtUp()becomesif b.caughtUp()TestNeighborEdgesBuilder_FailedTickDoesNotMarkGraphBuilt_200neighbor_builder.go:isFloodRoute(routeType)becomesisFloodRoute(routeType) || routeType < 0TestNeighborEdgesBuilder_NullRouteTypeAddsNoObserverEdge_200path_resolver.goresolvePathBackward:fromPubkeyis not put inseenTestObserverAnchor_BackwardWalkExcludesOriginator_200How each test works
X1, failed tick. Two triggers reject every INSERT and UPDATE on
neighbor_edges. A new flood observation (["c355"]) makes every build try to upsert observer↔c3a, so the warm-up and every tick fail with an upsert error after reading one row. That row count is under the cap, socaughtUp()alone would say the build is complete. Readingneighbor_edgesstill works, and every tick still publishes a non-empty graph. The test waits for two graph refreshes, so at least one tick has fully finished. It then asserts four things:RunResolvedPathBackfillreturnserrResolvedPathBackfillNotReady;Control: once the triggers are dropped, the next tick marks the graph built, and the same pass resolves the rows. This shows that a failed tick is the only thing holding the pass back.
X3, NULL route type. One build covers two rows from the same observer. The flood row
["a111"]makes the observer↔a1a edge (the control). The NULL row["c366"], whose transmission hasroute_typeNULL, must not make an observer↔c3b edge. The test also checks that the fixture really has exactly one NULLroute_typerow.X4, originator exclusion. A flood ADVERT from
from188, path["f0", "b2"]. A second relay shares thef0prefix and has no known edges. The forward chain leaves hop 0 nil, because its anchor is the excluded originator. In the backward chain, the originator is the onlyf0candidate adjacent to hop 1 (b2a). The test asserts thatresolvePathBackwardnever returns the originator, and thatresolveObservationPathgives[nil, b2a].Real defects found
None. All three tests pass on master unchanged.
Tests run locally
cd cmd/ingestor && go test -count=1 ./...: ok (100 s)go test -race -count=3 -run '_200$' .: ok, no racego test -count=50 -run 'FailedTickDoesNotMarkGraphBuilt_200' .: ok (timing stability of the tick wait)go vet ./...: ok.gofmt -lon the new file: clean.sh test-all.sh: 211 passed, 0 failedRules
cmd/ingestor;cmd/serverandinternal/are untouched.map[string]interface{}.🤖 Generated with Claude Code