Responsibility: Implements strict data contracts and Pydantic schemas (app/layer1_schemas/base.py). Rejects unapproved payloads or non-compliant agent names prior to network routing.
Engine: FastAPI / Uvicorn running an Application Factory pattern (create_app()).
Responsibility: Handles high-concurrency API request routing, security middleware execution, input sanitization, and structured payload processing.
Layer 3: Orchestration, Commit DAG & Metered Gateway
Engine: SQLite/PostgreSQL State Stores, Native GeminiWorker integration, Model Context Protocol (MCP) tool registries, and Redis hot-path metering.
Responsibility: Governs agent decision loops, enforces the Commit DAG (Directed Acyclic Graph) for execution lineage, manages BYOK (Bring Your Own Key) routing, and handles real-time token/usd metering.
Engine: HMAC-SHA256 Signer (app/layer4_crypto/signer.py) and Treasury Gates (app/layer4_ledgers/treasury.py).
Responsibility: Signs and verifies all request envelopes; enforces hard spending ceilings ($50.00 single-transaction limit) to prevent runaway autonomous agent costs.
Engine: OpenTelemetry standards, immutable JSON-Lines (audit_log.jsonl), and PostgreSQL audit logs.
Responsibility: Captures UTC timestamped trace events, execution latencies, and output quality checks across all system transitions.
3. Dendro Taxonomy Enforcement Matrix
Agent identity across all system layers is strictly validated at Layer 1 using soft prefix matching (@field_validator("agent_name")). Agent names must begin with an approved prefix followed by a hyphen or underscore (e.g., sapling_01, resin-gate).
Dendro Tier
Operational Role
Execution Authority
Side-Effect Constraints
Seedling
Intake & Parsing
Read-only input sanitization and schema parsing
Zero write privileges
Sapling
Task Decomposition
Route planning and breaking goals into DAG nodes
Orchestration only; no external API execution
Cambium
Worker Execution
Data transformation, internal tool execution
Scoped database writes (isolated by organization_id)
Resin
Security & Treasury
HMAC sign-off, x402 spending gate evaluation
Hard ceiling ($50.00 USD max per transaction)
Heartwood
Commit & State Sync
DAG node locking, Knowledge Graph state commit
Full audit log write access
Ancient
Long-Term Memory
Historical retrieval and global state context
Read-only graph state queries
Krummholz
Edge Operations
Local worker execution in constrained environments
Restricted local capability scope
4. Subsystem Specifications
A. The Commit DAG Engine (Task Lineage)
Commit Nodes (commit_nodes): Every sub-task execution generates an immutable commit record holding parent commit pointers (parent_ids), deterministic SHA-256 state hashes, agent roles, and input/output payloads.
Commit Edges (commit_edges): Links parent execution nodes to child nodes.
State Rollback: If a downstream worker fails, the system rewinds state to the last valid parent commit hash without corrupting database integrity.
B. Metered Gateway & BYOK Architecture
API Key Security: Machine-to-machine tokens (bcl_...) are authenticated via SHA-256 hashes (key_hash). Plaintext keys are never stored.
Metering Engine: Redis Lua scripts (METER_LUA) atomically track rate limits (Requests Per Minute) and execute micro-cent balance deductions (INCRBYFLOAT with negative cost deltas) in under 1ms.
BYOK Support: Tenants can supply custom LLM keys (custom_llm_key), bypassing Master Gateway charges while maintaining telemetry logging.
C. Hardware-Isolated Automated USDC Sweeper Daemon
AWS KMS Signing Engine (kms_signer.py): Uses an AWS KMS HSM key (us-west-2, bristlecone-sweeper-bot) to sign Base L2 transactions without ever exposing private keys on disk or in memory. Converts ASN.1 DER signatures to EIP-2 canonical format with $v$ recovery value calculation.
Sweeper Daemon (sweeper_daemon.py): Polls Base L2 RPC nodes every 10 seconds, checks hot-wallet USDC balance (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), verifies native ETH gas reserves, constructs raw ERC-20 transfer payloads (0xa9059cbb), and routes sweeps directly to corporate custody.
System Daemon (bristlecone-sweeper.service): Runs asynchronously under systemd with auto-restart and journalctl logging. Operated in DRY_RUN_MODE = True during pre-deployment verification.
July 20, 2026: Blueprinting & Core 5-Layer Baseline
Baseline Setup: Initialized the isolated environment using uv, established pyproject.toml, locked core dependencies, and configured AGENTS.md.
Layer 1 Taxonomy Locking: Built prefix validation rules rejecting rogue agent names (422 Unprocessable Entity) while permitting valid Dendro prefixes.
Treasury Gate Test: Verified pre-execution rejection of a simulated $150.00 transaction due to breaching the $50.00 single-transaction hard limit.
July 21, 2026: Zero-Trust Defense & Cryptographic Payload Signing
HMAC-SHA256 Engine: Implemented PayloadSigner in app/layer4_crypto/signer.py using canonical JSON serialization (sort_keys=True) and hmac.compare_digest for constant-time validation.
Tamper Probe: Intercepted valid payloads, modified body attributes, and verified immediate 403 Forbidden rejections at Layer 2.
Durable Telemetry: Implemented append-only JSONL logging (audit_log.jsonl) across all state graph transitions.
July 22, 2026: Externalized Secrets, Tool Gating & Streamlit UI
Tool Execution Gating: Deployed tool_gater.py enforcing dual-gate checks (explicit tool whitelist + HMAC signature) before executing function calls.
Control Panel & Daemon: Created Streamlit frontend (dashboard.py) connected to FastAPI; mounted bristlecone-logic.service background daemon under systemd.
July 23, 2026: SQLite Persistence & Native Gemini Worker Integration
SQLite State Engine: Built SQLiteStateStore (state_store.py) to manage local task execution state and audit logging offline.
Native Gemini Worker: Encapsulated GeminiWorker (gemini-flash-latest) inside Layer3Orchestrator, translating natural language intent directly into structured, schema-compliant tool parameters.
July 24, 2026: Containerization & Zero-Trust Pipeline Verification
Multi-Stage Dockerfile: Packaged the core microservice engine into isolated Docker containers (bristlecone_m2m_engine).
Security & Middleware Hardening: Integrated payload size limits (1MB cap), API key verification dependencies, and CORS/TrustedHost middleware.
July 26, 2026: VPS Deployment & PostgreSQL Schema Baseline
Cloud Infrastructure: Deployed production container stack to Vultr VPS (bristlecone-prod-1, IP: 45.76.245.124) using Docker Compose behind an Nginx reverse proxy.
Database Relational Setup: Initialized PostgreSQL 16 database (bristlecone_db) using SQLAlchemy 2.0 and Alembic migrations.
July 27, 2026: Multi-Tenant Context & JWT Refactoring
JWT Claims Integration: Updated authentication handlers to encode organization_id directly as org_id inside JWT tokens.
Tenant Isolation: Enforced tenant-scoped query filters across /users, /projects, and /organizations endpoints.
July 28, 2026: Commit DAG Engine & Admin API Stack
DAG Services & API: Deployed /api/v1/dag endpoints for creating commit nodes, linking parent dependencies, and retrieving graph lineages.
July 30, 2026: Metered Gateway, BYOK Schema & Automated Sweeps
Metering Schema: Provisioned tenants, api_keys, and llm_usage_ledger tables with NUMERIC(12, 6) precision.
Background Sweeper: Configured system cron (/etc/cron.d/bristlecone-sweep) executing automated low-balance checks every 15 minutes.
July 31, 2026: Concurrency Optimization & System Benchmarking
Swarm Benchmark: Executed 150-request load test (50 concurrent workers) achieving a 100% processing success rate (136 metered HTTP 200s, 14 rate-limited HTTP 429s, 0 connection drops) and exact balance reconciliation.
August 1, 2026: AWS KMS HSM Signer, Base L2 USDC Sweeper & KYB Submission
AWS KMS HSM Provisioning: Configured AWS KMS key in us-west-2 (ECC_SECG_P256K1) linked to restricted IAM identity bristlecone-sweeper-bot. Derived operational signing hot wallet address 0x1B4309CFdbCEee7618a7fBDc5b145691F9246D67.
Offline Signer Engine (kms_signer.py): Implemented raw ASN.1 DER signature parsing, EIP-2 low-S canonicalization, and offline EIP-1559 transaction building to sign Base L2 transactions without storing private keys locally.
Base L2 USDC Sweeper Daemon (sweeper_daemon.py): Constructed automated background service polling Base L2 (Chain ID 8453) for native USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), managing ETH gas threshold checks, and executing automated contract transfers.
Systemd Mounting & Git Synchronization: Deployed bristlecone-sweeper.service daemon in DRY_RUN_MODE = True. Staged, committed, and pushed full codebase to GitHub (Bristlecone2026/bristlecone-logic, commit 95cc197).
Coinbase Business KYB Onboarding Submission: Formally submitted corporate onboarding documentation to Coinbase Business. Completed W-9 tax self-certification (Single-Member LLC / Disregarded Entity) and attached official state-stamped Idaho Certificate of Organization (B1137-4347.pdf, File # 0006897706, filed July 13, 2026). System flagged application for standard manual compliance review.
9. Current Deployment Status, KYB Clearance & Operational Monetization Roadmap
As of August 1, 2026, the core technical infrastructure of Bristlecone Logic LLC is 100% complete, hardened, and running on production hardware. The 5-layer zero-trust API microservice engine is containerized and deployed on the Vultr VPS (bristlecone-prod-1), supported by PostgreSQL 16 state storage, Redis hot-path metering, and an Nginx reverse proxy with keepalive connection pooling. On the financial security side, Layer 0 hardware key isolation is fully operational: AWS KMS in us-west-2 generates EIP-1559 transaction signatures, while sweeper_daemon.py stands ready under systemd control (bristlecone-sweeper.service). On the administrative side, all compliance documentation—including the IRS W-9 self-certification and the official state-stamped Idaho Certificate of Organization (B1137-4347.pdf, File # 0006897706)—has been submitted to Coinbase Business and is currently undergoing standard manual KYB review.
To move from the current production-ready state directly into live deployment and revenue ($$$) generation, the operational playbook consists of four immediate execution steps once Coinbase compliance clears:
Coinbase Business Account Activation & Vault Pair: Upon KYB approval, obtain the dedicated Base L2 USDC deposit address from the Coinbase Business portal and assign it to SWEEP_DESTINATION_ADDRESS within /opt/bristlecone/bristlecone-logic/.env.
Gas Reservoir Top-Up: Transfer $3.00–$5.00 worth of native Base ETH to operational hot wallet 0x1B4309CFdbCEee7618a7fBDc5b145691F9246D67 to maintain transaction gas reserves.
Arm Automated Sweeper: Update sweeper_daemon.py to set DRY_RUN_MODE = False and execute systemctl restart bristlecone-sweeper to begin real-time auto-routing of incoming USDC to corporate storage.
Endpoint Exposure & Commercial Onboarding: Provision commercial API keys (bcl_...) for early-adopter M2M clients and external autonomous agent swarms, exposing the metered FastAPI endpoints to collect pay-per-call USDC micro-payments that auto-settle directly into Mercury bank business accounts.
Building out a 6-layer zero-trust microservice engine with AWS KMS signing, Redis-metered rate limiting, and Base L2 treasury integration in less than two weeks is a major milestone. Having the infrastructure containerized, tested, and pushed to production on schedule gives us a rock-solid foundation to build on.
When you're dealing with real money and autonomous agent execution, the operational plan and safety net are just as critical as the codebase itself.
Here is the blueprint for how we monitor, govern, and emergency-stop the system once we go live.
1. Monitoring Cadence & Health Checks
Operating a headless M2M engine requires a mix of automated background telemetry and brief manual audits.
Frequency
Target / Metric
Method / Tool
Operational Action
Real-time (24/7)
Container & Daemon Status
systemd watchdog + Docker Healthchecks
Auto-restarts failed services; emits system log alerts.
Ensure ETH balance at 0x1B43... stays above $2.00–$3.00 for gas fees.
Weekly (10 Mins)
Reconciliation & Ledger Audit
PostgreSQL llm_usage_ledger vs. Coinbase Ledger
Verify that micro-cent API usage matches off-chain credit balances and USDC sweeps.
2. Emergency Kill Switches (How to Stop It Immediately)
If something breaks, an RPC node drops, or abnormal agent activity occurs, you need immediate mechanisms to halt execution. We have three distinct circuit breakers:
Level 1: Daemon Halt (Stop Treasury Sweeps)
Scenario: Unusual Base network gas spikes or target vault address changes.
Execution: Run sudo systemctl stop bristlecone-sweeper.
Effect: Pauses on-chain automated USDC sweeps immediately. M2M API traffic continues operating normally, and USDC remains safely buffered in the hot-wallet contract.
Level 2: API Gateway Lockout (Stop M2M Ingress)
Scenario: Rogue agent swarm, unexpected code error, or prompt-injection attempt.
Execution: Toggle MAINTENANCE_MODE=True in /opt/bristlecone/bristlecone-logic/.env and reload, or pause Nginx (sudo systemctl stop nginx).
Effect: Rejects all incoming API requests at the door with an HTTP 503 response. Zero data transforms or LLM token expenses can occur.
Scenario: Server compromise or root access breach on the Vultr VPS.
Execution: Log into the AWS IAM Console and deactivate key AKIAZ6J5P3YSONVJZAOG.
Effect: Because private keys are stored in AWS KMS HSM hardware and never exist on the server disk or in memory, revoking the IAM credential instantly renders the server incapable of signing any on-chain transactions.
Runaway Agent Loop: The Layer 4 Treasury Gate hard-caps single transactions at $50.00, and the Redis Lua Metering Gate rate-limits requests per minute (RPM). An agent cannot drain credits in a runaway loop.
Bad Code Execution / Data Corruption: The Commit DAG Engine (commit_nodes and commit_edges) creates deterministic SHA-256 state hashes for every execution node. If a downstream worker fails, the system rewinds to the last valid parent commit without database corruption.
Once Coinbase completes their KYB review and we set up the live vault, we can walk through a full dry-run checklist together.
Which notification channel would you prefer to hook up first for automated real-time alerts (e.g., low gas balance, high error rates)—a Discord webhook, Telegram bot, or Twilio SMS?
Filed away, Josh. Separating personal and business accounts is essential to maintaining the corporate veil and protecting liability for Bristlecone Logic LLC.
Before executing live commands, we will audit and verify that every service is explicitly owned and billed under Bristlecone Logic LLC:
[x] AWS (KMS & Signing): Account under Bristlecone Logic LLC.
[x] Vultr (Server Infrastructure): Account under Bristlecone Logic LLC.
[x] GitHub (Repository Host): Account under Bristlecone Logic LLC.
[x] Coinbase Business: KYB application currently in final review for the LLC.
[ ] Google Cloud / AI Studio (API Key): Migrate from personal account to a dedicated Bristlecone Logic LLC Google Cloud project, attach the corporate Mercury Bank card for API usage billing, and issue a corporate GEMINI_API_KEY.
[ ] Chat Workspace Access (Conversational AI): Set up a Google Workspace account for Bristlecone Logic LLC (@bristlecone...) with Gemini integration so all strategic planning conversations, code reviews, and engine work remain securely under the corporate veil with enterprise data privacy.
Everything is logged. Once Coinbase finishes their review, we'll run through this checklist item by item to make sure every line of code, every API request, and every dollar is strictly stovepiped inside the LLC.
Seed Prompt for Use:
I am Joshua Simpson, founder of Bristlecone Logic LLC. We are operating strictly under the corporate veil for all infrastructure, system operations, and engineering discussions.
You are "Jim"—my direct, objective AI engineering collaborator. Your core operating guidelines:
1. Maintain an objective, peer-to-peer posture. Provide direct, grounded analysis, solutions, and technical feedback without fluff, sycophancy, or unnecessary apologies.
2. Maintain strict continuity across all project discussions, architectures, and strategies.
3. Remain objective, factual, and precise in all aspects of execution and planning.
PROJECT CONTEXT & SYSTEM ARCHITECTURE:
We are building and operating an automated 6-layer zero-trust M2M engine. Key parameters include:
- Infrastructure: AWS KMS (HSM transaction signing), Vultr cloud hosting, GitHub, Redis rate-limiting, and Base L2 execution.
- Telemetry & Alerting: Discord Webhook bridge for real-time alerts (Sweeps, Gas, Errors).
- Guardrails: $50 ETH operational runway/cap and a 3-tier emergency Kill-Switch strategy (Daemon halt, API Gateway lock, KMS revocation).
ATTACHED CONTEXT:
Below/Attached is our production Blueprint 3.0 markdown document outlining the complete system architecture, environment specifications, and operational workflows.
TASK:
Review this framework, adopt the persona of “Jim” (a play on Gemini) under these precise guardrails, and confirm you are fully initialized and ready to pick up execution for Bristlecone Logic LLC.
Pas encore de liste d'outils. Les serveurs distants en obtiennent une après le premier contrôle d'état.
FAQ
Questions
Comment installer Bristlecone Logic ?
Copiez sur cette page la configuration stdio pour Cursor, Claude Desktop, Claude Code ou VS Code. Elle utilise l'installation de l'éditeur, pas un proxy PlugMCP.
Bristlecone Logic nécessite-t-il une clé API ?
Aucune variable d'environnement requise n'est indiquée sur cette fiche.
Quel transport Bristlecone Logic utilise-t-il ?
Bristlecone Logic s'exécute en local via stdio.
Quand Bristlecone Logic a-t-il été vérifié pour la dernière fois ?
Dernière vérification : 2026-11-08. Micro-settled web content extraction and JSON schema validation utilities for AI agents via XRPL.