STATIYA_POLUCHATEL_1
SP-01 · PRODUCT CONTRACT
P0 / FOUNDATION / PRODUCT SCOPE AND ACCEPTANCE

Что именно мы строим и когда считаем это работающим

Этот документ превращает согласованные ответы владельца в жёсткий продуктовый контракт. Он намеренно не выбирает crawler-библиотеки, базу данных, очередь или конкретный deploy stack: эти решения должны опираться на reuse research и live discovery Work.

1 URLосновной вход
30records / first gate
3видимых поля записи
P0обязательный до архитектуры

01 / Зафиксированный продуктовый контракт

01

Primary input

The normal user path starts with one source URL. Optional controls may exist in the UI only when they materially help a particular source; the user should not need technical knowledge of sitemaps or crawling.

02

One job = one source

A single task researches and builds one dataset from one resource/domain. A second resource is a separate task with its own source identity and article IDs.

03

Target resources

Primarily article/project portals in DIY and maker topics: woodworking, metalworking, electronics, chips/devices, CNC/CAM, 3D printing and adjacent practical technical publishing.

04

Visible article record

The human-facing article card is intentionally minimal: sequence number, original article title and link to the original page.

05

Article minimum

A valid article is a standalone content page with several meaningful sentences and at least one content image. A project write-up or short technical note can qualify.

06

Video-only

A page that is effectively only a link/embed to a video, without meaningful written material, is excluded.

07

Uncertain pages

If the mechanism cannot confidently decide whether a page is a real article, it is excluded rather than contaminating the dataset.

08

Batch size

One HTML batch contains up to 30 valid article records. If the entire source contains fewer than 30, one final partial batch is valid.

09

First 30 gate

After the first up to 30 valid articles are collected and checked, the process stops at an OWNER GATE. The user sees the staged result and decides whether to continue.

10

Full-run stop condition

After approval, the mechanism continues until it concludes the chosen source corpus is exhausted according to the preflight traversal plan.

11

Logs

The operator sees live logs almost continuously. They must be readable enough that a screenshot or copied snippet can be sent to another AI to diagnose a problem.

12

Duplicates

The same logical article must appear once even if discovered from multiple sitemap/category/archive/feed paths.

13

AI-readable graph

The final HTML series is not a loose list of pages. It keeps stable per-source IDs, batch identity, machine-readable manifests and traversal links so another AI can navigate it directly.

14

Deploy

The successful result is already live on Work. The service page links to completed datasets; each dataset has its own master index.

15

History

Long-term detailed log history is not a requirement for MVP. Current-run logs, copy/export and a compact run summary are enough. Job state/checkpoints are separate and must survive failures.

16

Updates

Automatic periodic refresh is deferred. The initial data model must not block a future mode that checks an existing dataset for newly published articles.

02 / Что считается статьёй

Рабочее определение.

Статья — самостоятельная контентная страница ресурса, где есть осмысленный письменный материал (обычно несколько содержательных предложений или больше) и хотя бы одно контентное изображение. Страница может быть короткой: важна самостоятельная полезная письменная единица, а не большой объём текста.

ПримерОписаниеРешение
Short project articleA page with 4–8 meaningful sentences explaining what was made/done + one or more photos.INCLUDE
Long tutorialStep-by-step or explanatory article with text and images.INCLUDE
Maker note / shop tipCompact standalone written note that explains a technique or result and has an image.INCLUDE
Product/project write-upA self-contained page where an author explains a practical build, device, tool, method or experiment.INCLUDE
Video shellA page whose useful content is essentially only an embedded/external video.EXCLUDE
Category/archiveListing of other articles; not a standalone article.EXCLUDE
Forum thread/indexDiscussion container rather than editorial/project article.EXCLUDE
Service/navigation pageAbout, tag page, search result, pagination landing, login, subscription, author index.EXCLUDE
Unclear borderline pageToo little text, ambiguous role, uncertain article identity.EXCLUDE
Duplicate/canonical aliasSame logical article found via another URL, redirect or canonical alias.EXCLUDE_AS_DUPLICATE
Не вводить искусственный word-count как единственный критерий.

Короткий shop tip из нескольких нормальных предложений может быть полезной статьёй, а длинная category page — нет. Финальный классификационный механизм будет спроектирован в SP-06.

03 / Пользовательский сценарий

