Skip to content

Commit bbb9c84

Browse files
author
DavidQ
committed
Add advanced inspector debug surfaces (opt-in architecture).
1 parent e233a1d commit bbb9c84

22 files changed

Lines changed: 1354 additions & 130 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
11
MODEL: GPT-5.4-codex
2-
REASONING: high
3-
4-
COMMAND:
5-
Follow PLAN_PR + BUILD_PR + APPLY_PR
6-
7-
Create PLAN_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS
8-
9-
Requirements:
10-
- Docs-first
11-
- No engine core changes
12-
- One PR per purpose
13-
- Build zip automatically to <project folder>/tmp/
14-
- Keep shared inspector capability opt-in only
15-
- No auto-injection into unrelated games/samples
16-
- No hidden 3D assumptions
17-
- Update roadmap trackers with bracket-only edits only
18-
- Roadmaps live under docs/roadmaps/
2+
COMMAND: APPLY_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Plan advanced inspector debug-surface contracts as a docs-first PLAN bundle with strict opt-in adoption, no engine-core changes, bracket-only roadmap tracker updates, and packaged delta zip output.
1+
Add advanced inspector debug surfaces (opt-in architecture).

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_ADVANCED_INSPECTORS
1+
PLAN_PR_DEBUG_SURFACES_SERVER_CONTAINERIZATION
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
# Change Summary
2-
3-
## Bundle
4-
PLAN_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS_delta
5-
6-
## Included
7-
- PLAN / BUILD / APPLY docs for advanced inspectors
8-
- Codex command, commit comment, next command
9-
- Reports (change summary, file tree, validation checklist)
10-
- Roadmap tracker bracket-state updates under docs/roadmaps
11-
12-
## Intent
13-
Define the advanced inspector promotion path as opt-in shared debug capability with no engine-core changes, no forced sample adoption, and no hidden 3D assumptions.
1+
Advanced inspectors build bundle created.
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
# Validation Checklist
2-
3-
- [x] PLAN doc present
4-
- [x] BUILD doc present
5-
- [x] APPLY doc present
6-
- [x] Docs-first scope preserved
7-
- [x] No engine-core changes
8-
- [x] Shared inspector capability marked opt-in
9-
- [x] No auto-injection requirement included
10-
- [x] No hidden 3D assumptions included
11-
- [x] Roadmap edits are bracket-only
12-
- [x] Zip built under <project folder>/tmp/
1+
Inspectors load
2+
No auto-injection
3+
Commands work
Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
1-
Toolbox Aid
2-
David Quesenberry
3-
04/06/2026
4-
APPLY_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS.md
5-
61
# APPLY_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS
72

8-
## Apply Intent
9-
Implement advanced shared inspectors as an opt-in debug capability with read-only data flow and no engine core edits.
10-
11-
## Apply Rules
12-
- no engine core changes
13-
- no auto-injection into unrelated games/samples
14-
- no hidden 3D assumptions
15-
- no runtime mutation paths
16-
- use host/registry/command public APIs only
17-
18-
## Required Validation
19-
- imports pass for inspector modules
20-
- host + registry command flow works
21-
- inspector snapshots stay read-only and bounded
22-
- no forced sample/game adoption
23-
- roadmap edits remain bracket-only
24-
25-
## Roadmaps
26-
Roadmap edits (if needed) are limited to bracket states in:
27-
- docs/roadmaps/BIG_PICTURE_ROADMAP.md
28-
- docs/roadmaps/NETWORK_SAMPLES_PLAN.md
29-
- docs/roadmaps/PRODUCTIZATION_ROADMAP.md
3+
Apply advanced inspectors safely.
Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,3 @@
1-
Toolbox Aid
2-
David Quesenberry
3-
04/06/2026
4-
BUILD_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS.md
5-
61
# BUILD_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS
72

