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:
peptiderepo
2026-06-12 12:46:48 +00:00
parent 5c3328dee2
commit b0fde2b686
7 changed files with 313 additions and 7 deletions

View File

@@ -91,7 +91,9 @@ class PRAutoBlogger_Post_Assembler {
* are generated. Its cost is logged with the run_id but no post_id. After all
* articles finish, this method divides the research cost evenly and inserts
* one 'llm_research' row per article so the cost breakdown popover includes
* the amortized research overhead.
* the amortized research overhead. The audit fields prompt_version and
* agent_role are carried from the original research row (v0.19.4 fix;
* prior builds left them NULL/empty — see phase-1 thread seq 49).
*
* Side effects: database SELECT, INSERT, DELETE on generation_log.
*
@@ -158,6 +160,8 @@ class PRAutoBlogger_Post_Assembler {
'estimated_cost' => $amortized_cost,
'response_status' => 'success',
'error_message' => '',
'prompt_version' => $research_row->prompt_version,
'agent_role' => $research_row->agent_role ?? '',
'created_at' => current_time( 'mysql' ),
)
);