seedproject-web/api/cli/qa-start.php
Carlos Arias 56c1926b81 qa: QA agent — HTTP site testing with one-click Web Designer fixes
- migration 013: cja_qa_runs + cja_qa_findings
- runner: runQa (crawl pages/links/images/external/contact-probes/health/
  SEO/meta/sitemap/a11y), qaTriage (LLM summary via qa skill), /devconsole/qa/run
- qa-start/finish/routes.php CLI bridge
- adminqa controller (runs/findings/fix/ignore); fix() chains to the Web
  Designer queue; /admin/qa report page + nav link
- qa skill; contact form probed via honeypot (writes nothing)
2026-07-24 03:30:13 +00:00

25 lines
811 B
PHP

<?php
/**
* Open a QA run and print its run_id. Called by the console runner (which has no
* DB driver) before it starts crawling.
*
* php api/cli/qa-start.php --trigger=manual # or --trigger=scheduled
*/
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../config.php';
$opts = getopt('', ['trigger::']);
$trigger = in_array(($opts['trigger'] ?? ''), ['manual', 'scheduled'], true) ? $opts['trigger'] : 'manual';
$pdo = new PDO(
sprintf('mysql:host=%s;dbname=%s;charset=utf8mb4', DB_HOST, DB_NAME),
DB_USER,
DB_PASS,
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);
$stmt = $pdo->prepare("INSERT INTO cja_qa_runs (status, `trigger`, started_at) VALUES ('running', ?, NOW())");
$stmt->execute([$trigger]);
echo json_encode(['run_id' => (int) $pdo->lastInsertId()]);