7a0da7932b
Backwards Compatibility / Verify Encryption Constants (push) Waiting to run
Backwards Compatibility / PyPI Version Compatibility (push) Waiting to run
Backwards Compatibility / Database Migration Tests (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-form] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-metrics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-workflow] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [history-news] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [library] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [link-analytics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [mobile] (push) Blocked by required conditions
Docker Tests (Consolidated) / detect-changes (push) Waiting to run
Docker Tests (Consolidated) / Build Test Image (push) Waiting to run
Docker Tests (Consolidated) / All Pytest Tests + Coverage (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [accessibility] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [api-crud] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-login] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-register] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-lifecycle] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [error-benchmark] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) (push) Blocked by required conditions
Docker Tests (Consolidated) / Accessibility Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Unit Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Example Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / Production Image Smoke Test (push) Blocked by required conditions
Docker Tests (Consolidated) / Infrastructure Tests (push) Blocked by required conditions
OSSF Scorecard / OSSF Security Scorecard Analysis (push) Waiting to run
OSV-Scanner (Scheduled) / scan-scheduled (push) Failing after 0s
Create Release / test-gate (push) Has been cancelled
Create Release / release-gate (push) Has been cancelled
Create Release / ci-gate (push) Has been cancelled
Create Release / version-check (push) Has been cancelled
Create Release / e2e-test-gate (push) Has been cancelled
Create Release / responsive-test-gate (push) Has been cancelled
Create Release / compat-test-gate (push) Has been cancelled
Create Release / compose-integration-gate (push) Has been cancelled
Create Release / vulture-gate (push) Has been cancelled
Create Release / build (push) Has been cancelled
Create Release / provenance (push) Has been cancelled
Create Release / prerelease-docker (push) Has been cancelled
Create Release / publish-docker (push) Has been cancelled
Create Release / create-release (push) Has been cancelled
Create Release / cleanup-changelog (push) Has been cancelled
Create Release / trigger-pypi (push) Has been cancelled
Create Release / monitor-pypi (push) Has been cancelled
Create Release / Clean up orphan prerelease tags and signatures (push) Has been cancelled
130 lines
4.3 KiB
Python
130 lines
4.3 KiB
Python
#!/usr/bin/env python
|
|
"""
|
|
Test script to validate BrowseComp dataset loading and decryption.
|
|
This helps debug issues with the BrowseComp dataset.
|
|
"""
|
|
|
|
import sys
|
|
|
|
from loguru import logger
|
|
|
|
# Logger is already imported from loguru
|
|
# Set debug level for this script
|
|
logger.remove()
|
|
# diagnose=False: loguru defaults to True, which renders repr() of every
|
|
# local in every traceback frame on exception. Users copy this snippet
|
|
# into their own scripts, so leaving the default on would propagate the
|
|
# credential-in-traceback leak (#4185) wherever the snippet lands.
|
|
logger.add(sys.stderr, level="DEBUG", diagnose=False)
|
|
|
|
# Add path to import local_deep_research
|
|
sys.path.append(".")
|
|
|
|
try:
|
|
from local_deep_research.benchmarks.datasets import decrypt, load_dataset
|
|
except ImportError as e:
|
|
print(f"Error importing modules: {e}")
|
|
sys.exit(1)
|
|
|
|
|
|
def test_browsecomp_decryption():
|
|
"""Test decryption of BrowseComp dataset."""
|
|
print("\n=== Testing BrowseComp Decryption ===\n")
|
|
|
|
try:
|
|
# Load a small number of examples to test
|
|
examples = load_dataset("browsecomp", num_examples=3)
|
|
|
|
if not examples:
|
|
print("Error: No examples loaded from dataset")
|
|
return
|
|
|
|
print(
|
|
f"Successfully loaded {len(examples)} examples from BrowseComp dataset\n"
|
|
)
|
|
|
|
# Check if decryption worked by examining examples
|
|
for i, example in enumerate(examples):
|
|
print(f"Example {i + 1}:")
|
|
print(f" ID: {example.get('id', 'unknown')}")
|
|
|
|
# Check if we have decrypted data
|
|
if "original_problem" in example:
|
|
print(" Decryption successful!")
|
|
print(
|
|
f" Original problem (encrypted): {example.get('original_problem', '')[:50]}..."
|
|
)
|
|
print(
|
|
f" Decrypted problem: {example.get('problem', '')[:50]}..."
|
|
)
|
|
print(
|
|
f" Decrypted answer: {example.get('correct_answer', '')[:50]}..."
|
|
)
|
|
else:
|
|
print(
|
|
" Decryption may have failed - no original_problem field"
|
|
)
|
|
print(f" Problem: {example.get('problem', '')[:50]}...")
|
|
print(f" Answer: {example.get('answer', '')[:50]}...")
|
|
|
|
# Try manual decryption
|
|
canary = example.get("canary", "")
|
|
if canary:
|
|
print("\n Attempting manual decryption...")
|
|
try:
|
|
problem = example.get("problem", "")
|
|
answer = example.get("answer", "")
|
|
|
|
decrypted_problem = decrypt(problem, canary)
|
|
decrypted_answer = decrypt(answer, canary)
|
|
|
|
print(
|
|
f" Manually decrypted problem: {decrypted_problem[:50]}..."
|
|
)
|
|
print(
|
|
f" Manually decrypted answer: {decrypted_answer[:50]}..."
|
|
)
|
|
except Exception as e:
|
|
print(f" Manual decryption failed: {e}")
|
|
else:
|
|
print(" No canary found for manual decryption")
|
|
|
|
print()
|
|
|
|
except Exception as e:
|
|
print(f"Error in test: {e}")
|
|
|
|
|
|
def test_simpleqa_loading():
|
|
"""Test loading of SimpleQA dataset for comparison."""
|
|
print("\n=== Testing SimpleQA Loading ===\n")
|
|
|
|
try:
|
|
# Load a small number of examples to test
|
|
examples = load_dataset("simpleqa", num_examples=3)
|
|
|
|
if not examples:
|
|
print("Error: No examples loaded from dataset")
|
|
return
|
|
|
|
print(
|
|
f"Successfully loaded {len(examples)} examples from SimpleQA dataset\n"
|
|
)
|
|
|
|
# Check examples
|
|
for i, example in enumerate(examples):
|
|
print(f"Example {i + 1}:")
|
|
print(f" ID: {example.get('id', 'unknown')}")
|
|
print(f" Problem: {example.get('problem', '')[:50]}...")
|
|
print(f" Answer: {example.get('answer', '')[:50]}...")
|
|
print()
|
|
|
|
except Exception as e:
|
|
print(f"Error in test: {e}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# Test both datasets for comparison
|
|
test_browsecomp_decryption()
|
|
test_simpleqa_loading()
|