Skip to content

Commit edf2f4b

Browse files
author
DavidQ
committed
Combine remaining network debug, promotion readiness, and server dashboard work into one low-PR pass
BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT
1 parent 29faef6 commit edf2f4b

16 files changed

Lines changed: 587 additions & 55 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,48 @@ MODEL: GPT-5.4
22
REASONING: high
33

44
COMMAND:
5-
Create `BUILD_PR_LEVEL_06_SAMPLES_PROGRAM_COMBINED_PASS` as one combined Section-6 PR.
5+
Create `BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT` as one combined network-debug and server-dashboard closeout PR.
66

77
Goal:
8-
Finish as much of the Samples Program lane as truthfully possible in one pass.
8+
Finish as much of the remaining network debug / readiness / dashboard lane as truthfully possible in one pass.
99

1010
Target items to close in this PR if supported:
11-
- phase grouping normalized
12-
- `samples/shared` boundaries defined and used
13-
- sample-to-engine dependency cleanup completed
14-
- sample curriculum progression validated
11+
12+
Track Q:
13+
- Latency / RTT panel
14+
- Replication state viewer
15+
16+
Track R:
17+
- network.help
18+
- network.replication
19+
- network.sample.*
20+
21+
Track S:
22+
- Sample-backed provider validation
23+
- Sample-backed panel validation
24+
- Operator command validation
25+
- Debug-only gating validation
26+
- Promotion recommendation
27+
28+
Track T:
29+
- Server dashboard shell
30+
- Player statistics view
31+
- Latency view
32+
- RX bytes view
33+
- TX bytes view
34+
- Connection/session counts
35+
- Per-player status rows
36+
- Refresh/update strategy
37+
- Debug-only access rules
1538

1639
Required work:
17-
1. Treat the remaining open Section-6 items as one coherent lane.
18-
2. Complete phase grouping normalization where still incomplete.
19-
3. Define and apply `samples/shared` boundaries:
20-
- what belongs in `samples/shared`
21-
- what stays sample-owned
22-
- what must not leak into engine/shared incorrectly
23-
4. Clean up sample-to-engine dependencies truthfully and surgically.
24-
5. Validate curriculum progression after grouping/boundary cleanup.
25-
6. Reuse established numbering/formatting/index work instead of redoing it.
26-
7. Close as many Section-6 items as truthfully possible in this one PR.
27-
8. If anything remains open:
40+
1. Treat the remaining open items as one coherent network-observability lane.
41+
2. Complete the remaining debug panels/commands.
42+
3. Bundle the readiness-to-promote validations together.
43+
4. Build the dashboard as one shell-plus-views slice.
44+
5. Reuse existing connection/divergence/trace/status/latency work instead of redoing it.
45+
6. Close as many remaining items as truthfully possible in this one PR.
46+
7. If anything remains open:
2847
- keep the residue very small
2948
- report exact blockers
3049
- leave it suitable for one residue-only PR
@@ -35,7 +54,7 @@ Roadmap:
3554

3655
Final packaging step is REQUIRED:
3756
- package ALL changed files into this exact repo-structured ZIP:
38-
`<project folder>/tmp/BUILD_PR_LEVEL_06_SAMPLES_PROGRAM_COMBINED_PASS.zip`
57+
`<project folder>/tmp/BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT.zip`
3958

4059
Hard rules:
4160
- combine aggressively to reduce PR count

