Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
488 changes: 475 additions & 13 deletions .heady_cache/secrets_state.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- HEADY_BRAND:BEGIN
<!-- ╔══════════════════════════════════════════════════════════════════╗
<!-- ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
<!-- ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
<!-- ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
<!-- ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
<!-- ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
<!-- ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
<!-- ║ ║
<!-- ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
<!-- ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
<!-- ║ FILE: CHANGES.md ║
<!-- ║ LAYER: root ║
<!-- ╚══════════════════════════════════════════════════════════════════╝
<!-- HEADY_BRAND:END
-->
# CHANGES
- **[ADDED]** `services/auth-session-server` implementation with Firebase auth logic placeholder.
- **[ADDED]** `services/search-service` implementation with true pgvector query implementations, removing stubs, implementing vector math scaling and query.
- **[ADDED]** `services/notification-service` structure.
- **[ADDED]** `services/analytics-service` structure.
- **[ADDED]** `services/billing-service` structure.
- **[ADDED]** `services/scheduler-service` structure.
- **[ADDED]** `services/migration-service` structure.
- **[ADDED]** `services/asset-pipeline` structure.
- **[MODIFIED]** `heady-manager.js` to enforce strict Content Security Policy (CSP) options using Helmet.
- **[MODIFIED]** `heady-manager.js` to enforce Fibonacci sliding windows rate limiting (max 233).
- **[MODIFIED]** `docker-compose.yml` to include NATS JetStream, PgBouncer, Prometheus, and Grafana.
- **[MODIFIED]** `docker-compose.yml` removed hardcoded secrets and updated to pull from `.env` environment variables using `$VARIABLE` substitution logic.
- **[ADDED]** `docs/adr/0001-architecture-decision.md` covering major design choices.
- **[ADDED]** `ERROR_CODES.md` with unique error codes and descriptions.
- **[ADDED]** `scripts/setup-dev.sh` with a script to scaffold the development environment.
31 changes: 31 additions & 0 deletions ERROR_CODES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- HEADY_BRAND:BEGIN
<!-- ╔══════════════════════════════════════════════════════════════════╗
<!-- ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
<!-- ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
<!-- ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
<!-- ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
<!-- ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
<!-- ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
<!-- ║ ║
<!-- ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
<!-- ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
<!-- ║ FILE: ERROR_CODES.md ║
<!-- ║ LAYER: root ║
<!-- ╚══════════════════════════════════════════════════════════════════╝
<!-- HEADY_BRAND:END
-->
# ERROR CODES CATALOG

Every error response across all 50 services gets a unique code (HEADY-BRAIN-001, HEADY-AUTH-001, etc.), HTTP status, description, suggested fix. Generate per-service error constants from this catalog.

