Структурированная сводка для этой задачи не записана. Показан сохранённый результат без изменений.
Итог
The end-to-end tests pass and the operator guide is written. The scheduler is not switched on: switching it on needs your acceptance of this task, an approved campaign config, and a research connector that doesn't exist yet.
Both runs used made-up test companies and simulated research responses, not real web research. That's because nothing in the codebase can do real research on a schedule yet. The live database was only copied, never written: its checksum is identical before and after.
Checks
python3 -m unittest tests.test_e2e -v: all 16 tests pass in about 25 s.- Full suite: 182 tests pass.
What the tests show
- Two runs in a row:
- Run 1 finds two companies, plus a name variant of one that is correctly merged.
- Run 2, a day later, finds both again plus one new company.
- Result: 3 leads, no duplicate companies, leads or evidence. Re-importing a run's file is refused or ignored.
- A second campaign run straight after the first shares a company without duplicating it or affecting the first campaign's reviews.
- Evidence quality:
- Everything imported stays UNVERIFIED and is linked to the run that found it.
- Each fact keeps its source URL, dates, quoted text and a hash of that text.
- A source page that doesn't back the claim leaves the lead unqualified.
- An inference can't be promoted, even if someone supplies a URL for it.
- Human decisions survive a later run: review verdicts, notes, evidence marked VERIFIED or REJECTED, and a shortlist approval are unchanged after run 2. The approved lead stays on the shortlist.
- Restart recovery, tested by force-killing a real worker process:
- Killed during research: once its lock expires, the run is marked interrupted and nothing partial is saved. The next run waits until it is normally due, so there is no rapid retry loop.
- Killed right after the import was saved: the import finishes on restart without repeating research or creating duplicates.
- Resource limits:
- Hitting the cap on research calls or page fetches stops the run with nothing imported.
- A hung research call is killed at its time limit, in under 15 s here.
- The cap on lead cards and the weekly budget are enforced, and a campaign pauses itself after repeated failures.
- Rollback:
- The kill switch, global disable and per-campaign pause each stop runs.
- Restoring a backup brings back the exact earlier state, including human decisions.
- Rolling back a config leaves the campaign paused until a person resumes it.
- Monitoring: each run writes a complete event trail that can't be edited, mirrors it to the log, and leaves no locks or active runs behind.
- Real data: on a copy of the live database, two runs left all 8 existing leads and their records unchanged. The most recent existing company was correctly skipped as already known.
Things to know
- Weak leads are still imported: leads the research marks as disqualified or needing more research still enter the review queue as UNVERIFIED leads.
- Verification is literal: evidence counts as backed only if the exact quoted text appears on the source page. That doesn't prove the claim itself is true.
Files
tests/test_e2e.py: the acceptance tests.docs/OPERATOR_GUIDE.md: the test report, daily checks, how to stop, recover and roll back (including the backup command), and the activation steps.config/conservative-schedule.json: a prop
[truncated]