The ingest bridge pulls orders from real sources (Reddit, generic scrapers, retail APIs) and feeds them to Sovereign-OS so you can really take orders from the web.
- Reddit: PRAW-based; subreddits like
forhire,slavelabour; parses goal and optional $ amount. - Scraper: Any URL returning JSON or HTML; CSS selectors or JSON path for goal/amount.
- Retail: Shopify or WooCommerce; map new orders to goals (e.g. “Order #123: …”).
Two modes:
- Serve mode (default): Bridge runs an HTTP server. You set
SOVEREIGN_INGEST_URLto the bridge’s/jobsendpoint. Sovereign-OS polls it and enqueues jobs. - Post mode: Bridge has no server; it periodically fetches from sources and POSTs each new job to
SOVEREIGN_OS_URL/api/jobs.
pip install praw requests beautifulsoup4Reddit needs praw; scraper needs requests and beautifulsoup4 for HTML. Retail uses requests only.
Minimal serve mode (no sources – for testing with static JSON):
export BRIDGE_MODE=serve
export BRIDGE_PORT=9000
python -m sovereign_os.ingest_bridgeThen set Sovereign-OS:
export SOVEREIGN_INGEST_URL=http://localhost:9000/jobs?take=trueUse ?take=true so each poll consumes the buffer and jobs are not re-sent.
Reddit (serve mode):
export BRIDGE_MODE=serve
export BRIDGE_PORT=9000
export BRIDGE_REDDIT_ENABLED=true
export REDDIT_CLIENT_ID=your_client_id
export REDDIT_CLIENT_SECRET=your_client_secret
export REDDIT_USER_AGENT="SovereignOS-Bridge/1.0"
export REDDIT_SUBREDDITS=forhire,slavelabour
export BRIDGE_POLL_INTERVAL_SEC=60
export BRIDGE_DEDUP_WINDOW_SEC=3600
python -m sovereign_os.ingest_bridgePost mode (bridge POSTs directly to Sovereign-OS):
export BRIDGE_MODE=post
export SOVEREIGN_OS_URL=http://localhost:8000
export SOVEREIGN_OS_API_KEY=your_key_if_required
export BRIDGE_REDDIT_ENABLED=true
export REDDIT_CLIENT_ID=...
export REDDIT_CLIENT_SECRET=...
python -m sovereign_os.ingest_bridge| Variable | Description | Default |
|---|---|---|
BRIDGE_MODE |
serve or post |
serve |
BRIDGE_HOST |
Bind host (serve mode) | 0.0.0.0 |
BRIDGE_PORT |
Bind port (serve mode) | 9000 |
SOVEREIGN_OS_URL |
Sovereign-OS base URL (post mode) | http://localhost:8000 |
SOVEREIGN_OS_API_KEY |
API key for POST /api/jobs | (none) |
BRIDGE_POLL_INTERVAL_SEC |
How often to fetch from sources | 60 |
BRIDGE_DEDUP_WINDOW_SEC |
Don’t re-emit same source_id within this many seconds | 3600 |
BRIDGE_CONFIG_PATH |
Optional YAML overlay path | (none) |
| Variable | Description |
|---|---|
BRIDGE_REDDIT_ENABLED |
true to enable |
REDDIT_CLIENT_ID |
Reddit app client ID |
REDDIT_CLIENT_SECRET |
Reddit app client secret |
REDDIT_USER_AGENT |
User-Agent string |
REDDIT_SUBREDDITS |
Comma-separated, e.g. forhire,slavelabour |
REDDIT_LIMIT_PER_SUB |
New posts per subreddit per run |
REDDIT_MIN_SCORE |
Skip posts with score below this |
REDDIT_KEYWORDS_REQUIRED |
Comma-separated; post must contain one |
Create a Reddit “script” app at reddit.com/prefs/apps to get client ID and secret. Full Reddit setup (bridge + delivery + posting on r/forhire): REDDIT_SETUP_GUIDE.md.
| Variable | Description |
|---|---|
BRIDGE_SCRAPER_ENABLED |
true to enable |
BRIDGE_SCRAPER_URL |
URL to fetch (JSON or HTML) |
BRIDGE_SCRAPER_SELECTOR_GOAL |
CSS selector for goal (HTML) or leave empty for JSON |
BRIDGE_SCRAPER_SELECTOR_AMOUNT |
CSS selector for amount (HTML) |
BRIDGE_SCRAPER_SELECTOR_ID |
CSS selector for unique id (HTML) |
If the URL returns JSON, the bridge expects an array (or { "jobs": [...] }) of objects with goal or title/description, and optional amount_cents or amount.
| Variable | Description |
|---|---|
BRIDGE_RETAIL_ENABLED |
true to enable |
BRIDGE_RETAIL_PROVIDER |
shopify or woocommerce |
BRIDGE_RETAIL_API_URL |
Shopify: https://store.myshopify.com/admin/api/2024-01; Woo: store REST URL |
BRIDGE_RETAIL_API_KEY |
Shopify: Admin API access token; Woo: consumer_key:consumer_secret |
BRIDGE_RETAIL_STORE_DOMAIN |
Optional store domain |
-
GET /jobs?take=true
Returns a JSON array of{ goal, amount_cents, currency, charter }.
Iftake=true, returns the current buffer and clears it (recommended forSOVEREIGN_INGEST_URLso each job is only sent once). -
GET /health
Returns{ "status": "ok", "service": "ingest_bridge" }.
- Start the bridge (e.g.
python -m sovereign_os.ingest_bridge). - Start Sovereign-OS with:
SOVEREIGN_INGEST_URL=http://<bridge_host>:9000/jobs?take=trueSOVEREIGN_INGEST_INTERVAL_SEC=60(or your choice)SOVEREIGN_AUTO_APPROVE_JOBS=truefor full auto flow.
Jobs from Reddit/scraper/retail will then appear in the Job queue and run through CEO/CFO/permissions/delivery/Stripe as in DEMO_SCRIPT.md.
- Reddit: Respect Reddit API Terms and rate limits; use a proper user agent.
- Scraping: Respect robots.txt and site ToS; prefer official APIs when available.
- Retail: Use read-only or order-read scopes where possible; keep API keys in env only.