Skip to content

Commit 5f6bfd0

Browse files
author
DavidQ
committed
Apply network promotion build
1 parent dc3a7b1 commit 5f6bfd0

25 files changed

Lines changed: 909 additions & 153 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
11
MODEL: GPT-5.4-codex
2-
REASONING: high
3-
4-
COMMAND:
5-
Create PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION
6-
7-
Requirements:
8-
- Follow PLAN_PR + BUILD_PR + APPLY_PR
9-
- Docs-first
10-
- One PR per purpose
11-
- No engine core changes in this PLAN PR
12-
- Define promotion path for proven network debug capabilities
13-
- Prefer reusable ownership under engine/debug/network
14-
- Keep engine core limited to minimal contracts/hooks only
15-
- Keep sample-specific scenarios, feeds, and local adapters project-owned
16-
- Include target structure, ownership matrix, migration phases, validation strategy, risk controls, and rollout notes
17-
- Update roadmap references under docs/roadmaps/ with bracket-only edits only if needed
18-
- Write outputs under docs/pr and docs/dev/reports
19-
- Package to <project folder>/tmp/PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION_delta.zip
2+
COMMAND: APPLY_PR_DEBUG_SURFACES_NETWORK_PROMOTION

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docs: plan network debug promotion into reusable engine-debug layer
1+
Apply network promotion build

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_DEBUG_SURFACES_NETWORK_PROMOTION
1+
APPLY_PR_DEBUG_SURFACES_NETWORK_PROMOTION
Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION
2-
3-
Summary:
4-
- Rebuilt the PLAN PR document as a docs-first network promotion plan with explicit:
5-
- target structure
6-
- ownership matrix
7-
- migration phases
8-
- validation strategy
9-
- risk controls
10-
- rollout notes
11-
- Preserved one-PR-purpose scope and no engine-core implementation changes.
12-
- Kept reusable ownership centered on `engine/debug/network` and restricted core to minimal contracts/hooks.
13-
- Kept sample-specific scenarios, synthetic feeds, and local adapters project-owned by design.
14-
- Updated roadmap reference in `docs/roadmaps/NETWORK_SAMPLES_PLAN.md` using bracket-only status change for promotion recommendation.
15-
16-
Scope controls:
17-
- docs-first only
18-
- read-only debug data-flow expectations preserved
19-
- no dashboard coupling to console/overlay internals
1+
Network promotion build bundle.

docs/dev/reports/file_tree.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
HTML-JavaScript-Gaming/
2-
docs/
3-
pr/
4-
PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION.md
5-
BUILD_PR_DEBUG_SURFACES_NETWORK_PROMOTION.md
6-
APPLY_PR_DEBUG_SURFACES_NETWORK_PROMOTION.md
7-
dev/
8-
reports/
9-
file_tree.txt
10-
change_summary.txt
11-
validation_checklist.txt
12-
roadmaps/
13-
NETWORK_SAMPLES_PLAN.md
1+
docs/pr
2+
docs/dev
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION validation checklist
2-
3-
[x] PLAN/BUILD/APPLY discipline is explicitly stated
4-
[x] PLAN PR is docs-first and one-purpose
5-
[x] No engine core implementation changes are introduced
6-
[x] Promotion path for proven network debug capabilities is defined
7-
[x] Reusable ownership preference under `engine/debug/network` is documented
8-
[x] Engine core remains limited to minimal contracts/hooks in plan boundaries
9-
[x] Sample-specific scenarios/feeds/adapters remain project-owned
10-
[x] Target structure is documented
11-
[x] Ownership matrix is documented
12-
[x] Migration phases are documented
13-
[x] Validation strategy is documented
14-
[x] Risk controls are documented
15-
[x] Rollout notes are documented
16-
[x] Roadmap reference update (if needed) used bracket-only edit
17-
[x] Reports are written under `docs/dev/reports`
18-
[x] ZIP target path defined at `<project folder>/tmp/PLAN_PR_DEBUG_SURFACES_NETWORK_PROMOTION_delta.zip`
1+
Validate network promotion.
Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/06/2026
4+
APPLY_PR_DEBUG_SURFACES_NETWORK_PROMOTION.md
5+
16
# APPLY_PR_DEBUG_SURFACES_NETWORK_PROMOTION
27

38
## Purpose
4-
Apply the approved extraction and promotion of shared network debug capabilities into a reusable engine-debug network layer while preserving current behavior.
9+
Apply the approved network promotion by introducing shared reusable network debug modules and rebinding sample network plugins to shared bootstrap logic.
510

6-
## Execution Rules
7-
- Behavior parity first.
8-
- Extraction/relocation only unless explicitly required for wiring.
9-
- No unrelated refactors.
10-
- No engine core UI logic.
11-
- Keep sample-owned scenarios local.
11+
## Apply Rules
12+
- no engine core implementation changes
13+
- keep sample-specific feeds/scenarios/adapters project-owned
14+
- keep data flow read-only for network providers and dashboard pieces
15+
- keep dashboard decoupled from console/overlay internals
16+
- no combo-key behavior changes
1217

