Skip to content

Tighten built-in upload metadata file validation#361

Merged
adamziel merged 1 commit into
trunkfrom
codex/builtin-upload-metadata-file-validator
May 18, 2026
Merged

Tighten built-in upload metadata file validation#361
adamziel merged 1 commit into
trunkfrom
codex/builtin-upload-metadata-file-validator

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

What it does

Holds attachments with missing or empty _wp_attachment_metadata.file as built-in WordPress upload conflicts. The existing discovered media validator already caught this shape; now the production WordPress-scoped validator reports it directly as plugin-wp-attachment-upload-metadata-file-drift.

Also refreshes the merge reliability release-gate evidence from v0.1.40 to the newly published v0.1.41 release.

Rationale

A merged attachment can have _wp_attached_file and serialized metadata but still lack the metadata-side original file field. WordPress uses that field when reasoning about media derivatives, so a generic merge should not treat the state as coherent or silently pick a regeneration policy.

Implementation

When built-in upload validation sees readable attachment metadata without a usable file field, it records a review-only conflict with:

  • field: _wp_attachment_metadata.file
  • role: metadata-file
  • metadata_file_present
  • metadata_file
  • the referenced _wp_attached_file path

Testing instructions

php -l scripts/cow/merge.php
php -l tests/cow/media_validator.php
php tests/cow/media_validator.php
git diff --check

Hold missing or empty attachment metadata file fields as built-in WordPress upload conflicts and refresh release-gate evidence for v0.1.41.
@adamziel adamziel merged commit 3eed59e into trunk May 18, 2026
2 checks passed
@adamziel adamziel deleted the codex/builtin-upload-metadata-file-validator branch May 18, 2026 18:24
@adamziel adamziel mentioned this pull request May 18, 2026
adamziel added a commit that referenced this pull request May 18, 2026
## Release `v0.1.42`

Version bump for `v0.1.42`.

**Changelog draft:**
* Tighten built-in upload metadata file validation (#361)
* Validate built-in attachment image metadata shape (#362)

**Full changelog:**

v0.1.41...release/v0.1.42

## Verification

* `git diff --check`
* `cargo metadata --no-deps --format-version 1`

## Next steps

Merging this PR prepares the release commit. Tagging the merged trunk
commit as `v0.1.42` will run the release workflow and publish binaries.

Co-authored-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants