EXEC-45 · TASK-006 EXECUTION RESULT TEMPLATE

HTTP Fetch Worker — Execution Evidence + Result

Canonical evidence-template для фактического исполнения TASK-006 / EXEC-31. Он проверяет, что leased QueueItem обрабатывается одним bounded HTTP attempt, каждый target и redirect повторно проходит TASK-002 security/scope guard, response limits реально enforced, retry class передаётся persistent queue, а результат сохраняется как immutable FetchResult.

TASK-005 VERIFIED→ EXEC-31 implementation→ EXEC-45 evidence/result→ TASK-007 gate
UNFILLED TEMPLATE BLOCKED UNTIL TASK-005 VERIFIED HTTP-FIRST · BOUNDED · SECURE

1. Purpose

Доказать, что worker безопасно и воспроизводимо превращает leased queue item в один FetchResult, не выполняет classifier/parser responsibilities и не управляет persistent retry временем самостоятельно.

Worker выполняет одну bounded попытку. Persistent retry scheduling принадлежит TASK-005 queue.

2. Entry gate

RequirementExpectedActualEvidence
TASK-002VERIFIED security guardREAL_VALUEREAL_REF
TASK-003VERIFIED Job fencingREAL_VALUEREAL_REF
TASK-004VERIFIED CrawlPlanREAL_VALUEREAL_REF
TASK-005VERIFIED persistent queueREAL_VALUEREAL_REF
HTTP clientReal approved adapter knownREAL_VALUEREAL_REF
TLS behaviorVerification enabledREAL_VALUEREAL_REF
TASK-006 остаётся BLOCKED, пока TASK-005 не VERIFIED.

3. Execution identity

FieldValue
ProjectAutonomous Site Research Pipeline / Statiya_poluchatel_1
WindowAW-01
TaskTASK-006
SpecificationEXEC-31 — HTTP Fetch Worker Implementation Packet
Evidence documentEXEC-45
ResultUNFILLED / BLOCKED UNTIL TASK-005 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

HTTP_CLIENT=REAL_VALUE
DNS_CONNECT_STRATEGY=REAL_VALUE
TLS_LIBRARY_OR_STACK=REAL_VALUE
BODY_STREAMING_API=REAL_VALUE
CLOCK_SOURCE=REAL_VALUE
TEST_SERVER=REAL_VALUE
TEST_RUNNER=REAL_VALUE

TASK_002_EVIDENCE_REF=REAL_VALUE
TASK_005_EVIDENCE_REF=REAL_VALUE
PROJECT_STATE_REF=REAL_VALUE

5. Reuse-before-build review

CapabilityExisting?ActionRef
HTTP client/transportREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Timeout configREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Streaming response readerREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Retry classifier helperREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Header sanitizerREAL_VALUEREUSE / EXTEND / CREATEREAL_REF
Rate limiter/origin budgetREAL_VALUEREUSE / EXTEND / CREATEREAL_REF

6. Changed files

{
  "changed_files": [
    {
      "path": "REAL_PATH",
      "change_type": "ADDED | MODIFIED | DELETED",
      "purpose": "REAL_DESCRIPTION"
    }
  ]
}

Allowed scope

  • HTTP fetch worker;
  • transport adapter integration;
  • manual redirect loop;
  • response streaming/limits;
  • retry classification;
  • FetchResult persistence/serialization;
  • queue ACK/NACK integration;
  • fixtures/tests.

Out of scope

  • HTML parsing;
  • link extraction;
  • classifier;
  • logical dedup;
  • browser rendering;
  • deploy.

7. One-attempt worker contract

INPUT:
  leased QueueItem
  current Job fencing token
  READY CrawlPlan

PROCESS:
  validate target at request time
  execute one bounded HTTP attempt
  manually process bounded redirects
  stream bounded response
  classify result

OUTPUT:
  immutable FetchResult
  +
  ACK or NACK request to TASK-005

Evidence

  • worker does not internally sleep/retry indefinitely;
  • worker does not create a second queue;
  • retry timing delegated to TASK-005;
  • worker rejects stale fencing before durable mutation;
  • completed attempt has one durable result identity.

8. Request-time security revalidation

Даже URL, уже проверенный при enqueue, повторно проверяется непосредственно перед connect.

