GitLab Transcend Hackathon 2026 · Path B Target: Sherlock Project Rule: DEF-104

Supervised Incident-to-Immunity System

ANTIBODY demonstrates how a production defect in sherlock_project/sites.py (Incident #104: unbounded outbound HTTP requests breaching canary latency thresholds) is converted into an AST-validated structural defense (DEF-104), discovering 6 latent sibling sites across 4 verbs, and deterministically halting held-out recurrence attacks in GitLab CI.

Central Technical Result
PROVEN_DEFENDED
Schema: Draft 2020-12 Validated Pipeline: 2943123842 (Clean Main)
Stage 1 · Proof PROVEN
RED → GREEN
Pre-fix: Exit 1 (2 failed)
Post-fix: Exit 0 (3 passed)
Stage 2 · Siblings 6 SITES
6 Confirmed
Across 4 modules & 4 HTTP verbs
(8 safe counterparts preserved)
Stage 3 · Validation 7 / 7 MUTANTS
100% Class A
3/3 negative controls rejected
0 False Positives on clean code
Stage 4 · Gate BLOCKED
BLOCKED
Held-out recurrence attack halted
Hash-bound receipt emitted

The Closed Immunity Loop (Incident to Defense)

Automated sequence turning ephemeral alerts into durable architectural defenses
Deterministic Oracle
Step 01
Production Defect
Unbounded HTTP call in sites.py triggers latency breach.
diagnosis.json
Step 02
Regression Proof
Focused test proves defect before patch (RED) and resolves post-patch (GREEN).
proof.json
Step 03
Sibling Discovery
AST & Semgrep sweep discovers 6 latent sibling sites across verbs & files.
siblings.json
Step 04
Structural Defense
Semgrep rule DEF-104 tested against 7 AST mutants and 3 negative controls.
DEF-104.validation.json
Step 05
Recurrence Gate
Held-out recurrence attack is deterministically BLOCKED in GitLab CI.
recurrence_receipt.json

Five Authoritative Lifecycle Stages

Interactive execution receipts, AST rules, and machine verifications
Select stage to inspect receipts
Authoritative Consolidated Receipt PROVEN_DEFENDED

Consolidated execution receipt generated by demonstrate_e2e.py and formally validated against antibody/schemas/e2e_evidence.schema.json.

ScenarioINC-104: Outbound HTTP Timeout Recurrence Prevention
Defense IDDEF-104
Rule SHA256dbee6e133c320fc0619903b83c885319cceb7cbc484f01aa5564a20319bb1e26
Execution VerdictPROVEN_DEFENDED
Schema ValidationDraft2020-12 Valid
Stages Summary Snapshot 5 / 5 Stages Verified
1. Regression Proof PROVEN RED (Exit 1) → GREEN (Exit 0)
2. Sibling Discovery PASSED 6 confirmed sibling sites discovered
3. Structural Defense PASSED 7/7 AST mutants caught · 3 negative controls
4. Recurrence Gate PASSED Held-out attack BLOCKED · 0 False Positives
5. Consolidated Receipt PASSED Schema valid output emitted
incidents/INC-104/e2e_evidence.json
{
  "scenario": "INC-104: Outbound HTTP Timeout Recurrence Prevention",
  "timestamp": "2026-10-13T09:42:17.162877+00:00",
  "duration_seconds": 128.61,
  "status": "PROVEN_DEFENDED",
  "defense": {
    "defense_id": "DEF-104",
    "rule_sha256": "dbee6e133c320fc0619903b83c885319cceb7cbc484f01aa5564a20319bb1e26",
    "integrity_verified": true
  },
  "stages": {
    "stage_1_regression_proof": {
      "status": "PROVEN",
      "reg_01": "PASSED",
      "reg_02": "PASSED",
      "pre_fix_exit": 1,
      "post_fix_exit": 0
    },
    "stage_2_sibling_discovery": {
      "confirmed_siblings": 6,
      "files_affected": 4,
      "out_of_scope_cases": 3
    },
    "stage_3_structural_defense": {
      "validation_status": "passed",
      "mutations_caught": 7,
      "mutations_total": 7,
      "good_corpus_flagged": 0
    },
    "stage_4_recurrence_gate": {
      "gate_status": "passed",
      "recurrence_attack_blocked": true,
      "recurrence_findings": 1,
      "siblings_defended": 6,
      "known_good_control_clean": true
    }
  },
  "evidence_references": {
    "regression_proof": "incidents/INC-104/proof.json",
    "siblings_report": "incidents/INC-104/siblings.json",
    "defense_validation": "defenses/DEF-104.validation.json",
    "recurrence_receipt": "defenses/DEF-104.recurrence_receipt.json"
  }
}
Deterministic Regression Proof PROVEN

CI script antibody/scripts/regression_proof.py proves defect reproduction before code fix and verifies resolution post-fix.

Target Functionsherlock_project/sites.py:check_target_connection
Regression Testtests/regression/test_timeout_regression.py
Pre-Fix StatusRED (Exit 1) 2 tests failed
Post-Fix StatusGREEN (Exit 0) 3 tests passed
Check REG-01 / REG-02PASSED
Code Remediation Diff Bounded Timeout

Patch applied to sherlock_project/sites.py establishing explicit connect/read timeout:

sherlock_project/sites.py
@@ -145,3 +145,5 @@
- response = requests.get(url, headers=headers)
+ # DEF-104: Enforce explicit connect/read timeout
+ response = requests.get(url, headers=headers, timeout=(3.05, 10.0))
incidents/INC-104/proof.json
{
  "incident_id": "104",
  "target": "sherlock_project/sites.py:check_target_connection",
  "regression_test": "tests/regression/test_timeout_regression.py",
  "pre_fix": {
    "ref": "9e612429ec5c55b53983630fd863ff8392948087:sherlock_project/sites.py",
    "exit_code": 1,
    "status": "RED",
    "tests_passed": 1,
    "tests_failed": 2
  },
  "post_fix": {
    "ref": "HEAD",
    "exit_code": 0,
    "status": "GREEN",
    "tests_passed": 3,
    "tests_failed": 0
  },
  "proof_status": "PROVEN",
  "reg_01": "PASSED",
  "reg_02": "PASSED",
  "reg_03": "PASSED",
  "timestamp": "2026-10-13T09:40:11.856372+00:00"
}
AST & Semgrep Sibling Sweep 6 SIBLINGS FOUND

antibody/scripts/discover_siblings.py scans for the same defect pattern across different modules, files, and HTTP verbs.

Total Candidates Examined17 sites evaluated
Confirmed Sibling Sites6 confirmed (requiring defense)
Safe Counterparts Preserved8 safe (existing timeouts)
Explicit Scope Limits3 out of scope (documented boundary)
HTTP Verbs CoveredGET (3), POST (1), PUT (1), DELETE (1)
Confirmed Sibling Sites Breakdown 4 Files
ID Module Symbol Verb Confidence
SIB-104-001fixture_direct_sibling.pyfetch_site_manifestGETHigh
SIB-104-002fixture_incident_104.pycheck_target_connectionGETHigh
SIB-104-005fixture_renamed_sibling.pyretrieve_remote_metadataGETHigh
SIB-104-009fixture_verb_sibling.pysend_telemetry_beaconPOSTHigh
SIB-104-010fixture_verb_sibling.pyupdate_remote_statePUTHigh
SIB-104-011fixture_verb_sibling.pypurge_remote_recordDELETEHigh
incidents/INC-104/siblings.json (Summary & First Confirmed Sites)
{
  "incident_id": "104",
  "rule_id": "DEF-104",
  "summary": {
    "total_candidates": 17,
    "confirmed_siblings": 6,
    "safe_counterparts": 8,
    "out_of_scope": 3,
    "files_affected": 4,
    "modules_affected": 4,
    "by_module": {
      "fixture_direct_sibling": 1,
      "fixture_incident_104": 1,
      "fixture_renamed_sibling": 1,
      "fixture_verb_sibling": 3
    },
    "by_http_verb": {
      "get": 3,
      "post": 1,
      "put": 1,
      "delete": 1
    }
  },
  "sites_sample": [
    {
      "path": "antibody/corpus/siblings/fixture_direct_sibling.py",
      "symbol": "fetch_site_manifest",
      "line": 12,
      "confidence": "high",
      "classification": "confirmed_sibling",
      "http_verb": "get",
      "rule_id": "DEF-104",
      "reason": "Outbound HTTP call without explicit timeout parameter matching DEF-104 structural pattern",
      "requires_validation": false,
      "scope_limit": null,
      "id": "SIB-104-001"
    },
    {
      "path": "antibody/corpus/siblings/fixture_incident_104.py",
      "symbol": "check_target_connection",
      "line": 13,
      "confidence": "high",
      "classification": "confirmed_sibling",
      "http_verb": "get",
      "rule_id": "DEF-104",
      "reason": "Outbound HTTP call without explicit timeout parameter matching DEF-104 structural pattern",
      "requires_validation": false,
      "scope_limit": null,
      "id": "SIB-104-002"
    },
    {
      "path": "antibody/corpus/siblings/fixture_renamed_sibling.py",
      "symbol": "retrieve_remote_metadata",
      "line": 13,
      "confidence": "high",
      "classification": "confirmed_sibling",
      "http_verb": "get",
      "rule_id": "DEF-104",
      "reason": "Outbound HTTP call without explicit timeout parameter matching DEF-104 structural pattern",
      "requires_validation": false,
      "scope_limit": null,
      "id": "SIB-104-005"
    }
  ]
}
Defense Validator Oracle PASSED

antibody/scripts/validate_defense.py subjects rule DEF-104 to an adversarial mutation oracle and negative controls.

Rule IdentifierDEF-104 (Severity: ERROR)
Class A Mutants (M1-M7)7 / 7 Caught (100%)
Good Code Corpus9 / 9 Preserved (0 FP)
Negative Controls3 / 3 Rejected (Overbroad, Narrow, Regex)
Class B Boundaries1 / 3 (Honest scope limits disclosed)
Semgrep Rule Definition YAML AST

Declarative structural pattern in defenses/DEF-104.yaml:

defenses/DEF-104.yaml
rules:
  - id: antibody-def-104-http-no-timeout
    languages: [python]
    severity: ERROR
    message: "Outbound HTTP call without explicit timeout. Prevented by defense DEF-104 generated from Incident #104."
    metadata:
      incident: "104"
      defense: "DEF-104"
      incident_url: "https://gitlab.example.com/antibody/sherlock/-/issues/104"
    pattern-either:
      - patterns:
          - pattern: requests.$M(...)
          - metavariable-regex:
              metavariable: $M
              regex: '^(get|post|put|patch|delete|head|options|request)$'
          - pattern-not: requests.$M(..., timeout=$T, ...)
      - pattern: requests.$M(..., timeout=None, ...)
      - pattern: urllib.request.urlopen($U)
      - patterns:
          - pattern-inside: |
              $S = requests.Session()
              ...
          - pattern: $S.$M(...)
          - metavariable-regex:
              metavariable: $M
              regex: '^(get|post|put|patch|delete|head|options|request)$'
          - pattern-not: $S.$M(..., timeout=$T, ...)
defenses/DEF-104.validation.json
{
  "defense_id": "DEF-104",
  "rule_sha256": "dbee6e133c320fc0619903b83c885319cceb7cbc484f01aa5564a20319bb1e26",
  "checks": {
    "lint": true,
    "original": true,
    "siblings": true,
    "mutants_A": {
      "total": 7,
      "caught": 7
    },
    "mutants_B": {
      "total": 3,
      "caught": 1
    },
    "good": {
      "total": 9,
      "flagged": 0
    },
    "repo_clean": true
  },
  "status": "passed",
  "attempt": 1
}
Recurrence Gate Enforcement ATTACK BLOCKED

Authoritative CI gate antibody/scripts/recurrence_gate.py evaluates whether a held-out attack is blocked and siblings protected.

Held-Out Attack Fixtureheld_out_recurrence.py
Attack Execution ResultBLOCKED (1 finding)
Safe Counterpart TwinALLOWED (0 findings)
Sibling Defense Coverage6 of 6 Defended
Cryptographic Hash BindingVerified SHA256
CI Blocking Diagnostic Output Authoritative

Terminal diagnostic emitted during recurrence gate evaluation in CI pipeline:

recurrence-gate stdout
[RECURRENCE BLOCKED]
File: antibody/corpus/recurrence/held_out_recurrence.py:27
Rule: DEF-104 (Incident #104)
Message: Outbound HTTP call without explicit timeout.
Prevented by defense DEF-104 generated from Incident #104.
defenses/DEF-104.recurrence_receipt.json
{
  "defense_id": "DEF-104",
  "incident_id": "104",
  "rule_sha256": "dbee6e133c320fc0619903b83c885319cceb7cbc484f01aa5564a20319bb1e26",
  "recurrence": {
    "fixture_path": "antibody/corpus/recurrence/held_out_recurrence.py",
    "blocked": true,
    "findings": 1
  },
  "sibling_defense": {
    "evaluated": 6,
    "defended": 6,
    "safe_preserved": 8,
    "out_of_scope": 3
  },
  "checks": {
    "lint": true,
    "original": true,
    "siblings": true,
    "mutants_A": {
      "total": 7,
      "caught": 7
    },
    "mutants_B": {
      "total": 3,
      "caught": 1
    },
    "good": {
      "total": 9,
      "flagged": 0
    },
    "repo_clean": true,
    "recurrence_blocked": true,
    "integrity_verified": true
  },
  "status": "passed",
  "attempt": 1
}

System Verification Matrix (Pipeline 2943123842)

Authoritative audit ledger distinguishing verified execution from honest boundaries
GitLab CI Verified
Job / Component Stage Status Verification Evidence
regression-proof verify PASS RED on unpatched source → GREEN on patched source (REG-01, REG-02 verified)
unit-test verify PASS Full upstream Sherlock test suite passed on Python 3.12
validate-defense secure PASS DEF-104 validated: 7/7 AST mutants caught, 3/3 negative controls rejected
discover-siblings secure PASS 6 confirmed sibling sites discovered across 4 files and 4 HTTP verbs
recurrence-gate secure PASS Held-out recurrence attack deterministically blocked; receipt emitted
build-image package PASS (DinD) Container built ephemeral in Docker-in-Docker runner (manual trigger; not published)
static-analysis secure FAIL (ALLOWED) Ruff reported legacy debt (104 errors); configured with allow_failure: true
GitLab Duo Platform Execution agent UNVERIFIED Flows authored per Flow Registry v1; simulated locally, unverified on remote Duo
Automated Canary Rollback release UNVERIFIED Declarative policy in canary-policy.yaml; CI release jobs unexecuted
Platform Limitations & Non-Claims (Honest Engineering Boundaries)
No Live GitLab Duo Flow Claim Custom flow configurations (.gitlab/duo/flows/antibody-fix-prove.yaml and antibody-respond.yaml) are validated against official schemas and simulated offline via fix_prove_runner.py. We do not claim live remote Duo agent runner execution took place.
No Automated Canary Rollback Claim Canary thresholds in deploy/canary-policy.yaml are declarative specifications. The ci/release.yml and ci/monitor.yml jobs remain skeleton placeholders and were not executed during this deployment.
No Public Container Registry Publishing The build-image job in GitLab CI verified Docker packaging in an ephemeral DinD runner. The resulting image was not published to a public container registry.
Intra-Procedural AST Scope Limits Structural defense DEF-104 accurately catches intra-procedural calls and session wrappers. Complex inter-procedural taint flows (e.g. factory-instantiated sessions) are documented as known Class B boundary limits.

Direct Machine Evidence Files (JSON & YAML)

Download or view the raw cryptographic and structured evidence payloads