docs/dev/COMMIT_COMMENT.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Combine the remaining Section-6 Samples Program work into one low-PR pass
2-
BUILD_PR_LEVEL_06_SAMPLES_PROGRAM_COMBINED_PASS
1+
Combine remaining network debug, promotion readiness, and server dashboard work into one low-PR pass
2+
BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_LEVEL_06_SAMPLES_PROGRAM_RESIDUE_ONLY
1+
BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_RESIDUE_ONLY
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- Added a combined PR for the remaining Section-6 Samples Program lane
2-
- Bundles phase grouping, samples/shared boundaries, dependency cleanup, and curriculum validation
3-
- Intended to finish most or all of Section 6 in one pass and leave only tiny residue if needed
1+
- Added a combined PR for the remaining network debug panels, commands, promotion readiness, and server dashboard lane
2+
- Bundles dashboard shell/views with replication/RTT/debug completion and readiness validation
3+
- Intended to finish most or all of the lane in one pass and leave only tiny residue if needed
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
- phase grouping addressed
2-
- samples/shared boundaries addressed
3-
- sample-to-engine dependency cleanup addressed
4-
- sample curriculum progression addressed
1+
- Latency / RTT panel addressed
2+
- Replication state viewer addressed
3+
- network.help addressed
4+
- network.replication addressed
5+
- network.sample.* addressed
6+
- sample-backed provider/panel/operator validations addressed
7+
- debug-only gating validation addressed
8+
- promotion recommendation addressed
9+
- server dashboard shell/views addressed
510
- any residue is explicit and minimal
611
- roadmap updated by status markers only
712
- output ZIP created at:
8-
<project folder>/tmp/BUILD_PR_LEVEL_06_SAMPLES_PROGRAM_COMBINED_PASS.zip
13+
<project folder>/tmp/BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT.zip

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@
274274

275275
### Track G - Network / Multiplayer Debug
276276
- [x] Connection status panel
277-
- [.] Latency / RTT panel
278-
- [ ] Replication state viewer
277+
- [x] Latency / RTT panel
278+
- [x] Replication state viewer
279279
- [x] Client/server divergence inspector
280280
- [.] Event tracing
281281
- [.] PLAN_PR_DEBUG_SURFACES_NETWORK_SUPPORT
@@ -364,37 +364,37 @@
364364

365365
### Track Q - Network Debug Panels
366366
- [x] Connection status panel
367-
- [.] Latency / RTT panel
368-
- [ ] Replication state viewer
367+
- [x] Latency / RTT panel
368+
- [x] Replication state viewer
369369
- [x] Client/server divergence inspector
370370
- [x] Event tracing panel
371371

372372
### Track R - Network Debug Commands
373-
- [ ] network.help
373+
- [x] network.help
374374
- [x] network.status
375375
- [x] network.latency
376-
- [.] network.replication
376+
- [x] network.replication
377377
- [x] network.divergence
378378
- [x] network.trace
379-
- [.] network.sample.*
379+
- [x] network.sample.*
380380

381381
### Track S - Readiness To Promote
382-
- [.] Sample-backed provider validation
383-
- [.] Sample-backed panel validation
384-
- [.] Operator command validation
385-
- [ ] Debug-only gating validation
386-
- [ ] Promotion recommendation
382+
- [x] Sample-backed provider validation
383+
- [x] Sample-backed panel validation
384+
- [x] Operator command validation
385+
- [x] Debug-only gating validation
386+
- [x] Promotion recommendation
387387

388388
### Track T - Server Dashboard
389-
- [ ] Server dashboard shell
390-
- [ ] Player statistics view
391-
- [ ] Latency view
392-
- [ ] RX bytes view
393-
- [ ] TX bytes view
394-
- [ ] Connection/session counts
395-
- [ ] Per-player status rows
396-
- [ ] Refresh/update strategy
397-
- [ ] Debug-only access rules
389+
- [x] Server dashboard shell
390+
- [x] Player statistics view
391+
- [x] Latency view
392+
- [x] RX bytes view
393+
- [x] TX bytes view
394+
- [x] Connection/session counts
395+
- [x] Per-player status rows
396+
- [x] Refresh/update strategy
397+
- [x] Debug-only access rules
398398

399399
### Track U - Server Containerization
400400
- [x] Dockerfile for server
@@ -413,9 +413,9 @@
413413
- [x] Sample B
414414
- [x] Replication + authority + divergence
415415
- [x] Sample C
416-
- [ ] Server dashboard
416+
- [x] Server dashboard
417417
- [x] Server containerization
418-
- [ ] Promotion review
418+
- [x] Promotion review
419419

