|
| 1 | +# BUILD_PR_LEVEL_12_8_NETWORK_DIRECTORY_NORMALIZATION |
| 2 | + |
| 3 | +## Build Scope |
| 4 | +Normalize the current flat `src/engine/network/` layout into explicit network subfolders using the reviewed `src.zip` file set. |
| 5 | + |
| 6 | +## One PR Purpose Only |
| 7 | +Network directory normalization only. |
| 8 | + |
| 9 | +## Testable PR Requirement |
| 10 | +This PR is not commit-only. |
| 11 | +The implementation must: |
| 12 | +1. move files into the new structure |
| 13 | +2. update imports/exports |
| 14 | +3. keep runtime behavior unchanged |
| 15 | +4. pass real boot/smoke validation |
| 16 | +5. update roadmap markers only if execution-backed validation succeeds |
| 17 | + |
| 18 | +## Source Baseline Used |
| 19 | +Reviewed from uploaded `src.zip`. |
| 20 | + |
| 21 | +## Current Files Confirmed |
| 22 | +- `src/engine/network/AuthoritativeInputIngestionContract.js` |
| 23 | +- `src/engine/network/AuthoritativeServerRuntime.js` |
| 24 | +- `src/engine/network/ChatPresenceLayer.js` |
| 25 | +- `src/engine/network/ClientReconciliationStrategy.js` |
| 26 | +- `src/engine/network/ClientReplicationApplicationLayer.js` |
| 27 | +- `src/engine/network/HandshakeSimulator.js` |
| 28 | +- `src/engine/network/HostServerBootstrap.js` |
| 29 | +- `src/engine/network/InterestManager.js` |
| 30 | +- `src/engine/network/LobbySessionManager.js` |
| 31 | +- `src/engine/network/LoopbackTransport.js` |
| 32 | +- `src/engine/network/NetworkConditionSimulator.js` |
| 33 | +- `src/engine/network/NetworkDebugOverlay.js` |
| 34 | +- `src/engine/network/NetworkingLayer.js` |
| 35 | +- `src/engine/network/PredictionReconciler.js` |
| 36 | +- `src/engine/network/RemoteInterpolationBuffer.js` |
| 37 | +- `src/engine/network/ReplicationMessageContract.js` |
| 38 | +- `src/engine/network/RollbackDiagnostics.js` |
| 39 | +- `src/engine/network/Serializer.js` |
| 40 | +- `src/engine/network/SessionLifecycleContract.js` |
| 41 | +- `src/engine/network/StateReplication.js` |
| 42 | +- `src/engine/network/TransportContract.js` |
| 43 | +- `src/engine/network/index.js` |
| 44 | + |
| 45 | +## Target Structure |
| 46 | +```text |
| 47 | +src/engine/network/ |
| 48 | + index.js |
| 49 | + transport/ |
| 50 | + TransportContract.js |
| 51 | + LoopbackTransport.js |
| 52 | + NetworkConditionSimulator.js |
| 53 | + Serializer.js |
| 54 | + session/ |
| 55 | + SessionLifecycleContract.js |
| 56 | + HandshakeSimulator.js |
| 57 | + LobbySessionManager.js |
| 58 | + ChatPresenceLayer.js |
| 59 | + server/ |
| 60 | + AuthoritativeServerRuntime.js |
| 61 | + AuthoritativeInputIngestionContract.js |
| 62 | + InterestManager.js |
| 63 | + RollbackDiagnostics.js |
| 64 | + client/ |
| 65 | + ClientReplicationApplicationLayer.js |
| 66 | + ClientReconciliationStrategy.js |
| 67 | + PredictionReconciler.js |
| 68 | + RemoteInterpolationBuffer.js |
| 69 | + replication/ |
| 70 | + ReplicationMessageContract.js |
| 71 | + StateReplication.js |
| 72 | + bootstrap/ |
| 73 | + HostServerBootstrap.js |
| 74 | + NetworkingLayer.js |
| 75 | + debug/ |
| 76 | + NetworkDebugOverlay.js |
| 77 | +``` |
| 78 | + |
| 79 | +## Exact Move Map |
| 80 | +- `src/engine/network/TransportContract.js` -> `src/engine/network/transport/TransportContract.js` |
| 81 | +- `src/engine/network/LoopbackTransport.js` -> `src/engine/network/transport/LoopbackTransport.js` |
| 82 | +- `src/engine/network/NetworkConditionSimulator.js` -> `src/engine/network/transport/NetworkConditionSimulator.js` |
| 83 | +- `src/engine/network/Serializer.js` -> `src/engine/network/transport/Serializer.js` |
| 84 | + |
| 85 | +- `src/engine/network/SessionLifecycleContract.js` -> `src/engine/network/session/SessionLifecycleContract.js` |
| 86 | +- `src/engine/network/HandshakeSimulator.js` -> `src/engine/network/session/HandshakeSimulator.js` |
| 87 | +- `src/engine/network/LobbySessionManager.js` -> `src/engine/network/session/LobbySessionManager.js` |
| 88 | +- `src/engine/network/ChatPresenceLayer.js` -> `src/engine/network/session/ChatPresenceLayer.js` |
| 89 | + |
| 90 | +- `src/engine/network/AuthoritativeServerRuntime.js` -> `src/engine/network/server/AuthoritativeServerRuntime.js` |
| 91 | +- `src/engine/network/AuthoritativeInputIngestionContract.js` -> `src/engine/network/server/AuthoritativeInputIngestionContract.js` |
| 92 | +- `src/engine/network/InterestManager.js` -> `src/engine/network/server/InterestManager.js` |
| 93 | +- `src/engine/network/RollbackDiagnostics.js` -> `src/engine/network/server/RollbackDiagnostics.js` |
| 94 | + |
| 95 | +- `src/engine/network/ClientReplicationApplicationLayer.js` -> `src/engine/network/client/ClientReplicationApplicationLayer.js` |
| 96 | +- `src/engine/network/ClientReconciliationStrategy.js` -> `src/engine/network/client/ClientReconciliationStrategy.js` |
| 97 | +- `src/engine/network/PredictionReconciler.js` -> `src/engine/network/client/PredictionReconciler.js` |
| 98 | +- `src/engine/network/RemoteInterpolationBuffer.js` -> `src/engine/network/client/RemoteInterpolationBuffer.js` |
| 99 | + |
| 100 | +- `src/engine/network/ReplicationMessageContract.js` -> `src/engine/network/replication/ReplicationMessageContract.js` |
| 101 | +- `src/engine/network/StateReplication.js` -> `src/engine/network/replication/StateReplication.js` |
| 102 | + |
| 103 | +- `src/engine/network/HostServerBootstrap.js` -> `src/engine/network/bootstrap/HostServerBootstrap.js` |
| 104 | +- `src/engine/network/NetworkingLayer.js` -> `src/engine/network/bootstrap/NetworkingLayer.js` |
| 105 | + |
| 106 | +- `src/engine/network/NetworkDebugOverlay.js` -> `src/engine/network/debug/NetworkDebugOverlay.js` |
| 107 | + |
| 108 | +## Keep In Place |
| 109 | +- `src/engine/network/index.js` |
| 110 | + |
| 111 | +## index.js Requirement |
| 112 | +Update `src/engine/network/index.js` so the public export surface remains stable after file moves. |
| 113 | +Prefer re-export compatibility so existing import sites keep working where possible. |
| 114 | + |
| 115 | +## Import Update Rule |
| 116 | +- update all imports impacted by moved files |
| 117 | +- do not leave stale paths |
| 118 | +- do not leave duplicate shadow copies behind |
| 119 | +- do not widen scope outside this move-map unless required by import resolution |
| 120 | + |
| 121 | +## Validation Requirements |
| 122 | +The BUILD implementation must be testable and must validate all of the following: |
| 123 | + |
| 124 | +### Path / Import Validation |
| 125 | +- all moved module imports resolve |
| 126 | +- `src/engine/network/index.js` exports resolve |
| 127 | +- no broken relative imports remain |
| 128 | + |
| 129 | +### Runtime Smoke Validation |
| 130 | +- existing network sample/runtime boot still works |
| 131 | +- transport/session lifecycle still works |
| 132 | +- authoritative runtime still boots |
| 133 | +- replication/apply path still works |
| 134 | + |
| 135 | +### Regression Protection |
| 136 | +- focused 2D smoke path still boots |
| 137 | +- no engine API breakage caused by path rewiring |
| 138 | + |
| 139 | +## Roadmap Update Rule |
| 140 | +Update: |
| 141 | +`docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md` |
| 142 | + |
| 143 | +Allowed: |
| 144 | +- status markers only: `[ ]` `[.]` `[x]` |
| 145 | + |
| 146 | +Forbidden: |
| 147 | +- wording edits |
| 148 | +- structure edits |
| 149 | +- additions |
| 150 | +- deletions |
| 151 | + |
| 152 | +## Marker Progress |
| 153 | +This BUILD is execution-backed and testable. |
| 154 | +Advance the related normalization marker only when the move-map is implemented and validated successfully. |
| 155 | + |
| 156 | +## Acceptance Criteria |
| 157 | +- exact file move-map applied |
| 158 | +- imports updated |
| 159 | +- stable network export surface preserved |
| 160 | +- no duplicate legacy copies left behind |
| 161 | +- runtime smoke checks pass |
| 162 | +- roadmap updated by marker only |
0 commit comments