Skip to content

Commit cc90a7e

Browse files
author
DavidQ
committed
docs: add BUILD_PR asset pipeline validation & output bundle
1 parent 599d6ed commit cc90a7e

9 files changed

+408
-12
lines changed

docs/dev/CODEX_COMMANDS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ MODEL: GPT-5.4
22
REASONING: high
33

44
COMMAND:
5-
Create BUILD_PR_ASSET_PIPELINE_CONVERTERS
5+
Create BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT
66

77
Scope:
8-
- add converter abstraction layer
9-
- implement minimal converters
10-
- integrate with pipeline foundation
8+
- add validation stage
9+
- add export/output stage
10+
- integrate with pipeline
1111

1212
Validation:
1313
- npm run test:launch-smoke -- --tools
14-
- verify conversions usable
14+
- verify assets validate and export
1515

1616
Output:
17-
<project>/tmp/BUILD_PR_ASSET_PIPELINE_CONVERTERS_delta.zip
17+
<project>/tmp/BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docs: add BUILD_PR asset pipeline converters bundle
1+
docs: add BUILD_PR asset pipeline validation & output bundle
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT Report
2+
3+
## Scope Outcome
4+
- Added shared validation/output stages to the asset pipeline with minimal integration work.
5+
- Kept scope focused to shared pipeline modules (no UI/theme/editor-state/render changes).
6+
7+
## Validation Stage Additions
8+
- New shared module: `tools/shared/assetPipelineValidationOutput.js`
9+
- Added registry-level validation for:
10+
- schema shape (expected section arrays)
11+
- ID rules (required IDs, supported character set)
12+
- references (candidate/graph-resolved references)
13+
- Reused existing shared registry utilities:
14+
- `sanitizeAssetRegistry(...)`
15+
- `buildAssetDependencyGraph(...)`
16+
- `findRegistryEntryById(...)`
17+
- Missing dependency targets are enforced as validation issues.
18+
19+
## Output Stage Additions
20+
- Added deterministic JSON output artifact builder:
21+
- schema: `tools.asset-pipeline-output/1`
22+
- format: `json`
23+
- deterministic build path: `build/assets/<projectId>.assets.pipeline.json`
24+
- Reused existing shared JSON payload helper:
25+
- `createRegistryDownloadPayload(...)`
26+
- Output includes summary + validation counts + sanitized registry payload.
27+
28+
## Pipeline Integration
29+
- Updated `tools/shared/assetPipelineFoundation.js` to integrate new stages.
30+
- Stage map now includes:
31+
- `validation`
32+
- `output`
33+
- `registerAssetPipelineCandidate(...)` now executes:
34+
- normalize -> convert -> candidate validate -> register -> pipeline validation -> output
35+
- On pipeline validation failure:
36+
- returns `valid: false`
37+
- preserves incoming registry (no invalid registry write-forward)
38+
- output stage is omitted
39+
- Added exported helpers:
40+
- `validateAssetPipelineRegistryState(...)`
41+
- `createAssetPipelineOutput(...)`
42+
43+
## Validation
44+
- Required smoke:
45+
- `npm run test:launch-smoke -- --tools`
46+
- Result: PASS (`9/9`)
47+
- Evidence: `docs/dev/reports/launch_smoke_report.md`
48+
- Focused validation/output verification:
49+
- verified valid assets pass and produce output artifacts
50+
- verified unresolved references fail validation and suppress output stage
51+
- verified deterministic export path/format
52+
- Result: PASS
53+
- Evidence: `docs/dev/reports/BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT_validation.txt`
54+
55+
## Exact Files Changed
56+
- `docs/pr/BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT.md`
57+
- `docs/dev/reports/asset_pipeline_validation_output_targets.txt`
58+
- `tools/shared/assetPipelineValidationOutput.js`
59+
- `tools/shared/assetPipelineFoundation.js`
60+
- `docs/dev/reports/launch_smoke_report.md`
61+
- `docs/dev/reports/BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT_validation.txt`
62+
- `docs/dev/reports/BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT_report.md`
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ASSET PIPELINE VALIDATION & OUTPUT TARGETS
2+
3+
- validation rules (schema, IDs, references)
4+
- export JSON format
5+
- build artifact structure
6+
7+
Keep:
8+
- simple
9+
- deterministic

docs/dev/reports/launch_smoke_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Launch Smoke Report
22

3-
Generated: 2026-04-12T00:31:13.799Z
3+
Generated: 2026-04-12T00:38:22.248Z
44

55
Filters: games=false, samples=false, tools=true, sampleRange=all
66

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# BUILD_PR_ASSET_PIPELINE_VALIDATION_OUTPUT
2+
3+
## Purpose
4+
Add validation, export, and build-output stages to the asset pipeline so assets can be verified and packaged consistently.
5+
6+
## Goals
7+
- validation rules enforcement
8+
- export formats (JSON baseline)
9+
- build artifacts output
10+
11+
## Scope
12+
- validation layer
13+
- export/output layer
14+
- integration with existing pipeline
15+
16+
## Out of Scope
17+
- complex packaging systems
18+
- deployment pipelines
19+
- 3D/export formats
20+
21+
## Strategy
22+
- extend pipeline after converters
23+
- add validation checkpoints
24+
- output standardized artifacts
25+
26+
## Validation
27+
- npm run test:launch-smoke -- --tools
28+
- assets validate and export without errors

