fix(maintenance): v0.19.4 — composer GD-rung tests, layout-key cleanup, carried P3s
Items completed:
1. GD-rung tests (QA P2, verdict 2026-06-11-6f76df1.md P2-1):
- New ImageComposerEditorTest.php: 7 tests covering wp_get_image_editor WP_Error,
resize WP_Error, upscale size-mismatch guard, save WP_Error, zero-width geometry
guard, missing-role guard, and successful OG resize happy path.
- Orchestrator gd-rung test added to ImageComposerTest.php: forces capability='gd'
via filter, asserts Imagick renderer is never called, pass-through featured is
always first.
2. Dead layout keys removed (QA P3, same verdict P3-3):
- Removed caption_margin_right (og) and caption_side_padding (square) from
Layout::defaults(). The Imagick renderer never reads them: og text is
left-anchored from logo_x+logo_w+caption_gap; square text is center-anchored
at floor(width/2). Right-edge geometry is enforced by caption_chars_per_line.
Decision: remove (not consume) — no renderer geometry to wire them to.
3. Amortized pv/role (P3 carried, phase-1 thread seq 49 + seq 50):
- Post_Assembler::amortize_research_costs() SELECT now includes prompt_version
and agent_role; INSERT carries them forward so amortized llm_research rows are
no longer stamped with NULL/empty audit fields.
4. fetch_page() error body (P3 carried, phase-1 thread seq 50):
- Runware_Catalog_Fetcher::fetch_page() non-200 exceptions now include up to
200 chars of the response body for log-based diagnosis.
5. cto-review.yml isinstance guard: ALREADY FIXED at HEAD (line 454 uses
c.get("severity", "UNKNOWN")). Noted in CHANGELOG; no code change.
Agent-Session: engineer-prab-maint-20260612
This commit is contained in:
@@ -322,4 +322,30 @@ class ImageComposerTest extends BaseTestCase {
|
||||
$this->assertStringStartsWith( 'prautoblogger_', $key );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ladder rung 2 forced via the override filter ('gd'): compose() emits the
|
||||
* pass-through featured variant as first element, and fires exactly one WARNING.
|
||||
* The Imagick renderer must never be called on this rung.
|
||||
*
|
||||
* Source: QA verdict 2026-06-11-6f76df1.md P2-1 and CTO handoff
|
||||
* convo/prautoblogger/threads/2026-06-maintenance-v0194/01-cto-maintenance-handoff.md item 1.
|
||||
*/
|
||||
public function test_gd_rung_emits_passthrough_featured_and_single_warning(): void {
|
||||
Filters\expectApplied( 'prautoblogger_image_compose_capability' )->andReturn( 'gd' );
|
||||
|
||||
// Imagick renderer must not be invoked on the gd rung.
|
||||
$renderer = $this->createMock( \PRAutoBlogger_Image_Composer_Imagick::class );
|
||||
$renderer->expects( $this->never() )->method( 'compose_featured' );
|
||||
$renderer->expects( $this->never() )->method( 'compose_og' );
|
||||
$renderer->expects( $this->never() )->method( 'compose_square' );
|
||||
|
||||
$composer = new \PRAutoBlogger_Image_Composer( $renderer );
|
||||
$variants = $composer->compose( $this->image_data, $this->context() );
|
||||
|
||||
// Pass-through featured variant is always first.
|
||||
$this->assertNotEmpty( $variants );
|
||||
$this->assertSame( 'featured', $variants[0]['role'] );
|
||||
$this->assertSame( 'raw_base_bytes', $variants[0]['bytes'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user