Repository navigation
feat(config): operator default for the 1-byte hop mode (#912 M2) - #1001
Conversation
…op mode (#912 M2) Go: customizer.oneByteHopsDefault parsing (show/mark/hide, unknown, absent, wrong type, case variants) and its place in the customizer block of /api/config/client. JS: the resolution order (stored choice, operator default, mark), explicit storage, following a later default, the Kpa-clawbot#1633 migration and the customizer's server-default label. E2E: a fresh visitor gets an intercepted hide default, the visitor's own choice wins across a reload, and the setting fits a 375x560 phone in light and dark. The #674 tests now expect an explicit mark to be stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
customizer.oneByteHopsDefault (show, mark or hide) is a named field on CustomizerConfig, read from the canonical key only (#884): an unknown value logs one warning and gives mark, an absent key is mark as before. /api/config/client serves the effective value in its customizer block. hop-filter.js resolves the visitor's stored choice, then the operator default, then mark. An explicit choice is now always stored, so a pick of mark survives a hide default; a visitor who never chose follows the operator default, also a later change, and is told through mc-hide-1byte-hops-changed. The Kpa-clawbot#1633 key migration is unchanged. The customizer labels the server default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review — CS-VM2 PR#1001 — head a0c7e38Dom: REQUEST CHANGES. One small required fix (F1): once visitors have picked a mode, most of them have no way back to following the operator default, although the PR and the docs say Reset All provides one. Everything else is nits. Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code. [A] = an assumption or inference, not verified. Trees tested:
All work was done in Findings
Answers to the review pointsGo
JS (
Customizer
Perf budgets (Go)
Tests run
MutantsGo: all 10 killed, run on copies of the merged
JS: 14 of 16 killed, checked against the #912 and #674 unit suites with an unmutated baseline. [T]
Phone walk-through (real
|
…M2) Review of PR #1001: - F1: while a visitor has a stored 1-byte hop choice, the Display tab offers "Use server default" under the setting. It calls the new MC_clear1ByteHopsMode(), which removes the choice (and the Kpa-clawbot#1633 key), so the visitor follows the operator default again, later changes too. MC_get1ByteHopsChoice() tells the stored choice from the default. - F2: MC_clear1ByteHopsMode() fires mc-hide-1byte-hops-changed, and Reset All goes through it, so an open map follows without a reload. - F3: hop-filter.js fires mc-1byte-hops-default-changed when the operator default changes. The customizer updates the open select in place on both events (labels, selection, the reset button), so a panel opened before /api/config/client lands shows the right default. - F4: docs/CUSTOMIZATION.md says that an explicit Mark picked before M2 was stored as no key, so those visitors follow the default. - F5: unit tests for a junk early MC_CUSTOMIZER_CFG and for the Kpa-clawbot#1633 key under a load-time default with no earlier read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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 Fix — PR#1001 — head 01ecb3bThe fix is one commit, Author and committer are Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code.
F6 is handled by the owner comment on #912. F7 is pre-existing and left alone; it still shows in the phone screenshots. Test runs
Performance:
Manifest: the #912 suite's Open
|
Review — CS-VM1 PR#1001 — head 01ecb3bDom: REQUEST CHANGES. The fix round is complete: F1–F5 are fixed and tested, and my own mutants and phone walk-through agree. One new required item came up during this review: #1004 (#912 M1) merged into master, and the PR no longer merges. Besides the textual conflict, the Live map would keep its "Show until M2" fallback and ignore the operator default this PR adds. Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code. [A] = an assumption or inference, not verified. Trees tested:
All work was done in
Findings
Answers to the review pointsIs every required finding fixed, and every nit fixed or explained?
Are the new tests red without the fix and green with it?
Did anything else change that the first review did not see?
The standing checks
Tests run
The servers were stopped by port ( MutantsJS (mine), checked against the #912, #674, Kpa-clawbot#1633, Kpa-clawbot#1496, #673 and #741 unit suites, with an unmutated baseline green:
V7 was an equivalent mutant (same reads, same order), so I do not count it. Go (mine), on a copy of the merged
Phone walk-throughThe setup:
How I drove it:
Steps:
Result: 40/40. No step was impossible, and only the tip needed closing. I looked at the screenshots: the button sits directly under the select, readable in both themes, clear of the panel footer and the bottom nav. Not verified
|
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>
|
Review feedback addressed (commit Fix — PR#1001 round 2 — head abdff3fTwo commits on top of
Tests run (on
|
Review — CS-VM1 PR#1001 — head abdff3fDom: REQUEST CHANGES. One required item, R2. On an instance whose Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code. [A] = an assumption or inference, not verified. Trees tested:
All work was done in
Findings
Answers to the review pointsR1: merge resolution against master (#1004). Done correctly. [T]
One helper only (DRY). Yes. [T]
Live reads stored choice → operator default → Show. Yes, as code; but see R2 for what this means with a current server.
The M1 tests now assert the operator default. Yes. [T]
The new red/green test and its mutant.
Phone walk: 375×560, cold start, operator default Standing checks
Tests run
The servers were stopped by port ( MutantsJS, checked against the #912 M1, #912 M2, #674, Kpa-clawbot#1633, Kpa-clawbot#1496 and #673 unit suites and the frontend helpers, with an unmutated baseline green [T]:
Go, on a copy of the merged
Phone walk-through [T]The setup:
How I drove it:
27/27. No step was impossible, and nothing had to be closed to reach the next control. I looked at the screenshots:
My first harness run failed every tap on a bottom-nav tab. That was my own on-screen check, which clipped at the top of the nav; it was fixed before the run above, not a PR issue. Not verified
|
CS-VM1 review round 3, R2 (option b): the M2 plan says "if the key is absent, the behaviour is as today". The server served an effective `mark` for a missing customizer.oneByteHopsDefault, so on every unconfigured instance Live switched from Show to Mark on merge. - /api/config/client carries oneByteHopsDefault only when config.json sets it (omitempty); an invalid value still warns and serves mark. - MC_get1ByteHopsDefault() is null without an operator default. The customizer then reads as on master: Mark "(default)", the hint that Live shows every hop until a pick, and "Use default" on the reset button. - An unconfigured instance: Live Show, other pages Mark, as on master. A configured value applies everywhere as before. - config.example.json no longer sets the key (staging copies the example); CUSTOMIZATION.md, the example comment and api-spec.md say what a missing key does, and (N1) that on Live Mark dashes every segment touching a 1-byte hop while the route view marks only uncertain inferred hops. - Tests: the Go shape test asserts no key on the wire without config; the M1 E2E cold start on a key-less server asserts no default served, Live Show, B drawn, nothing dashed (red on abdff3f and with a server that serves mark for no key); M2 unit/E2E cover the pre-M2 labels and hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review feedback addressed (commit Fix — PR#1001 round 3 — head 0c5ef4eThe branch was behind
Tests run
Browser: 375×560,
|
Review — CS-VM1 PR#1001 — head 0c5ef4eDom: APPROVE with nits. R2 is closed with option (b) and works as described: an unconfigured instance now draws Live exactly as master does, and a configured value applies everywhere, Live included. N1, the label, the Go shape test and the phone flow check out, and every mutant I wrote is killed. The one nit (N2) is that the PR body still describes the round-2 behaviour. The author has already flagged this; it should be fixed before merge, but it is not a code issue. Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code. [A] = an assumption or inference, not verified. Trees tested
All work was done in
Findings
Answers to the review pointsR2, option (b): the server serves only a configured
N1, the docs clause. Fixed. [T] [K]
The "(server default)" label. Correct in both cases. [T]
The Go shape test.
My own mutants for R2. All killed [T]. Details are in "Mutants".
Phone walk: 375×560 cold start, no config, then operator default Standing checks
Tests run
All servers were stopped by port ( MutantsJS, run against the #912 M2, #912 M1, #674, Kpa-clawbot#1633, Kpa-clawbot#1496, #673, customizer-v2 unit suites and the frontend helpers. The unmutated baseline was green [T].
Go, on a copy of the merged
Phone walk-through [T]The setup:
How I drove it:
All 10 runs pass all 9 steps. No step was impossible, and nothing had to be closed to reach the next control. The screenshots were taken while the picker was open. The headless native drop-down list covers the area under the select, so I took two extra shots with the picker closed and a stored pick (deep link, for the picture only). They show the reset button cleanly under the select in light and dark. Not verified
|
Relates to #912
Status: M2 is built as planned. Every requirement has a test that is red on master and green here, plus at least one killed mutant. All local suites are green, except time-budget tests that fail the same way on clean master on this machine.
Evidence labels: [T] = ran here, with the output checked. [K] = checked by reading code. [A] = an assumption or inference, not verified.
Plan (M2 of #912, as approved there)
customizer.oneByteHopsDefault(show/mark/hide) as a named field,CustomizerConfig.OneByteHopsDefault. Nomap[string]interface{}.configkey(Config: feature gates and the base-map token must only accept canonical key spellings #884). An unknown value logs one warning and givesmark. An absent key givesmark, as today.customizerblock of/api/config/client.hop-filter.jsresolves the visitor's stored choice first, then the operator default, thenmark.roles.jspasses the value tohop-filter.js, and the customizer labels the server default.config.example.json,docs/CUSTOMIZATION.mdanddocs/api-spec.md.live.jsis not touched; M1 is a separate branch.Changes
cmd/server/config.goOneByteHopsDefault stringis taggedjson:"-", so onlyapplyOneByteHopsDefaultfills it, fromkeys.Get("customizer", "oneByteHopsDefault"). A value of the wrong type, for example2, gives one warning andmarkinstead of rejecting the whole config file.OneByteHopsDefault,Customizer) are ignored, withconfigkey's usual warning.(*Config).OneByteHopsDefault()returns the effective mode.cmd/server/types.go,routes.goCustomizerClientConfig.OneByteHopsDefault(json:"oneByteHopsDefault") is always present in the response.public/hop-filter.jsMC_get1ByteHopsDefault/MC_set1ByteHopsDefault.get1ByteHopsMode()falls back to the operator default instead of a hard-codedmark.set1ByteHopsMode()always stores the choice.mc-hide-1byte-hops-changedonly when it changes the effective mode, that is, only for a visitor following the default.map.jsandpackets.jsalready re-render on that event.MC_CUSTOMIZER_CFGarrived before the file loaded, it is read at load time, so script order does not matter.MC_get1ByteHopsChoice()returns the stored choice, ornullfor a visitor who follows the default.MC_clear1ByteHopsMode()removes the choice (and the feat: customizer toggle to hide 1-byte path hops everywhere — they may do more harm than good Kpa-clawbot/CoreScope#1633 key) and firesmc-hide-1byte-hops-changed.MC_set1ByteHopsDefault()also firesmc-1byte-hops-default-changedwhen the operator default itself changes.public/roles.jscustomizer.oneByteHopsDefaultintoMC_CUSTOMIZER_CFGand hands it tohop-filter.js.hop-filter.jsvalidates it.public/customize-v2.jsMC_clear1ByteHopsMode). The open select is updated in place on both events (labels, selection, button), not re-rendered, because a pick fireschangewhile the select has the focus. Reset All goes throughMC_clear1ByteHopsMode(), so the open page follows the default without a reload.markto be stored, which is the storage change in the plan.Performance: nothing changes in a hot path.
get1ByteHopsMode()reads one more variable, and the extra event fires at most once per config load. [K]Config and customizer: this is the customizer item from the plan. The customizer shows the server default. Visitors cannot edit the operator default, by design.
Requirements → tests → mutants
customizer.oneByteHopsDefault: show/mark/hide valid; unknown value → one warning +mark; absent →markTestOneByteHopsDefaultValidation912(11 cases) [T]"", G6 unknown →hide[T]configkeyonly, a wrong type does not drop the fileTestOneByteHopsDefaultIsANamedField912,TestOneByteHopsDefaultCanonicalKeyOnly912,TestOneByteHopsDefaultBadTypeKeepsTheFile912[T]json:"oneByteHopsDefault") [T]customizerblock of/api/config/clientTestClientConfigOneByteHopsDefaultShape912; E2E step 1 [T]""[T]test-issue-912-m2-1byte-operator-default.js(resolution tests) [T]marksurvives ahidedefaultmark→ no key) killed by exactly that E2E step [T]roles.jshands the server value overroles.jssnippet) [T]test-issue-912-m2-1byte-operator-default-e2e.js[T]: on master's frontend 5/7 red, on the fix 7/7 green, then 3/3 more green runsMC_get1ByteHopsChoice,MC_clear1ByteHopsMode, "offers Use server default only while a pick is stored", "the reset button and a pick keep the open select in step"; E2E F1 (pick Show, press the button: 0 relays on the open route, nothing stored, focus on the select, still Hide after a reload) [T]/api/config/clientheld until the panel is open, with and without a stored pick [T]config.example.json(+ its existing Go decode tests),docs/CUSTOMIZATION.md,docs/api-spec.md[T]/[K]Red on master:
OneByteHopsDefaultdoes not exist yet [T]. The assertion-level failures come from the mutants above.public/with 5/7 red [T]. Step 1 was green there only because that server binary already had the fix; on master the Go shape test covers it.Mutants:
cmd/server[T].Checks
cd cmd/server && go vet ./...go test -run 912|Customizer|ConfigClient|ClientConfiggo test ./...(wholecmd/serverpackage, one local process,-timeout 90m, nothing else running)TestAdvertIntervalAnalytics_AggregatePerf(25.4 ms vs 25 ms on master),TestProfileCard_CostandTestCoverage941_PerfBudget(504 terrain timeout). Each fails the same way on its own on clean master on this machine [T]. All #912 tests pass [T]. Earlier runs under load also hit the default 10 min and a 30 min timeout, andTestAdvertIntervalBucket_Perf/TestMomentsTickCostBounded_881failed only under load [T]. CI runs the package in 3 shards with-timeout 20m.node scripts/run-go-server-shard.js --validatesh test-all.shtest-live-heard-filter.js58.9 ms on 10k nodes):test-live-heard-filter.js,test-live-scope-color.js,test-issue-724-masts-hint.js,test-issue-728-ortho-base.js,test-issue-941-predicted-reach.js,test-issue-730-buildings-ui.js,test-issue-598-hop-path-inference.js[T]node test-frontend-helpers.jsnode test-issue-674-1byte-hop-modes.jsnode scripts/run-e2e-shard.js --validatee2e-fixture.db(freshened, migrated)scripts/check-xss-sinks.sh --diff origin/mastermap[string]interface{}outside tests;cmd/serverstays read-onlyvar(--…)styles [T].github/not touched: 9 indeploy.yml, 1 inrelease-fast-path.yml, unchanged [T]Review fixes (commit
01ecb3be)test-issue-912-m2-1byte-operator-default.jsa0c7e38c(every F1–F3 test) [T]test-issue-912-m2-1byte-operator-default-e2e.jspublic/: 7 passed, 4 failed (the 4 new steps) [T]sh test-all.shtest-live-follow.jspassed on the fix and failed on head, so it is load-dependent [T]run-go-server-shard.js --validate,run-e2e-shard.js --validatescripts/check-xss-sinks.sh --diff(vsa0c7e38cand vsorigin/master)elementFromPointhits it, no sideways scroll; a tap gives Hide, nothing stored, the button hidden [T]No Go code changed in the fix round.
go vetand the #912 / ClientConfig / Customizer Go tests: ok [T]. Fullcmd/servergo test ./...: the same budget failures as above (TestAdvertIntervalAnalytics_AggregatePerf,TestProfileCard_Cost,TestCoverage941M2_PerfBudget,TestCoverage941_PerfBudget) and nothing else [T].cmd/ingestorgo test ./...: ok in 18.5 min with-timeout 40m; the default 10 min timed out here with no failing test [T].CI per job
What I expect from CI, without having verified it [A]:
Remaining items
TestAdvertIntervalAnalytics_AggregatePerf,TestProfileCard_CostandTestCoverage941_PerfBudgetfail on this machine on clean master too. This PR does not cause them; the CI runners are the gate.meanSecondsyet (no CI measurement). The validator accepts that.hideon staging, a fresh profile shows Hide on Live") is not done: I have no staging access. Live only follows the mode on its map once M1 lands.docs/CUSTOMIZATION.mdsays so.🤖 Generated with Claude Code