## Implementation Plan ### Objective Eliminate the single confirmed code defect: `SeoRunForm` accepts malformed URLs and relative paths at submission, which later cause 0‑byte failures in the worker subprocess. The fix adds URL format validation following the same pattern used by `IsslopRunForm` in the same module. ### Changes Required **1. `devplacepy/models.py` – `SeoRunForm.url_scheme` validator (lines 456–462)** Replace the current empty‑string check with a robust validator that: - Rejects blank input. - Rejects strings that do not match a valid http/https URL pattern after optionally prepending `https://`. - Rejects relative paths (e.g. `/feed`) and malformed schemes (e.g. `ahttps://`). Reuse the existing `ISSLOP_URL_PATTERN` regex (or create an equivalent named constant) already defined in the same file. The logic mirrors `IsslopRunForm.url_scheme` (lines 477–489). **2. `tests/api/tools/seo.py` – Add two new test cases** - `test_run_rejects_malformed_url` – POST with `ahttps://devplace.net/sitem`, expect 400/422. - `test_run_rejects_relative_path` – POST with `/feed`, expect 400/422. These tests confirm the validator stops garbage input before it reaches the worker. **3. Environmental failures are out of scope** The valid‑URL failures (`Battlepenguin.com`, `devplace.net`) cannot be reproduced or fixed from source alone. The sitemap/URL asymmetry is architectural, not a code defect, and will be addressed in a separate ticket once production diagnostics are available. ### Definition of Done - [ ] The `SeoRunForm.url_scheme` validator raises `ValueError` for all inputs tested by the two new test cases. - [ ] The validator accepts `https://example.com` and `http://example.com` (with or without scheme). - [ ] `make test-unit` passes (exit code 0, all tests green). - [ ] `ruff check .` passes (exit code 0, no new lint errors). - [ ] No functionality regressions: existing tests in `tests/api/tools/seo.py` and `tests/e2e/tools/seo.py` continue to pass. - [ ] Only two files are changed: `devplacepy/models.py` (validator logic) and `tests/api/tools/seo.py` (test additions).