tools/shared/assetPipelineFoundation.js

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ import {
1010
createAssetPipelineConverterRegistry,
1111
listAssetPipelineConverters
1212
} from "./assetPipelineConverters.js";
13+
import {
14+
createAssetPipelineOutputArtifact,
15+
validateAssetPipelineState
16+
} from "./assetPipelineValidationOutput.js";
1317

1418
export const ASSET_PIPELINE_STAGES = Object.freeze({
1519
INGEST: "ingest",
1620
NORMALIZE: "normalize",
1721
CONVERT: "convert",
1822
VALIDATE: "validate",
19-
REGISTER: "register"
23+
REGISTER: "register",
24+
VALIDATION: "validation",
25+
OUTPUT: "output"
2026
});
2127

2228
export const ASSET_PIPELINE_SECTION_RULES = Object.freeze({
@@ -143,6 +149,38 @@ export function validateAssetPipelineCandidate(rawCandidate = {}) {
143149
return validateNormalizedAssetPipelineCandidate(candidate);
144150
}
145151

152+
export function validateAssetPipelineRegistryState(options = {}) {
153+
const registry = options.registry && typeof options.registry === "object"
154+
? options.registry
155+
: {};
156+
const candidate = options.candidate && typeof options.candidate === "object"
157+
? cloneValue(options.candidate)
158+
: null;
159+
160+
return validateAssetPipelineState({
161+
registry,
162+
candidate,
163+
sectionRules: ASSET_PIPELINE_SECTION_RULES
164+
});
165+
}
166+
167+
export function createAssetPipelineOutput(options = {}) {
168+
const registry = options.registry && typeof options.registry === "object"
169+
? options.registry
170+
: {};
171+
const validation = options.validation && typeof options.validation === "object"
172+
? cloneValue(options.validation)
173+
: null;
174+
const format = safeString(options.format, "json");
175+
176+
return createAssetPipelineOutputArtifact({
177+
registry,
178+
validation,
179+
format,
180+
sectionRules: ASSET_PIPELINE_SECTION_RULES
181+
});
182+
}
183+
146184
export function registerAssetPipelineCandidate(options = {}) {
147185
const incomingRegistry = options.registry && typeof options.registry === "object"
148186
? options.registry
@@ -171,7 +209,9 @@ export function registerAssetPipelineCandidate(options = {}) {
171209
registry,
172210
entry: null,
173211
validation,
174-
conversion: conversionResult
212+
conversion: conversionResult,
213+
pipelineValidation: null,
214+
output: null
175215
};
176216
}
177217

@@ -188,21 +228,55 @@ export function registerAssetPipelineCandidate(options = {}) {
188228
}
189229

190230
const nextRegistry = upsertRegistryEntry(registry, candidate.section, entry);
231+
const pipelineValidation = validateAssetPipelineRegistryState({
232+
registry: nextRegistry,
233+
candidate
234+
});
235+
if (!pipelineValidation.valid) {
236+
return {
237+
stage: ASSET_PIPELINE_STAGES.REGISTER,
238+
valid: false,
239+
registry,
240+
entry: null,
241+
validation,
242+
conversion: conversionResult,
243+
pipelineValidation,
244+
output: null
245+
};
246+
}
247+
248+
const output = createAssetPipelineOutput({
249+
registry: nextRegistry,
250+
validation: pipelineValidation,
251+
format: safeString(options.outputFormat, "json")
252+
});
253+
191254
return {
192255
stage: ASSET_PIPELINE_STAGES.REGISTER,
193256
valid: true,
194257
registry: nextRegistry,
195258
entry,
196259
validation,
197-
conversion: conversionResult
260+
conversion: conversionResult,
261+
pipelineValidation,
262+
output
198263
};
199264
}
200265

201266
export function summarizeAssetPipelineRules() {
267+
const output = createAssetPipelineOutput({
268+
registry: {},
269+
format: "json"
270+
});
202271
return {
203272
schema: "tools.asset-pipeline-foundation-rules/1",
204273
stages: cloneValue(ASSET_PIPELINE_STAGES),
205274
sectionRules: cloneValue(ASSET_PIPELINE_SECTION_RULES),
206-
converters: listAssetPipelineConverters(DEFAULT_PIPELINE_CONVERTER_REGISTRY)
275+
converters: listAssetPipelineConverters(DEFAULT_PIPELINE_CONVERTER_REGISTRY),
276+
output: {
277+
schema: output.artifact.schema,
278+
format: output.format,
279+
filePathTemplate: "build/assets/<projectId>.assets.pipeline.json"
280+
}
207281
};
208282
}

0 commit comments

Comments
 (0)