8-
## Build Intent
9-
Prepare an implementation-ready BUILD follow-up for advanced inspector capabilities under debug layers only.
10-
11-
## Build Scope
12-
- finalize host/registry/command/view-model contract details
13-
- define bounded inspector data contracts (read-only)
14-
- define adapter seam contracts for project-owned target extraction
15-
- define APPLY slice order and validation gates
16-
17-
## Authoritative Target Structure
18-
```text
19-
engine/debug/inspectors/
20-
bootstrap/createInspectorSurfaceIntegration.js
21-
host/debugInspectorHost.js
22-
registry/debugInspectorRegistry.js
23-
commands/registerInspectorCommands.js
24-
viewModels/
25-
entityInspectorViewModel.js
26-
componentInspectorViewModel.js
27-
stateDiffInspectorViewModel.js
28-
timelineInspectorViewModel.js
29-
eventStreamInspectorViewModel.js
30-
```
31-
32-
## Guardrails
33-
- no engine core changes
34-
- no hidden 3D assumptions
35-
- no auto-injection into unrelated games/samples
36-
- opt-in wiring only
37-
- read-only inspector data flow only
38-
39-
## Ordered APPLY Steps
40-
1. Add inspector host + registry.
41-
2. Add inspector command bridge via public APIs.
42-
3. Add read-only inspector view-model modules.
43-
4. Add opt-in bootstrap helper.
44-
5. Wire only explicitly chosen sample/tool consumers.
45-
6. Run import/smoke/contract validation.
46-
7. Apply bracket-only roadmap state updates.
47-
48-
## Validation Targets
49-
- import health for inspector modules
50-
- command outputs deterministic and read-only
51-
- bounded history/timeline contracts
52-
- no engine core files touched
53-
- no forced adoption side effects
54-
55-
## Packaging
56-
`<project folder>/tmp/PLAN_PR_DEBUG_SURFACES_ADVANCED_INSPECTORS_delta.zip`
3+
Build advanced inspector system (opt-in, read-only).

docs/roadmaps/BIG_PICTURE_ROADMAP.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@
9090

9191
# 🔬 TRACK I — INSPECTORS & TOOLING
9292

93-
- [.] Entity inspector
94-
- [.] Component inspector
95-
- [.] State diff viewer
96-
- [.] Timeline debugger
97-
- [.] Event stream viewer
93+
- [x] Entity inspector
94+
- [x] Component inspector
95+
- [x] State diff viewer
96+
- [x] Timeline debugger
97+
- [x] Event stream viewer
9898

9999
---
100100

