EXEC-48 · TASK-009 EXECUTION RESULT TEMPLATE

Logical Identity + Canonical + Ordering + Stable IDs — Execution Evidence + Result

Canonical evidence-template для фактического исполнения TASK-009 / EXEC-34. Он проверяет строгую последовательность: сначала logical identity, затем canonical, затем corpus ordering, затем freeze и только после этого stable article IDs. Weak similarity signals сами по себе не могут объединять разные статьи.

TASK-008 VERIFIED→ EXEC-34 implementation→ EXEC-48 evidence/result→ TASK-010 gate
UNFILLED TEMPLATE BLOCKED UNTIL TASK-008 VERIFIED IDENTITY → CANONICAL → ORDER → IDs

1. Purpose

Доказать, что только INCLUDE-records из TASK-008 превращаются в frozen ordered corpus, а duplicate merging основан на сильном evidence, canonical выбирается по объяснимому правилу, final order следует evidence-backed strategy из CrawlPlan и stable IDs назначаются только после freeze.

Критический invariant: никогда не нумеровать raw URLs до logical identity и ordering freeze.

2. Entry gate

RequirementExpectedActualEvidence
TASK-004VERIFIED ordering evidence/CrawlPlanREAL_VALUEREAL_REF
TASK-006VERIFIED redirects/final URLsREAL_VALUEREAL_REF
TASK-007VERIFIED canonical observations/provenanceREAL_VALUEREAL_REF
TASK-008VERIFIED classificationREAL_VALUEREAL_REF
INCLUDE corpusAvailableREAL_VALUEREAL_REF
Stable source_idAvailableREAL_VALUEREAL_REF
TASK-009 остаётся BLOCKED, пока TASK-008 не VERIFIED.

3. Execution identity

FieldValue
ProjectAutonomous Site Research Pipeline / Statiya_poluchatel_1
WindowAW-01
TaskTASK-009
SpecificationEXEC-34 — Logical Identity + Canonical + Ordering + Stable IDs
Evidence documentEXEC-48
ResultUNFILLED / BLOCKED UNTIL TASK-008 VERIFIED
Executed byREAL_VALUE
Started / completedREAL_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

CapabilityExisting?ActionRef
Logical identity storeREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Canonical URL resolverREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Redirect convergence helperREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Ordering engineREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Stable ID allocatorREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Corpus freeze/version helperREAL_VALUEREUSE / EXTEND / CREATEREAL_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

  1. valid same-source canonical explicitly observed and consistent;
  2. stable redirect destination;
  3. normalized final URL;
  4. 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:

  1. ARCHIVE_ORDER
  2. DATE_PUBLISHED
  3. FEED_ORDER
  4. PROVEN_SITEMAP_ORDER
  5. DISCOVERY_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.

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

FixtureExpected
same normalized URL twiceone identity
two URLs redirect to same finalone identity
valid canonical aliasesone identity, aliases retained
same source content IDone identity
same title, different final URLs/contenttwo identities
same date, similar slugremain separate without strong evidence
malformed canonicalignored, no false merge
external canonicalnot blindly merged
archive DESC evidencedeterministic DESC order
missing tie datadeterministic fallback

18. Tests executed

Test groupCommandResultEvidence
Strong identity mergesREAL_COMMANDPASS / FAILREAL_REF
Weak-only non-mergeREAL_COMMANDPASS / FAILREAL_REF
Canonical selectionREAL_COMMANDPASS / FAILREAL_REF
Ordering hierarchyREAL_COMMANDPASS / FAILREAL_REF
Tie-break determinismREAL_COMMANDPASS / FAILREAL_REF
Corpus freeze immutabilityREAL_COMMANDPASS / FAILREAL_REF
Stable ID allocationREAL_COMMANDPASS / FAILREAL_REF
No renumber on later update fixtureREAL_COMMANDPASS / FAILREAL_REF
No ID reuseREAL_COMMANDPASS / FAILREAL_REF
prev/next chainREAL_COMMANDPASS / FAILREAL_REF
Replay determinismREAL_COMMANDPASS / FAILREAL_REF
Regression suiteREAL_COMMANDPASS / FAILREAL_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 itemResultEvidence
Only INCLUDE records processedPASS / FAILREAL_REF
Strong evidence drives mergesPASS / FAILREAL_REF
Weak evidence never sufficient alonePASS / FAILREAL_REF
Aliases/provenance retainedPASS / FAILREAL_REF
Canonical selection deterministicPASS / FAILREAL_REF
Ordering follows evidence-backed methodPASS / FAILREAL_REF
Tie-break deterministicPASS / FAILREAL_REF
Corpus frozen before IDsPASS / FAILREAL_REF
Article IDs stable per sourcePASS / FAILREAL_REF
No automatic renumberingPASS / FAILREAL_REF
No ID reusePASS / FAILREAL_REF
prev/next chain validPASS / FAILREAL_REF
Replay deterministicPASS / FAILREAL_REF
No batching/rendering logic addedPASS / FAILREAL_REF
No benchmark-answer injectionPASS / FAILREAL_REF
No unrelated diffPASS / FAILREAL_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
TASK-010 нельзя открывать, пока logical identity, ordering freeze и stable IDs не доказаны.

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.