Emit artifact diagnostics bundles#391
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wp-codebox/artifact-diagnostics/v1contract for normalized runtime/artifact diagnostics.files/diagnostics.jsonin every Codebox artifact bundle and reference it from manifest, metadata, review evidence, and returned artifact paths.buildArtifactDiagnostics()so downstream consumers can normalize observation diagnostics without product-specific packet scripts.Testing
npm run buildnode --input-type=module -e 'import assert from \"node:assert/strict\"; import { buildArtifactDiagnostics } from \"./packages/runtime-playground/dist/index.js\"; const diagnostics = buildArtifactDiagnostics([{ id: \"obs-1\", type: \"import-report\", observedAt: \"2026-01-01T00:00:00.000Z\", data: { diagnostics: [{ diagnostic_id: \"layout-gap-1\", type: \"layout_fidelity_gap\", severity: \"warning\", message: \"Grid lost\", path: \"index.html\", selector: \".hero\", refs: [{ path: \"files/import-report.json\", kind: \"import-report\" }], source_report: { html: { element_count: 8 } } }] } }]); assert.equal(diagnostics.schema, \"wp-codebox/artifact-diagnostics/v1\"); assert.equal(diagnostics.status, \"reported\"); assert.equal(diagnostics.summary.warning, 1); assert.equal(diagnostics.diagnostics[0].id, \"layout-gap-1\"); assert.equal(diagnostics.diagnostics[0].details.source_report.html.element_count, 8); console.log(\"artifact diagnostics contract smoke passed\")'node packages/cli/dist/index.js run --mount ./examples/simple-plugin:/wordpress/wp-content/plugins/simple-plugin --command wordpress.run-php --arg code='echo \"diagnostics smoke\";' --artifacts "$tmpdir" --jsonplus assertions fordiagnosticsPath,metadata.artifacts.diagnostics, andreview.evidence.diagnosticsnpm run release:packagenpm run package-distribution-smokeNotes
npm run artifact-contract-smokewas attempted but did not return within 10 minutes in this environment. The targeted artifact bundle diagnostics smoke passed.package-distribution-smokeandrelease:packageconflicted indist/release/.../playwright; rerunning sequentially passed.AI assistance