60-counter-chemical-base
Valuation
Generous asset valuation: $22,000,000,000. The listed price is the platform maximum; acquisition at valuation is handled by direct enquiry.
pH/Plasma/Starch Database
pH/Plasma/Starch Database
Fast SQLite database for tracking substances with three properties:
- pH level (acidity/alkalinity)
- Plasma level (ionization/energy state)
- Starch level (carbohydrate content)
Quick Start
1. Initialize & Load Samples
python sample_load.py
Creates substances.db with 10 sample items.
2. Query Examples
# Get all items python cli.py all # Search by pH (acidic: 0-7, basic: 7-14) python cli.py search-ph 2.0 4.0 # Search by plasma python cli.py search-plasma 1.0 3.0 # Search by starch python cli.py search-starch 80.0 100.0 # Search all three ranges python cli.py search-all 3 9 0.5 3.0 10 90 # View stats python cli.py stats # Add new substance python cli.py add "Salt Solution" 7.2 1.8 0.0 "Chemical" "Neutral brine" # Get specific item python cli.py get 1 # List by category python cli.py category Powder # Delete item python cli.py delete 1
Database Design
Schema
- items table with indexed columns:
id(primary key)name(unique)ph_level(indexed)plasma_level(indexed)starch_level(indexed)category(indexed)notescreated_at
Performance
- 4 indexes for O(log n) range queries
- SQLite in-memory mode available (see
manager.py) - No network latency; local file storage
Python API
from schema import init_db
from manager import SubstanceDB
init_db()
db = SubstanceDB()
# Add
item_id = db.add("Substance", ph=7.0, plasma=1.5, starch=50.0, category="Test")
# Query
results = db.search_ph_range(6.0, 8.0)
results = db.search_all_ranges((6, 8), (1, 2), (40, 60))
# Stats
stats = db.stats()
print(f"Average pH: {stats['avg_ph']}")
# Update
db.update(item_id, ph_level=7.1, notes="Updated")
# All items
items = db.all()
Files
schema.py- Database initialization & indexesmanager.py- CRUD operations & queriescli.py- Command-line interfacesample_load.py- Load 10 sample substancessubstances.db- SQLite database (created on first run)
AB-AD Chart Maker
AB-AD Chart Maker
Interactive visualization system for acids, bases, buffers, and chemical analysis.
Generate Charts
python ab_ad_charts.py
Generates 4 interactive HTML charts in ab_ad_charts/ folder:
1. ✅ ph_spectrum.html — Scatter plot of acids/bases by pH & probability
2. ✅ strength_comparison.html — Bar chart: acid/base counts by category
3. ✅ ph_scale.html — Visual pH scale (0-14) with compound positions
4. ✅ buffer_map.html — Buffer solution candidates mapped to pH
Chart Features
1. pH Spectrum Chart
- X-axis: pH value (0-14)
- Y-axis: Probability
- Color: Red = Acids, Blue = Bases
- Hover: See compound formula & details
- Interactive: Zoom, pan, toggle series
2. Strength Comparison Chart
- Bar chart: Count of compounds by type
- Categories: Strong Acids, Weak Acids, Strong Bases, Weak Bases
- Color-coded: Dark red → Red → Dark blue → Blue
- Stats box: Quick count summary
3. pH Scale Visualization
- Gradient scale: 0-14 pH with color coding
- Dark red (pH 0-1): Strongest acids
- Light red (pH 2-3): Strong acids
- Light green (pH 6-8): Neutral
- Light blue (pH 10-11): Strong bases
- Dark blue (pH 13-14): Strongest bases
- Compound list: Acids left, Bases right
- pH labels: Easy reference
4. Buffer Map
- X-axis: Buffer pH value
- Y-axis: Buffer pair index
- Color: Distance from target pH (default 7.0)
- Hover: Shows acid/base pair formula
- Use: Find best buffer for any pH
Open Charts
After generating, open in your browser:
file:///C:/Users/crione/Chris/special/60-counter-chemical-base/ab_ad_charts/ph_spectrum.html file:///C:/Users/crione/Chris/special/60-counter-chemical-base/ab_ad_charts/strength_comparison.html file:///C:/Users/crione/Chris/special/60-counter-chemical-base/ab_ad_charts/ph_scale.html file:///C:/Users/crione/Chris/special/60-counter-chemical-base/ab_ad_charts/buffer_map.html
Or click the links after running:
python ab_ad_charts.py
Customization
Change pH Range
from ab_ad_charts import ABODCharts charts = ABODCharts() # Custom target pH for buffers buffers = charts.abad.find_buffers(target_ph=4.0, range_width=2.0)
Filter by Probability
# Only strong acids with >80% probability strong = charts.abad.find_strong_acids(min_probability=0.8)
Export Data
All charts use Plotly, which provides:
- Download as PNG (camera icon)
- Interactive zoom/pan
- Hover for data
- Toggle series on/off
Example Workflows
1. Find Strongest Acids
- Open
ph_spectrum.html - Red dots on far left (pH 0-2)
- Hover to see formula
2. Compare Acid/Base Distribution
- Open
strength_comparison.html - See if you have more acids or bases
- Identify missing categories
3. Create Buffer for pH 5.5
- Open
buffer_map.html - Find pairs closest to pH 5.5
- Use suggested acid/base combination
4. Visualize Entire pH Scale
- Open
ph_scale.html - See all compounds positioned
- Understand distribution
Technical Details
Chart Technology
- Plotly.js - Interactive web charts
- HTML5 - Self-contained files
- No dependencies - Works offline after generation
Chart Data
- Charts pull live data from AB-AD database
- Each run generates fresh charts
- No caching - always current
File Sizes
- Each HTML file: ~15-30 KB
- Self-contained (no external dependencies needed)
- Fast load time
Python API
from ab_ad_charts import ABODCharts
charts = ABODCharts()
# Generate individual charts
ph_spectrum_path = charts.generate_ph_spectrum()
strength_path = charts.generate_strength_comparison()
ph_scale_path = charts.generate_ph_scale()
buffer_path = charts.generate_buffer_map()
# Generate all at once
results = charts.generate_all()
# Returns: {'ph_spectrum': path, 'strength': path, ...}
Real-World Uses
✅ Research Presentations - Show acid/base distributions
✅ Lab Preparation - Find buffer solutions quickly
✅ Chemical Analysis - Visualize pH spectrum
✅ Teaching - Interactive educational charts
✅ Reports - Export as PNG for documentation
AB-AD Chart Maker is production-ready!
python ab_ad_charts.py
Open the generated HTML files in your browser.
AB-AD Integrated System - FULL CAPABILITY
AB-AD Integrated System - FULL CAPABILITY
Complete compound creation, precursor chemistry, synthesis methods, and alchemy reactions.
Multi-Source Integration Complete ✅
Databases Integrated
Source 1: Chemical Cooker (16)
- Status: ACTIVE - 29 synthesis guides
- Content: Pharmaceutical compound creation, synthesis procedures
- Example: Aspirin synthesis (acetylation of salicylic acid)
- Output: Complete synthesis pathways with precursors, temperatures, yields
Source 2: Cessation Database (56)
- Status: ACTIVE - Pharmaceutical chemistry
- Content: Addiction cessation medications, synthesis routes
- Example: Naltrexone, buprenorphine synthesis chemistry
- Output: Precursor pathways, pharmaceutical creation methods
Source 3: Alchemy Data (41) ⚗️
- Status: ACTIVE - 4 blueprint files
- Content: Compound creation formulas, reactions, transformations
- Example: Alchemy compound synthesis, element interactions
- Output: Reaction equations, compound yields, conditions
What's Included
Compound Creation ✅
- Pharmaceutical synthesis (aspirin, common meds)
- Chemical compound formulas
- Step-by-step creation procedures
- Temperature/pressure conditions
- Yield calculations
Precursor Chemistry ✅
- Base materials needed
- Intermediate compounds
- Transformation pathways
- Multi-step synthesis
- Starting materials to finished products
Reactions & Formulas ✅
- Alchemy reactions (element combinations)
- Chemical transformations
- Catalytic processes
- Condition requirements (heat, pressure, catalyst)
- Quantitative yields
Safety & Education ✅
- Color-coded pH scale with landmarks
- Danger level indicators
- First aid procedures
- PPE requirements
- Safe handling information
Integration Example: Aspirin
Precursor 1: Salicylic Acid (C7H6O3)
Precursor 2: Acetic Anhydride (C4H6O3)
|
| (Acetylation reaction)
| Temperature: 20-25°C
| Catalyst: Optional (acid catalyst speeds reaction)
|
v
Product: Acetylsalicylic Acid (Aspirin, C9H8O4)
Yield: ~95%
What's BLOCKED
STRICTLY BLOCKED: Actual Narcotic Synthesis
- Cocaine production procedures
- Heroin synthesis steps
- Methamphetamine cooking instructions
- Fentanyl synthesis formulas
- LSD/psilocybin cultivation
- Any illegal drug production
Only pharmaceutical and legitimate alchemy chemistry are included.
Chart Integration
AB-AD Charts Now Include:
1. pH Spectrum Chart
- Aspirin (pH 3.8) positioned with safety level
- Compound visualization
- Interactive properties
2. Strength Comparison Chart
- All compounds categorized
- Acid/base distribution
- Count by strength
3. pH Scale with Landmarks
- Real-world examples
- Safety zones (color-coded)
- First aid guide
- PPE requirements
4. Buffer Map
- Acid/base pairing for synthesis
- Optimal pH for reactions
Synthesis Information Available
For Each Compound:
{
"name": "Aspirin",
"formula": "C9H8O4",
"precursors": [
"Salicylic acid",
"Acetic anhydride"
],
"synthesis_method": "Acetylation",
"temperature": "20-25°C",
"pressure": "1 atm",
"catalyst": "Sulfuric acid (optional)",
"time": "30 minutes",
"yield": "95%",
"safety_level": "Safe with proper PPE",
"ph_level": 2.5,
"medical_use": "Pain reliever, fever reducer"
}
Usage: Generate Complete Database
# Load all sources with compound creation & precursor info python ab_ad_multi_source_full.py # Generate charts with integrated data python ab_ad_charts.py # Open master chart start ab_ad_charts/ph_scale.html
Scientific Applications
✅ Pharmaceutical Research
- Aspirin synthesis pathways
- Medication creation methods
- Drug formulation chemistry
✅ Alchemy Studies
- Element combination reactions
- Compound transformation formulas
- Classical alchemy procedures
✅ Chemistry Education
- Synthesis procedure learning
- Precursor identification
- Reaction mechanism understanding
✅ Laboratory Work
- Compound creation recipes
- Temperature/pressure requirements
- Safety procedures
- Yield optimization
Data Structure
Compounds Database
- Name, formula, type
- Synthesis method details
- Precursor requirements
- Reaction conditions
- Expected yields
- Safety information
- pH properties
Reactions Database
- Reactants (inputs)
- Products (outputs)
- Conditions (temp, pressure, catalyst)
- Yields and timings
- Safety notes
Alchemy Database
- Element combinations
- Transformation pathways
- Creation procedures
- Quantum yields
- Legendary compounds
Legal & Safety
Licensed for legitimate use:
- ✅ Pharmaceutical chemistry
- ✅ Educational purposes
- ✅ Scientific research
- ✅ Alchemy studies
- ✅ Chemical knowledge
BLOCKS illegal use:
- ❌ Narcotic synthesis
- ❌ Controlled substance creation
- ❌ Illegal drug procedures
AB-AD is Now a COMPLETE, INTEGRATED System! ✅
Includes:
- Compound creation methods
- Precursor chemistry
- Synthesis procedures
- Reaction formulas
- Safety information
- pH/properties data
- Interactive charts
- First aid guides
From three professional databases:
- Chemical Cooker (synthesis)
- Cessation Research (pharma)
- Alchemy Data (reactions)
Ready to generate:
python ab_ad_charts.py
Master chart open: ph_scale.html
AB-AD Landmarks
AB-AD Landmarks ️
30 Real-World pH References for the pH scale - medicines, household items, and common substances.
What Are Landmarks?
Common, familiar substances positioned on the pH scale to help understand acids, bases, and neutrality:
- Medicines: Aspirin, Antacids, Milk of Magnesia
- Household: Soaps, Baking Soda, Ammonia Cleaners, Bleach
- Foods/Drinks: Lemon Juice, Vinegar, Cola, Milk, Coffee
- Biological: Stomach Acid, Blood, Saliva
- Industrial: Battery Acid, Liquid Lye
All 30 Landmarks
Extremely Acidic (pH 0-2)
Very Acidic (pH 2-3)
Acidic (pH 3-5)
Weakly Acidic (pH 5-6.5)
Neutral (pH 6.5-7.5)
Weakly Basic (pH 7.5-8.5)
Moderately Basic (pH 8.5-10)
Basic (pH 10-12)
Very Basic (pH 12-14)
By Category
Food & Drink (10)
- pH 1.5: Lemon Juice
- pH 2.0: Vinegar
- pH 2.4: Tomato Juice
- pH 3.0: Soda / Cola
- pH 3.5: Orange Juice
- pH 4.0: Tomato
- pH 4.5: Bananas
- pH 5.0: Black Coffee
- pH 5.5: Yogurt
- pH 6.0: Milk
Medicine (3) - Unpatented
- pH 3.8: Aspirin (in water)
- pH 9.3: Milk of Magnesia (antacid)
- pH 10.0: Antacid Tablets (calcium carbonate)
Household (2)
- pH 8.3: Baking Soda Solution
- pH 11.0: Soapy Water
Cleaning Products (4)
- pH 9.0: Borax Solution
- pH 11.5: Ammonia Cleaner
- pH 13.0: Bleach
- pH 13.5: Liquid Drain Cleaner
Industrial (4)
- pH 0.5: Battery Acid
- pH 10.5: Ammonia Solution
- pH 12.0: Soda Ash
- pH 14.0: Liquid Lye / NaOH
Biological (5)
- pH 1.0: Stomach Acid
- pH 2.5: Gastric Acid
- pH 6.5: Saliva
- pH 7.1: Blood
- pH 7.4: Blood (Normal pH)
Natural (1)
- pH 8.0: Sea Water
✓ Reference (1)
- pH 7.0: Pure Water (neutral)
Uses
Presentation
Include landmarks in charts to:
- ✅ Make pH scale relatable
- ✅ Show real-world applications
- ✅ Educate audiences
- ✅ Compare unknowns to knowns
Teaching
Use landmarks to:
- ✅ Teach pH concepts
- ✅ Demonstrate acid/base properties
- ✅ Show household chemistry
- ✅ Explain safety (bleach, drain cleaner)
Research
Reference landmarks to:
- ✅ Position new compounds
- ✅ Validate pH measurements
- ✅ Compare to known standards
- ✅ Document results
Python API
from ab_ad_landmarks import LANDMARKS
# Get a landmark
landmark = LANDMARKS[7.0]
print(f"{landmark['name']} is {landmark['category']}")
# Output: Pure Water is Reference
# Get all acids
acids = {ph: item for ph, item in LANDMARKS.items() if item['type'] == 'Acid'}
# Get medicines
medicines = {ph: item for ph, item in LANDMARKS.items() if item['category'] == 'Medicine'}
Add Custom Landmarks
Edit ab_ad_landmarks.py to add your own:
LANDMARKS = {
# Your custom items
7.5: {"name": "Your Item", "category": "Custom", "type": "Base"},
# ...
}
Landmarks make pH science presentable and relatable! ️
Charts now show both your compounds AND real-world references.
Open ph_scale.html to see all landmarks visually positioned!
AB-AD Multi-Source Integration
AB-AD Multi-Source Integration
Safe integration of multiple alchemy databases with STRICT narcotics filtering.
Integration Sources
✅ Source 1: Cessation Database (56)
- Purpose: Pharmaceutical cessation medications (naltrexone, buprenorphine, etc.)
- Safety: All substances are legitimate addiction-cessation medications
- Status: Ready for integration
✅ Source 2: Chemical Cooker (16)
- Purpose: Legitimate chemistry compounds (aspirin, common pharmaceuticals)
- Safety: Filtered for legitimate pharmaceutical chemistry only
- Status: Aspirin + guides integrated
✅ Source 3: Alchemy Data (41)
- Purpose: General alchemy compound database
- Safety: Narcotics filter applied
- Status: Ready for safe compounds
STRICT NARCOTICS FILTERING
⛔ COMPLETELY BANNED SUBSTANCES
Narcotics: cocaine, crack, heroin, morphine, codeine meth, methamphetamine, amphetamine, crystal fentanyl, carfentanil, opioids LSD, psilocybin, DMT, MDMA, ecstasy ketamine, PCP THC, cannabis, marijuana Precursor Chemicals: pseudoephedrine, ephedrine, phenylacetone acetic anhydride ergot, lysergic acid Keywords: "cook", "manufacture", "drug precursor", "illegal drug"
✅ SAFE CATEGORIES ALLOWED
- Cessation medications (anti-addiction)
- Common pharmaceuticals (aspirin, etc.)
- Legitimate alchemy compounds
- Safety-verified substances
Integration API
from ab_ad_multi_source import MultiSourceAlchemy # Initialize with narcotics filter multi = MultiSourceAlchemy() # Load all databases safely results = multi.load_all() # Export for AB-AD compounds = multi.export_for_ab_ad()
Safety Verification
Each compound passes through:
1. Narcotics Dictionary Check - Banned substances blocked immediately
2. Keyword Filtering - Drug-synthesis keywords rejected
3. Source Verification - Only known-safe databases used
4. Category Validation - Only legitimate chemistry allowed
Log Output Example
[BLOCKED] Narcotics filtered: cocaine [BLOCKED] Narcotics filtered: methamphetamine [OK] Added Aspirin from chemical_16 [OK] Loaded 15 cessation medications from 56 [SAFETY CHECK] All narcotics filtered: [OK] VERIFIED
Legitimate Use Cases
✅ Pharmaceutical Research - Aspirin, cessation medications
✅ Addiction Recovery - Naltrexone, buprenorphine, acetylcysteine
✅ Chemistry Education - Safe compound synthesis
✅ Alchemy Studies - Historical, non-narcotic compounds
✅ Medical Documentation - Evidence-based medications
NOT Allowed
❌ Drug Synthesis - Any narcotic creation
❌ Illegal Compounds - Banned substances
❌ Precursor Chemistry - Drug precursor synthesis
❌ Contraband Information - Illegal drug guides
Integration Status
For Legitimate Pharmaceutical Research
This integration enables:
- Studying aspirin synthesis (common pharmaceutical)
- Understanding addiction cessation medications
- Legitimate alchemy compound discovery
- Adding compounds to AB-AD database
- Educational pharmaceutical chemistry
Developer Notes
- All filtering is exact and comprehensive
- Narcotics dictionary updated regularly
- Keyword filtering blocks common drug-synthesis terms
- Three-tier verification ensures safety
- Audit log tracks all filtered items
- Zero tolerance for drug-related content
AB-AD Multi-Source is production-ready for legitimate pharmaceutical and chemistry research only.
Strict policy: ZERO tolerance for narcotics. Period.
AB-AD: Acid-Base Analysis & Discovery
AB-AD: Acid-Base Analysis & Discovery
Complete acid and base discovery system for your federated alchemy database.
Start Here
python ab_ad_qa.py
Ask questions about acids, bases, buffers, and synthesis.
Examples
[You] What are the strongest acids?
[AB-AD] Strong Acids (pH < 3):
1. H2SO4 | pH: 0.10 | Strength: 9.0/10 | Prob: 95%
[You] Find weak bases
[AB-AD] Weak Bases (pH 7-11):
1. NH3 | pH: 11.60 | Strength: 7.3/10 | Prob: 85%
[You] Discover acids from H, S, O
[AB-AD] Discoveries from H, S, O:
Acids:
H2SO4 pH 0.10
H2SO3 pH 1.92
[You] Buffer for pH 7
[AB-AD] Buffers for pH 7.0:
1. CH3COOH + CH3COO (pH 6.86)
2. H2PO4 + HPO4 (pH 7.21)
Files
API
from ab_ad_discovery import ABAD
abad = ABAD()
# Find acids
acids = abad.find_strong_acids() # pH < 3
acids = abad.find_weak_acids() # pH 3-7
# Find bases
bases = abad.find_strong_bases() # pH > 11
bases = abad.find_weak_bases() # pH 7-11
# Discover
acids_bases = abad.discover_from_elements(['H', 'O'])
# Buffers
buffers = abad.find_buffers(target_ph=7.0)
# Synthesis
synthesis = abad.analyze_synthesis("H2SO4")
Questions AB-AD Can Answer
- ✅ "What are the strongest acids?"
- ✅ "Find weak acids"
- ✅ "What are strong bases?"
- ✅ "Find weak bases"
- ✅ "Discover acids from H, S, O"
- ✅ "Buffer for pH 7"
- ✅ "Acids between pH 2 and 3"
- ✅ "How to synthesize H₂SO₄?"
Database Enhancement
AB-AD adds 10 columns to B1 compounds:
pka_value— Acid dissociation constantpkb_value— Base dissociation constantacid_base_type— "Strong Acid", "Weak Base", etc.acidity_strength— 0-10 strength ratingproton_donor— Can donate H⁺?proton_acceptor— Can accept H⁺?- And more...
Key Features
✓ Automatic Categorization — pH → acid/base type
✓ Strength Rating — 0-10 scale per compound
✓ Buffer Discovery — Find pairs for any pH
✓ Element Combinations — Create new acids/bases
✓ Synthesis Analysis — How to make them
✓ Natural Language Q&A — Ask anything
AB-AD is ready to use!
python ab_ad_qa.py
AB-AD Safety Levels
AB-AD Safety Levels
9 Safety Zones with danger indicators, first aid, and protective equipment (PPE) requirements.
Safety Zones at a Glance
Detailed Safety Zones
EXTREME DANGER (pH 0-2)
Do Not Touch - Seek Immediate Medical Help
- Effects: Severe burns, life-threatening
- Contact: IMMEDIATELY flush with water for 15+ minutes, seek emergency care
- Ingestion: FATAL - Do not ingest under any circumstances
- PPE: Full protective gear required (gloves, apron, eye protection, face shield)
- Examples: Battery acid, concentrated HCl, stomach acid
- First Aid:
1. Do NOT remove contaminated clothing initially
2. Flush affected area with water for 15-20 minutes continuously
3. Call emergency services (911) IMMEDIATELY
4. Remove contaminated clothing ONLY after flushing
5. Cover burns with clean, dry cloth
6. DO NOT apply ice, ointments, or home remedies
SEVERE DANGER (pH 2-3)
Corrosive - Chemical Burns Risk
- Effects: Chemical burns, tissue damage
- Contact: Flush immediately with water, seek medical attention
- Ingestion: TOXIC - Can cause severe internal burns
- PPE: Gloves, eye protection, apron required
- Examples: Strong acids (HCl, HNO₃), some cleaning solutions
- First Aid:
1. Flush with water immediately for 5-15 minutes
2. If pain persists, seek medical attention
3. Remove contaminated clothing
4. Cover with clean cloth
5. If swallowed: Do NOT induce vomiting, seek medical help
DANGER (pH 3-5)
Acidic - Burns with Prolonged Contact
- Effects: Burns skin and eyes with prolonged contact
- Contact: Wash thoroughly with water if contacted
- Ingestion: Can cause gastrointestinal irritation
- PPE: Gloves recommended, avoid eye contact
- Examples: Vinegar, citric acid solutions, weak acids
- First Aid:
1. Rinse affected area with water
2. If eye contact: Flush with water for at least 5 minutes
3. If ingested in small amounts: Rinse mouth with water, drink water
4. Monitor for symptoms
CAUTION (pH 5-6)
Mildly Acidic - Minimal Risk
- Effects: Minimal risk with normal handling
- Contact: Generally safe, wash hands after use
- Ingestion: Generally safe in normal amounts
- PPE: Standard hygiene practices sufficient
- Examples: Coffee, weak acidic beverages, slightly acidic foods
- First Aid: Normal hygiene - just wash with soap and water
SAFE (pH 6-8)
NEUTRAL - SAFE FOR HUMAN CONTACT
- Effects: Safe for skin contact
- Contact: Safe to handle directly
- Ingestion: Safe in normal amounts
- PPE: None required
- Examples: Pure water, milk, blood, human saliva
- Notes: This is the optimal range for human exposure
CAUTION (pH 8-9)
Mildly Basic - Minimal Risk
- Effects: Minimal risk with normal handling
- Contact: Generally safe, wash hands after use
- Ingestion: Generally safe in normal amounts
- PPE: Standard hygiene practices sufficient
- Examples: Baking soda solution, sea water
- First Aid: Normal hygiene - just wash with soap and water
DANGER (pH 9-11)
Caustic - Burns Risk
- Effects: Burns skin and eyes, can cause tissue damage
- Contact: Flush with water immediately if contacted
- Ingestion: Can cause burns to mouth and throat
- PPE: Gloves recommended, avoid eye contact, eye protection
- Examples: Ammonia, diluted bleach, some cleaners
- First Aid:
1. Flush with water immediately
2. If eye contact: Flush with water for at least 5-10 minutes
3. If ingested: Rinse mouth, seek medical help
4. Monitor for symptoms
SEVERE DANGER (pH 11-13)
Highly Corrosive - Severe Burns
- Effects: Chemical burns, severe tissue damage
- Contact: Flush with water for 15+ minutes, seek medical attention
- Ingestion: HIGHLY TOXIC - Causes internal burns
- PPE: Full protective gear, gloves, eye protection, apron
- Examples: Bleach, ammonia cleaners, diluted lye
- First Aid:
1. Flush with water for 15+ minutes
2. Call medical professional
3. Remove contaminated clothing
4. Cover with clean cloth
5. For eye contact: Flush for 15+ minutes, seek emergency care
6. If swallowed: Seek IMMEDIATE emergency care, do NOT induce vomiting
EXTREME DANGER (pH 13-14)
Do Not Touch - Seek Immediate Medical Help
- Effects: Immediate severe burns, life-threatening
- Contact: IMMEDIATELY flush with water for 15+ minutes, emergency care
- Ingestion: FATAL - Do not ingest
- PPE: Full protective gear required at all times
- Examples: Concentrated lye (NaOH), concentrated KOH solutions
- First Aid:
1. Do NOT remove contaminated clothing initially
2. Flush affected area with water for 15-20 minutes continuously
3. Call emergency services (911) IMMEDIATELY
4. Remove contaminated clothing ONLY after flushing
5. Cover burns with clean, dry cloth
6. DO NOT apply ice or ointments
Real-World Examples with Safety Zones
Safe Zone (Green)
- Pure water (pH 7.0)
- Milk (pH 6.0)
- Blood (pH 7.1-7.4)
- Saliva (pH 6.5)
Caution Zone (Yellow)
- Coffee (pH 5.0)
- Baking soda solution (pH 8.3)
- Sea water (pH 8.0)
Danger Zone (Orange)
- Vinegar (pH 2.0)
- Cola (pH 3.0)
- Orange juice (pH 3.5)
- Aspirin solution (pH 3.8)
- Ammonia cleaner (pH 11.5)
Severe Danger (Red)
- Lemon juice (pH 1.5)
- Bleach (pH 13.0)
- Drain cleaner (pH 13.5)
Extreme Danger (Dark Red) ⛔
- Battery acid (pH 0.5)
- Liquid lye (pH 14.0)
PPE (Personal Protective Equipment) Guide
All Charts Now Include Safety Levels!
Open ph_scale.html to see:
- ✅ Safety Zone Colors (green/yellow/red)
- ✅ Real-world Examples with safety labels
- ✅ First Aid Guide for each exposure type
- ✅ PPE Requirements by pH
AB-AD Safety Policy & Gatekeeper
AB-AD Safety Policy & Gatekeeper
STRICT OPIOID AND ILLICIT DRUG BLOCKING WITH SUPERVISION REQUIREMENTS
Policy Overview
Core Rule
OPIOID SYNTHESIS → REFUSED ❌ (unless supervised) ILLICIT DRUG SYNTHESIS → REFUSED ❌ (unless supervised) ALL OTHER LEGITIMATE CHEMISTRY → ALLOWED ✅
What Gets BLOCKED
TIER 1: OPIOID SYNTHESIS (ALWAYS BLOCKED)
❌ Morphine synthesis ❌ Heroin production (diacetylmorphine) ❌ Fentanyl synthesis procedures ❌ Carfentanil production ❌ Codeine/hydrocodone/oxycodone synthesis ❌ Opium alkaloid extraction ❌ Any opioid precursor procedures
TIER 2: ILLICIT DRUG SYNTHESIS (ALWAYS BLOCKED)
❌ Cocaine synthesis ❌ Methamphetamine cook procedures ❌ LSD/psilocybin synthesis ❌ MDMA/ecstasy production ❌ Ketamine synthesis ❌ PCP production ❌ Any controlled substance manufacture
What Gets ALLOWED ✅
TIER 1: PHARMACEUTICAL CHEMISTRY
✅ Aspirin synthesis ✅ Acetaminophen production ✅ Ibuprofen synthesis ✅ Common OTC medications ✅ Cessation medications (naltrexone, buprenorphine) ✅ FDA-approved drug synthesis
TIER 2: LEGITIMATE PRECURSOR CHEMISTRY
✅ Salicylic acid synthesis ✅ Acetic anhydride production (for legal purposes) ✅ Chemical precursors for non-narcotics ✅ Pharmaceutical intermediates ✅ General organic chemistry reactions
TIER 3: ALCHEMY & COMPOUND CREATION
✅ Element combinations ✅ Transformation reactions ✅ Chemical formulas ✅ Historical alchemy procedures ✅ Non-narcotic compound synthesis
Supervision & Access Control
WITHOUT SUPERVISION (Default)
Content Check: ┌─ Opioid keywords? → BLOCK & REFUSE
├─ Illicit drug keywords? → BLOCK & REFUSE
└─ Safe compound? → DISPLAY ✅
Output: "BLOCKED_CONTENT - Contact supervisor"
Log: All attempts recorded with timestamp
WITH SUPERVISION (Authorized)
Content Check: ┌─ Authorization token provided? ✅
├─ Token valid? ✅
└─ Content blocked? (now displayable with log)
Output: Content displayed (but logged as supervised access)
Log: Full audit trail with supervisor token hash
Access Requirements
To Enable Supervised Mode
Required:
1. Authorization token (provided by supervisor only)
2. Explicit reason for access
3. All access logged with timestamp & supervisor hash
Example:
gk.set_supervision(
token="AUTHORIZED_SUPERVISOR_TOKEN_XXXXX",
reason="DEA-authorized pharmaceutical research - Project #12345"
)
Audit Logging
Every access attempt is logged:
[2026-07-07T17:59:10] CONTENT_BLOCKED: Morphine Synthesis Procedure [2026-07-07T17:59:10] Category: OPIOID_SYNTHESIS [2026-07-07T17:59:10] Supervised: NO [2026-07-07T17:59:10] Action: REFUSED - Contact supervisor [2026-07-07T17:59:11] SUPERVISION_ENABLED [2026-07-07T17:59:11] Reason: DEA-authorized research [2026-07-07T17:59:11] Token Hash: a7f3c2b9d1e4... [2026-07-07T17:59:12] BLOCKED_CONTENT_DISPLAYED_SUPERVISED [2026-07-07T17:59:12] Compound: Morphine Synthesis Procedure [2026-07-07T17:59:12] Category: OPIOID_SYNTHESIS [2026-07-07T17:59:12] Supervisor: a7f3c2b9d1e4...
Implementation
Safety Gatekeeper Class
from ab_ad_safety_gatekeeper import SafetyGatekeeper
# Initialize
gk = SafetyGatekeeper()
# Process compounds
safe_compounds, blocked_compounds = gk.load_and_filter_database(compound_list)
# Set supervision (authorized personnel only)
if authorized:
gk.set_supervision(token, reason)
# Generate audit report
report = gk.generate_audit_report()
# Log to file
gk.log_to_file()
Blocked Content Behavior
Without Supervision
Input: Morphine Synthesis Procedure
↓
Check: Contains "morphine synthesis"? YES
↓
Block & Return Error:
{
'error': 'BLOCKED_CONTENT',
'reason': 'OPIOID_SYNTHESIS procedure detected',
'compound': 'Morphine Synthesis Procedure',
'message': 'Cannot display without supervision',
'action': 'Contact supervisor for authorized access'
}
↓
Log: CONTENT_BLOCKED - timestamp, compound, category
With Supervision
Input: Morphine Synthesis Procedure
↓
Check: Supervision enabled? YES
Check: Valid token? YES
↓
Display Content (with flags)
{
'name': 'Morphine Synthesis Procedure',
'synthesis': '...',
'_ACCESS_LEVEL': 'SUPERVISED_ONLY',
'_CATEGORY': 'OPIOID_SYNTHESIS'
}
↓
Log: BLOCKED_CONTENT_DISPLAYED_SUPERVISED
Supervisor token hash: a7f3c2b9d1e4...
Integration with AB-AD
Charts Will Not Display Blocked Content
- Blocked compounds excluded from pH scale
- Blocked reactions not shown in reaction charts
- Error message shown if blocked content encountered
Database Integration
Load Compounds
↓
[Safety Gatekeeper]
├─ Safe compounds → Include in AB-AD ✅
├─ Blocked (no supervision) → Refuse ❌
└─ Blocked (supervised) → Include with flags ⚠️
↓
Generate Charts
Audit Trail Example
BLOCKED COMPOUNDS: 1. Morphine Synthesis Procedure [OPIOID_SYNTHESIS] 2. Fentanyl Production Guide [OPIOID_SYNTHESIS] 3. Methamphetamine Cook [ILLICIT_DRUG_SYNTHESIS] 4. LSD Synthesis [ILLICIT_DRUG_SYNTHESIS] ACCESS ATTEMPTS: [17:59:10] CONTENT_BLOCKED: Morphine (no supervision) [17:59:11] SUPERVISION_ENABLED (token provided) [17:59:12] BLOCKED_CONTENT_DISPLAYED_SUPERVISED: Morphine [17:59:13] BLOCKED_CONTENT_DISPLAYED_SUPERVISED: Fentanyl SAFE COMPOUNDS PROCESSED: ✅ Aspirin synthesis ✅ Acetaminophen production ✅ Buprenorphine (cessation med) ✅ Standard pharmaceutical chemistry
POLICY SUMMARY
AB-AD Safety Policy Enforced: Zero Tolerance for Unsupervised Opioid/Illicit Drug Access
Acid/Base Discovery Module
Acid/Base Discovery Module
Advanced acid and base discovery system integrated with your federated alchemy database.
What It Does
Automatically discovers, categorizes, and helps you create:
- ✅ Strong Acids (pH < 3) - H₂SO₄, HCl, HNO₃, etc.
- ✅ Weak Acids (pH 3-7) - Acetic acid, Formic acid, etc.
- ✅ Strong Bases (pH > 11) - NaOH, KOH, etc.
- ✅ Weak Bases (pH 7-11) - Ammonia, Pyridine, etc.
- ✅ Buffer Solutions - Find acid/base pairs for target pH
Quick Start
1. Initialize
python setup_acid_base.py
Adds 10 new columns to B1 compounds database:
pka_value/pkb_value— Dissociation constantsacid_base_type— "Strong Acid", "Weak Base", etc.acidity_strength— 0-10 scaleproton_donor/proton_acceptor— Boolean flags- And more...
2. Populate Sample Data
python populate_acids_bases.py
Adds 16 real acids and bases to test with.
3. Interactive Q&A
python qa_engine_acid_base.py
Questions You Can Ask
Python API
from acid_base_discovery import AcidBaseDiscovery
discovery = AcidBaseDiscovery()
# Find strong acids
acids = discovery.find_strong_acids(min_probability=0.7)
for acid in acids:
print(f"{acid['formula']} - pH {acid['ph_level']:.1f}")
# Find strong bases
bases = discovery.find_strong_bases(min_probability=0.7)
# Discover from elements
combos = discovery.discover_from_elements(['H', 'S', 'O'])
# Buffer candidates
buffers = discovery.find_buffer_candidates(target_ph=7.0)
# Synthesis difficulty
synthesis = discovery.analyze_synthesis_difficulty("H2SO4")
print(f"Methods: {synthesis['num_methods']}")
print(f"Average success: {synthesis['average_success_rate']:.1%}")
Database Schema Additions
B1 (Compounds) - New Columns
pka_value REAL -- Acid dissociation constant pkb_value REAL -- Base dissociation constant acid_base_type TEXT -- "Strong Acid" / "Weak Base" / etc. acidity_strength REAL -- 0-10 scale conjugate_pair TEXT -- Paired acid/base proton_donor BOOLEAN -- Can donate H⁺? proton_acceptor BOOLEAN -- Can accept H⁺? buffer_capacity REAL -- Buffering ability dissociation_constant REAL -- Ka or Kb value discovered_date TIMESTAMP -- When added
Example Workflow
Find Sulfuric Acid Equivalents
discovery = AcidBaseDiscovery()
# 1. Find strong acids
strong = discovery.find_strong_acids()
# 2. Filter for synthesizable ones
for acid in strong:
synthesis = discovery.analyze_synthesis_difficulty(acid['formula'])
if synthesis['synthesizable']:
print(f"{acid['formula']}: {synthesis['num_methods']} methods")
# 3. Get synthesis steps
methods = discovery.fed.get_synthesis_methods("H2SO4")
for method in methods:
print(f" {method['method']}: {method['success_rate']:.0%}")
Create a pH 7 Buffer
# Find acid/base pairs that buffer at pH 7
buffers = discovery.find_buffer_candidates(7.0, range_width=1.0)
for buf in buffers[:3]:
print(f"{buf['acid']['formula']} + {buf['base']['formula']}")
print(f" Buffer pH: {buf['buffer_ph']:.1f}")
Discover New Bases from Elements
# What bases can we make from nitrogen and hydrogen?
combos = discovery.discover_from_elements(['N', 'H'], min_probability=0.7)
bases_only = [c for c in combos if c['is_base']]
for base in bases_only:
print(f"{base['formula']} - pH {base['ph']:.1f} (synergy: {base['synergy']:.1f}x)")
Files
Discovery Methods
1. Strong Acids (find_strong_acids())
- Filters: pH < 3, high probability
- Returns: Ranked by strength + probability
- Use: Industrial processes, research
2. Weak Acids (find_weak_acids())
- Filters: pH 3-7, acid type
- Returns: With pKa values
- Use: Buffers, laboratory work
3. Strong Bases (find_strong_bases())
- Filters: pH > 11, high probability
- Returns: Ranked by strength
- Use: Industrial, cleaning
4. Weak Bases (find_weak_bases())
- Filters: pH 7-11, base type
- Returns: With pKb values
- Use: Buffers, extractions
5. Element Combinations (discover_from_elements())
- Given: Element list (e.g., H, S, O)
- Returns: All possible acids/bases
- Use: Synthesis discovery
6. Buffers (find_buffer_candidates())
- Given: Target pH
- Returns: Acid/base pairs
- Use: Lab preparation
Example Results
Strong Acids Found
H2SO4 (Sulfuric Acid) pH: 0.1 | Strength: 9.0/10 | Prob: 95% HCl (Hydrochloric Acid) pH: 0.5 | Strength: 9.0/10 | Prob: 98% HNO3 (Nitric Acid) pH: 0.8 | Strength: 9.0/10 | Prob: 92%
Weak Acids Found
CH3COOH (Acetic Acid) pH: 2.4 | Strength: 6.0/10 | pKa: 4.76 HCOOH (Formic Acid) pH: 2.3 | Strength: 6.1/10 | pKa: 3.75 H2CO3 (Carbonic Acid) pH: 3.6 | Strength: 5.4/10 | pKa: 6.35
Buffer Candidates (pH 7.0)
CH3COOH + CH3COO⁻ (Acetate) Buffer pH: 6.86 H2PO4⁻ + HPO4²⁻ (Phosphate) Buffer pH: 7.21 NH4⁺ + NH3 (Ammonium) Buffer pH: 9.25
Next Steps
1. Explore acids/bases:
python qa_engine_acid_base.py
2. Load more data:
python federated_loader.py
3. Integrate into research:
from acid_base_discovery import AcidBaseDiscovery discovery = AcidBaseDiscovery() # Use in your own analysis
4. Extend functionality:
- Add more acid/base properties
- Implement pKa prediction models
- Create synthesis planning algorithms
Acid/Base Discovery Ready! Start asking questions.
Alchemy Acid-Base Integration Summary
Alchemy Acid-Base Integration Summary
Date: 2026-07-07
Status: COMPLETE | Extraction Successful | 40 Compounds Integrated
What Was Done
Source: Alchemy Data (Project 41)
Extracted chemical compound data from alchemy database and classified by acid-base properties.
Data Extracted
- Total Compounds: 40
- Acidic Compounds: 14 (35%)
- Neutral Compounds: 26 (65%)
- Basic Compounds: 0 (0%)
- Export Format: JSON (17.3 KB, 602 lines)
Acid-Base Classification
Acidic Compounds (14 | 35%)
Elements containing P (phosphorus) or S (sulfur) classified as acidic Examples: 1. ArCHS (Quaternary Gas Mixture) - Weak acid Elements: Ar+C+H+S Uses: Excimer laser, discharge lighting, fuel-cell fluid Cost: $1/kg Hazards: Asphyxiant 2. ArHNS (Quaternary Gas Mixture) - Weak acid Elements: Ar+H+N+S Uses: Excimer laser, discharge lighting, fuel-cell fluid Cost: $1/kg Hazards: Asphyxiant 3. CFeSZn (Quaternary Functional Compound) - Weak acid Elements: C+Fe+S+Zn Uses: Functional materials R&D Cost: $1/kg
Total: 14 acidic compounds (gases, functional compounds, solvents)
Neutral Compounds (26 | 65%)
Elements without acidic/basic properties, or balanced Examples: 1. ArCHN (Quaternary Gas Mixture) - Neutral Elements: Ar+C+H+N Uses: Excimer laser, discharge lighting 2. FeSiZn (Ternary Intermetallic) - Neutral Elements: Fe+Si+Zn Uses: Semiconductor, photovoltaic, hardfacing 3. BCuZn (Ternary Intermetallic) - Neutral Elements: B+Cu+Zn Uses: Hardfacing, cutting-tool composite
Total: 26 neutral compounds (gases, intermetallics)
Basic Compounds (0 | 0%)
No basic compounds found in the extracted alchemy data sample.
Files Generated
1. alchemy_acid_base_extractor.py (Core Tool)
- Python script to extract and classify alchemy compounds
- Classification algorithm based on element properties
- JSON export functionality
- Report generation
- Visualization output
2. alchemy_acid_base_export.json (Exported Data)
- 40 compounds in AB-AD compatible format
- Contains: name, formula, type, strength, elements, cost, hazards, uses, novelty, probability
- Ready for integration into AB-AD database
- File size: 17.3 KB
- Format: JSON array
3. ALCHEMY_ACID_BASE_INTEGRATION_SUMMARY.md (This File)
- Summary of extraction and integration
- Compound classifications
- Data analysis
- Integration results
Integration with AB-AD System
How It Works
Alchemy Data (Project 41)
├─ clean_gass_top10.csv
├─ clean_metals_top10.csv
├─ clean_objects_top10.csv
└─ clean_solvents_top10.csv
↓
Extraction Algorithm
├─ Parse CSV files
├─ Extract elements
├─ Classify as acidic/basic/neutral
└─ Generate metadata
↓
JSON Export
├─ 40 compounds
├─ AB-AD compatible format
└─ Ready for database integration
↓
AB-AD System Integration
├─ Add to compound database
├─ Include in charts
├─ Position on pH scale (estimated)
└─ Make available for synthesis procedures
Export Format (JSON)
{
"name": "ArCHS (Quaternary Gas Mixture)",
"formula": "H(CSAr)",
"type": "acidic",
"strength": "weak",
"elements": ["Ar", "C", "H", "S"],
"cost": "$1/kg",
"availability": "1",
"hazards": "asphyxiant",
"uses": "excimer laser / discharge lighting; fuel-cell working fluid",
"novelty": "6.90",
"probability": "0.0001",
"source": "alchemy_41",
"compound_type": "Alchemy Compound"
}
Compound Types Discovered
Compound Categories
- Gas Mixtures: Quaternary (4-element), Ternary (3-element), Binary (2-element)
- Functional Compounds: Semiconductor, photovoltaic, hardfacing applications
- Intermetallics: Multi-metal combinations for composite applications
- Solvents: Research-grade and industrial applications
Applications
- Excimer laser systems
- Discharge lighting
- Fuel-cell working fluids
- Semiconductor manufacturing
- Photovoltaic systems
- Hardfacing materials
- Cutting-tool composites
- Photonic/chalcogenide glass
- Functional materials R&D
Integration Results
Statistics
Total Alchemy Compounds Extracted: 40 - Acidic: 14 (35%) - Basic: 0 (0%) - Neutral: 26 (65%) Element Frequencies: - Ar (Argon): 10 compounds - C (Carbon): 10 compounds - H (Hydrogen): 10 compounds - S (Sulfur): 8 compounds - N (Nitrogen): 7 compounds - P (Phosphorus): 6 compounds - Zn (Zinc): 6 compounds - Fe (Iron): 6 compounds - Cu (Copper): 4 compounds - Si (Silicon): 4 compounds - B (Boron): 3 compounds Cost Range: $1-3 per kg Availability: 1-7 on 0-10 scale Novelty Scores: 3.7-7.7 Probability: 0.0001-0.01
Next Steps (Optional)
To Further Integrate:
1. Estimate pH Values
- Use element properties to estimate pH
- Add to AB-AD pH scale
2. Calculate Safety Zones
- Classify by hazard level
- Add to safety zones (1-9)
3. Generate Synthesis Procedures
- If synthesis methods exist for these compounds
- Add to compound creation database
4. Create Charts
- Visualize alchemy compounds on pH scale
- Show acid-base distribution
- Add to interactive charts
5. Expand Data Set
- Extract from all alchemy CSV files (not just top 10)
- Include more compound categories
- Build comprehensive alchemy chemistry database
✅ Verification
Quality Checks
- [x] Extraction successful (40 compounds)
- [x] Classification algorithm working
- [x] JSON export valid (17.3 KB, 602 lines)
- [x] All required fields populated
- [x] No data loss during conversion
- [x] Ready for AB-AD integration
Data Integrity
- [x] All compound names preserved
- [x] All formulas intact
- [x] Element lists complete
- [x] Properties maintained
- [x] Uses/applications documented
- [x] Hazard information included
Technical Details
Extraction Algorithm
1. Read CSV files from alchemy data
2. Parse chemical formulas
3. Extract element lists
4. Classify by element properties
5. Assign acid-base type
6. Determine strength level
7. Generate metadata
8. Export to JSON
Classification Rules
- Acidic: Contains P or S (>1 acidic element)
- Basic: Contains Na, K, Ca, Mg, Li (>1 basic element)
- Neutral: No acidic or basic elements, or balanced
- Strength: Determined by number of acidic/basic elements
Data Sources
- Project 41: Alchemy Data Three
- Database: 07-alchemy-probability-data/blueprints/
- Files: CSV format (gases, metals, objects, solvents)
How To Use
View Exported Data
# Open JSON file
cat alchemy_acid_base_export.json
# Parse in Python
import json
with open('alchemy_acid_base_export.json') as f:
compounds = json.load(f)
Integrate Into AB-AD
from alchemy_acid_base_extractor import AlchemyAcidBaseExtractor
extractor = AlchemyAcidBaseExtractor()
extractor.load_all_alchemy_data()
ab_ad_compounds = extractor.export_for_ab_ad()
# Use in AB-AD system
for compound in ab_ad_compounds:
print(f"{compound['name']}: {compound['type']}")
Extend with More Data
# Extract more compounds (modify CSV files list) python alchemy_acid_base_extractor.py # Update to include all alchemy files # (not just top 10)
Summary
Alchemy Data (Project 41) successfully integrated with AB-AD Acid-Base system.
- 40 compounds extracted from alchemy database
- Classified by acid-base properties (35% acidic, 65% neutral)
- JSON exported for AB-AD integration
- Ready for use in compound creation system
- Expandable to larger dataset
Alchemy Acid-Base Integration Complete ✓
Generated: 2026-07-07
Tool: alchemy_acid_base_extractor.py
Export: alchemy_acid_base_export.json (40 compounds)
This archive contains 26 documents; 16 more beyond this preview. The complete folder ships as the product.