# SEO tracking worker — local, not deployed Run tests: `python3 -m unittest discover -v` Read-only actual Google collection: `python3 seo_performance_tracker.py --probe-url https://canina.ir/blog/dog-black-seed-nigella-sativa --state article-probe.sqlite --receipt live-article-receipt.json` Read all research findings with strict pagination: `python3 seo_performance_tracker.py --backend https://HOST --state tracker.sqlite --receipt receipt.json`. Supply `CANINA_ADMIN_TOKEN` through the environment, never command arguments/logs. CLI performs no remote mutations. Dependencies: Python 3, requests, google-auth. Credentials stay in their original path. `deliver_snapshots(store, backend)` is an explicit opt-in library operation, exercised against both a local HTTP fixture and the actual Nest module over TCP with disposable PostgreSQL (see `VERIFICATION.md`). It posts the sibling v2 ingestion contract (contract.md) and retains immutable payload for retries. Local keys include finding, date period, feedbackVersion. It rereads feedbackVersion before delivery, but this is not an atomic guard; snapshot metadata records the observed revision and snapshots never execute article directives. Actual article creation must atomically claim backend `/action` with expectedVersion and feedbackVersion; this worker does not publish articles. SourceMetadata.worker retains Clarity, query rows, provenance and mandatory directive. `deliver_alerts(store, session, endpoint)` is an opt-in structured department receiver adapter. Pending events remain durable in SQLite, deduplicated per source/error/finding/day; successful receiver HTTP acknowledgement marks delivery. Receiver must itself persist and deduplicate idempotencyKey. No actual Telegram/department receiver configured or tested. No background daemon/cron installed. Automatic retry is not scheduled; rerun explicit delivery to retry. Measurement: inclusive 14 date labels ending UTC today minus 3 days, GSC final; GA4 timezone metadata retained. For the verified property GA4 returned America/Los_Angeles, aligning GSC date labels, but not proving session-level cross-source attribution. Page metrics queried separately from anonymized/top-row query data; never sum query rows to invent full page metrics. No rows = null/no_data, not zero. Scroll unavailable absent instrumentation. Query response may omit anonymized queries. GA4 thresholding metadata retained; no automated scaling/pruning policy implemented without approved comparative evidence. ## Verified read-only outcome (2026-10-28) Actual REST requests succeeded using AuthorizedSession. For 2026-10-12 through 2026-10-25, sampled existing article `/blog/dog-black-seed-nigella-sativa`: GSC 5 clicks, 32 impressions, position 3.4375; GA4 2 active users, 33 total engagement seconds, average 16.5 seconds/user, bounce 0.5. GSC query rows empty despite nonzero page metrics (not contradictory; query coverage is limited). Two runs produced one immutable local snapshot and two pending unavailable-source alerts. Receipts contain actual request results, not authenticated-session-construction claims. Discovery fetched a single sample page and is explicitly not a site-wide audit. ## Blockers / boundaries - Clarity frontend project wiring exists; reporting credentials/access not verified. No Clarity data fabricated. - Repo Order/OrderItem has product linkage but no observed article landing/session/order identity chain; related product sales are correlation, not article/keyword causal attribution. Commerce metrics remain null. - Authenticated list/ingestion now exercised against the actual Nest SEO module and real disposable PostgreSQL with a test-only JWT strategy and the shared guards. This does not verify production identity lookup or API-key authentication. Real department/Telegram receipt remains unverified; production writes forbidden. - Mandatory CEO directives carried with revision; existing article publishers are not integrated by this worker. - Integrated into the authorized develop worktree under `scripts/seo-performance/`. No push/Stage/deploy/cron. See `VERIFICATION.md` for exact local acceptance and limitations. - Historical spec zero defaults/threshold recommendations were unsafe and intentionally not restored. Local snapshot same-key remeasurement is immutable; a new period/revision creates a new record. Correcting an earlier snapshot requires an explicit future revision design. - See `VERIFICATION.md` for source baseline and graph provenance. Original graph is SHA-unbound navigation, not completeness proof.