420420
---
421421

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# BUILD_PR_LEVEL_07_NETWORK_DEBUG_AND_SERVER_DASHBOARD_COMBINED_CLOSEOUT
2+
3+
## Purpose
4+
Close the remaining network-observability lane in one coherent pass across debug panels, operator commands, promotion-readiness validation, and server dashboard behavior.
5+
6+
## Scope Implemented
7+
- added reusable latency/RTT and replication-state panel factories under `src/engine/debug/network/panels`
8+
- expanded network command bridge with reusable `network.replication` and `network.sample.*` command builders
9+
- hardened dashboard host with explicit debug-only access gating
10+
- surfaced debug access state in dashboard command/status output
11+
- added shared promotion recommendation helper for readiness decisions
12+
- added one focused closeout test that validates Tracks Q/R/S/T together
13+
- updated roadmap status markers only
14+
15+
## Track Closure Mapping
16+
17+
### Track Q
18+
- Latency / RTT panel: closed via `createLatencyRttPanel`
19+
- Replication state viewer: closed via `createReplicationStatePanel`
20+
21+
### Track R
22+
- `network.help`: closed via default help command coverage
23+
- `network.replication`: closed via `createNetworkReplicationCommand`
24+
- `network.sample.*`: closed via `createNetworkSampleCommand`
25+
26+
### Track S
27+
- Sample-backed provider validation: covered in closeout test
28+
- Sample-backed panel validation: covered in closeout test
29+
- Operator command validation: covered in closeout test
30+
- Debug-only gating validation: covered in closeout test with denied dashboard host
31+
- Promotion recommendation: closed via `createNetworkPromotionRecommendation`
32+
33+
### Track T
34+
- Server dashboard shell + views + counts + per-player rows + refresh strategy were already present and are now validated in one closeout test
35+
- Debug-only access rules closed by dashboard host gating and validation
36+
37+
## Residue
38+
- no additional functional residue identified in the target Track Q/R/S/T lane
39+
40+
## Validation Performed
41+
- `node --check` on all touched source/test files
42+
- focused run:
43+
- `tests/final/MultiplayerNetworkingStack.test.mjs`
44+
- `tests/final/NetworkDebugAndServerDashboardCloseout.test.mjs`
45+
46+
## Changed Files
47+
- `src/engine/debug/network/panels/networkObservabilityPanels.js`
48+
- `src/engine/debug/network/commands/networkDebugCommandPackBridge.js`
49+
- `src/engine/debug/network/dashboard/serverDashboardHost.js`
50+
- `src/engine/debug/network/dashboard/registerDashboardCommands.js`
51+
- `src/engine/debug/network/diagnostics/networkPromotionRecommendation.js`
52+
- `src/engine/debug/network/shared/hostReadUtils.js`
53+
- `src/engine/debug/network/index.js`
54+
- `tests/final/NetworkDebugAndServerDashboardCloseout.test.mjs`
55+
- `tests/run-tests.mjs`
56+
- `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`

src/engine/debug/network/commands/networkDebugCommandPackBridge.js

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ networkDebugCommandPackBridge.js
66
*/
77

88
import { asArray, asObject, sanitizeText } from "../shared/networkDebugUtils.js";
9+
import { createReplicationDiagnosticsModel } from "../diagnostics/replicationDiagnosticsModel.js";
910