Required proof

  • normalized URL revalidated by TASK-002;
  • resolved addresses revalidated;
  • scope still valid under current CrawlPlan;
  • redirect targets receive full validation;
  • unsafe target rejected before connection;
  • current security-policy/version captured in FetchResult evidence.

Critical transport proof

VALIDATED_DNS_TO_ACTUAL_CONNECT_BINDING:
  PROVEN | BLOCKED | NOT_PROVEN

METHOD:
  REAL_VALUE

EVIDENCE:
  REAL_REF
Если client после validation самостоятельно резолвит hostname без accepted mitigation, DNS rebinding / TOCTOU gap остаётся blocker.

9. Redirect handling

Required behavior

  • automatic redirects in client disabled or proven safely intercepted;
  • Location parsed as untrusted URL;
  • relative Location resolved safely;
  • every hop passes TASK-002 security + scope;
  • redirect count hard-limited;
  • loop detected;
  • redirect chain recorded in FetchResult;
  • unsafe redirect terminates attempt without connect to unsafe target.
{
  "redirect_tests": {
    "one_safe_redirect": "PASS | FAIL",
    "multi_hop_safe": "PASS | FAIL",
    "loop": "PASS | FAIL",
    "limit": "PASS | FAIL",
    "private_target": "PASS | FAIL",
    "unsupported_scheme": "PASS | FAIL",
    "scope_escape": "PASS | FAIL"
  }
}

10. Timeouts / hard limits

LimitConfigured valueTested?Evidence
Connect timeoutREAL_VALUEYES / NOREAL_REF
Read timeoutREAL_VALUEYES / NOREAL_REF
Total attempt durationREAL_VALUEYES / NOREAL_REF
Redirect countREAL_VALUEYES / NOREAL_REF
Header bytes/countREAL_VALUEYES / NOREAL_REF
Compressed response bytesREAL_VALUEYES / NOREAL_REF
Decompressed/body bytesREAL_VALUEYES / NOREAL_REF
Retained evidence sizeREAL_VALUEYES / NOREAL_REF

Required proof

  • body read is streaming/bounded;
  • worker does not download huge payload then check size;
  • decompression bomb path bounded;
  • timeout maps to structured retry class;
  • limit hit maps to structured terminal result.

11. Content handling

Supported useful types

text/html
application/xhtml+xml
application/xml
text/xml
application/rss+xml
application/atom+xml
text/plain

Evidence

  • content-type normalized;
  • charset extracted where relevant;
  • binary/media response does not enter HTML parser path;
  • status and headers summary retained safely;
  • body storage/reference strategy recorded;
  • cookies/auth headers not persisted in evidence.

12. Rate / concurrency evidence

Required

  • global concurrency bound;
  • per-origin concurrency bound;
  • per-origin pacing/rate limit;
  • CrawlPlan rate policy honored;
  • 429 Retry-After passed to queue scheduler;
  • future browser fallback can share origin budget rather than bypass it.
{
  "rate_policy": {
    "global_concurrency": "REAL_VALUE",
    "per_origin_concurrency": "REAL_VALUE",
    "per_origin_rate": "REAL_VALUE",
    "retry_after_honored": "PASS | FAIL"
  }
}

13. Retry classification evidence

FETCH_OK
FETCH_OK_REDIRECTED
RETRY_429
RETRY_5XX_TRANSIENT
RETRY_TIMEOUT
RETRY_CONNECTION_TRANSIENT
NO_RETRY_NOT_FOUND
NO_RETRY_ACCESS_DENIED
NO_RETRY_SECURITY_REJECT
NO_RETRY_REDIRECT_POLICY
NO_RETRY_BODY_LIMIT

Required mapping tests

ConditionExpectedActual
200 HTMLFETCH_OKREAL_VALUE
301→200FETCH_OK_REDIRECTEDREAL_VALUE
429RETRY_429REAL_VALUE
503RETRY_5XX_TRANSIENTREAL_VALUE
timeoutRETRY_TIMEOUTREAL_VALUE
connection reset/transientRETRY_CONNECTION_TRANSIENTREAL_VALUE
404NO_RETRY_NOT_FOUNDREAL_VALUE
403NO_RETRY_ACCESS_DENIED or accepted policy equivalentREAL_VALUE
private redirectNO_RETRY_SECURITY_REJECTREAL_VALUE
redirect loop/limitNO_RETRY_REDIRECT_POLICYREAL_VALUE
body capNO_RETRY_BODY_LIMITREAL_VALUE