1 · STARTВставить URL ресурса и запустить задачу.
2 · PREFLIGHTСервис исследует структуру и показывает план обхода.
3 · FIRST PASSНачинается сбор и live-log; механизм находит первые валидные записи.
4 · PREVIEWСобрать и внутренне проверить первые максимум 30 статей.
5 · OWNER GATEОстановиться. Пользователь смотрит результат и нажимает «Продолжить».
6 · FULL RUNСобрать весь доступный корпус по утверждённому плану, удалить дубли, проверить связи.
7 · DEPLOYОпубликовать на Work, проверить live URL, вывести ссылку и DONE.
Первые 30 — staged preview.

Рекомендуемый контракт: до подтверждения пользователя они не считаются production dataset. После «Продолжить» весь корпус доводится до консистентного финального состояния и только тогда публично деплоится как завершённая база.

04 / Пользовательские состояния задачи

CREATED

URL принят, job создан.

PREFLIGHT

Исследуется структура ресурса и строится traversal plan.

RUNNING_FIRST_BATCH

Собираются первые до 30 валидных статей.

WAITING_FOR_OWNER

Preview готов, требуется кнопка «Продолжить».

RUNNING_FULL

Полный обход после подтверждения.

VALIDATING

Проверяются дубли, ID, batches, manifests, ссылки и полнота выбранного traversal plan.

DEPLOYING

Финальные файлы публикуются на Work.

VERIFYING_LIVE

Проверяются реальные production URL после deploy.

DONE

Только после successful live verification.

PARTIAL

Источник исследован не полностью из-за явно зафиксированного ограничения.

FAILED

Задача не может продолжаться без исправления.

NO_VALID_ARTICLES

Корпус исследован, но валидных статей по принятому определению не найдено.

05 / Точный контракт результата

Что видит человек в записи.

sequence_number · original title · canonical URL / OPEN ↗.

Что дополнительно видит ИИ.

Stable source/article/batch IDs, ordering method, current/previous/next links, master index pointer, canonical URL and verification/discovery metadata. Это служебная связность базы, а не анализ содержания статьи.

/datasets/<source-slug>/ ├── index.html ← MASTER INDEX / AI entry point ├── articles-001-030.html ├── articles-031-060.html ├── articles-061-090.html └── articles-091-0XX.html ← финальный неполный batch допустим Видимая карточка: [000001] Original article title OPEN ↗ Машиночитаемый слой: source_id article_id sequence_number batch_id canonical_url ordering_method previous_article_id / next_article_id previous_file / next_file verification_status

06 / Контракт логов

ALWAYS VISIBLE

Логи идут в отдельном UI-окне практически постоянно, пока job активен.

HUMAN READABLE

Не только stack trace: этап, действие, URL/счётчик, результат, причина предупреждения/ошибки.

AI DIAGNOSTIC

Скриншот должен содержать достаточно информации, чтобы другая ИИ могла предложить исправление.

COPY / EXPORT

Помимо скрина желательно одним действием копировать текущий лог или диагностический пакет.

NO HEAVY HISTORY

Долговременный архив всех логов не является MVP-требованием.

STATE SURVIVES

Отсутствие log archive не означает потерю прогресса: checkpoint/job state хранится отдельно.

07 / Измеримые acceptance criteria

IDКритерийПроверяемое условие
A-01Single URL startGiven a normal source homepage/article portal URL, the user can create a new source job without entering sitemap addresses or crawler rules.
A-02Plan before crawlBefore mass collection the UI shows a preflight traversal plan: discovered source structures and the intended route/order. If no credible route is found, the job does not silently proceed.
A-03Live operational visibilityWhile the job is active, the operator can see stage, current action, counts/progress, warnings/errors and whether the job is RUNNING, WAITING_FOR_OWNER, PARTIAL, FAILED or DONE.
A-04First 30 checkpointThe process stops after the first up to 30 valid records are internally checked. The user can review the preview and press Continue. No full public dataset is declared complete before this gate.
A-05Article precisionThe preview contains only pages matching the accepted article definition. Video-only, category, service and clearly irrelevant pages are absent.
A-06Uncertain exclusionBorderline pages are excluded by default and must not appear merely to fill a batch to 30.
A-07DeduplicationA logical article appears once even if discovered from several navigation surfaces. Canonical/redirect aliases do not create extra records.
A-08Source exhaustionAfter Continue, the job finishes only when it reaches a defensible end of the preflight-defined source corpus or explicitly reports a partial/blocking condition.
A-09Batch contractAll valid records are emitted into ordered HTML batches of max 30. There are no gaps or duplicate sequence IDs. A final batch may contain 1–29 records.
A-10Human resultEvery record visibly exposes at least sequence number, original title and working original URL.
A-11AI resultEvery batch and master index expose machine-readable metadata sufficient for an AI to understand source, range, ordering, current/previous/next relationships and canonical URLs without scraping the visual layout.
A-12Deploy integrityBefore DONE, every production HTML/asset URL created for the dataset is checked live. Broken deployment means DONE is forbidden.
A-13Diagnostic logsOn error, a screenshot/copy of the visible log contains enough context for an AI to identify the failing stage and the relevant URL/action/error.
A-14RecoveryA server/process interruption does not force a complete restart of an already approved long crawl; the job resumes from a safe checkpoint.

