1. Purpose
Доказать, что classifier отделяет valid article/project pages от listing/service/forum/video-only/empty/no-image/uncertain pages по прозрачному deterministic decision order, сохраняет evidence и не выполняет identity merge, canonical selection или stable ID assignment.
2. Entry gate
| Requirement | Expected | Actual | Evidence |
|---|---|---|---|
| TASK-006 | VERIFIED FetchResult | REAL_VALUE | REAL_REF |
| TASK-007 | VERIFIED Candidate/provenance | REAL_VALUE | REAL_REF |
| Successful fetched Candidate corpus | Available | REAL_VALUE | REAL_REF |
| HTML parser/extractor | Real implementation known | REAL_VALUE | REAL_REF |
| Classifier versioning contract | Known | REAL_VALUE | REAL_REF |
3. Execution identity
| Field | Value |
|---|---|
| Project | Autonomous Site Research Pipeline / Statiya_poluchatel_1 |
| Window | AW-01 |
| Task | TASK-008 |
| Specification | EXEC-33 — Article Classifier V1 |
| Evidence document | EXEC-47 |
| Result | UNFILLED / BLOCKED UNTIL TASK-007 VERIFIED |
| Executed by | REAL_VALUE |
| Started / completed | REAL_VALUE |
4. Environment facts
REPO_ROOT=REAL_VALUE BRANCH=REAL_VALUE REVISION_BEFORE=REAL_VALUE REVISION_AFTER=REAL_VALUE HTML_PARSER=REAL_VALUE TEXT_EXTRACTOR=REAL_VALUE IMAGE_SIGNAL_EXTRACTOR=REAL_VALUE CLASSIFIER_VERSION=REAL_VALUE AI_REVIEW_PROVIDER=DISABLED | REAL_VALUE TEST_RUNNER=REAL_VALUE TASK_006_EVIDENCE_REF=REAL_VALUE TASK_007_EVIDENCE_REF=REAL_VALUE PROJECT_STATE_REF=REAL_VALUE
5. Reuse-before-build review
| Capability | Existing? | Action | Ref |
|---|---|---|---|
| Main content text extractor | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| DOM cleanup helper | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Image signal extractor | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Listing/archive detector | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Service/search/forum detector | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Video-only detector | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Source-profile hook | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| AI review adapter | REAL_VALUE | REUSE / EXTEND / CREATE / DISABLED | REAL_REF |
6. Changed files
{
"changed_files": [
{
"path": "REAL_PATH",
"change_type": "ADDED | MODIFIED | DELETED",
"purpose": "REAL_DESCRIPTION"
}
]
}
Allowed scope
- classifier V1;
- signal extraction helpers;
- source profile extension point;
- classification evidence/reason codes;
- optional ambiguity AI adapter;
- frozen fixtures/tests.
Out of scope
- network requests;
- link discovery;
- logical dedup;
- canonical merge;
- ordering;
- stable article ID assignment;
- rendering/deploy.
7. Input contract
{
"candidate": {
"candidate_id": "...",
"job_id": "...",
"normalized_url": "...",
"provenance": {...}
},
"fetch_result": {
"fetch_id": "...",
"final_url": "...",
"status_code": 200,
"content_type": "text/html",
"body": {...},
"result_code": "FETCH_OK"
},
"source_profile": {
"profile_id": "DEFAULT | REAL_VALUE",
"version": "REAL_VALUE"
}
}
Required preconditions
- Candidate and FetchResult belong to same Job/request lineage;
- FetchResult successful enough to classify;
- HTML body available;
- stale/cancelled Job handled consistently;
- classifier never triggers network fetch.
8. Extracted signal evidence
Classification record should retain bounded interpretable signals.
{
"signals": {
"title": "...",
"main_text_chars": 0,
"main_text_sentences": 0,
"content_image_count": 0,
"video_embed_count": 0,
"link_density": 0.0,
"repeated_card_count": 0,
"article_structured_data": false,
"listing_signals": [],
"service_signals": [],
"forum_signals": [],
"source_profile_signals": []
}
}
Rules
- signals reproducible from same HTML;
- no hidden mutable external state;
- thresholds/version captured;
- evidence bounded; do not persist unnecessary full DOM dumps.
9. Hard exclusions
Hard exclusions should run before positive article heuristics.
Expected classes
- fetch invalid/unclassifiable;
- explicit search page;
- forum/thread index where policy excludes;
- service/commerce utility page;
- known listing/archive shell;
- video-only page;
- no meaningful text;
- no content image;
- uncertain after all evidence.
Evidence
{
"hard_exclusion_tests": {
"fetch_invalid": "PASS | FAIL",
"listing": "PASS | FAIL",
"service": "PASS | FAIL",
"forum": "PASS | FAIL",
"video_only": "PASS | FAIL",
"no_text": "PASS | FAIL",
"no_image": "PASS | FAIL"
}
}
10. Meaningful-text extractor
Required behavior
- prefer main/article content where detectable;
- remove/discount navigation, headers, footers, cookie banners, repetitive menus;
- count actual prose, not alt/title/meta strings alone;
- retain sentence/character evidence;
- support short-but-substantive project/tip pages;
- thresholds configurable/versioned.
Fixture cases
- long article;
- short useful note with several substantive sentences;
- navigation shell with lots of menu text;
- tag/archive page with many titles but little prose;
- one-sentence stub;
- script/style-heavy page with little readable text.
11. Content-image qualification
TASK-008 determines image presence from HTML/DOM metadata and does not download images.
Positive signals
- image inside article/main content;
- figure/picture/source/img in content region;
- source-profile-specific content image selector;
- valid lazy-load source attribute according to parser policy.
Should normally not qualify alone
- logo;
- avatar;
- icon;
- tracking pixel;
- navigation thumbnail;
- footer badge;
- social sharing icon.
Required tests
{
"image_tests": {
"article_hero": "PASS | FAIL",
"inline_figure": "PASS | FAIL",
"lazy_image": "PASS | FAIL",
"logo_only": "PASS | FAIL",
"avatar_only": "PASS | FAIL",
"tracking_pixel_only": "PASS | FAIL"
}
}
12. Listing / service / forum detection
Listing/archive evidence
- many repeated cards/links;
- high link density;
- pagination/category markers;
- little unique prose;
- archive/list structured patterns.
Service/search evidence
- search results form/results shell;
- service/contact/product utility layout;
- checkout/account/login-like functional page where policy excludes;
- source-specific excluded patterns.
Forum evidence
- thread/index/navigation structure;
- many user/posts/comments but not editorial article according to policy;
- source-specific forum routes.
13. Video-only detection
Video-only page
- primary content = player/embed;
- meaningful article prose below threshold;
- no substantive accompanying written article;
- decision =
EXCLUDE_VIDEO_ONLY.
Article with embedded video
Если есть самостоятельный meaningful written article + content image and other policy requirements, embedded video itself не является exclusion.
14. Deterministic decision order
1. fetch invalid -> EXCLUDE_FETCH_INVALID 2. hard shell/service/search/forum -> corresponding exclusion 3. video only -> EXCLUDE_VIDEO_ONLY 4. no meaningful text -> EXCLUDE_NO_MEANINGFUL_TEXT 5. no content image -> EXCLUDE_NO_CONTENT_IMAGE 6. listing/archive shell -> EXCLUDE_LISTING 7. strong substantive article -> INCLUDE_ARTICLE 8. strong short useful project/tip note -> INCLUDE_SHORT_NOTE 9. bounded AI review only if configured and ambiguity policy allows 10. otherwise -> EXCLUDE_UNCERTAIN
15. Source-profile hook
Source-specific knowledge допускается как versioned configuration, а не hardcoded benchmark answer key.
Allowed examples
- known article container selector;
- known archive/service route pattern;
- known content-image selector;
- known stable page-type marker;
- threshold tuning justified by evidence.
Forbidden
- explicit list of benchmark article URLs as production classifier input;
- hardcoded expected INCLUDE/EXCLUDE answers;
- title whitelist derived from reference dataset;
- special-case ordering/identity logic hidden in classifier.
{
"source_profile": {
"profile_id": "REAL_VALUE",
"version": "REAL_VALUE",
"rules": [],
"benchmark_answer_data_used": false
}
}
16. Optional bounded AI review
AI используется только для narrow ambiguous cases, если это предусмотрено implementation.
Entry conditions
- deterministic rules cannot confidently classify;
- page survived hard exclusions;
- bounded evidence packet prepared;
- AI budget available;
- model/result version captured.
AI input should be bounded
- title;
- URL/path;
- short extracted main-text sample;
- signal summary;
- source profile hints;
- allowed output enum.
Required behavior
- structured output only;
- timeout/failure → EXCLUDE_UNCERTAIN or deterministic fallback;
- no per-page mandatory AI dependency;
- hard exclusions not overridden;
- AI call count measurable.
{
"ai_review": {
"enabled": "YES | NO",
"model": "REAL_VALUE",
"calls_in_fixture_suite": 0,
"timeouts": 0,
"invalid_outputs": 0,
"fallback_policy": "EXCLUDE_UNCERTAIN",
"evidence_refs": []
}
}
17. Stable reason codes
INCLUDE_ARTICLE INCLUDE_SHORT_NOTE EXCLUDE_VIDEO_ONLY EXCLUDE_NO_MEANINGFUL_TEXT EXCLUDE_NO_CONTENT_IMAGE EXCLUDE_LISTING EXCLUDE_SERVICE EXCLUDE_FORUM EXCLUDE_DUPLICATE_SHELL EXCLUDE_UNCERTAIN EXCLUDE_FETCH_INVALID
Evidence requirement
- one final reason code per classification;
- supporting signal/evidence list retained;
- reason code semantics stable/versioned;
- downstream TASK-009 reads only final INCLUDE records.
18. Classification record evidence
{
"classification_id": "...",
"candidate_id": "...",
"fetch_id": "...",
"job_id": "...",
"decision": "INCLUDE | EXCLUDE",
"reason_code": "INCLUDE_ARTICLE",
"classifier_version": "REAL_VALUE",
"source_profile_version": "REAL_VALUE",
"signals": {...},
"evidence_refs": [],
"ai_review": null,
"created_at": "..."
}
Required proof
- replay same Candidate/FetchResult/version → same semantic decision;
- classification does not mutate FetchResult;
- classification record versioned;
- downstream can audit why INCLUDE/EXCLUDE happened;
- no article_id assigned here.
19. Frozen fixture corpus
| Fixture class | Expected result |
|---|---|
| substantive article + image | INCLUDE_ARTICLE |
| short useful project/tip + image | INCLUDE_SHORT_NOTE |
| video only | EXCLUDE_VIDEO_ONLY |
| one-line/stub | EXCLUDE_NO_MEANINGFUL_TEXT |
| article-like text, no content image | EXCLUDE_NO_CONTENT_IMAGE |
| category/archive | EXCLUDE_LISTING |
| service/search | EXCLUDE_SERVICE |
| forum/index | EXCLUDE_FORUM |
| fetch invalid | EXCLUDE_FETCH_INVALID |
| ambiguous weak page | EXCLUDE_UNCERTAIN unless bounded AI proves allowed include |
Benchmark rule
Fine Woodworking reference may later be used for validation metrics, but not as hidden production classifier truth.
20. Tests executed
| Test group | Command | Result | Evidence |
|---|---|---|---|
| Meaningful text extraction | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Content image qualification | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Listing detection | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Service/search detection | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Forum detection | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Video-only detection | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Short-note include | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Uncertain → exclude | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Source-profile hook | REAL_COMMAND | PASS / FAIL | REAL_REF |
| AI fallback if enabled | REAL_COMMAND | PASS / FAIL / N/A | REAL_REF |
| Replay determinism | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Regression suite | REAL_COMMAND | PASS / FAIL | REAL_REF |
21. Negative / boundary cases
- page with many navigation links but no prose must not INCLUDE;
- page with long comments but no editorial article must follow forum policy;
- logo-only page must not satisfy content-image requirement;
- article title similarity must not influence duplicate identity here;
- rel=canonical must not trigger merge here;
- AI invalid output must not become INCLUDE;
- AI timeout must not block whole pipeline;
- source profile cannot bypass hard fetch invalid condition;
- classification replay must not change decision under same version/input;
- classifier must not perform external network calls.
{
"negative_tests": {
"navigation_shell_false_positive": "PASS | FAIL",
"logo_only_image_false_positive": "PASS | FAIL",
"no_identity_merge_leak": "PASS | FAIL",
"canonical_does_not_merge": "PASS | FAIL",
"ai_invalid_output_fails_closed": "PASS | FAIL | N/A",
"ai_timeout_fails_closed": "PASS | FAIL | N/A",
"no_network_calls": "PASS | FAIL"
}
}
22. Acceptance checklist
| Acceptance item | Result | Evidence |
|---|---|---|
| Deterministic-first classifier implemented | PASS / FAIL | REAL_REF |
| Hard exclusions precede positive include rules | PASS / FAIL | REAL_REF |
| Meaningful-text extraction works | PASS / FAIL | REAL_REF |
| Content-image qualification works without downloads | PASS / FAIL | REAL_REF |
| Listing/service/forum/video-only detection works | PASS / FAIL | REAL_REF |
| Short useful note supported | PASS / FAIL | REAL_REF |
| Uncertain defaults to EXCLUDE | PASS / FAIL | REAL_REF |
| Source-profile hook versioned | PASS / FAIL | REAL_REF |
| Benchmark answer key not used in production logic | PASS / FAIL | REAL_REF |
| AI review bounded/optional/fail-closed if enabled | PASS / FAIL / N/A | REAL_REF |
| Stable reason codes emitted | PASS / FAIL | REAL_REF |
| Classification evidence persisted | PASS / FAIL | REAL_REF |
| Replay deterministic under same version/input | PASS / FAIL | REAL_REF |
| No identity/order/ID logic added | PASS / FAIL | REAL_REF |
| No network calls added | PASS / FAIL | REAL_REF |
| No unrelated diff | PASS / FAIL | REAL_REF |
23. Gaps / blockers
{
"blockers": [],
"known_gaps": [],
"false_positive_cases": [],
"false_negative_cases": [],
"unproven_ai_behavior": [],
"blocks_TASK_009": true
}
Automatic blockers
- uncertain page can become INCLUDE without sufficient evidence;
- classifier requires network per page;
- benchmark answer list leaks into production rules;
- no content-image requirement enforced;
- listing/service/forum false positives obvious in frozen fixtures;
- AI failure can produce INCLUDE;
- same input/version yields different semantic result;
- classifier performs identity merge/order/ID assignment.
24. Final result
VERIFIED PARTIAL FAILED BLOCKED
25. Project state update
If VERIFIED
{
"active_window_id": "AW-01",
"last_verified_task": "TASK-008",
"completed_tasks": [
"TASK-001",
"TASK-002",
"TASK-003",
"TASK-004",
"TASK-005",
"TASK-006",
"TASK-007",
"TASK-008"
],
"current_task_id": "TASK-009",
"last_evidence_ref": "EXEC-47_FILLED_REAL_REF",
"repo_revision": "REAL_REVISION_AFTER",
"open_blockers": [],
"state_version": "INCREMENT_REAL_VALUE"
}
If not VERIFIED
{
"current_task_id": "TASK-008",
"last_task_result": "PARTIAL | FAILED | BLOCKED",
"open_blockers": ["..."],
"next_action": "TASK_008_REPAIR_OR_CLASSIFIER_REVIEW"
}
26. Canonical machine-readable result
{
"schema": "STATIYA_TASK_EXECUTION_EVIDENCE",
"schema_version": "1.0",
"project_id": "autonomous-site-research-pipeline",
"active_window_id": "AW-01",
"task_id": "TASK-008",
"packet_ref": "EXEC-33",
"evidence_document_ref": "EXEC-47",
"result": "BLOCKED_UNTIL_TASK_007_VERIFIED",
"task_007_evidence_ref": "REAL_VALUE",
"classifier_version": "REAL_VALUE",
"source_profile_version": "REAL_VALUE",
"ai_review": {
"enabled": false,
"provider": "REAL_VALUE"
},
"repo": {
"root": "REAL_VALUE",
"revision_before": "REAL_VALUE",
"revision_after": "REAL_VALUE"
},
"changed_files": [],
"reused_components": [],
"created_components": [],
"tests": [],
"acceptance_checks": [],
"blockers": [],
"known_gaps": [],
"next_task_allowed": false,
"next_task_id_if_verified": "TASK-009",
"next_packet_if_verified": "EXEC-34",
"created_at": "REAL_VALUE"
}
27. Next exact action
EXEC-47 заполняется только после реального TASK-007 = VERIFIED и исполнения EXEC-33.
If TASK-008 = VERIFIED
Следующий execution step: TASK-009 / EXEC-34 — Logical Identity + Canonical + Ordering + Stable IDs.
If TASK-008 ≠ VERIFIED
Создать bounded classifier repair record и не переходить к TASK-009.