14. Immutable FetchResult evidence

{
  "fetch_id": "...",
  "queue_item_id": "...",
  "job_id": "...",
  "requested_url": "...",
  "final_url": "...",
  "redirect_chain": [],
  "status_code": 200,
  "content_type": "text/html",
  "charset": "utf-8",
  "headers_summary": {},
  "body": {
    "storage": "INLINE_BOUNDED | BLOB_REF",
    "content_ref": "...",
    "bytes": 0
  },
  "timing": {},
  "resolved_addresses": [],
  "security_policy_version": "...",
  "result_code": "FETCH_OK",
  "retry_hint": null,
  "evidence_refs": []
}

Required proof

  • FetchResult stored/returned exactly once per attempt identity;
  • result is not later mutated by classifier;
  • body bounds reflected in metadata;
  • redirect chain preserved;
  • security evidence preserved;
  • sanitized headers only;
  • result serializes/deserializes safely.

15. TASK-005 queue integration

Fetch classQueue action
FETCH_OK / FETCH_OK_REDIRECTEDACK / COMPLETED
RETRY_*NACK retriable with retry hint
NO_RETRY_*NACK terminal

Required proof

  • ACK/NACK uses current queue lease;
  • ACK/NACK uses current Job fencing token;
  • stale lease/fence rejects mutation;
  • retry scheduling remains queue responsibility;
  • same attempt replay does not double-increment counters;
  • crash after FetchResult persist but before ACK can be recovered idempotently.

16. Logs / sanitization

Allowed structured fields

  • job_id;
  • queue_item_id;
  • fetch_id;
  • stage;
  • result_code;
  • status_code;
  • requested/final URL if product logging policy allows;
  • timings;
  • bytes;
  • reason code.

Must not log

  • response body;
  • cookies;
  • Authorization;
  • Set-Cookie values;
  • secrets/tokens;
  • arbitrary sensitive headers.

17. Required local fixture HTTP server

EndpointPurpose
/ok-html200 bounded HTML
/redirect-oneone safe redirect
/redirect-looploop handling
/redirect-privatesecurity rejection before unsafe connect
/429Retry-After handling
/503transient server error
/slowtimeout
/large-bodystreaming body cap
/binaryunsupported/binary content
/malformed-locationredirect policy error
/robots.txtcontrol resource
/sitemap.xmlXML fetch path

18. Tests executed

Test groupCommandResultEvidence
200 HTML fetchREAL_COMMANDPASS / FAILREAL_REF
Safe redirectsREAL_COMMANDPASS / FAILREAL_REF
Unsafe redirectsREAL_COMMANDPASS / FAILREAL_REF
TimeoutsREAL_COMMANDPASS / FAILREAL_REF
Body/header limitsREAL_COMMANDPASS / FAILREAL_REF
429/Retry-AfterREAL_COMMANDPASS / FAILREAL_REF
5xx retry classificationREAL_COMMANDPASS / FAILREAL_REF
404/403 terminal behaviorREAL_COMMANDPASS / FAILREAL_REF
FetchResult serializationREAL_COMMANDPASS / FAILREAL_REF
Queue ACK/NACK integrationREAL_COMMANDPASS / FAILREAL_REF
Crash/replay integrationREAL_COMMANDPASS / FAILREAL_REF
Regression suiteREAL_COMMANDPASS / FAILREAL_REF

19. Negative / security cases

  • worker called with stale Job fencing token → reject;
  • worker called with invalid/expired queue lease → reject;
  • target becomes private at request time → reject;
  • redirect to private target → reject before connect;
  • unsupported redirect scheme → reject;
  • TLS verification disabled by config → startup/config/test failure;
  • body exceeds cap → stop stream and classify terminal;
  • redirect exceeds max → terminal redirect-policy result;
  • Retry-After absurdly large → bounded by queue policy;
  • malformed Location → structured terminal result;
  • binary response does not execute parser/classifier here.
{
  "negative_tests": {
    "stale_fence": "PASS | FAIL",
    "expired_lease": "PASS | FAIL",
    "request_time_private_resolution": "PASS | FAIL",
    "private_redirect": "PASS | FAIL",
    "tls_verification": "PASS | FAIL",
    "body_limit": "PASS | FAIL",
    "redirect_limit": "PASS | FAIL",
    "malformed_location": "PASS | FAIL"
  }
}

