Skip to content

fix: complete alt-text job as skipped when attachment was deleted before it ran - #3639

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-3638-data-machine
Oct 17, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-3638-data-machine

Conversation

@chubes4

@chubes4 chubes4 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

AltTextTask now distinguishes a deleted/trashed attachment from a genuinely non-image attachment at execution time. A missing, non-attachment, or trashed post completes the child job as skipped with reason 'attachment_deleted' instead of failing, which SystemTaskStep already propagates as success so the parent Alt Text Generation job no longer fails with packet_failure. A real non-image attachment (e.g. explicitly targeted via force or a manual ability call) still fails clearly. Covered by new PHPUnit tests for the skip path, the trash path, the genuine-failure path, and parent-step status on both skipped and failed children.

What changed

  • inc/Engine/AI/System/Tasks/AltTextTask.php: added a get_post() existence/post-type/trash check before wp_attachment_is_image(); deleted or trashed attachments complete the job as skipped with reason 'attachment_deleted' instead of failing
  • tests/Unit/Engine/AI/System/Tasks/AltTextTaskTest.php: replaced placeholder-assertion tests with real tracking-job assertions — deleted attachment completes as skipped, trashed attachment completes as skipped, non-image attachment fails
  • tests/Unit/Core/Steps/SystemTask/SystemTaskSkippedChildParentStatusTest.php (new): proves a skipped alt-text child does not fail the parent SystemTaskStep (status 'succeeded', no datamachine_fail_job for the parent) while a failed non-image child still fails the parent step

How to test

  1. Run homeboy review test data-machine; expect passes as recorded by Cook's deterministic gate.

Compatibility

Backward compatible. No schema, API, or settings changes. The only behavioral change is that jobs for attachments deleted between queue time and execution now complete as skipped (reason 'attachment_deleted') instead of failing; genuine non-image targets keep the existing failure message. SystemTaskStep's existing skipped-child handling is reused unchanged. CHANGELOG and versions untouched (release-owned).

Evidence

  • Verified command homeboy review test data-machine: status=succeeded; candidate commit 399c1903d20c4d8fa571370e1cf1028f65594546, tree 96b9473d8b26fe8ffcf1febc8704b57e34809f2d, fingerprint 2005829969828b46f63f20c47119638bc67a97c76dbc20384f1310b25c3ee20d; durable gate gate-1
  • Base unchanged since verification: main remains at 0f03814.
  • CI expected: Homeboy CI after push
  • Candidate adoption provenance: the candidate was promoted from the recorded Cook task execution.
  • Cook deterministic verification: 1 gate(s) completed green.
  • Durable run execution: Succeeded
  • Reviewer-resolvable evidence from source_refs[0]: fix: alt-text task fails (and fails its parent) when the attachment was deleted before it ran #3638
  • Task objective: fix: alt-text task fails (and fails its parent) when the attachment was deleted before it ran #3638
  • Verified candidate scope: 3 changed file(s): inc/Engine/AI/System/Tasks/AltTextTask.php, tests/Unit/Core/Steps/SystemTask/SystemTaskSkippedChildParentStatusTest.php, tests/Unit/Engine/AI/System/Tasks/AltTextTaskTest.php.
  • Verified finalization base: main at 0f03814
  • deterministic gate passed: sh -c homeboy review test data-machine (Passed)

AI assistance

  • AI assistance: Yes
  • Tool(s): Homeboy (pi)
  • Model: anthropic-claude-fable-5
  • Used for: Alt text generation system task (alt_text_generation), queued via the add_attachment hook or the datamachine/generate-alt-text ability, executed through SystemTaskStep as parent/child jobs.

@chubes4
chubes4 merged commit 7a16542 into main Oct 17, 2026
26 checks passed
@chubes4
chubes4 deleted the fix/issue-3638-data-machine branch October 17, 2026 20:27
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.

1 participant