LEAD-ENGINE-001.1 · Campaign contract and evidence policy
Статус: COMPLETED
Структурированная сводка для этой задачи не записана. Показан сохранённый результат без изменений.
Итог
I've delivered the versioned campaign schema, the pilot campaign config and the validation tests in /home/iovon/lead-generation. All 46 tests pass with python3 -m unittest tests.test_campaign_config -v. They also pass with the jsonschema library hidden, with only the 2 tests that need it skipped. Both JSON files load cleanly, and running the checker on the pilot config prints OK campaign.v1 PILOT-SW-LICENSING-EU v1 (DRAFT).
Files
docs/schema/campaign-v1.schema.json — the versioned schema (campaign.v1). The safety rules are fixed values that a campaign cannot override.app/campaign_config.py — the checker. It validates a config against the schema and checks rules that span several fields. It also checks single evidence records, status changes and which status each stage may assign. Run it with python3 -m app.campaign_config <file>.config/pilot-campaign.json — the LEAD-001.1 pilot, covering:- the 6 services, 6 target roles and 7 signal types, each with a maximum age;
- scoring rules: thresholds 70 and 40, and "only uses vendor X" disqualifies a lead;
- run limits, set to 60 companies screened → 20 candidates → 10 Lead Cards;
- acceptance: 10 cards, at least 5 judged worth contacting by a human.
tests/test_campaign_config.py — the acceptance tests.docs/campaign-config.md — a short policy reference for the next tasks.- Empty
app/__init__.py and tests/__init__.py so the modules import cleanly.
Rules the code enforces
- No fabricated URLs:
- A source URL must have been fetched during the run or supplied by a human. Generated or inferred URLs are rejected.
- If the run's fetch log is supplied, any URL not in it counts as fabricated.
- Placeholder, local and IP addresses are rejected, as are non-http(s) URLs.
- An unknown publication date must be left empty; dates are never guessed.
- No automatic VERIFIED:
- Research stages are limited to UNVERIFIED (discovery, enrichment) or SUPPORTED (verification, qualification). Only the final human review stage can mark something VERIFIED.
- A claim can only move from SUPPORTED to VERIFIED, by a named human reviewer. It cannot jump straight from UNVERIFIED.
- A config that lets anyone other than a human set or remove VERIFIED fails validation.
- Inferences stay hypotheses: they can never become SUPPORTED or VERIFIED.
- Pilot is safe by default: outreach is off (a fixed rule in v1), there is no schedule, the campaign status is DRAFT, starting a run needs approval, and runs stop when a budget runs out.
- Domain-agnostic core: a test fails if pilot-specific wording appears in the checker or the schema.
Notes for the next task
- No money budget is set (
max_cost_eur: null) because none was given. Runs are capped by calls, tokens and time instead. You can set an amount later without changing the schema. - The pilot definition has no approval date, so
approved_at is left empty rather than guessed. - The existing campaign record in
data/leads.db was not changed. Loading this config into the database belongs to LEAD-ENGINE-001.2. - No research was done and nobody was contacted. The test evidence is made-up sample data and is labelled as such.
Решение
Ожидает вашего решения: принять, вернуть на доработку или отложить.