20. Acceptance checklist

Acceptance itemResultEvidence
Worker performs one bounded attemptPASS / FAILREAL_REF
Request-time TASK-002 revalidationPASS / FAILREAL_REF
DNS/connect safety proofPASS / FAILREAL_REF
Every redirect revalidatedPASS / FAILREAL_REF
TLS verification enabledPASS / FAILREAL_REF
Timeouts hard-enforcedPASS / FAILREAL_REF
Body/headers bounded while streamingPASS / FAILREAL_REF
Rate/concurrency policy enforcedPASS / FAILREAL_REF
Retry classes exactPASS / FAILREAL_REF
Immutable FetchResult producedPASS / FAILREAL_REF
Queue ACK/NACK integration correctPASS / FAILREAL_REF
Crash/replay does not corrupt countersPASS / FAILREAL_REF
Logs sanitizedPASS / FAILREAL_REF
No parser/classifier/browser logic addedPASS / FAILREAL_REF
No unrelated diffPASS / FAILREAL_REF

21. Gaps / blockers

{
  "security_blockers": [],
  "transport_blockers": [],
  "known_gaps": [],
  "unproven_limits": [],
  "blocks_TASK_007": true
}

Automatic blockers

  • request bypasses TASK-002;
  • redirect auto-follow bypasses validation;
  • DNS/connect TOCTOU unmitigated;
  • TLS verification disabled;
  • body limit checked only after full download;
  • unbounded timeout/redirect path;
  • worker runs persistent retry loop itself;
  • stale worker can ACK/NACK;
  • FetchResult mutable or not durable enough for replay semantics;
  • secrets/body contents appear in logs.

22. Final result

VERIFIED
PARTIAL
FAILED
BLOCKED
Для HTTP worker security/transport blocker не может быть downgraded до «known gap», если он позволяет unsafe network access.

23. Project state update

If VERIFIED

{
  "active_window_id": "AW-01",
  "last_verified_task": "TASK-006",
  "completed_tasks": [
    "TASK-001",
    "TASK-002",
    "TASK-003",
    "TASK-004",
    "TASK-005",
    "TASK-006"
  ],
  "current_task_id": "TASK-007",
  "last_evidence_ref": "EXEC-45_FILLED_REAL_REF",
  "repo_revision": "REAL_REVISION_AFTER",
  "open_blockers": [],
  "state_version": "INCREMENT_REAL_VALUE"
}

If not VERIFIED

{
  "current_task_id": "TASK-006",
  "last_task_result": "PARTIAL | FAILED | BLOCKED",
  "open_blockers": ["..."],
  "next_action": "TASK_006_REPAIR_OR_TRANSPORT_SECURITY_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-006",
  "packet_ref": "EXEC-31",
  "evidence_document_ref": "EXEC-45",
  "result": "BLOCKED_UNTIL_TASK_005_VERIFIED",
  "task_005_evidence_ref": "REAL_VALUE",
  "http_client": "REAL_VALUE",
  "dns_connect_strategy": "REAL_VALUE",
  "repo": {
    "root": "REAL_VALUE",
    "revision_before": "REAL_VALUE",
    "revision_after": "REAL_VALUE"
  },
  "changed_files": [],
  "reused_components": [],
  "created_components": [],
  "tests": [],
  "acceptance_checks": [],
  "security_blockers": [],
  "known_gaps": [],
  "next_task_allowed": false,
  "next_task_id_if_verified": "TASK-007",
  "next_packet_if_verified": "EXEC-32",
  "created_at": "REAL_VALUE"
}

25. Next exact action

EXEC-45 заполняется только после реального TASK-005 = VERIFIED и исполнения EXEC-31.

If TASK-006 = VERIFIED

Следующий execution step: TASK-007 / EXEC-32 — Candidate Link Discovery + Emission.

If TASK-006 ≠ VERIFIED

Создать bounded transport/security repair record и не переходить к TASK-007.