๐Ÿ  Home ๐ŸŽฏ Heroes ๐Ÿ›ก๏ธ IP Gate ๐Ÿ“‹ Patents ๐Ÿ”— Evidence ๐Ÿ’‰ CDx โ™ป๏ธ Repurposing ๐Ÿšฆ Gates ๐ŸŽ›๏ธ Control ๐Ÿงช Wet Lab โš›๏ธ Quantum

๐Ÿ”— Evidence Chain โ€” Audit & Replay

Every pipeline decision is recorded with timestamp + SHA-256 hash. Immutable audit trail. Replay any hero's journey.

๐Ÿ” Look Up Hero Evidence Chain

๐Ÿ“‹ Evidence Step Inventory

All recorded pipeline actions. Each writes to evidence_chain in DDB with {step, decision, detail, timestamp, hash}.

StepRecordsReplay CommandDescription
le_backfillCOMPUTEDpython3 -c "from intelligence_orchestrator import *"Ligand efficiency computed from Vina + MW
target_justificationPURSUE / HOLDpython3 -c "from target_justification import justify_target; print(justify_target('GENE'))"Why pursue this target? ChEMBL + DepMap + pathway scoring
ip_gateDE_NOVO / REPURPOSE / CDX / DEPRIORITIZEpython3 -c "from ip_gate import run_ip_gate; print(run_ip_gate('GENE', hero_data))"Unified IP classification: patent + ChEMBL phase + trials + expression
ip_routerREPURPOSE_CONFIRMED / CDX_VALIDATED / PARKEDpython3 -c "from repurpose_expression_matcher import check_expression_in_cancer; print(check_expression_in_cancer('GENE','colorectal'))"Post-IP-gate routing: expression match, biomarker validate, or park
tox_sel_backfillCOMPUTEDpython3 -c "from rdkit.Chem import Descriptors; ..."Toxicity (hERG risk) + selectivity (fsp3/promiscuity) from SMILES
competitive_diffPROCEED / PARKpython3 -c "from competitive_diff_scorer import compute_competitive_diff; print(compute_competitive_diff(hero))"Is our compound differentiated vs trial competitors?
agentic_retryGPU_RESUBMITaws batch submit-job --job-name retry-GENE ...Auto-retry with scaffold seeding + CRC enhancement
evidence_assessmentauthority=X.XXXpython3 -c "from evidence_gap_builder import assess_evidence; ..."Multi-source evidence authority (inhibitors, structure, family, pathway)
evidence_gap_builderfull_authority / evidence_missingpython3 -c "from evidence_gap_builder import build_gap_report; ..."What evidence is missing? What assays to run?
repurposing_candidateDrug namepython3 -c "from repurpose_expression_matcher import check_expression_in_cancer; ..."Approved drug found for this target
chemistry_validationPASS / FAILpython3 -c "from chemistry_gate import validate_compound; ..."PAINS, reactive groups, Lipinski, stability checks
grade_assignmentA+ / A / B+ / B / Cpython3 -c "from chemistry_gate import compute_grade; ..."Final hero grade based on composite score
gpu_dockUPDATEDaws batch submit-job --job-name dock-GENE ...GPU docking result written (Vina score, SMILES)
brain_bus_syncALL_BRAINS_CONNECTEDpython3 -c "..."CortexQ brain signals synchronized

๐Ÿ”„ How to Replay

Full Hero Replay (all steps)

cd /Users/georgesoto/projects/edice-r
python3 << 'EOF'
import sys, json; sys.path.insert(0, 'agents')
import os; os.environ['AWS_PROFILE'] = 'edice-r-admin'
import boto3
ddb = boto3.Session(profile_name='edice-r-admin', region_name='us-east-1').resource('dynamodb')
hero = ddb.Table('cortex-heroes').get_item(Key={'pk': 'GENE_NAME'}).get('Item', {})
chain = hero.get('evidence_chain', [])
print(f"Evidence chain for {hero.get('pk')} ({len(chain)} entries):")
for entry in chain:
    e = json.loads(entry) if isinstance(entry, str) else entry
    print(f"  [{e.get('timestamp','')}] {e.get('step'):25s} โ†’ {e.get('decision'):20s} | {e.get('detail','')}")
EOF

Replay Single Step

# Replay IP Gate decision for a specific hero
python3 -c "
import sys; sys.path.insert(0, 'agents')
from ip_gate import run_ip_gate
result = run_ip_gate('KRAS_CRC', {
    'chembl_max_phase': 4,
    'clinical_trial_count': 795,
    'cancer_type': 'colorectal'
})
print(result)
"

Replay Entire Nightly (dry run)

# Run nightly orchestrator locally (reads from DDB, writes evidence)
cd /Users/georgesoto/projects/edice-r
AWS_PROFILE=edice-r-admin python3 -c "
import sys; sys.path.insert(0, 'agents')
from intelligence_orchestrator import run_nightly_intelligence
result = run_nightly_intelligence()
import json; print(json.dumps(result, indent=2, default=str))
"

Verify Chain Integrity (SHA-256)

# Each entry has a hash: sha256(gene:step:decision:timestamp)
# Verify no entries were tampered with:
python3 -c "
import sys, json, hashlib; sys.path.insert(0, 'agents')
import boto3
ddb = boto3.Session(profile_name='edice-r-admin', region_name='us-east-1').resource('dynamodb')
hero = ddb.Table('cortex-heroes').get_item(Key={'pk': 'GENE_NAME'}).get('Item', {})
chain = hero.get('evidence_chain', [])
for entry in chain:
    e = json.loads(entry) if isinstance(entry, str) else entry
    expected = hashlib.sha256(f\"{hero['pk']}:{e['step']}:{e['decision']}:{e['timestamp']}\".encode()).hexdigest()[:16]
    status = 'โœ…' if e.get('hash') == expected else 'โŒ TAMPERED'
    print(f\"  {status} [{e['timestamp']}] {e['step']} โ†’ {e['decision']}\")
"

๐Ÿ“‹ All Heroes โ€” Evidence Links

Loading hero list...