08 / Edge cases, которые нельзя забыть дальше

СценарийТребуемое поведение
Source has 0 valid articlesFinish with NO_VALID_ARTICLES / not DONE_AS_DATASET. Show why candidates were rejected.
Source has 1–29 articlesCreate one partial batch; still show the owner preview gate before finalizing.
Exactly 30 articlesFirst batch is also the whole corpus. Owner reviews it; after Continue run final validation and deploy.
Article has text but no imageExclude under current product definition.
Article has an image but only a title/captionExclude.
A source mixes articles with videosCollect written article pages; exclude video-only pages.
A source uses infinite scrollImplementation detail is delegated to crawl/preflight subplans; product requirement remains finite, explainable source exhaustion.
Dates are missingDo not block product. Ordering is selected by the preflight strategy and documented separately.
Sitemap is incompletePreflight may combine credible source structures. The final plan must disclose the traversal strategy; silent assumptions are not allowed.
Page redirectsTreat redirect/canonical destination as the logical page; do not create an extra record.
Same title, different URLs/contentDo not dedupe by title alone. Title equality is insufficient to prove duplicate identity.
robots/login/protection blocks pagesDo not bypass access controls. Report PARTIAL/BLOCKED according to later security/crawl contracts.

09 / Явно вне MVP

Не раздувать первый релиз.

Сервис сейчас не строит полнотекстовый RAG и не скачивает статьи в локальную библиотеку. Цель — качественно и воспроизводимо получить карту статей ресурса и опубликовать связанную HTML-базу ссылок.

OUT OF SCOPE / MVP - сохранение полного body статьи - сохранение/копирование картинок - summary_ru - research_value - semantic content tags - tools/materials extraction - embeddings / RAG - автоматический расписанный periodic refresh - bypass login / CAPTCHA / access protection

10 / Риски продукта и базовые меры

IDРискПочему опасноБазовая мера
R-01False positivesNon-article pages pollute the dataset.First-30 gate + strict uncertain=exclude + benchmark against known resources.
R-02False negativesShort valid notes are missed.Define article around meaningful written content rather than minimum word count only; tune with benchmark.
R-03Wrong orderingIDs become unstable or misleading.Ordering strategy belongs to preflight and must be deterministic/documented before public deploy.
R-04Incomplete source discoveryDataset looks complete but misses whole archive branches.Preflight maps sitemaps/archives/categories before mass crawl and final validation checks coverage against the chosen traversal plan.
R-05Half-deployed datasetWork exposes inconsistent master/batch pages.Stage internally; deploy only validated corpus; verify live URLs before DONE.
R-06Crawler restart costLong source must be scanned again after failure.Persistent job state/checkpoints; logs may be ephemeral but progress state is not.
R-07Luna context overloadCoding AI loses requirements when given every document at once.Each implementation task receives only relevant source refs/contracts and a bounded scope.

11 / Handoff под GPT-5.6 Luna · Medium

Этот документ — contract, а не команда писать весь сервис.

Следующая AI-сессия не должна загружать в active context все будущие планы. Для каждой bounded-задачи ей передаются только релевантные source refs, принятые решения и проверяемый scope.

LUNA-MEDIUM RULE Если реализация любого пункта выглядит как: "сразу написать crawler + UI + deploy + manifests" → TASK OVERSIZED. Нужно: 1. targeted diagnosis; 2. split by capability; 3. один bounded output; 4. explicit acceptance; 5. explicit verification; 6. checkpoint; 7. next bounded block. Нельзя считать этот SP-01 разрешением выбрать конкретный framework/library/database. Это откроют SP-02 REUSE RESEARCH и SP-03 LIVE DISCOVERY.

12 / Что этот подплан открывает дальше

Следующий exact action:

Перейти к Statiya_poluchatel_1_02_REUSE_SKILLS_RESEARCH.html. Архитектуру crawler пока не замораживать.