Research-Stack/5-Applications/scripts/test_knowledge_ingestion.py
Brandon Schneider ba1e4cf191 feat: add RDS probe tool, credential server, and Notion/Linear ingestion pipeline
New infrastructure components:
- rds_probe: Rust database inspection tool with IAM auth
- credential_server.py: REST credential provider server
- credential_provider.py: credential resolution chain
- ene_rds_fractal_fold.py / ene_rds_wiki_layer.py: RDS-backed ENE layers
- import_dumps_to_rds.py / export_linear_from_rds.py: ingestion pipeline
- recover_credential_server.sh: deployment script (sanitized)

Sanitize hardcoded secrets across codebase:
- Strip API keys from recover_credential_server.sh → env var lookups
- Replace hardcoded Wolfram appid (HYJE3R3R63) → env var in 5 scripts
- Strip fallback key values from config/index.js
- Add .claude/ and optimized_basis_v3.bin to .gitignore

Ingested 2,685 records into RDS: 2,421 Linear issues + 264 wiki pages
2026-05-18 00:31:44 -05:00

45 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""
Test script for knowledge ingestion with Wolfram Alpha API
"""
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '.')))
from infra.knowledge_ingestion import KnowledgeIngestion
def test_wolfram_alpha():
"""Test Wolfram Alpha API integration"""
api_key = os.environ.get("WOLFRAM_ALPHA_APPID", "")
print("Testing Wolfram Alpha API integration...")
ingestion = KnowledgeIngestion(api_key)
# Test a simple query
print("\n1. Testing simple query: 'What is 2+2?'")
result = ingestion.wolfram.query("What is 2+2?")
if result:
print(f"Result: {result}")
else:
print("Query failed")
# Test domain knowledge retrieval
print("\n2. Testing domain knowledge: 'mathematics'")
domain_knowledge = ingestion.wolfram.get_domain_knowledge("mathematics")
print(f"Domain knowledge: {domain_knowledge}")
# Test OpenMath ingestion
print("\n3. Testing OpenMath Content Dictionary ingestion...")
openmath_result = ingestion.openmath.fetch_content_dictionary("arith1")
print(f"OpenMath result: {openmath_result}")
# Test nLab scraping
print("\n4. Testing nLab wiki scraping...")
nlab_result = ingestion.nlab.scrape_page("topological_space")
print(f"nLab result: {nlab_result}")
print("\nAll tests complete!")
if __name__ == "__main__":
test_wolfram_alpha()