Status/content type/scope/service/listing signatures.
01 / Product rule
Содержательная письменная часть обязательна. Контентное изображение обязательно. Video-only и uncertain исключаются. Это прямой product contract, а не временная эвристика.
Короткий технический tip может быть валидным, а длинная category page — нет. Решение строится по нескольким структурным сигналам.
02 / Основные сигналы
| ID | Signal | Meaning |
|---|---|---|
| SIG-01 | Standalone page evidence | URL/page has its own content detail view rather than a listing/index shell. |
| SIG-02 | Meaningful main text | Extracted main content contains coherent prose, not only navigation, labels, captions or comments. |
| SIG-03 | Content image | At least one image belongs to the content area and is not only logo/avatar/icon/tracking/advertisement. |
| SIG-04 | Title | A stable human-readable content title exists from page heading/meta/article markup. |
| SIG-05 | Article semantics | article/main schema/DOM patterns support content-page interpretation. |
| SIG-06 | Listing density | High ratio of outbound internal content links/cards to own prose indicates category/archive page. |
| SIG-07 | Video dominance | Embedded video/player is dominant and written text is only a short intro/caption. |
| SIG-08 | Utility semantics | login/account/search/tag/author/about/contact/cart/subscription/service semantics. |
| SIG-09 | Forum semantics | thread/replies/user discussion structure dominates rather than authored article/project write-up. |
| SIG-10 | Content duplication shell | Page is thin alias/redirect/canonical duplicate of another logical page. |
03 / Reason codes
| Code | Meaning |
|---|---|
| INCLUDE_ARTICLE | Standalone content page meets text + image + title requirements. |
| INCLUDE_SHORT_NOTE | Short but meaningful standalone written note/project tip with content image. |
| EXCLUDE_VIDEO_ONLY | Video/player is the substantive content; text is insufficient. |
| EXCLUDE_NO_MEANINGFUL_TEXT | No coherent written body beyond chrome/captions/metadata. |
| EXCLUDE_NO_CONTENT_IMAGE | No qualifying content image found under current product contract. |
| EXCLUDE_LISTING | Category/archive/tag/search/issue/listing page. |
| EXCLUDE_SERVICE | About/login/account/subscription/navigation/utility page. |
| EXCLUDE_FORUM | Discussion/forum/thread page, not article/project write-up. |
| EXCLUDE_DUPLICATE_SHELL | Thin alias/canonical shell handled as duplicate path. |
| EXCLUDE_UNCERTAIN | Evidence does not confidently prove article status. |
| EXCLUDE_FETCH_INVALID | Non-HTML or invalid/unusable fetched content. |
04 / Decision flow
| Step | Question | Action |
|---|---|---|
| 1 | FETCH VALID? | Non-HTML, empty or unusable → EXCLUDE_FETCH_INVALID. |
| 2 | OBVIOUS SERVICE/LISTING? | Strong utility/category/archive semantics → exclude. |
| 3 | MAIN CONTENT FOUND? | No meaningful main text → exclude. |
| 4 | TEXT MEANINGFUL? | Several coherent sentences or equivalent short technical note required. |
| 5 | CONTENT IMAGE FOUND? | No qualifying content image → exclude under current owner rule. |
| 6 | VIDEO DOMINANT? | If yes and prose is only shell/intro → EXCLUDE_VIDEO_ONLY. |
| 7 | TITLE STABLE? | No usable content title → usually EXCLUDE_UNCERTAIN. |
| 8 | ARTICLE/PROJECT EVIDENCE? | Sufficient positive signals → INCLUDE. |
| 9 | BORDERLINE? | Never include to fill quota → EXCLUDE_UNCERTAIN. |
05 / Written-content rules
| Rule | Contract |
|---|---|
| Do not use one hard word count | A 60-word shop tip may be valid; a 500-word archive page may not be. |
| Use main-content extraction | Boilerplate/nav/footer/comments should not count as article prose. |
| Sentence coherence | Text should contain coherent authored statements, not only labels/spec tables/link lists. |
| Short-note exception | A compact project/shop note can qualify if it independently explains a technique/result. |
| Comments are not body | User comments/replies do not rescue an otherwise textless page. |
| Hidden text ignored | CSS-hidden/aria utility text should not be treated as visible article prose. |
| Language agnostic | Classifier should work structurally across languages; avoid Russian/English-only keyword logic as primary test. |
06 / Content-image rules
| Rule | Contract |
|---|---|
| Content-area location | Prefer images inside article/main/body/project content container. |
| Exclude chrome | Logo, favicon, avatar, author portrait, social icon, nav icon, badge, spacer, tracking pixel do not count. |
| Exclude ads | Ad/affiliate banner alone does not satisfy image requirement. |
| Lazy-load aware | Inspect src/srcset/data-src and rendered DOM when needed. |
| Dimensions | Tiny icons/pixels should not count; exact threshold tuned by fixtures, not guessed globally. |
| CSS background | May count only if clearly a content image and reliably identifiable. |
| Video poster | A video poster alone must not make a video-only page qualify. |
07 / Title and canonical extraction
| Title rule | Contract |
|---|---|
| Preferred | Visible H1/main heading that belongs to content. |
| Fallback | og:title / article metadata / <title> only if consistent and not site-only boilerplate. |
| Normalize | Collapse whitespace, decode entities; preserve original wording/case as much as possible. |
| Site suffix | Remove repeated site-brand suffix only when source-specific pattern is proven. |
| No generated titles | Never invent a title from URL slug if page title is absent. |
| Canonical rule | Contract |
|---|---|
| Final fetched URL | Always retain as evidence. |
| rel=canonical | Treat as candidate, not unquestioned truth. |
| Same-source canonical | Can become preferred logical URL if valid and in allowed source scope. |
| External canonical | Do not silently switch dataset to another domain; flag for SP-07 review. |
| Redirect destination | Prefer stable final URL when within approved source identity. |
| Conflicts | redirect vs canonical vs og:url conflict → preserve evidence; SP-07 resolves identity. |
08 / Classifier layers
main/article/h1/content containers, listing density, forms, replies.
Main prose extraction; Trafilatura/DOM extractor may provide signal.
Find content image vs chrome/video poster.
Patterns learned from first-batch tuning; versioned per source.
Only for offline rule-tuning/diagnostics, not default per-page dependency.
INCLUDE or EXCLUDE with reason/evidence; UNCERTAIN maps to EXCLUDE.
ИИ можно использовать для анализа ошибок, построения/уточнения source profile и difficult-case review на тестовой выборке. Массовая классификация должна быть воспроизводимой и работать без обязательного API-вызова на каждую страницу.
09 / Source-specific classifier profile
| Field | Purpose |
|---|---|
| profile_id | Stable source-specific classifier profile. |
| source_id | Owning source. |
| version | Increment when rules change. |
| article_url_patterns[] | Evidence-backed positive URL patterns. |
| exclude_url_patterns[] | Utility/listing/video-only patterns. |
| article_container_selectors[] | Observed content containers. |
| title_selectors[] | Source-specific title extraction fallbacks. |
| body_selectors[] | Source-specific text extraction selectors. |
| image_selectors[] | Content image selectors. |
| exclude_selectors[] | Comments/nav/listing/ad/player-only regions. |
| video_only_patterns[] | Known video shell templates. |
| notes | Human-readable rationale. |
| created_from_evidence[] | Sample candidate IDs/pages supporting rules. |
10 / Как первые 30 используются для настройки
| Step | Action |
|---|---|
| TUNE-01 | Run generic classifier on initial candidates. |
| TUNE-02 | Collect first up to 30 INCLUDE results + representative EXCLUDE samples. |
| TUNE-03 | Show owner staged preview. |
| TUNE-04 | If errors are observed, edit source profile/rules—not individual records only. |
| TUNE-05 | Re-run the same candidate set deterministically. |
| TUNE-06 | Version classifier/source profile. |
| TUNE-07 | Only after owner Continue, apply frozen profile to full corpus. |
Если в preview попала category page, нужно исправить classifier/profile и заново прогнать тот же набор кандидатов. Иначе полный crawl повторит ошибку тысячи раз.
11 / Structured events
| Event | Payload |
|---|---|
| CLASSIFY_START | candidate_id, url, classifier_version, profile_version |
| CLASSIFY_SIGNAL | candidate_id, signal_id, value, evidence_summary |
| CLASSIFY_INCLUDE | candidate_id, reason_code, title, canonical_candidate, confidence |
| CLASSIFY_EXCLUDE | candidate_id, reason_code, confidence |
| CLASSIFY_ERROR | candidate_id, error_code, safe_detail |
| PROFILE_RULE_HIT | candidate_id, profile_rule_id |
| PROFILE_VERSION_CHANGED | source_id, old_version, new_version, reason |
12 / Failure modes
| ID | Failure | Mitigation |
|---|---|---|
| F-06-01 | Extractor finds navigation as main text | Use structural/source selectors; benchmark against known negatives. |
| F-06-02 | Short valid tip excluded | Tune short-note rule on first-30 corpus; do not globally lower precision blindly. |
| F-06-03 | Category page included due long intro text | Listing-density and many-content-links signal must override raw text length. |
| F-06-04 | Video page included because poster image exists | Video poster does not satisfy image rule by itself. |
| F-06-05 | Article excluded because lazy image unresolved | Inspect lazy attributes/rendered DOM if HTTP HTML carries image references. |
| F-06-06 | Forum thread looks article-like | Reply/thread/user-post patterns are explicit negatives. |
| F-06-07 | Source changes template | Profile hit rate drops / classifier errors rise → log drift and require retune. |
| F-06-08 | Canonical points external | Do not rewrite automatically; pass conflict evidence to SP-07. |
| F-06-09 | LLM unavailable | Core classification must still work; AI is not required for every page. |
13 / Definition of Done
| ID | Criterion |
|---|---|
| A-06-01 | Every candidate receives exactly one final INCLUDE/EXCLUDE decision or explicit classifier error. |
| A-06-02 | UNCERTAIN never becomes INCLUDE automatically. |
| A-06-03 | Video-only fixtures are excluded even if they contain a poster image. |
| A-06-04 | Listing/category fixtures are excluded even when they contain substantial intro text. |
| A-06-05 | Short standalone written tip with content image can be included. |
| A-06-06 | A page without qualifying content image is excluded under current product contract. |
| A-06-07 | Title is extracted from page evidence and never invented from URL slug. |
| A-06-08 | Classifier output contains reason_code, confidence/evidence and version. |
| A-06-09 | Source-specific profile is versioned and reproducible. |
| A-06-10 | Re-running same candidate set with same profile/version yields same decisions. |
| A-06-11 | First-30 tuning changes rules/profile, then re-runs—not manual hidden edits only. |
| A-06-12 | Classifier can operate without per-page LLM calls. |
| A-06-13 | External canonical conflict is passed downstream instead of silently changing source. |
| A-06-14 | Representative positive/negative fixture set is stored for regression tests. |
14 / Luna Medium bounded blocks
| Block | Scope | Expected result |
|---|---|---|
| LUNA-06-A | Classifier data contract | Candidate input/output models + reason codes + tests. |
| LUNA-06-B | Hard exclusions | Status/content type/listing/service/forum basic rules. |
| LUNA-06-C | Main-text extraction | Generic extractor + coherent-text signals + fixtures. |
| LUNA-06-D | Image qualification | Content image detection + lazy-loading + negative icon/poster cases. |
| LUNA-06-E | Title/canonical extraction | Evidence-only title + canonical conflict payload. |
| LUNA-06-F | Source profile engine | Versioned selectors/pattern rules. |
| LUNA-06-G | Decision engine | Combine signals deterministically; uncertain→exclude. |
| LUNA-06-H | First-30 tuning workflow | Profile update/re-run/freeze for full run. |
| LUNA-06-I | Regression suite | Positive/negative fixtures + drift/error counters. |