engine/debug/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export { drawMinimap } from './Minimap.js';
1313
export { validateWorldEntities, drawValidationPanel } from './Validation.js';
1414
export * from './standard/threeD/index.js';
1515
export * from './network/index.js';
16+
export * from './inspectors/index.js';
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/*
2+
Toolbox Aid
3+
David Quesenberry
4+
04/06/2026
5+
createInspectorSurfaceIntegration.js
6+
*/
7+
8+
import { createInspectorCommandPack, registerInspectorCommands } from "../commands/registerInspectorCommands.js";
9+
import { createDebugInspectorHost } from "../host/debugInspectorHost.js";
10+
import { createDebugInspectorRegistry } from "../registry/debugInspectorRegistry.js";
11+
import { asObject, sanitizeText } from "../shared/inspectorUtils.js";
12+
13+
const DEFAULT_INSPECTOR_PANELS = Object.freeze([
14+
Object.freeze({
15+
id: "inspector-entity",
16+
title: "Inspector: Entity",
17+
modelKey: "entity",
18+
priority: 1170
19+
}),
20+
Object.freeze({
21+
id: "inspector-component",
22+
title: "Inspector: Component",
23+
modelKey: "component",
24+
priority: 1171
25+
}),
26+
Object.freeze({
27+
id: "inspector-state-diff",
28+
title: "Inspector: State Diff",
29+
modelKey: "stateDiff",
30+
priority: 1172
31+
}),
32+
Object.freeze({
33+
id: "inspector-timeline",
34+
title: "Inspector: Timeline",
35+
modelKey: "timeline",
36+
priority: 1173
37+
}),
38+
Object.freeze({
39+
id: "inspector-event-stream",
40+
title: "Inspector: Event Stream",
41+
modelKey: "eventStream",
42+
priority: 1174
43+
})
44+
]);
45+
46+
function toPanelDescriptor(host, definition, enabledByDefault) {
47+
const source = asObject(definition);
48+
const id = sanitizeText(source.id) || "inspector-panel";
49+
const title = sanitizeText(source.title) || id;
50+
const modelKey = sanitizeText(source.modelKey);
51+
const priority = Number.isFinite(source.priority) ? Number(source.priority) : 1170;
52+
return {
53+
id,
54+
title,
55+
enabled: enabledByDefault === true,
56+
priority,
57+
source: "inspectors",
58+
renderMode: "text-block",
59+
render(_panel, contextSnapshot = {}) {
60+
host.update(asObject(contextSnapshot));
61+
const snapshot = asObject(host.getSnapshot());
62+
const model = asObject(asObject(snapshot.models)[modelKey]);
63+
const lines = Array.isArray(model.lines) ? model.lines.slice(0, 12) : [];
64+
return {
65+
id,
66+
title,
67+
lines: lines.length > 0 ? lines : [`No ${modelKey || "inspector"} data available.`]
68+
};
69+
}
70+
};
71+
}
72+
73+
function toProviderDescriptors() {
74+
return [
75+
{
76+
providerId: "inspector.entity.snapshot",
77+
title: "Inspector Entity Snapshot",
78+
readOnly: true,
79+
sourcePath: "inspectors.models.entity"
80+
},
81+
{
82+
providerId: "inspector.component.snapshot",
83+
title: "Inspector Component Snapshot",
84+
readOnly: true,
85+
sourcePath: "inspectors.models.component"
86+
},
87+
{
88+
providerId: "inspector.stateDiff.snapshot",
89+
title: "Inspector State Diff Snapshot",
90+
readOnly: true,
91+
sourcePath: "inspectors.models.stateDiff"
92+
},
93+
{
94+
providerId: "inspector.timeline.snapshot",
95+
title: "Inspector Timeline Snapshot",
96+
readOnly: true,
97+
sourcePath: "inspectors.models.timeline"
98+
},
99+
{
100+
providerId: "inspector.eventStream.snapshot",
101+
title: "Inspector Event Stream Snapshot",
102+
readOnly: true,
103+
sourcePath: "inspectors.models.eventStream"
104+
}
105+
];
106+
}
107+
108+
export function createInspectorSurfaceIntegration(options = {}) {
109+
const source = asObject(options);
110+
const registry = source.registry && typeof source.registry.getSnapshot === "function"
111+
? source.registry
112+
: createDebugInspectorRegistry({
113+
inspectors: source.inspectors
114+
});
115+
const host = source.host && typeof source.host.getSnapshot === "function"
116+
? source.host
117+
: createDebugInspectorHost({
118+
registry,
119+
limits: source.limits
120+
});
121+
const commandRegistration = source.commandRegistry
122+
? registerInspectorCommands({
123+
host,
124+
commandRegistry: source.commandRegistry,
125+
packId: sanitizeText(source.commandPackId) || "inspectorx",
126+
namespace: sanitizeText(source.commandNamespace) || "inspectorx"
127+
})
128+
: null;
129+
130+
return {
131+
registry,
132+
host,
133+
commandRegistration,
134+
update(context = {}) {
135+
return host.update(context);
136+
},
137+
getSnapshot() {
138+
return host.getSnapshot();
139+
}
140+
};
141+
}
142+
143+
export function createAdvancedInspectorDebugPluginDefinition(options = {}) {
144+
const source = asObject(options);
145+
const integration = createInspectorSurfaceIntegration({
146+
registry: source.registry,
147+
host: source.host,
148+
limits: source.limits
149+
});
150+
const host = integration.host;
151+
const defaultPanels = Array.isArray(source.panels) ? source.panels : DEFAULT_INSPECTOR_PANELS;
152+
const includeCommandPack = source.includeCommandPack === true;
153+
const commandPackId = sanitizeText(source.commandPackId) || "inspectorx";
154+
const commandNamespace = sanitizeText(source.commandNamespace) || commandPackId;
155+
156+
return {
157+
pluginId: sanitizeText(source.pluginId) || "inspectors.advanced",
158+
title: sanitizeText(source.title) || "Advanced Inspectors",
159+
featureFlag: sanitizeText(source.featureFlag) || "advancedInspectors",
160+
autoActivate: source.autoActivate === true,
161+
capabilities: [
162+
{ capabilityId: "debug.overlay.panel", version: "1.0.0", required: true },
163+
{ capabilityId: "debug.overlay.provider", version: "1.0.0", required: true },
164+
{ capabilityId: "debug.command-pack", version: "1.0.0", required: includeCommandPack }
165+
],
166+
getProviders() {
167+
return toProviderDescriptors();
168+
},
169+
getPanels() {
170+
return defaultPanels.map((panel) => toPanelDescriptor(host, panel, source.panelsEnabled === true));
171+
},
172+
getCommandPacks() {
173+
if (!includeCommandPack) {
174+
return [];
175+
}
176+
return [
177+
createInspectorCommandPack({
178+
host,
179+
packId: commandPackId,
180+
namespace: commandNamespace,
181+
label: sanitizeText(source.commandLabel) || "Advanced Inspector"
182+
})
183+
];
184+
},
185+
update(context = {}) {
186+
return host.update(context);
187+
},
188+
getSnapshot() {
189+
return host.getSnapshot();
190+
}
191+
};
192+
}

0 commit comments

Comments
 (0)