13-
## Apply Steps
14-
1. Create minimal engine-core contract files.
15-
2. Create `engine/debug/network` structure.
16-
3. Move shared providers into `engine/debug/network/providers`.
17-
4. Move shared panels/renderers into `engine/debug/network/panels`.
18-
5. Move shared commands into `engine/debug/network/commands`.
19-
6. Move dashboard foundation/enhancement pieces into `engine/debug/network/dashboard`.
20-
7. Add bootstrap/composition wiring.
21-
8. Reconnect sample integrations through public registration.
22-
9. Validate end-to-end.
18+
## Ordered Apply Sequence
19+
1. Add `engine/debug/network` shared modules (shared/provider/panel/command/bootstrap).
20+
2. Add read-only dashboard and diagnostics helpers under `engine/debug/network`.
21+
3. Export shared network layer through `engine/debug/index.js`.
22+
4. Rebind Sample A/B/C debug plugin factories through shared network bootstrap.
23+
5. Run targeted import and smoke checks.
2324

24-
## Required Validation
25-
- Existing network smoke checks still pass.
26-
- Server dashboard sections still render/update.
27-
- Unknown group/macro/network identifiers still fail safely.
28-
- No runtime mutations introduced.
29-
- No console/overlay regressions.
25+
## Validation
26+
- all added modules import successfully
27+
- Sample A/B/C plugins still return provider/panel/command packs
28+
- provider descriptors remain read-only
29+
- dashboard host run-once behavior succeeds with normalized snapshots
30+
- no changes to engine core APIs
3031

31-
## Roadmap Notes
32-
Update roadmap trackers with bracket-only edits only after validation confirms promotion readiness milestones.
32+
## Rollback
33+
If promotion causes regressions:
34+
- revert `engine/debug/network` additions
35+
- restore direct plugin object construction in sample debug plugin files
36+
- keep sample-level behavior as pre-promotion baseline
Lines changed: 44 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,57 @@
1+
Toolbox Aid
2+
David Quesenberry
3+
04/06/2026
4+
BUILD_PR_DEBUG_SURFACES_NETWORK_PROMOTION.md
5+
16
# BUILD_PR_DEBUG_SURFACES_NETWORK_PROMOTION
27

3-
## Purpose
4-
Translate the approved promotion plan into an executable build package describing the exact target structure, ownership map, migration order, validation checklist, and rollback rules for promoting network debug surfaces.
8+
## Build Summary
9+
Define the implementation shape for promoting reusable network debug capabilities into a shared `engine/debug/network` layer while keeping sample scenarios and adapters project-owned.
10+
11+
## Workflow Discipline
12+
PLAN_PR -> BUILD_PR -> APPLY_PR
13+
14+
## Scope
15+
- create reusable network debug modules under `engine/debug/network`
16+
- keep engine core unchanged in this slice
17+
- keep data flow read-only for providers/panels/dashboard
18+
- preserve sample-level integration for Sample A/B/C
519

6-
## Authoritative Target Structure
20+
## Target Structure
721
```text
8-
src/engine/debug/network/
22+
engine/debug/network/
23+
index.js
24+
shared/
25+
networkDebugUtils.js
926
providers/
27+
networkDebugProviderRegistry.js
1028
panels/
29+
networkDebugPanelRegistry.js
1130
commands/
31+
networkDebugCommandPackBridge.js
32+
bootstrap/
33+
createNetworkDebugSurfaceIntegration.js
1234
dashboard/
35+
serverDashboardHost.js
36+
serverDashboardRegistry.js
37+
serverDashboardProviders.js
38+
serverDashboardRenderer.js
1339
diagnostics/
14-
bootstrap/
40+
divergenceDiagnosticsModel.js
41+
latencyDiagnosticsModel.js
42+
replicationDiagnosticsModel.js
1543
```
1644

17-
## Minimal Core Contract Area
18-
```text
19-
src/engine/core/debug/
20-
NetworkDebugContracts.js
21-
NetworkDebugRegistrationHooks.js
22-
NetworkDebugGate.js
23-
```
24-
25-
## Ownership Matrix
26-
| Component | Destination |
27-
|---|---|
28-
| Shared network providers | engine/debug/network |
29-
| Shared network panels | engine/debug/network |
30-
| Shared network commands | engine/debug/network |
31-
| Server dashboard host/registry/renderer | engine/debug/network/dashboard |
32-
| Divergence/trace presentation helpers | engine/debug/network/diagnostics |
33-
| Synthetic sample feeds | project/sample-owned |
34-
| Scenario wiring | project/sample-owned |
35-
| Reproduction docs | docs/pr + docs/roadmaps |
36-
| Minimal registration/gating hooks | engine/core/debug |
37-
38-
## Migration Order
39-
1. Define minimal core contracts only.
40-
2. Extract shared providers.
41-
3. Extract shared panels/renderers.
42-
4. Extract shared commands.
43-
5. Extract dashboard foundation/enhancements.
44-
6. Add bootstrap/composition layer.
45-
7. Reconnect sample integrations through public registration.
46-
8. Run full validation across samples/dashboard.
47-
48-
## Guardrails
49-
- No redesign during extraction.
50-
- No runtime feature expansion.
51-
- No server product UI work.
52-
- No console-overlay-dashboard coupling.
53-
- No sample-specific scenario logic in shared layers.
45+
## Ownership Model
46+
- shared reusable logic: `engine/debug/network`
47+
- sample-specific scenarios and local adapters: `games/network_sample_*`
48+
- engine core: no implementation changes in this promotion slice
5449

