seedproject-web/api/db/migrations/013_create_cja_qa.sql
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

31 lines
1.8 KiB
SQL

-- QA agent: automated site-test runs and their findings.
--
-- A run is one crawl of the live site (links, images, forms, API, SEO/meta).
-- Each finding is one issue (or pass) with a severity and a fix hint that can be
-- handed to the Web Designer queue as a fix task. Same shape as cja_tasks.
CREATE TABLE IF NOT EXISTS `cja_qa_runs` (
`run_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`status` enum('running','done','failed') NOT NULL DEFAULT 'running',
`trigger` enum('manual','scheduled') NOT NULL DEFAULT 'manual',
`summary` text DEFAULT NULL, -- plain-English triage summary
`counts` longtext DEFAULT NULL CHECK (`counts` IS NULL OR json_valid(`counts`)),
`started_at` datetime NOT NULL DEFAULT current_timestamp(),
`finished_at` datetime DEFAULT NULL,
PRIMARY KEY (`run_id`),
KEY `idx_cja_qa_runs_recent` (`started_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `cja_qa_findings` (
`finding_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`run_id` int(10) unsigned NOT NULL,
`check_type` varchar(40) NOT NULL DEFAULT '', -- page, link, image, external, form, health, seo, sitemap, a11y
`severity` enum('error','warning','info') NOT NULL DEFAULT 'info',
`url` varchar(500) NOT NULL DEFAULT '',
`detail` varchar(500) NOT NULL DEFAULT '',
`fix_hint` text DEFAULT NULL, -- prompt for a Web Designer fix task
`status` enum('open','fix_queued','ignored') NOT NULL DEFAULT 'open',
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`finding_id`),
KEY `idx_cja_qa_findings_run` (`run_id`, `severity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;