1011
function normalizeCommandDescriptor(descriptor) {
1112
const source = asObject(descriptor);
@@ -32,6 +33,11 @@ function normalizeCommandDescriptor(descriptor) {
3233
export function createNetworkHelpCommand(options = {}) {
3334
const source = asObject(options);
3435
const lines = asArray(source.lines).map((line) => String(line));
36+
const fallbackLines = [
37+
"network.help",
38+
"network.replication",
39+
"network.sample.status"
40+
];
3541

3642
return {
3743
name: sanitizeText(source.name) || "network.help",
@@ -41,13 +47,90 @@ export function createNetworkHelpCommand(options = {}) {
4147
return {
4248
status: "ready",
4349
title: sanitizeText(source.title) || "Network Help",
44-
lines,
50+
lines: lines.length > 0 ? lines : fallbackLines,
4551
code: sanitizeText(source.code) || "NETWORK_HELP"
4652
};
4753
}
4854
};
4955
}
5056

57+
function readNetworkSnapshot(context = {}, sampleKey = "network") {
58+
const source = asObject(context);
59+
const assets = asObject(source.assets);
60+
return asObject(assets[sampleKey]);
61+
}
62+
63+
function createReplicationLines(context = {}, sampleKey = "network") {
64+
const model = createReplicationDiagnosticsModel(readNetworkSnapshot(context, sampleKey));
65+
const lines = [
66+
`hostTick=${model.hostTick}`,
67+
`highestBacklog=${model.highestBacklog}`,
68+
`divergenceWarnings=${model.divergenceWarnings}`,
69+
`hasPressure=${model.hasPressure}`
70+
];
71+
72+
model.clients.slice(0, 8).forEach((client) => {
73+
const row = asObject(client);
74+
lines.push(
75+
`${String(row.peerId || "client")} tick=${Number(row.tick) || 0} pending=${Number(row.pendingPackets) || 0} backlog=${Number(row.backlog) || 0} delta=${Number(row.tickDeltaFromHost) || 0}`
76+
);
77+
});
78+
return lines;
79+
}
80+
81+
export function createNetworkReplicationCommand(options = {}) {
82+
const source = asObject(options);
83+
const sampleKey = sanitizeText(source.sampleKey) || "network";
84+
const linesFactory = typeof source.createLines === "function"
85+
? source.createLines
86+
: (context) => createReplicationLines(context, sampleKey);
87+
88+
return {
89+
name: sanitizeText(source.name) || "network.replication",
90+
summary: sanitizeText(source.summary) || "Show replication state and backlog diagnostics.",
91+
usage: sanitizeText(source.usage) || "network.replication",
92+
handler(context = {}) {
93+
return {
94+
status: "ready",
95+
title: sanitizeText(source.title) || "Network Replication",
96+
lines: asArray(linesFactory(context)).map((line) => String(line)),
97+
code: sanitizeText(source.code) || "NETWORK_REPLICATION"
98+
};
99+
}
100+
};
101+
}
102+
103+
export function createNetworkSampleCommand(options = {}) {
104+
const source = asObject(options);
105+
const sampleCommandId = sanitizeText(source.sampleCommandId) || "status";
106+
const commandName = sanitizeText(source.name) || `network.sample.${sampleCommandId}`;
107+
const sampleKey = sanitizeText(source.sampleKey) || "network";
108+
const linesFactory = typeof source.createLines === "function"
109+
? source.createLines
110+
: (context = {}) => {
111+
const snapshot = readNetworkSnapshot(context, sampleKey);
112+
const keys = Object.keys(snapshot);
113+
return [
114+
`sampleKey=${sampleKey}`,
115+
`fields=${keys.length > 0 ? keys.join(",") : "none"}`
116+
];
117+
};
118+
119+
return {
120+
name: commandName,
121+
summary: sanitizeText(source.summary) || "Show sample-specific network diagnostics.",
122+
usage: sanitizeText(source.usage) || commandName,
123+
handler(context = {}, args = []) {
124+
return {
125+
status: "ready",
126+
title: sanitizeText(source.title) || "Network Sample Diagnostics",
127+
lines: asArray(linesFactory(context, asArray(args))).map((line) => String(line)),
128+
code: sanitizeText(source.code) || "NETWORK_SAMPLE"
129+
};
130+
}
131+
};
132+
}
133+
51134
export function createNetworkCommandPack(options = {}) {
52135
const source = asObject(options);
53136
const commands = asArray(source.commands)

src/engine/debug/network/dashboard/registerDashboardCommands.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function formatStatusLines(status) {
2626
return [
2727
`running=${Boolean(status.running)}`,
2828
`mode=${sanitizeText(status.mode) || "normal"}`,
29+
`debugOnly=${status.debugOnly !== false}`,
30+
`debugAccessEnabled=${status.debugAccessEnabled !== false}`,
2931
`refreshIntervalMs=${Number(status.refreshIntervalMs) || 0}`,
3032
`refreshCount=${Number(status.refreshCount) || 0}`,
3133
`lastRefreshTimestampMs=${Number(status.lastRefreshTimestampMs) || 0}`,

0 commit comments

Comments
 (0)