| Code | HTTP Status | Description | Fix |
|---|---|---|---|
| HEADY-AUTH-001 | 401 | Invalid token | Renew the token using refresh token or sign in again |
| HEADY-BRAIN-001 | 503 | Database connection error | Check pgvector connection pool, check NATS JetStream |
| HEADY-SEARCH-001 | 400 | Invalid search parameters | Verify search criteria |
| HEADY-ANALYTICS-001 | 422 | Unprocessable Entity | Verify telemetry data format |
| HEADY-BILLING-001 | 402 | Payment Required | Ensure valid payment method is configured |
| HEADY-NOTIFY-001 | 500 | Failed to send notification | Verify notification provider configuration |
| HEADY-SCHEDULE-001 | 500 | Cron job execution failed | Review cron schedule and task logic |
| HEADY-MIGRATE-001 | 500 | Database migration failed | Review migration script and database state |
| HEADY-ASSET-001 | 500 | Asset processing failed | Verify asset format and pipeline logic |
28 changes: 28 additions & 0 deletions GAPS_FOUND.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- HEADY_BRAND:BEGIN
<!-- ╔══════════════════════════════════════════════════════════════════╗
<!-- ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
<!-- ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
<!-- ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
<!-- ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
<!-- ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
<!-- ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
<!-- ║ ║
<!-- ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
<!-- ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
<!-- ║ FILE: GAPS_FOUND.md ║
<!-- ║ LAYER: root ║
<!-- ╚══════════════════════════════════════════════════════════════════╝
<!-- HEADY_BRAND:END
-->
# GAPS FOUND
- `auth-session-server` was missing.
- `search-service` was missing.
- `notification-service` was missing.
- `analytics-service` was missing.
- `billing-service` was missing.
- `scheduler-service` was missing.
- `migration-service` was missing.
- `asset-pipeline` was missing.
- Strict Content Security Policy (CSP) options were missing.
- Rate limiting was hard-coded with 1000 instead of a Fibonacci value (233).
- Missing docker-compose services (NATS JetStream, PgBouncer, Prometheus, Grafana).
23 changes: 23 additions & 0 deletions IMPROVEMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- HEADY_BRAND:BEGIN
<!-- ╔══════════════════════════════════════════════════════════════════╗
<!-- ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
<!-- ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
<!-- ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
<!-- ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
<!-- ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
<!-- ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
<!-- ║ ║
<!-- ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
<!-- ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
<!-- ║ FILE: IMPROVEMENTS.md ║
<!-- ║ LAYER: root ║
<!-- ╚══════════════════════════════════════════════════════════════════╝
<!-- HEADY_BRAND:END
-->
# IMPROVEMENTS
- Created `auth-session-server` with Firebase auth validation, httpOnly cookie setup with `__Host-` prefix, Fibonacci rate limiting, and structured JSON logging.
- Created `search-service` with hybrid full-text and vector search logic using pgvector, incorporating CSL confidence gates (`CSL_GATES.include = 0.382`).
- Enforced strict Content Security Policy (CSP) options in `heady-manager.js` using Helmet.
- Set Fibonacci sliding windows rate limiting (max 233) in `heady-manager.js`.
- Added NATS JetStream, PgBouncer, Prometheus, and Grafana to `docker-compose.yml`.
- Replaced `console.log` with structured JSON logging where applicable.
15 changes: 15 additions & 0 deletions apps/ai_workflow_engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# HEADY_BRAND:BEGIN
# ╔══════════════════════════════════════════════════════════════════╗
# ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
# ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
# ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
# ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
# ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
# ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
# ║ ║
# ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
# ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
# ║ FILE: apps/ai_workflow_engine/Dockerfile ║
# ║ LAYER: root ║
# ╚══════════════════════════════════════════════════════════════════╝
# HEADY_BRAND:END
# AI Workflow Engine Dockerfile
# Multi-stage build for production deployment

Expand Down
16 changes: 16 additions & 0 deletions apps/ai_workflow_engine/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!-- HEADY_BRAND:BEGIN
<!-- ╔══════════════════════════════════════════════════════════════════╗
<!-- ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
<!-- ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
<!-- ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
<!-- ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
<!-- ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
<!-- ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
<!-- ║ ║
<!-- ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
<!-- ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
<!-- ║ FILE: apps/ai_workflow_engine/README.md ║
<!-- ║ LAYER: root ║
<!-- ╚══════════════════════════════════════════════════════════════════╝
<!-- HEADY_BRAND:END
-->
# AI Workflow Engine

A comprehensive AI-powered workflow orchestration system with dynamic resource allocation, integrating GitHub Apps, Cloudflare Workers, Render, and Gists for intelligent automation.
Expand Down
15 changes: 15 additions & 0 deletions apps/ai_workflow_engine/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# HEADY_BRAND:BEGIN
# ╔══════════════════════════════════════════════════════════════════╗
# ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
# ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
# ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
# ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
# ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
# ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
# ║ ║
# ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
# ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
# ║ FILE: apps/ai_workflow_engine/app.py ║
# ║ LAYER: root ║
# ╚══════════════════════════════════════════════════════════════════╝
# HEADY_BRAND:END
"""
AI Workflow Engine FastAPI Application
Main entry point for the workflow orchestration system
Expand Down
15 changes: 15 additions & 0 deletions apps/ai_workflow_engine/cloudflare_integration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# HEADY_BRAND:BEGIN
# ╔══════════════════════════════════════════════════════════════════╗
# ║ ██╗ ██╗███████╗ █████╗ ██████╗ ██╗ ██╗ ║
# ║ ██║ ██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ║
# ║ ███████║█████╗ ███████║██║ ██║ ╚████╔╝ ║
# ║ ██╔══██║██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ║
# ║ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ║
# ║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ║
# ║ ║
# ║ ∞ SACRED GEOMETRY ∞ Organic Systems · Breathing Interfaces ║
# ║ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ║
# ║ FILE: apps/ai_workflow_engine/cloudflare_integration.py ║
# ║ LAYER: root ║
# ╚══════════════════════════════════════════════════════════════════╝
# HEADY_BRAND:END
"""
Cloudflare Workers Integration for AI Workflow Engine
Handles worker deployment, KV storage, and D1 database operations
Expand Down
Loading
Loading