Commit Graph

2 Commits

Author SHA1 Message Date
peptiderepo
2bdc763dc0 fix: empty-content guard + finish_reason=length handling + reasoning budget (v0.18.1)
Reasoning models at high effort could spend the entire max_tokens budget
on thinking and return zero visible content with finish_reason=length;
the empty article flowed writer -> editor (reject) -> empty draft post,
with the cost booked as success (2026-06-11 incident: prod run acf24029,
draft post 921; diagnosis: convo pipeline-v2-phase1 seq 12).

- Empty-completion guard at the provider seam (new
  OpenRouter_Completion_Guard): empty/whitespace content is a failure;
  one retry with reasoning disabled (per-call override) when
  finish_reason=length or reasoning was active, then the stage fails.
- finish_reason=length always warning-logged (model, stage, tokens).
- Failed/retried attempts booked to generation_log with
  response_status=error + real token burn; run_decisions verdict rows
  (retry_reasoning_disabled / failed_empty_completion) for v0.18.0 runs.
- Writer-path guard in Content_Generator::execute_stage and
  belt-and-braces empty check in Publisher::create_post.
- Reasoning budget sanity: reasoning.max_tokens cap + completion
  headroom via new prautoblogger_reasoning_max_tokens setting (default
  constant 2048, 0 = legacy uncapped effort mode); cap replaces effort
  when active; governor reservations use the effective ceiling.
- Body assembly moved to Request_Builder::build_body (300-line cap).
- Tests: guard verdict matrix, builder budget shaping, writer/publisher
  guards, full provider retry path.

Agent-Session: prab-empty-draft-guard-20260611
2026-06-11 13:15:58 +00:00
peptiderepo
a8ba7a8ea9 feat: Wave 2 eval harness + image pipeline instrumentation (v0.13.0)
Closes #119

- Extract PRAutoBlogger_Image_Scene_Parser from image prompt builder (331→300 lines)
- Add frozen eval dataset (20 peptide topics at eval/dataset.json)
- Add LLM-as-judge scorer (gemini-flash-1.5 via OpenRouter, 3 axes)
- Add eval runner orchestrator with dry-run and Opik push support
- Add WP-CLI command: wp prautoblogger opik:eval [--limit=<n>] [--dry-run]
- Add image pipeline Opik instrumentation (image_prompt_rewrite span)
- Add content generator eval mode (suppresses publish + image gen)
- Version: v0.13.0
2026-04-24 12:03:33 +07:00