## Board 'New Article' button
- templates/admin/board-page.php: add #prab-board-generate-now button + status div
- includes/admin/class-board-page.php: inject generateNonce + i18n strings into prabBoard;
enqueue companion board-generate.js
- assets/js/board-generate.js: NEW – board button AJAX handler (fires
prautoblogger_generate_now, resets board backoff on success)
- assets/js/board.js: applySnapshot() re-enables button when no active runs
## Chained-cron checkpoint machine (retires SSH workaround)
- includes/core/class-generation-checkpoint-runner.php: NEW (295 lines)
Tick 1 (prautoblogger_gen_orchestrate): orchestrate_only() → persist queue → schedule Tick 2
Tick 2..N (prautoblogger_gen_tick): pop one idea → Article_Worker → reschedule or finalize
Budget/halt contract + lock release on all exit paths
- includes/class-executor.php: on_manual_generation() replaced with 1-line delegate to
Generation_Checkpoint_Runner::on_orchestrate_tick() (SSH workaround retired)
- includes/class-prautoblogger.php: register ORCHESTRATE_ACTION + GENERATE_ACTION hooks
- includes/core/class-pipeline-runner.php: expose orchestrate_only() public wrapper
- includes/core/class-pipeline-status.php: add write_initial() + write_error() helpers
## WP-CLI command
- includes/admin/class-wp-cli-commands.php: wp prautoblogger generate → kick_off()
## IA / perf pass (settings-backed pagination + DB indexes)
- includes/admin/class-board-data-provider.php: replace hardcoded posts_per_page=20 with
get_option('prautoblogger_board_column_limit', DEFAULT)
- includes/admin/class-board-gen-log-query.php: replace LIMIT 10/20 literals with settings-backed values
- includes/admin/class-ideas-browser-query.php: NEW – query helpers extracted from Ideas_Browser
(300-line rule split): query_ideas(), get_type_counts(), load_idea_data(),
find_post_by_run_id(), update_idea_stage()
- includes/admin/class-ideas-browser.php: delegates all query work to Ideas_Browser_Query
- includes/class-activator.php: set_default_options() adds board_column_limit + ideas_per_page
- includes/admin/class-admin-page.php: add new settings to numeric sanitization list
- prautoblogger.php: PRAUTOBLOGGER_DEFAULT_BOARD_COLUMN_LIMIT=20, PRAUTOBLOGGER_DEFAULT_IDEAS_PER_PAGE=30
- includes/class-schema-installer.php: indexes on generation_log + analysis_results (db 1.4.0)
- includes/class-pipeline-schema-installer.php: KEY started_at on runs table
## Guard P2s
- scripts/check-constants.php: --self-test mode + inline CONSTANTS_GUARD_WINDOW comment
- .github/workflows/ci.yml: check-constants-self-test step after main constants check
## PHPUnit test
- tests/unit/Core/GenerationCheckpointRunnerTest.php: NEW (227 lines)
4 tests: kick_off schedules+transient, empty-queue finalizes, halted-run aborts+cleanup,
multi-idea pops-one-and-reschedules
## Docs + version
- prautoblogger.php: Version 0.21.0, PRAUTOBLOGGER_DB_VERSION 1.4.0
- ARCHITECTURE.md: §25 Chained-Cron Checkpoint Generation Path
- CHANGELOG.md: v0.21.0 entry
- INFORMATION-ARCHITECTURE.md: NEW – admin pages, entry points, DB tables, options, CLI
- uninstall.php: purge prautoblogger_gen_orchestrate + prautoblogger_gen_tick cron hooks
Agent-Session: phase2-admin-m4-20260614
85 lines
3.6 KiB
Markdown
85 lines
3.6 KiB
Markdown
# Information Architecture — PRAutoBlogger
|
|
|
|
Auto-generated index of all admin surfaces, data flows, and integrations.
|
|
Maintained per DoD v1.1.0 (same-PR update rule).
|
|
|
|
---
|
|
|
|
## Admin Pages
|
|
|
|
| Slug | Class | Template | Purpose |
|
|
|------|-------|----------|---------|
|
|
| `prautoblogger-settings` | `PRAutoBlogger_Admin_Page` | `admin-page.php` | Main settings (schedule, models, budget, board limits) |
|
|
| `prautoblogger-board` | `PRAutoBlogger_Board_Page` | `board-page.php` | Kanban board: Generating / Failed / In Review / Published columns. New Article button (v0.21.0). |
|
|
| `prautoblogger-articles` | `PRAutoBlogger_Articles_Page` | `articles-page.php` | Paginated list of all articles/runs |
|
|
| `prautoblogger-dossier` | `PRAutoBlogger_Dossier_Page` | `dossier-page.php` | Per-article generation log + stage edit/re-run (M3) |
|
|
| `prautoblogger-ideas` | `PRAutoBlogger_Ideas_Browser` | `ideas-browser.php` | Analysis results browser with per-idea generation |
|
|
| `prautoblogger-activity` | `PRAutoBlogger_Activity_Page` | `activity-page.php` | Cost + generation activity log |
|
|
|
|
---
|
|
|
|
## Generation Entry Points (v0.21.0)
|
|
|
|
```
|
|
Board "New Article" button
|
|
└─ AJAX prautoblogger_generate_now
|
|
└─ Generation_Status_Poller::on_ajax_generate_now()
|
|
└─ schedules prautoblogger_manual_generation cron
|
|
└─ Executor::on_manual_generation()
|
|
└─ Generation_Checkpoint_Runner::on_orchestrate_tick() ← Tick 1
|
|
└─ schedules prautoblogger_gen_tick
|
|
└─ Generation_Checkpoint_Runner::on_generate_tick() ← Tick 2..N
|
|
|
|
WP-CLI: wp prautoblogger generate
|
|
└─ WP_CLI_Commands::generate_command()
|
|
└─ Generation_Checkpoint_Runner::kick_off()
|
|
└─ schedules prautoblogger_gen_orchestrate
|
|
└─ Generation_Checkpoint_Runner::on_orchestrate_tick() ← Tick 1
|
|
|
|
Daily auto-generation cron
|
|
└─ prautoblogger_daily_generation
|
|
└─ Executor::on_cron_run()
|
|
└─ Pipeline_Runner::run() (legacy synchronous path — runs in a single PHP process)
|
|
```
|
|
|
|
---
|
|
|
|
## Database Tables
|
|
|
|
| Table | DB Version | Purpose |
|
|
|-------|-----------|---------|
|
|
| `prautoblogger_sources` | 1.0.0 | Collected Reddit/RSS source content |
|
|
| `prautoblogger_analysis_results` | 1.0.0 | Scored article ideas |
|
|
| `prautoblogger_generation_log` | 1.0.0 | Per-LLM-call log (cost, tokens, status) |
|
|
| `prautoblogger_runs` | 1.0.0 | Per-run ledger (status, ceiling_usd) |
|
|
| `prautoblogger_run_stages` | 1.2.0 | Per-stage state for M3 re-run |
|
|
| `prautoblogger_stage_inputs` | 1.3.0 | Immutable input versions for stage edits (M3) |
|
|
| `prautoblogger_run_decisions` | 1.2.0 | Editorial decisions per run |
|
|
|
|
DB version history: 1.0→1.1 (schema normalisation), 1.1→1.2 (M2 dossier), 1.2→1.3 (M3 stage inputs), 1.3→1.4 (M4 indexes).
|
|
|
|
---
|
|
|
|
## Key Options
|
|
|
|
| Option | Type | Default | Purpose |
|
|
|--------|------|---------|---------|
|
|
| `prautoblogger_board_column_limit` | int | 20 | Max cards per board column |
|
|
| `prautoblogger_ideas_per_page` | int | 30 | Ideas browser page size |
|
|
| `prautoblogger_article_queue` | array | — | Checkpoint queue (run_id + ideas + results) |
|
|
| `prautoblogger_checkpoint_run_id` | string | — | Current run UUID for Tick 2..N finalize path |
|
|
| `prautoblogger_db_version` | string | — | Installed schema version (triggers dbDelta on mismatch) |
|
|
|
|
---
|
|
|
|
## WP-CLI Commands
|
|
|
|
| Command | Since | Description |
|
|
|---------|-------|-------------|
|
|
| `wp prautoblogger generate` | 0.21.0 | Queue article generation via chained-cron checkpoints |
|
|
| `wp prautoblogger opik:eval` | 0.12.0 | Trigger Opik eval run |
|
|
|
|
---
|
|
|
|
*Last updated: v0.21.0 (2026-06-14)*
|