55-
## Validation Checklist
56-
- Sample A passes.
57-
- Sample B passes.
58-
- Sample C passes.
59-
- Dashboard renders and refreshes.
60-
- Latency/trace/divergence outputs remain correct.
61-
- Public command paths remain intact.
62-
- Debug-only gating remains intact.
50+
## Validation Targets
51+
- network shared modules import successfully
52+
- Sample A/B/C debug plugins continue to expose providers/panels/commands
53+
- provider descriptors remain read-only
54+
- dashboard host/providers/renderer remain observational only
6355

64-
## Rollback Rule
65-
If parity is broken, revert to sample-owned wiring and keep docs/history intact.
56+
## Apply Gate
57+
APPLY should wire sample plugin creation through shared network bootstrap and export the shared layer from `engine/debug/index.js` without changing combo-key behavior or core runtime contracts.

engine/debug/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ export { default as StatsTracker } from './StatsTracker.js';
1212
export { drawMinimap } from './Minimap.js';
1313
export { validateWorldEntities, drawValidationPanel } from './Validation.js';
1414
export * from './standard/threeD/index.js';
15+
export * from './network/index.js';
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
Toolbox Aid
3+
David Quesenberry
4+
04/06/2026
5+
createNetworkDebugSurfaceIntegration.js
6+
*/
7+
8+
import { createReadOnlyNetworkProviders } from "../providers/networkDebugProviderRegistry.js";
9+
import { asArray, asBoolean, asObject, sanitizeText, shallowCloneArray } from "../shared/networkDebugUtils.js";
10+
11+
const DEFAULT_NETWORK_DEBUG_CAPABILITIES = Object.freeze([
12+
Object.freeze({ capabilityId: "debug.overlay.panel", version: "1.0.0", required: true }),
13+
Object.freeze({ capabilityId: "debug.command-pack", version: "1.0.0", required: true }),
14+
Object.freeze({ capabilityId: "debug.diagnostics.snapshot", version: "1.0.0", required: true }),
15+
Object.freeze({ capabilityId: "debug.overlay.provider", version: "1.0.0", required: true })
16+
]);
17+
18+
function cloneCapabilities(capabilities) {
19+
return asArray(capabilities).map((capability) => ({ ...asObject(capability) }));
20+
}
21+
22+
function clonePanels(panels) {
23+
return shallowCloneArray(panels);
24+
}
25+
26+
function cloneCommandPacks(commandPacks) {
27+
return asArray(commandPacks).map((pack) => ({
28+
...asObject(pack),
29+
commands: shallowCloneArray(asObject(pack).commands)
30+
}));
31+
}
32+
33+
export function createNetworkDebugPluginDefinition(options = {}) {
34+
const source = asObject(options);
35+
const pluginId = sanitizeText(source.pluginId) || "network.debug";
36+
const title = sanitizeText(source.title) || pluginId;
37+
const featureFlag = sanitizeText(source.featureFlag) || "networkDebug";
38+
const autoActivate = asBoolean(source.autoActivate, true);
39+
40+
const providerSource = typeof source.getProviders === "function"
41+
? source.getProviders()
42+
: source.providers;
43+
const panelSource = typeof source.getPanels === "function"
44+
? source.getPanels()
45+
: source.panels;
46+
const commandPackSource = typeof source.getCommandPacks === "function"
47+
? source.getCommandPacks()
48+
: source.commandPacks;
49+
50+
const providers = createReadOnlyNetworkProviders(providerSource);
51+
const panels = clonePanels(panelSource);
52+
const commandPacks = cloneCommandPacks(commandPackSource);
53+
const capabilities = cloneCapabilities(
54+
asArray(source.capabilities).length > 0
55+
? source.capabilities
56+
: DEFAULT_NETWORK_DEBUG_CAPABILITIES
57+
);
58+
59+
return {
60+
pluginId,
61+
title,
62+
featureFlag,
63+
autoActivate,
64+
capabilities,
65+
getProviders() {
66+
return createReadOnlyNetworkProviders(providers);
67+
},
68+
getPanels() {
69+
return clonePanels(panels);
70+
},
71+
getCommandPacks() {
72+
return cloneCommandPacks(commandPacks);
73+
}
74+
};
75+
}

0 commit comments

Comments
 (0)