1. Purpose
Доказать, что только INCLUDE-records из TASK-008 превращаются в frozen ordered corpus, а duplicate merging основан на сильном evidence, canonical выбирается по объяснимому правилу, final order следует evidence-backed strategy из CrawlPlan и stable IDs назначаются только после freeze.
2. Entry gate
| Requirement | Expected | Actual | Evidence |
|---|---|---|---|
| TASK-004 | VERIFIED ordering evidence/CrawlPlan | REAL_VALUE | REAL_REF |
| TASK-006 | VERIFIED redirects/final URLs | REAL_VALUE | REAL_REF |
| TASK-007 | VERIFIED canonical observations/provenance | REAL_VALUE | REAL_REF |
| TASK-008 | VERIFIED classification | REAL_VALUE | REAL_REF |
| INCLUDE corpus | Available | REAL_VALUE | REAL_REF |
| Stable source_id | Available | REAL_VALUE | REAL_REF |
3. Execution identity
| Field | Value |
|---|---|
| Project | Autonomous Site Research Pipeline / Statiya_poluchatel_1 |
| Window | AW-01 |
| Task | TASK-009 |
| Specification | EXEC-34 — Logical Identity + Canonical + Ordering + Stable IDs |
| Evidence document | EXEC-48 |
| Result | UNFILLED / BLOCKED UNTIL TASK-008 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 IDENTITY_STORE=REAL_VALUE CANONICAL_RULESET_VERSION=REAL_VALUE ORDERING_ENGINE_VERSION=REAL_VALUE ARTICLE_ID_STORE=REAL_VALUE TEST_RUNNER=REAL_VALUE TASK_004_EVIDENCE_REF=REAL_VALUE TASK_008_EVIDENCE_REF=REAL_VALUE PROJECT_STATE_REF=REAL_VALUE
5. Reuse-before-build review
| Capability | Existing? | Action | Ref |
|---|---|---|---|
| Logical identity store | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Canonical URL resolver | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Redirect convergence helper | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Ordering engine | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Stable ID allocator | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
| Corpus freeze/version helper | REAL_VALUE | REUSE / EXTEND / CREATE | REAL_REF |
6. Changed files / migrations
{
"changed_files": [
{
"path": "REAL_PATH",
"change_type": "ADDED | MODIFIED | DELETED",
"purpose": "REAL_DESCRIPTION"
}
],
"migrations": []
}
Allowed scope
- identity clustering;
- canonical candidate selection;
- ordering engine;
- stable ID assignment;
- corpus freeze/versioning;
- prev/next relations;
- fixtures/tests.
Out of scope
- article classification;
- HTML rendering;
- batching;
- deployment;
- benchmark-specific answer injection.
7. Input corpus
{
"source_id": "REAL_VALUE",
"ordering_strategy": {
"method": "ARCHIVE_ORDER | DATE_PUBLISHED | FEED_ORDER | PROVEN_SITEMAP_ORDER | DISCOVERY_ORDER",
"direction": "ASC | DESC",
"confidence": "HIGH | MEDIUM | LOW",
"evidence_refs": []
},
"include_records": [
{
"candidate_id": "...",
"classification_id": "...",
"reason_code": "INCLUDE_ARTICLE | INCLUDE_SHORT_NOTE",
"requested_url": "...",
"final_url": "...",
"canonical_observation": "...",
"source_specific_content_id": "...",
"ordering_evidence": {}
}
]
}
Required proof
- EXCLUDE records never enter corpus;
- all INCLUDE records trace back to TASK-008 evidence;
- source_id stable;
- ordering method comes from evidence, not title/slug intuition.
8. Logical identity pipeline
INCLUDE request-level records ↓ collect strong equivalence evidence ↓ build logical identity clusters ↓ retain aliases/provenance ↓ choose canonical representation ↓ order logical identities ↓ freeze corpus ↓ assign stable article IDs
Each cluster should retain
- cluster/identity ID;
- member request URLs;
- final URLs;
- redirect evidence;
- canonical observations;
- source-specific IDs where available;
- classification refs;
- merge reason/evidence;
- canonical selected URL/title.
9. Strong duplicate evidence
Strong evidence may justify a merge:
- same normalized/final URL;
- redirect convergence to same final URL;
- valid same-source canonical relationship;
- stable source-specific content ID;
- other explicitly documented source-specific equivalence.
Evidence record
{
"left_record": "...",
"right_record": "...",
"equivalent": true,
"strength": "STRONG",
"reason": "SAME_FINAL_URL | REDIRECT_CONVERGENCE | VALID_CANONICAL | SOURCE_CONTENT_ID | SOURCE_SPECIFIC_STRONG",
"evidence_refs": []
}
10. Weak evidence must not merge alone
Weak signals:
- same/similar title;
- same date;
- similar slug;
- same author;
- same image;
- similar text;
- neighboring archive position.
Required fixture
Две разные статьи с одинаковым title должны остаться двумя identities, если strong equivalence evidence отсутствует.
{
"weak_only_merge_attempt": "REJECTED | FAIL",
"same_title_distinct_articles": "PASS | FAIL",
"evidence_refs": []
}
11. Canonical selection evidence
Suggested priority
- valid same-source canonical explicitly observed and consistent;
- stable redirect destination;
- normalized final URL;
- deterministic source-specific fallback.
Required checks
- external-domain canonical not trusted automatically;
- invalid/malformed canonical ignored with evidence;
- canonical cannot merge two records without valid equivalence;
- canonical choice deterministic within cluster;
- aliases retained.
{
"canonical_tests": {
"valid_same_source": "PASS | FAIL",
"malformed": "PASS | FAIL",
"external_domain": "PASS | FAIL",
"redirect_destination": "PASS | FAIL",
"deterministic_fallback": "PASS | FAIL"
}
}
12. Ordering evidence
Allowed method hierarchy:
ARCHIVE_ORDERDATE_PUBLISHEDFEED_ORDERPROVEN_SITEMAP_ORDERDISCOVERY_ORDER
Required output per identity
{
"logical_identity_id": "...",
"ordering_key": "REAL_VALUE",
"ordering_method": "ARCHIVE_ORDER",
"ordering_direction": "DESC",
"ordering_evidence_refs": []
}
Required proof
- method matches CrawlPlan/evidence;
- tie-breaker deterministic;
- missing dates handled deterministically;
- sitemap order used only if proven;
- order does not change due to DB iteration order.
13. Corpus freeze
Before stable IDs, compiler creates a versioned frozen ordered corpus.
{
"corpus_freeze_id": "...",
"source_id": "...",
"identity_count": 0,
"ordering_method": "...",
"ordering_direction": "...",
"ordered_identity_ids": [],
"input_evidence_hash_or_version": "...",
"created_at": "..."
}
Freeze assertions
- no ID assignment before freeze;
- same semantic input → same ordered identity list;
- freeze immutable;
- rebuild creates new freeze version if input changes;
- downstream TASK-010 reads frozen corpus, not live mutable queries.
14. Stable article ID assignment
Required properties
- per-source namespace;
- stable after production assignment;
- not raw sequence number semantically;
- no automatic renumbering when new older/newer article appears later;
- no ID reuse after removal;
- one logical identity → one article_id;
- aliases never get independent IDs.
Example semantic record
{
"article_id": "FW-000211",
"source_id": "fine-woodworking",
"logical_identity_id": "...",
"sequence": 211,
"canonical_url": "...",
"aliases": [],
"corpus_freeze_id": "..."
}
sequence — позиция в конкретном ordered corpus. article_id — durable identity.
15. prev / next chain
Required
- sequence contiguous for frozen corpus;
- first article prev = null;
- last article next = null;
- for every middle item: A.next = B.article_id and B.prev = A.article_id;
- chain follows final publication ordering;
- no cycles except expected linear chain none.
{
"chain_validation": {
"count": 0,
"missing_links": [],
"broken_reciprocity": [],
"cycles": [],
"result": "PASS | FAIL"
}
}
16. Determinism / replay
Two clean equivalent runs must match on
- logical cluster membership;
- canonical selection;
- final order;
- article IDs where existing registry is reused;
- sequence values;
- prev/next relations.
Allowed differences
- execution timestamps;
- run IDs;
- opaque evidence IDs that do not affect semantics.
{
"determinism": {
"logical_membership_equal": "PASS | FAIL",
"canonical_equal": "PASS | FAIL",
"ordering_equal": "PASS | FAIL",
"stable_ids_equal": "PASS | FAIL",
"prev_next_equal": "PASS | FAIL"
}
}
17. Required fixtures
| Fixture | Expected |
|---|---|
| same normalized URL twice | one identity |
| two URLs redirect to same final | one identity |
| valid canonical aliases | one identity, aliases retained |
| same source content ID | one identity |
| same title, different final URLs/content | two identities |
| same date, similar slug | remain separate without strong evidence |
| malformed canonical | ignored, no false merge |
| external canonical | not blindly merged |
| archive DESC evidence | deterministic DESC order |
| missing tie data | deterministic fallback |
18. Tests executed
| Test group | Command | Result | Evidence |
|---|---|---|---|
| Strong identity merges | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Weak-only non-merge | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Canonical selection | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Ordering hierarchy | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Tie-break determinism | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Corpus freeze immutability | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Stable ID allocation | REAL_COMMAND | PASS / FAIL | REAL_REF |
| No renumber on later update fixture | REAL_COMMAND | PASS / FAIL | REAL_REF |
| No ID reuse | REAL_COMMAND | PASS / FAIL | REAL_REF |
| prev/next chain | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Replay determinism | REAL_COMMAND | PASS / FAIL | REAL_REF |
| Regression suite | REAL_COMMAND | PASS / FAIL | REAL_REF |
19. Negative cases
- same title alone cannot merge;
- same date alone cannot merge;
- same image alone cannot merge;
- external canonical cannot silently merge;
- canonical mismatch cannot erase aliases/evidence;
- IDs cannot be assigned before ordering freeze;
- DB row order cannot affect final order;
- rebuild cannot renumber existing article IDs;
- deleted/removed article ID cannot be reused;
- EXCLUDE record cannot enter frozen corpus.
{
"negative_tests": {
"weak_title_merge_rejected": "PASS | FAIL",
"weak_date_merge_rejected": "PASS | FAIL",
"external_canonical_merge_rejected": "PASS | FAIL",
"pre_freeze_id_assignment_rejected": "PASS | FAIL",
"renumber_prevented": "PASS | FAIL",
"id_reuse_prevented": "PASS | FAIL",
"exclude_corpus_entry_rejected": "PASS | FAIL"
}
}
20. Acceptance checklist
| Acceptance item | Result | Evidence |
|---|---|---|
| Only INCLUDE records processed | PASS / FAIL | REAL_REF |
| Strong evidence drives merges | PASS / FAIL | REAL_REF |
| Weak evidence never sufficient alone | PASS / FAIL | REAL_REF |
| Aliases/provenance retained | PASS / FAIL | REAL_REF |
| Canonical selection deterministic | PASS / FAIL | REAL_REF |
| Ordering follows evidence-backed method | PASS / FAIL | REAL_REF |
| Tie-break deterministic | PASS / FAIL | REAL_REF |
| Corpus frozen before IDs | PASS / FAIL | REAL_REF |
| Article IDs stable per source | PASS / FAIL | REAL_REF |
| No automatic renumbering | PASS / FAIL | REAL_REF |
| No ID reuse | PASS / FAIL | REAL_REF |
| prev/next chain valid | PASS / FAIL | REAL_REF |
| Replay deterministic | PASS / FAIL | REAL_REF |
| No batching/rendering logic added | PASS / FAIL | REAL_REF |
| No benchmark-answer injection | PASS / FAIL | REAL_REF |
| No unrelated diff | PASS / FAIL | REAL_REF |
21. Gaps / blockers
{
"blockers": [],
"known_gaps": [],
"identity_conflicts": [],
"ordering_conflicts": [],
"stable_id_conflicts": [],
"blocks_TASK_010": true
}
Automatic blockers
- false merge from weak evidence;
- same logical article receives multiple stable IDs;
- distinct articles merged;
- ordering differs between clean replays;
- IDs assigned before freeze;
- existing IDs renumbered automatically;
- ID reuse after removal;
- broken prev/next chain;
- EXCLUDE record included.
22. Final result
VERIFIED PARTIAL FAILED BLOCKED
23. Project state update
If VERIFIED
{
"active_window_id": "AW-01",
"last_verified_task": "TASK-009",
"completed_tasks": [
"TASK-001",
"TASK-002",
"TASK-003",
"TASK-004",
"TASK-005",
"TASK-006",
"TASK-007",
"TASK-008",
"TASK-009"
],
"current_task_id": "TASK-010",
"last_evidence_ref": "EXEC-48_FILLED_REAL_REF",
"repo_revision": "REAL_REVISION_AFTER",
"open_blockers": [],
"state_version": "INCREMENT_REAL_VALUE"
}
If not VERIFIED
{
"current_task_id": "TASK-009",
"last_task_result": "PARTIAL | FAILED | BLOCKED",
"open_blockers": ["..."],
"next_action": "TASK_009_REPAIR_OR_IDENTITY_ORDER_REVIEW"
}
24. 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-009",
"packet_ref": "EXEC-34",
"evidence_document_ref": "EXEC-48",
"result": "BLOCKED_UNTIL_TASK_008_VERIFIED",
"task_008_evidence_ref": "REAL_VALUE",
"corpus_freeze_ref": "REAL_VALUE",
"identity_ruleset_version": "REAL_VALUE",
"canonical_ruleset_version": "REAL_VALUE",
"ordering_engine_version": "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-010",
"next_packet_if_verified": "EXEC-35",
"created_at": "REAL_VALUE"
}
25. Next exact action
EXEC-48 заполняется только после реального TASK-008 = VERIFIED и исполнения EXEC-34.
If TASK-009 = VERIFIED
Следующий execution step: TASK-010 / EXEC-35 — Batch + Dataset Manifest Compiler.
If TASK-009 ≠ VERIFIED
Создать bounded identity/order/stable-ID repair record и не переходить к TASK-010.