Repository navigation
feat(live): the Live map follows the 1-byte hop setting (#912 M1) - #1004
Conversation
The Show / Mark / Hide setting for 1-byte path hops (hop-filter.js, #674) now applies to the Live map animation too. resolveHopPositions() takes the mode, read once per packet group from MC_get1ByteHopsMode(), so a change reaches the next packet at once: - Show: unchanged. - Hide: 1-byte hops are left out (MC_isVisibleHop), with resolved_path filtered in step so each server answer stays with its own hop; when hops were dropped every remaining segment is dashed and lighter, as route-render.js does (Kpa-clawbot#1689 r1). - Mark: 1-byte hops stay; segments that start or end at one are dashed and lighter (class live-path-uncertain on the trail). The follow (#880) still reads every hop position through resolveHopEntries(). "Multibyte only" is unchanged. Tests: test-issue-912-live-1byte-hops.js (vm, per mode, plus a 10k-path perf budget) and test-issue-912-live-1byte-hops-e2e.js (recorded Live polylines at 1440x900 and on a 375x560 touch phone). Relates to #912 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both new suites in scripts/e2e-shards.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review — CS-Minimax PR#1004 — head 889a3d6Dom: REQUEST CHANGES (small: one missing regression test, plus a merge-order condition for the default; the code itself is correct) Independent, read-only review. Evidence: [T] = a test (the PR's or mine) run by me, [A] = a run or measurement I did locally for this review, [K] = read from the code or diff. Findings
Requested for (1): one test that fails without Answers to the review pointsCorrectness [K][T]
Mode read once per packet group [K][T]
Rendering [K][A]
Default visual change
Tests [T][A]
Perf [K][A]
Merge commit
Invariants [K][A]
Phone walkthrough (real taps, cold start) [A]
Test runs [A]
CI per job (run 46044676327, attempt 1): every job passed. That covers Go Build & Test, Go Server Tests 1–3, Go Ingestor, Go Libraries & CLI, JS Unit & Lint, Script & Container checks, Verify Go Test Assignments, Verify E2E Shards & Coverage, Playwright E2E 1–3, and the Docker build and validate jobs. Deploy, Release and Badges were skipped, as they should be on a fork PR. I saw no sign of the known flakes #256 or #267, and no reruns. Server prep: a local Go server on Mutants (mine) [A]
Not verified
|
…ck Hide test Owner decision on #912 (2026-11-27): until M2 (#1001) lands, a visitor who never chose a 1-byte hop mode sees the Live map as Show. A stored Show / Mark / Hide applies as before. Other pages keep hop-filter.js's DEFAULT_MODE (mark). - hop-filter.js: an explicit choice is always stored, Mark included, so "chose Mark" and "never chose" differ (the rule M2 also adopts). New MC_getStored1ByteHopsMode() returns the stored choice or null. - live.js: oneByteHopsMode() uses the stored choice, else LIVE_1BYTE_HOPS_FALLBACK ('show'); M2 replaces this fallback. - customize-v2.js: the hint says Live shows every hop unmarked until a mode is picked. - Review finding 1: E2E step in Hide with a pure 1-byte path and decoded.path.hops set; it fails when the fallback resolveHopPositions call drops hopMode (mutant X3). - Unit: no stored mode -> Show on Live, stored show/mark/hide, Kpa-clawbot#1633 migration and junk mode. E2E: cold start draws unmarked, explicit Mark is stored. - #674 tests: an explicit Mark is now stored instead of "no key". - e2e-shards.json: meanSeconds 90 -> 10.5 (CI ~10 s, local 10.5 s). - Perf test comment: the real timings (60-125 ms per mode). Relates to #912 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review feedback addressed (commit
Local runs: unit 26/26, new E2E 8/8 (×3, about 10.5 s), 🤖 Generated with Claude Code |
Review — CS-Minimax PR#1004 — head d9d7eb4Dom: REQUEST CHANGES (merge only: the PR conflicts with current master and has no CI on this head; the code and tests of the fix round are good) This is an independent, read-only re-review after the fix round ( Evidence tags:
Findings
Nothing else is open. The rest of the earlier findings are resolved (see below). Earlier findings
The fix commit alone (
|
| Mutant | What it breaks | Killed by |
|---|---|---|
Y1 getStored1ByteHopsMode reads the raw key (no junk drop, no Kpa-clawbot#1633 migration) |
the stored-mode read | unit, 2 red ("Kpa-clawbot#1633 key migrates", "junk counts as no choice"). E2E green. |
Y2 Live treats a stored mark as no choice |
owner rule: explicit Mark applies | unit 2 red, E2E 1 red (Mark step) |
| Y3 Hide flags only the first remaining position | all segments uncertain after a drop | unit, 1 red |
Y4 fallback call passes 'show' instead of hopMode |
earlier finding 1 | E2E, 1 red (fallback step). Unit green. |
Y5 Mark flag shifted to i - 1 |
Mark index | survives unit 26/26 and E2E 8/8. See finding 2. |
Y5b Mark flag shifted to i + 1 |
Mark index | unit, 2 red |
The files were restored after each mutant and checked with cmp against a snapshot.
Phone walkthrough (real taps, cold start) [A]
I ran 375×560 and 360×640, both with isMobile and hasTouch, each in light and dark: 4 runs. Each run used a local Go server serving the merged tree.
- Cold
/with no stored mode, then tap Live in the bottom nav. The map is 375×504 (or 360×584) and nothing covers it. - A WS route A → B (1-byte) → C (2-byte). Result:
A→B solid@0.8, B→C solid@0.8. With no choice, Live is Show. - Still on Live, tap More → Customize → Display. The select shows "Mark uncertain hops (default)", and the new hint is present. Both are below the fold and are reached by scrolling inside the panel.
- Pick Hide and tap close. You are still on
#/live. The next packet drawsA→C dashed@0.5with no vertex on B. - Same path again, pick Mark and close. The next packet draws
A→B dashed@0.5, B→C dashed@0.5. - Tap the visible map centre: it hits the Leaflet layer, not an overlay.
In all 4 runs scrollWidth equalled the viewport and there were 0 page errors. No step was impossible. The customizer covers the map while it is open, as a modal does, and closing it is the normal flow. The only friction is finding 3.
Tests [A]
Everything below ran on the merged tree: origin/master 782e6bda plus the PR, with the shard conflict resolved by keeping both entries.
| Suite | Result |
|---|---|
node test-issue-912-live-1byte-hops.js |
26/26 (perf: filter alone 3.6 / 3.9 ms on 10k paths) |
node test-issue-674-1byte-hop-modes.js |
16/16 |
node test-frontend-helpers.js |
738 passed, 0 failed |
sh test-all.sh |
381/383. The 2 failures (#628 vendor gitattributes, #715 OG Denmark) need a .git; both pass in a git clone of the head. |
cmd/ingestor go test ./... |
ok (128.8 s), exit 0 |
cmd/server go test ./... |
ok (148.3 s), exit 0 |
node test-issue-912-live-1byte-hops-e2e.js |
8/8 |
| Affected Live E2Es, all green | #674 modes 7, multibyte-only 10, #880 follow 13, #880 M3 follow customizer 8, #428 Live leak 6, #673 3, heard filter 14, scope colour 8, Kpa-clawbot#1490 GPU 14, #972 7, pulse ring 4, #839 teardown 4, #883 teardown 10 |
node scripts/run-e2e-shard.js --validate |
295 suites across three non-empty shards |
scripts/check-xss-sinks.sh --diff 782e6bda |
exit 0 |
Server prep: a local Go server on e2e-fixture.db, prepared as CI does:
tools/freshen-fixture.sh;- the CI seed SQL from
deploy.yml; corescope-migrate;- the seeds 2073, 199, 245 and 122.
The server was stopped by port.
CI per job: none for d9d7eb47 (finding 1). Run 46044676327 on 889a3d69 was green per job, with skipped Deploy, Release and Badges as expected on a fork PR. That run does not cover the fix round. I can therefore make no statement about the known flakes #256 or #267 on this head.
Invariants [K][A]
- No Go diff, so
cmd/serverstays read-only. - No new
map[string]interface{}. - No hardcoded colours: there is no
#hexorrgb(in the added lines. - The XSS gate is clean.
- Fork guards: 9 in
deploy.ymland 1 inrelease-fast-path.yml; no workflow diff. - No closing keywords in the title, the body or the commits.
- All 3 commits are authored and committed with the expected
dborupidentity. - Scope: Live only, plus the storage rule that the owner decision needs. "Multibyte only" is untouched, and its E2E is green.
What would make this APPROVE
Merge origin/master into the branch, keeping both sides of scripts/e2e-shards.json, and get a green CI run on the new head. Finding 2 (one Mark fixture with a mid-path 1-byte hop) is welcome in the same push but not required.
Not verified
- No deployed instance, staging or prod (not allowed for this review).
- Real iOS Safari: I used Chromium touch emulation only, and the native select picker is not exercised. Finding 3's "no
changeon the same option" is standard HTML behaviour [K], not something I observed on a device. - The 1440 px desktop flow I saw only through the PR's E2E.
- CI on this head: none exists (finding 1).
- feat(config): operator default for the 1-byte hop mode (#912 M2) #1001 (M2) was not re-reviewed. I only checked that this PR's storage rule matches what its body says M2 uses.
Keeps both sides' new suites in scripts/e2e-shards.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The master merge kept both copies of test-issue-740-m3a-dagi-filter-e2e.js; --validate now passes (295 suites). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge with master done (the only blocker in the re-review of
|
Brings in #1004 (#912 M1). Conflicts resolved: - public/hop-filter.js: M1's MC_getStored1ByteHopsMode() and this PR's MC_get1ByteHopsChoice() had the same contract (the visitor's own choice, or null). Keep one: M1's name, with this PR's body, which drops junk and migrates the Kpa-clawbot#1633 key itself instead of going through get1ByteHopsMode(). customize-v2.js and the #912 M2 unit test now call MC_getStored1ByteHopsMode(). - test-issue-674-1byte-hop-modes{,-e2e}.js: both sides made the same change (an explicit Mark is stored); master's wording kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#912 M2) PR #1001 review (CS-VM1) R1: after #1004, Live's oneByteHopsMode() returned the stored choice or a hard "show", so a fresh visitor on an instance with oneByteHopsDefault "hide" still saw every 1-byte hop on Live. The owner decision on #912 (2026-11-27) was "once M2 lands, the operator default decides the starting mode". - hop-filter.js: get1ByteHopsMode(fallback) resolves the stored choice, then the operator default, then the caller's fallback (when it is a mode), then mark. Every other caller passes nothing and keeps mark. - live.js: oneByteHopsMode() is MC_get1ByteHopsMode('show'). Show is left only for a page with no default from /api/config/client, or no hop-filter.js. LIVE_1BYTE_HOPS_FALLBACK and the "until M2" comment are gone. - The customizer hint no longer says the Live map shows every hop unmarked until you pick a mode; the docs and config.example.json name the Live map among the places Mark and Hide apply. Tests: - test-issue-912-live-1byte-hops.js: "no stored mode" and "junk stored mode" now assert the operator default, Show only without one. New: a "hide" default with a fresh profile is Hide on Live (red with the old fallback), "show"/"mark" defaults, a pick beats the default, a late default and Use server default, an invalid default. - test-issue-912-live-1byte-hops-e2e.js: the cold-start step asserts the served default; new steps with /api/config/client answering "hide" (Hide on Live, nothing stored) and with no default (Show). - test-issue-912-m2-1byte-operator-default.js: review N1 (the reset button for a pick equal to the default), N2 (clear without an operator default fires mark) and the fallback order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Relates to #912
Status: M1 is implemented in one commit on
feat/912-m1-live-1byte-hops(basecd5ae0b6). Every M1 point has a test that is red on master and green here, and all 15 mutants were killed. Remaining local failures are timing budgets that fail the same way onorigin/masteron a GPU-less machine. Master was merged in afterwards (onlyscripts/e2e-shards.jsonconflicted; both new suites kept).Evidence tags: [T] = an automated test in this PR, [A] = a run or measurement done locally for this report (not checked in), [K] = read from the code or diff.
Plan (as built)
The issue's M1 plan, render-time only. Nothing stored changes.
resolveHopPositions(hops, payload, resolvedPath, mode)takes the mode.renderPacketTreereads it once per packet group from the visitor's stored choice (MC_getStored1ByteHopsMode(),hop-filter.js). If there is no stored choice, it usesLIVE_1BYTE_HOPS_FALLBACK = 'show'(fix round). An explicit choice is now always stored, Mark included, so "chose Mark" and "never chose" can be told apart. M2 uses the same storage rule. A change made throughMC_set1ByteHopsMode, which firesmc-hide-1byte-hops-changed, therefore reaches the next packet at once. Animations already running finish as they are.applyOneByteHopsMode()runs before resolution and decides hop visibility withMC_isVisibleHop(hop, { hide1ByteHops: true }):resolved_pathis filtered in step, so each server answer stays with its own hop.resolved_pathof the wrong length becomesnull; it can no longer line up with the shorter path by accident.route-render.js(feat(#1633): customizer toggle to hide 1-byte path hops everywhere Kpa-clawbot/CoreScope#1689 r1).drawAnimatedLine(..., uncertain)draws the canvas segment dashed (4 6), at weight 1.5 and opacity 0.5 instead of 0.8, in the segment's own colour. Hash colour still applies, unlike grey ghost lines. The fading Leaflet trail getsdashArray: '4 6'and the classlive-path-uncertain.resolveHopEntries(), which is unchanged.UNCERTAIN_SEGMENT_OPACITYis a constant; a later milestone could expose it in the customizer (AGENTS.md rule 8). M2 is left to its own branch.Requirements → test → mutant
Unit tests:
test-issue-912-live-1byte-hops.js(vm, reallive.js,hop-filter.jsandhop-resolver.js, registered intest-all.sh). E2E:test-issue-912-live-1byte-hops-e2e.js(assigned to shard 1). The E2E records everyL.polylineLive creates after a WS packet goes through the real_liveWSHandler().mark): unit 3 red, E2E 1 red [A]; F2 Mark stored as no key: unit 1 red, E2E 1 red [A]decoded.path.hopsfallback (pure 1-byte path)hopMode: E2E 1 red [A]hopMode = 'show'at the call site: killed by E2E (3 red) [A]resolved_pathstays pairedlive-path-uncertain,4 6, opacity < 0.8mark: unit [A]groupIsMultibyteor the toggle; [A]test-live-multibyte-only-e2e.js10/10resolveHopPositionson 10k paths, budgetRed on master [A]: with the final unit file against
origin/master'slive.js, 10 functional tests are red and the perf section throws (_liveApplyOneByteHopsModeis missing), exit 1. The E2E against a master server: Show passes; Hide, Mark and the phone Hide step fail ("a vertex sits on the hidden hop B", "A→B must be marked").All 15 mutants were killed [A]. M6, M7, M8, M14 and M15 are rendering or call-site mutants, killed by the E2E only. M12's first form (a node scan per hop) was too slow to finish and was replaced by a per-path scan; that one fails the 250 ms filter budget.
Performance (AGENTS.md rule 0)
resolved_path. Best of 5, interleaved [A]:origin/master(mode ignored)Runs locally vary between 0.8 and 2.3 s for the same code, so the checked-in budget assertions are relative: the filter alone costs at most 15 % of the resolve, and Hide or Mark at most 50 % + 20 ms over Show. The absolute caps are generous for CI runners.
Browser validation [A]
Local Go server with
e2e-fixture.dbprepared as CI does (freshen, the CI seed SQL, migrate, the four seed files).prefers-color-scheme).scrollWidthequal to the viewport and 0 page errors.Local test runs [A]
node test-issue-912-live-1byte-hops.jsnode test-frontend-helpers.jssh test-all.shorigin/mastertree fail the same way; #728 passes on rerun.cmd/ingestorgo test -timeout 20m ./...cmd/servergo test -timeout 20m ./...AdvertIntervalAnalytics_AggregatePerf,ProfileCard_Cost,Coverage941*_PerfBudget), then the 20 m timeout. No Go diff againstorigin/master[K]; a local slow-machine effect.node scripts/run-e2e-shard.js --validatescripts/check-xss-sinks.sh --diff origin/masterLive E2E suites against the branch [A]:
CI per job
Expected impact per job [K]:
meanSeconds10.5).deploy.yml, 1 inrelease-fast-path.yml).Invariants [K]
cmd/serveris untouched; no Go change at all.map[string]interface{}.#912matches in the diff are issue references.git addonly; one commit for M1 plus one for the fix round (d9d7eb47); no rebase, amend or force-push.Residuals
markdefault. Side effects:loadFollowpasses the unfilteredresolveHopEntries. This is pinned by the unit test "the follow (Live: “Follow a packet” – replay how one packet spreads through the mesh #880) still sees every hop position in Hide". Follow-up candidate.live-ghost-hops=false, an unplaceable 1-byte hop is dropped byraw.filter(h => h.known)before drawing, so the bridging segment is drawn solid in Mark (Hide would draw it dashed). Ghost hops are on by default; with them on, Mark flags the ghost position.hopsCompletedsplit slices hop positions by index. With hops dropped, the solid/dashed split point can shift. That split was already approximate, since it ignores the sender anchor and unknown hops. Segments keep their uncertain flag.drawMatrixLineignores the marking, as it already ignores ghost styling.UNCERTAIN_SEGMENT_OPACITY(0.5) and the4 6dash are constants.🤖 Generated with Claude Code