@babylonjs-toolkit/agent 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ # The Target — locking the bar as pixels
2
+
3
+ A gauntlet cannot converge on prose. "AAA quality" is not a bar; an image is. This document covers how the
4
+ target gets created, checked, locked, and paired with cameras.
5
+
6
+ Borrowed from the dream-loop pattern and adapted: the target is generated *first*, then the loop closes the
7
+ gap to it.
8
+
9
+ ---
10
+
11
+ ## 1. Where the target comes from
12
+
13
+ **In priority order:**
14
+
15
+ 1. **The user supplied reference media.** Use it directly. Copy into `_gauntlet/<name>/reference/`, named
16
+ per part/camera where possible (`hero-01.png`, `alley-02.png`).
17
+ 2. **There is an existing artifact to improve.** Capture the current state first, then feed that screenshot
18
+ to the image model as the **baseline** and ask for a refinement along the user's direction — so the
19
+ target is an *improvement on what exists*, not a divergence from it. This matters: a target that
20
+ reimagines the scene sends the loop chasing a layout it was never asked to build.
21
+ 3. **Starting fresh.** Generate the target directly from the brief.
22
+
23
+ Where the toolkit's image MCP is configured (`kie-image`, see
24
+ [Image, Video And Sound Generation](https://raw.githubusercontent.com/babylontoolkit/agent/main/references/web-kie-servers.md)):
25
+
26
+ ```
27
+ generate_image(prompt, out_path, reference_paths?, model?, aspect_ratio?, resolution?, output_format?)
28
+ ```
29
+
30
+ - `out_path` → `_gauntlet/<name>/reference/target-<camera>.png`
31
+ - `reference_paths` → the current-state screenshot for the refinement path (up to 14 files)
32
+ - `aspect_ratio` → match the locked camera's aspect; `resolution: "2K"` or `"4K"`; `output_format: "png"`
33
+
34
+ If no image-generation tool is available **and** the user supplied no reference media, **stop and ask** for
35
+ either a target image or an image-generation credential. Do not start a gauntlet against a prose bar.
36
+
37
+ ---
38
+
39
+ ## 2. Prompting for a target — the rule that decides everything
40
+
41
+ **Prompt for a real, in-engine screenshot. Never for concept art.**
42
+
43
+ Words like *concept art*, *cinematic*, *illustration*, *matte painting*, *artstation* produce an artist's
44
+ interpretation with lighting and detail no real-time renderer will ever produce — and the loop will chase it
45
+ forever and never pass.
46
+
47
+ | Write this | Not this |
48
+ |---|---|
49
+ | "in-engine screenshot, real-time game engine, gameplay camera" | "concept art", "key art" |
50
+ | "baked global illumination, reflection probes, real-time shadows" | "cinematic lighting", "dramatic atmosphere" |
51
+ | named framing, focal length, time of day, weather | "epic", "moody", "stunning" |
52
+ | the reference game's actual look, named | a mood board of five different games |
53
+
54
+ State the engine and the constraints in the prompt: *"a real-time in-engine screenshot from a modern
55
+ WebGL/WebGPU game, baked lightmaps, 1920×1080, gameplay camera at eye height"*. You will try to match it to
56
+ the pixel — so it has to be a thing a renderer could actually have output.
57
+
58
+ ---
59
+
60
+ ## 3. The reachability pass — before locking
61
+
62
+ **Do this once, before round 1, and it will save the whole run.** Walk the target against what the chosen
63
+ pipeline can physically deliver, and split it three ways:
64
+
65
+ | Verdict | Meaning | Goes in |
66
+ |---|---|---|
67
+ | **Reachable** | the pipeline exports it | the rubric |
68
+ | **Approximable** | not directly, but a stand-in gets close — a reflection probe for SSR, baked contact shadows for SSAO, a fog gradient for volumetrics | the loop card as the declared approach |
69
+ | **Out of reach** | no path across the export boundary at all | the loop card's `OUT OF REACH` slot |
70
+
71
+ Critics are instructed never to raise gaps against `OUT OF REACH` items. Without this list the critic names
72
+ the same impossible gap every round, the stall ladder fires, and the run parks for no good reason.
73
+
74
+ For `unity-level` jobs the boundary is concrete: the 73 scene-metadata keys the exporter emits. See
75
+ `unity-level-pipeline.md` § *Scope the target to what can actually cross the boundary*.
76
+
77
+ ---
78
+
79
+ ## 4. Locking
80
+
81
+ Once the target is agreed, **it is frozen for the run.** Record in the loop card:
82
+
83
+ ```
84
+ REFERENCE: _gauntlet/<name>/reference/target-hero.png (locked round 1, 2026-09-09)
85
+ _gauntlet/<name>/reference/target-alley.png (locked round 1, 2026-09-09)
86
+ ```
87
+
88
+ A moving target makes every score incomparable and every failed-approach log meaningless. If the user
89
+ genuinely wants a new bar mid-run, that is a **loop card amendment**: append it, date it, note which parts
90
+ must be re-judged, and reset those parts' best-score history. Never silently regenerate the target.
91
+
92
+ > **The optional dream-again step.** Once the artifact has passed against the current target, the user may
93
+ > ask to raise the bar — generate a *new* target using the current state as the baseline and run the loop
94
+ > again. That is a new amendment and, usually, a new set of rounds. It is a deliberate user decision, never
95
+ > something the loop does on its own.
96
+
97
+ ---
98
+
99
+ ## 5. Cameras — one target per locked camera
100
+
101
+ **A comparison against a target image is meaningless if the viewpoint drifts.** Every target image is paired
102
+ with exactly one locked camera, recorded in `_gauntlet/<name>/cameras.md`:
103
+
104
+ ```markdown
105
+ # Locked cameras
106
+ | Name | Target | Transform (pos / rot) | FOV | Res |
107
+ |----------------|---------------------------|------------------------------------|-----|-----------|
108
+ | gauntlet_hero | reference/target-hero.png | (12.0, 1.7, -8.5) / (4, 145, 0) | 60 | 1920x1080 |
109
+ | gauntlet_alley | reference/target-alley.png| (-3.2, 1.7, 22.0) / (0, -90, 0) | 50 | 1920x1080 |
110
+ | gauntlet_detail| reference/target-detail.png| (5.0, 0.9, 2.1) / (10, 200, 0) | 35 | 1920x1080 |
111
+ ```
112
+
113
+ - Three to five cameras is usually right: a hero establishing shot, one or two secondary angles, and a
114
+ detail crop that forces the critic to look closely.
115
+ - For `unity-level`, these are **real Unity cameras** named `gauntlet_<slug>` saved in the scene, so they
116
+ export with the level and can be selected by name in the browser.
117
+ - For `blender-model`, they are fixed orbit angles **plus a frozen lighting rig** — see
118
+ `blender-model-pipeline.md` § *Lock the viewer, not just the camera*.
119
+ - Evidence not captured from a locked transform is **inadmissible** — it fails the camera-lock gate.
120
+
121
+ Add a camera mid-run only by amendment, and generate its target at the same time.
@@ -0,0 +1,285 @@
1
+ # Pipeline: `unity-level`
2
+
3
+ **Deliverable:** a Unity-authored scene exported by the Babylon Toolkit as a **game level** — baked GI,
4
+ IBL/skybox, reflection probes, terrain, fog, tonemapping — consumed by a BabylonJS game.
5
+
6
+ The loop protocol in `SKILL.md` does not change. What changes is **what the builder edits** (a Unity scene,
7
+ via the CLI) and **what the verifier produces** (a browser screenshot of the *exported* level, plus the
8
+ exported scene metadata). No gameplay code is in scope here — the level is the artifact.
9
+
10
+ > **Required reading before round 1.** Fetch and read the Agent Reference's
11
+ > [Unity Exporter Instructions](https://raw.githubusercontent.com/babylontoolkit/agent/main/references/unity-exporter-cli.md)
12
+ > in full. Section numbers below (§4B, §8, §9 …) refer to it. Builder subagents must be given it too — a
13
+ > subagent does not inherit your context.
14
+
15
+ ---
16
+
17
+ ## 1. Prerequisite gate — before round 1, and again on every resume
18
+
19
+ **A gauntlet that starts without these spends its whole budget polishing something that never exports.**
20
+ Run the gate, write the result to `_gauntlet/<name>/pipeline.md`, and refuse to start if it fails.
21
+
22
+ ```bash
23
+ unity command bt_status --project-path "$PROJ"
24
+ ```
25
+
26
+ | Must be true | Why it is fatal |
27
+ |---|---|
28
+ | `pro : True` | **Community silently drops Terrain**, plus Rigidbody, Animator, AudioSource, NavMeshAgent, CharacterController, ParticleSystem, Canvas, VideoPlayer, **PostProcess volumes** and **LOD groups**. The export still succeeds and still writes scene metadata — it just quietly omits them. See §0. |
29
+ | An Editor is reachable | `unity command` needs a live Editor — resident headless or a GUI copilot session (§6). |
30
+ | All three packages installed | `com.unity.pipeline` + `org.khronos.unitygltf` + `com.babylontoolkit.editor` (§4.1). |
31
+ | Scene Exporter panel bootstrapped once, in a GUI session | Seeds layers, FreeImage, shader list and root namespace, and writes `package.json` (§5.1). **A cold machine that has never run the GUI cannot start a gauntlet.** |
32
+ | `npm install` run in the project root | Any build with `CompileProjectScript` needs the local `tsc` (§5.2). |
33
+ | `unity list --format json \| grep bt_` returns the eight `bt_*` commands | The shipped CLI bridge (`com.babylontoolkit.editor` 9.22.3+, §11). If empty: `recompile` + `recompile_status`. |
34
+ | `baking : False` | A lightmap bake in progress hard-blocks every export. |
35
+
36
+ The combined three-things check from §0, worth running verbatim:
37
+
38
+ ```bash
39
+ unity command eval 'string r = UnityTools.GetRootPath();
40
+ return "pro=" + ToolkitManager.IsPro()
41
+ + " tsc=" + System.IO.File.Exists(System.IO.Path.Combine(r, CanvasTools.CVPanel.TscLocalPath))
42
+ + " scene=" + UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene().path;' \
43
+ --project-path "$PROJ"
44
+ # want: pro=True tsc=True scene=Assets/Scenes/<the one you meant>.unity
45
+ ```
46
+
47
+ **Licence is a loop-card boundary, not a warning.** If `pro` is `False`, park immediately and tell the user
48
+ that a valid `Assets/[Config]/license.json` is required — the two service grant paths
49
+ (`HasActiveSubscription()`, `GenerateDeveloperLicense()`) are documented as **not live yet**, so
50
+ `license.json` is the only working path today.
51
+
52
+ ### `pipeline.md` for this kind
53
+
54
+ ```markdown
55
+ # Pipeline — unity-level
56
+ Unity project : /abs/path/UnityProject
57
+ Editor mode : copilot (resident GUI) | headless (-batchmode -nographics)
58
+ Editor version: 6000.5.10f1
59
+ Toolkit : 9.22.3 licence: professional
60
+ Scene : Assets/Scenes/Level01.unity
61
+ Export root : /abs/path/UnityProject/Export
62
+ Dev server : http://localhost:8888 (started via bt_devserver_start)
63
+ Player page : /index.html?scene=level01.gltf (requires a web-project build — see §4.3)
64
+ Bake tier : preview | production
65
+ ```
66
+
67
+ > **None of this survives a pause.** A resident Editor, a warm asset database and a running dev server are
68
+ > all session-scoped. On resume, re-launch and re-run the gate before touching anything.
69
+
70
+ ---
71
+
72
+ ## 2. Build surface — what a builder may edit
73
+
74
+ Everything runs against the **live active scene** through the CLI. The Editor keeps its in-memory state in
75
+ sync; raw file edits cannot.
76
+
77
+ ```bash
78
+ unity command eval_file /tmp/round-12-lighting.cs --project-path "$PROJ" --format json
79
+ ```
80
+
81
+ > ⚠️ **Never hand-edit `.unity`, `.prefab` or `.asset` YAML while a live Editor is reachable.** fileIDs and
82
+ > GUIDs are easy to get wrong, the Editor will not see the change until a reimport, and it is very easy to
83
+ > write valid-looking YAML into the wrong scene. Only edit files directly when `unity status` /
84
+ > `unity command` show no reachable Editor — and say so explicitly in the round journal.
85
+
86
+ Models come from Blender via the `blender-model` pipeline reference; **edit FBX files in place** so the
87
+ Unity GUID and importer settings survive and every scene reference picks up the change.
88
+
89
+ ### The LightingSettings trap — round 1 must handle it
90
+
91
+ A scene created with `EditorSceneManager.NewScene` in batch mode has **no LightingSettings asset**, and the
92
+ export throws `Lightmapping.lightingSettings is null`. Worse, *reading* the property throws when unset, so
93
+ a plain null-check raises the very error it checks for. Probe with `TryGetLightingSettings`, and note the
94
+ order and the `MarkSceneDirty` — without it the assignment is never written to disk and the *second* export
95
+ of that scene fails, which reads as "the fix stopped working" (§8.1):
96
+
97
+ ```
98
+ NewScene -> build hierarchy -> SaveScene -> assign LightingSettings
99
+ -> MarkSceneDirty -> SaveOpenScenes -> AssetDatabase.SaveAssets -> BuildProject
100
+ ```
101
+
102
+ ```bash
103
+ grep -n "m_LightingSettings" Assets/Scenes/Level01.unity
104
+ # bad: m_LightingSettings: {fileID: 0}
105
+ # good: m_LightingSettings: {fileID: 4890085278179872738, guid: 64c317a2..., type: 2}
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 3. Part taxonomy — the default decomposition
111
+
112
+ Round 1 records this as the part checklist in `progress.md`, ordered roughly by impact. Drop parts the
113
+ brief puts out of scope; never add gameplay code parts to a `unity-level` job.
114
+
115
+ | Part | Owns | Exported metadata it drives |
116
+ |---|---|---|
117
+ | **P1 Landform & terrain** | terrain heightmap, terrain layers, splat weights, trees/details | Terrain component (**Pro-gated**) |
118
+ | **P2 Blockout & composition** | major masses, silhouette, sightlines, the framing at each locked camera | geometry |
119
+ | **P3 Set dressing & scatter** | props, clutter, decals, LOD groups | geometry, LOD (**Pro-gated**) |
120
+ | **P4 Materials & surfacing** | albedo/roughness/metallic/normal, texel density, wear | materials, textures |
121
+ | **P5 Light rig** | sun angle + colour temp, practicals, shadow distance and softness, light modes | `light` components, `sunposition`, `sunrotation` |
122
+ | **P6 GI / lightmap bake** | lightmapper, resolution, bounces, denoiser, AO, UV padding | `ambientlightmap`, `lightmaplevel`, lightmap textures |
123
+ | **P7 IBL / skybox / ambient** | skybox material or cubemap, ambient mode/source, SH, sky reflections | `skybox`, `skyreflections`, `createpolynomials`, `ambientlighting`, `ambientskymode`, `ambientskysource`, `ambientskycolor`, `ambientgroundcolor`, `ambientlightintensity` |
124
+ | **P8 Reflection probes** | placement, resolution, box projection, intensity | `reflectionprobeintensity` |
125
+ | **P9 Atmosphere & fog** | fog type/mode/colour/density, height fog, volumetrics | `fogtype`, `fogmode`, `fogcolor`, `fogdensity`, `fogstart`, `fogend`, `fogvolumetric`, `fogbaseheight`, `fogmaximumheight`, `fogmeanfreepath`, `foganisotropy` |
126
+ | **P10 Image processing** | exposure, tonemapping, gamma, clear colour | `exposure`, `tonemapping`, `gammacorrection`, `imageprocessing`, `clearcolor` |
127
+ | **P11 Perf & budget** | draw calls, texture format, lightmap memory, render groups, freeze/prewarm | `webptextures`, `ktxtextures`, `webplightmaps`, `ktxlightmaps`, `rendergroups`, `freezeactivemeshes`, `prewarmup`, `performancepriority` |
128
+
129
+ ---
130
+
131
+ ## 4. Verify recipe — the round's step 4, in order
132
+
133
+ Four things can fail independently. Run them in this order and stop at the first failure.
134
+
135
+ ### 4.1 Bake
136
+
137
+ ```bash
138
+ # kick the bake
139
+ unity command eval 'UnityEditor.Lightmapping.BakeAsync(); return "started";' --project-path "$PROJ"
140
+
141
+ # poll — the export hard-throws while this is true
142
+ unity command eval 'return UnityEditor.Lightmapping.isRunning;' --project-path "$PROJ"
143
+ ```
144
+
145
+ **Bake tiering is a budget, and it is the dominant cost of this pipeline.** Converge on a **preview** tier
146
+ (low lightmap resolution, few bounces, fast/no denoiser) and switch to the **production** tier only for the
147
+ final rounds and the integration critic. Record the tier in `progress.md` under `Budgets:` and in every
148
+ round journal — *a preview-tier score is not comparable to a production-tier score*, and the critic must be
149
+ told which tier it is looking at.
150
+
151
+ ### 4.2 Export as a **game level**
152
+
153
+ The distinction that matters: **`selection == null` means game level.** That single flag gates the entire
154
+ scene-metadata block — skybox, ambient/IBL, SH, reflection probe intensity, fog, tonemapping, exposure,
155
+ gravity, navmesh, sun position. Pass a non-empty selection and you get an asset container with **none** of
156
+ it (§10). A level export writes 73 metadata keys; a container writes 23.
157
+
158
+ ```bash
159
+ unity command bt_export_level --scene Assets/Scenes/Level01.unity \
160
+ --project-path "$PROJ" --timeout 900
161
+ ```
162
+
163
+ - **Always pass `--scene`.** A fresh Editor session opens the *template's* default scene, and exporting
164
+ without opening yours silently exports the wrong one (§8.1).
165
+ - `bt_export_level` throws on `EditorApplication.isCompiling` and on `Lightmapping.isRunning`.
166
+ - `BuildProject` calls `SaveOpenScenes()` and `SaveSettings()` — **anything you toggle in memory is
167
+ persisted to disk.** Snapshot and restore, as the shipped bridge does for `geometryOnly`.
168
+
169
+ ### 4.3 Serve — and the `index.html` trap
170
+
171
+ ```bash
172
+ unity command bt_devserver_start --project-path "$PROJ"
173
+ unity command bt_devserver_status --project-path "$PROJ"
174
+ ```
175
+
176
+ | URL | Serves |
177
+ |---|---|
178
+ | `http://localhost:8888/index.html` | the generated web project, default scene |
179
+ | `http://localhost:8888/index.html?scene=level01.gltf` | the same player pointed at one scene (**file name, not a path**) |
180
+ | `http://localhost:8888/scenes/level01.gltf` | the raw exported asset |
181
+
182
+ > ⚠️ **`bt_export_level` defaults to `--geometryOnly true`, which skips the web-project emit — so
183
+ > `/index.html` 404s and there is nothing to screenshot.** Decide once, in round 1, and record it in
184
+ > `pipeline.md`: either run `bt_build_project` (or `--geometryOnly false`) to generate the player, or point
185
+ > your own BabylonJS loader page at the raw `scenes/*.gltf` URL. This is the most common first-round dead
186
+ > end in this pipeline.
187
+
188
+ ### 4.4 Capture from the locked camera
189
+
190
+ Locked cameras are **real Unity cameras** in the scene, named `gauntlet_<slug>` (e.g. `gauntlet_hero`), one
191
+ per target image, with their exact transform and fov recorded in `cameras.md`. They export as `camera`
192
+ components under both licence tiers.
193
+
194
+ In the browser, select the camera by name before the screenshot rather than trusting whichever camera the
195
+ player defaulted to — via the host's browser tool (`chrome-devtools` `evaluate_script` on Claude Code):
196
+
197
+ ```js
198
+ // select the locked camera, settle, then screenshot
199
+ const cam = scene.getCameraByName("gauntlet_hero");
200
+ if (!cam) throw new Error("locked camera missing from export");
201
+ scene.activeCamera = cam;
202
+ ```
203
+
204
+ Then capture to `_gauntlet/<name>/evidence/round-NN-<part>-hero.png`, and collect
205
+ `round-NN-<part>-metrics.json`: FPS, draw calls, load time, console errors.
206
+
207
+ > Confirm the camera-selection call against your player page on the first round and record what worked in
208
+ > `pipeline.md` — the toolkit's player may already expose its own camera switching, in which case use that.
209
+
210
+ ### 4.5 Read back the export boundary
211
+
212
+ The objective check this pipeline gets for free — assert that what the part was supposed to change actually
213
+ crossed the boundary. Scene metadata lives at **`scenes[0].extras.metadata`**, not the document root:
214
+
215
+ ```bash
216
+ jq '.scenes[0].extras.metadata
217
+ | {license, skybox, ambientlighting, ambientskymode, ambientlightmap, lightmaplevel,
218
+ reflectionprobeintensity, exposure, tonemapping, fogmode, fogvolumetric, sunposition}' \
219
+ "$PROJ/Export/scenes/level01.gltf"
220
+ ```
221
+
222
+ Write the result to `evidence/round-NN-<part>-metadata.json` and hand it to the critic. `license` must read
223
+ `"professional"`.
224
+
225
+ ---
226
+
227
+ ## 5. Extra critic inputs and gates for this pipeline
228
+
229
+ Added to the standard contract in `critic-rubrics.md`:
230
+
231
+ **Inputs:** the exported metadata dump, the bake tier, and — when a Unity-side capture exists — the Editor
232
+ viewport frame alongside the browser frame.
233
+
234
+ **Hard gates:**
235
+
236
+ | Gate | Fails when |
237
+ |---|---|
238
+ | **Export boundary** | a metadata key the part owns is absent, default, or contradicts what the round claims it set |
239
+ | **Licence tier** | `scenes[0].extras.metadata.license` is not `"professional"` |
240
+ | **Level, not container** | `properties` is `false`, or the scene-metadata block is missing — the export was made with a non-null selection |
241
+ | **Bake tier honesty** | the round journal does not state which tier the evidence was baked at |
242
+
243
+ **The Unity-vs-export gap — make the critic isolate it.** If the Editor viewport looks right and the
244
+ exported browser frame looks flat, the round's problem is the *export path*, not the art — and a critic
245
+ looking only at the browser frame will send the builder off to "fix the lighting" forever. When both frames
246
+ are available, the critic must state which side of the boundary the gap is on.
247
+
248
+ > Capturing the Unity side needs a graphics device — it works in **copilot mode** (a resident GUI Editor),
249
+ > via a `Camera.Render()` to a `RenderTexture` and `EncodeToPNG`. A `-nographics` headless Editor cannot
250
+ > render, so in headless mode this diagnostic is unavailable; say so rather than skipping it silently.
251
+ > Verify which you have on round 1 and record it in `pipeline.md`.
252
+
253
+ ---
254
+
255
+ ## 6. Scope the target to what can actually cross the boundary
256
+
257
+ The 73-key metadata list **is** the export surface for scene-level look. Anything the target image depends
258
+ on that has no key — screen-space reflections, SSGI/SSAO, custom render passes, bespoke volume stacks —
259
+ does not survive, and a critic that keeps raising it will name the same gap forever.
260
+
261
+ During the interview's target-reachability pass, walk the target against that key list and record whatever
262
+ cannot cross in the loop card's **`OUT OF REACH`** slot. Critics are instructed not to raise gaps against
263
+ it. Where an effect can be *approximated* on the BabylonJS side instead (a reflection probe standing in for
264
+ SSR, baked contact shadows standing in for SSAO), record that as the approach rather than as out of reach.
265
+
266
+ > The precise URP/HDRP boundary is worth **measuring on your first real export** rather than assuming.
267
+ > Export one scene with the effects you care about, dump `scenes[0].extras.metadata`, and record what
268
+ > actually landed in `pipeline.md`. Do that before finalizing the rubric for a job that leans on them.
269
+
270
+ ---
271
+
272
+ ## 7. Known failure modes — check these before blaming the art
273
+
274
+ | Symptom | Cause | Fix |
275
+ |---|---|---|
276
+ | Export produced geometry but no terrain / physics / LODs | community licence | §0 — install a valid `license.json`; the log line is `Pro Tools Disabled` |
277
+ | `Lightmapping.lightingSettings is null` | programmatic scene with no LightingSettings asset | §8.1, and remember `MarkSceneDirty` |
278
+ | The fix "stopped working" on the second export | `MarkSceneDirty` was missed, so the assignment never persisted | check `m_LightingSettings` in the `.unity` file |
279
+ | `A lightmap bake is in progress.` | `Lightmapping.isRunning` | poll it out before exporting |
280
+ | Exported the wrong scene | fresh session opened the template default | always pass `--scene` |
281
+ | `/index.html` 404s | `--geometryOnly true` skipped the web-project emit | §4.3 |
282
+ | Skybox/fog missing from the export | a non-null selection made it a container | §10 — `selection == null` for a level |
283
+ | Exporter settings changed on their own | `BuildProject` calls `SaveSettings()` every run | snapshot and restore what you toggle |
284
+ | Unity Hub cannot open the project | copilot mode leaves a resident Editor holding the lock | `bt-stop-editor.sh <ProjectPath>` (§4B.3) |
285
+ | `unity command` cannot connect | Safe Mode, or a batch Editor invisible to `status` | `unity pipeline list`; gate on `unity command`, not `unity status` |
@@ -0,0 +1,133 @@
1
+ # The Gauntlet Workspace — resumable state
2
+
3
+ This is what makes the loop resumable days or weeks later: **nothing the loop needs lives in the
4
+ conversation — it all lives in files.** A brand-new session with zero context reads the workspace and knows
5
+ exactly where it was.
6
+
7
+ **One folder per gauntlet job.** `_gauntlet/` is just the container; every job owns a self-contained
8
+ `_gauntlet/<name>/` workspace, so any number of gauntlets — even for the same project — can run, park and
9
+ resume independently.
10
+
11
+ ```
12
+ _gauntlet/
13
+ ├── cod-fps/ # one gauntlet job
14
+ │ ├── loop-card.md # The filled template — the loop's constitution:
15
+ │ │ # DELIVERABLE KIND, DELIVERABLE, OBJECTIVE,
16
+ │ │ # REFERENCE/BENCHMARK, RUBRIC + PASS THRESHOLD,
17
+ │ │ # OUT OF REACH, SUCCESS CONDITION, BOUNDARIES.
18
+ │ │ # Written once after the interview; the loop never edits it.
19
+ │ │ # A deliberate change is an AMENDMENT, appended and dated.
20
+ │ ├── brief.md # Full interview answers (genre, camera, physics, assets,
21
+ │ │ # target FPS, scope cuts, ESM/UMD, ...).
22
+ │ ├── cameras.md # The LOCKED capture cameras — name, exact transform, fov,
23
+ │ │ # resolution, and which target image each one pairs with.
24
+ │ │ # Evidence not shot from these is inadmissible.
25
+ │ ├── components.md # Component inventory of supplied interactive GLTF/GLB
26
+ │ │ # assets (protected TOOLKIT.* / project PROJECT.* /
27
+ │ │ # authoring-only) — written in round 1, read on resume.
28
+ │ │ # Only exists when supplied assets carry component metadata.
29
+ │ ├── pipeline.md # Pipeline state for the deliverable kind: project paths,
30
+ │ │ # Unity project root, licence tier, dev-server port, bake
31
+ │ │ # tier in use, .blend/FBX paths. Written round 1, re-verified
32
+ │ │ # on every resume (a resident Editor does NOT survive a pause).
33
+ │ ├── progress.md # THE resume file — format below.
34
+ │ ├── rounds/
35
+ │ │ ├── round-01.md # Append-only per-round journal: what was built, the critic's
36
+ │ │ ├── round-02.md # score + FULL gap list, gates, STRATEGY lines, evidence links.
37
+ │ │ └── ...
38
+ │ ├── reference/ # The bar: target.png (+ per-camera targets), user-supplied
39
+ │ │ # screenshots/clips. LOCKED at round 1.
40
+ │ └── evidence/ # Our side of the A/B: round-NN-<part>-<camera>.png,
41
+ │ # round-NN-<part>-metrics.json, exported-metadata dumps.
42
+ └── racing-demo/ # another job, fully independent — same layout
43
+ └── ...
44
+ ```
45
+
46
+ ## `progress.md` format
47
+
48
+ ```markdown
49
+ # Gauntlet Progress
50
+ Name: cod-fps
51
+ Kind: web-game | unity-level | blender-model
52
+ Template: gauntlet | bounded
53
+ Round: 12 (total, cumulative across all sessions)
54
+ Budgets: rounds 12/40 · no-improvement streak 0/3 · stall: none · bake tier: preview
55
+
56
+ ## Parts
57
+ - [x] P1 Movement & player controller — passed round 4 (9.0/10, gates all PASS)
58
+ - [~] P2 Weapon hands & viewmodel — attempt 3/5 · best 6.5 (round 9) · last 6.5 (round 11)
59
+ top gap (round 11): "hand anatomy — thumb wrap and knuckle spacing vs reference/weapons-01.png"
60
+ failed: "PBR metallic-only pass" (round 7 — 4.0; critic: plastic-looking; evidence/round-07-p2-hero.png)
61
+ failed: "baked AO decals" (round 9 — 6.5; critic: anatomy still off vs reference/weapons-01.png)
62
+ - [ ] P3 Level lighting & atmosphere
63
+ - [ ] P4 Enemy AI & combat feel
64
+
65
+ ## NEXT ACTION
66
+ Round 13 — P2: STALL APPROACHING (same top gap twice). Incremental tweaks are forbidden.
67
+ Replace the hand mesh outright rather than re-texturing it: re-source or re-model the
68
+ viewmodel hands, then re-capture evidence at 1080p from camera `hero` and re-run the
69
+ weapons critic.
70
+
71
+ ## Blockers / awaiting user
72
+ (none)
73
+ ```
74
+
75
+ - Part states: `- [ ]` pending · `- [~]` in-progress · `- [x]` critic-passed. Never flip `- [x]` for
76
+ partial, skipped, self-reported, or `unverified` work.
77
+ - Every part carries its attempt count, **best and last score**, the **current top gap**, and a
78
+ **failed-approaches log** ("tried X, scored Y, critic evidence Z, abandoned because W") so a resumed loop
79
+ never retries what already lost — a changed strategy is forced, not hoped for.
80
+ - **`NEXT ACTION`** is always exactly one imperative instruction a completely cold session can execute
81
+ first. When a stall tier is active, `NEXT ACTION` must say so and must name the forbidden move.
82
+
83
+ **Persistence rule (HARD):** update `progress.md` and append the round journal **after every round, before
84
+ starting the next**. If the session dies mid-round (limits, crash, user close), at most the in-flight round
85
+ is lost. Budgets count **cumulatively across sessions** — the round counter never resets on resume.
86
+
87
+ ## Round journal format (`rounds/round-NN.md`)
88
+
89
+ ```markdown
90
+ # Round 12 — P2 Weapon hands & viewmodel
91
+ Attempt: 3/5 · Bake tier: preview
92
+
93
+ ## Built
94
+ <what actually changed — files, scene objects, settings. Not a narrative.>
95
+ STRATEGY: <only when a stall tier forced an architectural change — what was thrown away>
96
+
97
+ ## Evidence
98
+ - evidence/round-12-p2-hero.png (camera `hero`, 1920x1080)
99
+ - evidence/round-12-p2-metrics.json (fps 58 · draws 412 · console 0 errors)
100
+
101
+ ## Critic
102
+ SCORE: 6.5 / 10 (Comp 1.5 · Light 1.5 · Mat 1.5 · Detail 1.5 · Motion 0.5)
103
+ PREVIOUS: 6.5 / 10 (round 09)
104
+ GATES: perf PASS · console PASS · authority PASS · camera PASS
105
+ VERDICT: FAIL
106
+ REGRESSION: none
107
+
108
+ ### Gap list
109
+ GAP 01 [Materials] ...
110
+ GAP 02 [Detail] ...
111
+ GAP 03 ...
112
+
113
+ ## Recorded
114
+ progress.md updated: attempt 3/5, stall -> approaching (same top gap twice)
115
+ ```
116
+
117
+ ## Resume protocol (`--resume [<name>]`, or auto-offered)
118
+
119
+ 1. Resolve the job: explicit name → that job; one job in `_gauntlet/` → resume it; several → list them and
120
+ ask.
121
+ 2. Fetch/read the Babylon Toolkit Agent Reference if not already remembered in this session.
122
+ 3. Read `_gauntlet/<name>/loop-card.md` → `progress.md` → `pipeline.md` → `cameras.md` →
123
+ `components.md` (if present) → the last 1–2 `rounds/*.md`.
124
+ 4. Read the pipeline reference for the job's `Kind` and **re-run its prerequisite gate**. This is not
125
+ optional on resume: a resident Unity Editor, a running dev server and a warm asset database do **not**
126
+ survive a pause. Re-establish them and re-verify licence tier before building anything.
127
+ 5. **Reality check:** verify the workspace still matches the project (files it claims exist do exist; the
128
+ build still builds; git state sane; the locked cameras still exist in the scene). Log discrepancies and
129
+ correct `progress.md` before looping — never resume against stale state.
130
+ 6. Report a one-paragraph "resuming from" summary to the user (job name, kind, round counter, parts
131
+ done/total, active stall tier, next action).
132
+ 7. Execute `NEXT ACTION` and enter the round protocol. Chat history is never required — the files ARE the
133
+ memory.