feat: M4 in-admin manual generation on chained-cron checkpoints + IA/perf pass (v0.21.0) (#166)
Final Phase 2 admin milestone. Board "New Article" runs through the M3 chained-cron checkpoint state machine (one stage/idea per tick, queue persisted before generate, lock released on every exit path) so generation survives Hostinger background-kill; retires the SSH-only do_action workaround (WP-CLI routes through the same entry). IA/perf: settings-backed board/ideas pagination + db 1.4.0 indexes. Folds guard P2s (--self-test + window doc). QA: APPROVE-WITH-P2-NOTES @f2a00d4+ delta APPROVE @0c8071f. Deferred (tracked): class-admin-page.php 353-line split + pagination Settings-UI fields. Agent-Session: phase2-admin-m4-20260614
This commit is contained in:
@@ -19,6 +19,14 @@ class PRAutoBlogger_WP_CLI_Commands {
|
||||
}
|
||||
|
||||
// Command: wp prautoblogger opik:eval
|
||||
\WP_CLI::add_command(
|
||||
'prautoblogger generate',
|
||||
array( self::class, 'generate_command' ),
|
||||
array(
|
||||
'shortdesc' => 'Queue a new article generation run on chained-cron checkpoints',
|
||||
)
|
||||
);
|
||||
|
||||
\WP_CLI::add_command(
|
||||
'prautoblogger opik:eval',
|
||||
array( self::class, 'opik_eval_command' ),
|
||||
@@ -69,4 +77,27 @@ class PRAutoBlogger_WP_CLI_Commands {
|
||||
|
||||
exit( $result['items_run'] > 0 ? 0 : 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue a new article generation run on chained-cron checkpoints.
|
||||
*
|
||||
* Routes through PRAutoBlogger_Generation_Checkpoint_Runner::kick_off()
|
||||
* (same path as the board "New Article" button). Does NOT execute
|
||||
* synchronously -- check the board or Activity Log for progress.
|
||||
* This retires the `do_action("prautoblogger_manual_generation")` workaround.
|
||||
*
|
||||
* ## OPTIONS
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* wp prautoblogger generate
|
||||
*
|
||||
* @param array $args Positional args (unused).
|
||||
* @param array $assoc_args Associative args (unused).
|
||||
* @return void
|
||||
*/
|
||||
public static function generate_command( array $args, array $assoc_args ): void {
|
||||
PRAutoBlogger_Generation_Checkpoint_Runner::kick_off();
|
||||
\WP_CLI::success( 'Generation queued on chained-cron checkpoints. Check the board or Activity Log for progress.' );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user