{"id":50389248,"url":"https://github.com/jmanhype/vaos-daemon","last_synced_at":"2026-05-30T17:02:34.046Z","repository":{"id":346917741,"uuid":"1184357939","full_name":"jmanhype/vaos-daemon","owner":"jmanhype","description":"Daemon — Elixir agent runtime. Signal classification, 3-tier routing, 48 tools, 18 LLM providers. Part of the VAOS ecosystem.","archived":false,"fork":false,"pushed_at":"2026-04-10T19:13:42.000Z","size":74219,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T19:28:20.707Z","etag":null,"topics":["agents","elixir","llm","signal-processing","viable-system-model"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmanhype.png","metadata":{"files":{"readme":"README-VAS-SWARM.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/com.osa.agent.plist","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-17T14:07:46.000Z","updated_at":"2026-04-10T19:13:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jmanhype/vaos-daemon","commit_stats":null,"previous_names":["jmanhype/vaos-daemon"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jmanhype/vaos-daemon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmanhype%2Fvaos-daemon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmanhype%2Fvaos-daemon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmanhype%2Fvaos-daemon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmanhype%2Fvaos-daemon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmanhype","download_url":"https://codeload.github.com/jmanhype/vaos-daemon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmanhype%2Fvaos-daemon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33700863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","elixir","llm","signal-processing","viable-system-model"],"created_at":"2026-05-30T17:02:32.535Z","updated_at":"2026-05-30T17:02:34.027Z","avatar_url":"https://github.com/jmanhype.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VAS-Swarm Integration\n\nVAOS-Swarm (Vault Agent OS Swarm) integration for OSA — connects OSA to the Go Kernel for JWT-based authorization, ALCOA+ audit trails, and real-time telemetry coordination.\n\n## Overview\n\nVAS-Swarm extends OSA with enterprise-grade governance and coordination capabilities:\n\n1. **JWT Authorization** — Every agent action requires a JWT token signed by the Kernel\n2. **Intent Hashing** — SHA256 hashes of agent intents for auditability\n3. **ALCOA+ Compliance** — Attributable, Legible, Contemporaneous, Original, Accurate records\n4. **Real-time Telemetry** — Agent status and performance metrics via AMQP\n5. **Signal Theory Routing** — Automatic capture and logging of routing decisions\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                      OSA Agent                                  │\n│  ┌──────────────────────────────────────────────────────────┐  │\n│  │   Signal Theory Classifier                                │  │\n│  │   → Mode, Genre, Type, Format, Weight                    │  │\n│  │   → Intent Hash Generation (SHA256)                      │  │\n│  └──────────────────────────────────────────────────────────┘  │\n│                            ↓                                   │\n│  ┌──────────────────────────────────────────────────────────┐  │\n│  │   VAS-Swarm Integration Layer                             │  │\n│  │   ├── IntentHash (SHA256 hashing)                         │  │\n│  │   ├── GrpcClient (JWT requests, telemetry)                │  │\n│  │   ├── TelemetryPublisher (AMQP publisher)                 │  │\n│  │   └── Integration (orchestration)                         │  │\n│  └──────────────────────────────────────────────────────────┘  │\n│                            ↓                                   │\n│  ┌──────────────────────────────────────────────────────────┐  │\n│  │   Communication Channels                                  │  │\n│  │   ├── gRPC (Go Kernel - JWT + audit)                      │  │\n│  │   └── AMQP (RabbitMQ - telemetry + commands)             │  │\n│  └──────────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────────┘\n                            ↓\n        ┌─────────────────────────────────────────┐\n        │              Go Kernel                   │\n        │   • JWT Token Issuance                   │\n        │   • ALCOA+ Audit Trail                  │\n        │   • Agent Coordination                   │\n        │   • Signal Theory Routing Logs           │\n        └─────────────────────────────────────────┘\n```\n\n## Components\n\n### 1. IntentHash\n\nSHA256-based intent hashing for audit trails:\n\n```elixir\n# Compute hash for an intent\n{:ok, hash} = IntentHash.compute(\"Build a REST API\")\n\n# Compute with full metadata for audit trail\n{:ok, intent_hash} = IntentHash.compute_with_metadata(\n  \"Build a REST API\",\n  \"agent-123\",\n  \"session-456\"\n)\n\n# Verify hash against original intent\n{:ok, true} = IntentHash.verify(hash, \"Build a REST API\")\n```\n\n### 2. GrpcClient\n\nFault-tolerant gRPC client for Kernel communication:\n\n```elixir\n# Request JWT token for an action\n{:ok, token_response} = GrpcClient.request_token(\n  \"agent-123\",\n  \"a1b2c3d4...\",\n  \"build\",\n  %{\"priority\" =\u003e \"high\"}\n)\n\n# Submit telemetry data\n{:ok, :submitted} = GrpcClient.submit_telemetry(%{\n  agent_id: \"agent-123\",\n  status: \"busy\",\n  cpu_usage: 45.5,\n  memory_usage: 60.2\n})\n\n# Submit routing logs\n{:ok, %{correlation_id: \"...\"}} = GrpcClient.submit_routing_log(%{\n  session_id: \"session-123\",\n  mode: \"BUILD\",\n  genre: \"DIRECT\",\n  weight: 0.85,\n  tier: \"elite\",\n  intent_hash: \"a1b2c3d4...\"\n})\n\n# Confirm ALCOA+ audit\n{:ok, %{audit_id: \"...\"}} = GrpcClient.confirm_audit(%{\n  agent_id: \"agent-123\",\n  action_id: \"action-456\",\n  intent_hash: \"a1b2c3d4...\",\n  jwt_token: \"eyJhbGciOi...\",\n  attributable: true,\n  legible: true,\n  contemporaneous: true,\n  original: true,\n  accurate: true\n})\n```\n\n### 3. TelemetryPublisher\n\nNon-blocking AMQP telemetry publisher:\n\n```elixir\n# Publish agent status (non-blocking)\nTelemetryPublisher.publish_agent_status(\n  \"agent-123\",\n  \"busy\",\n  %{cpu_usage: 45.5, memory_usage: 60.2}\n)\n\n# Publish routing telemetry\nTelemetryPublisher.publish_routing(%{\n  session_id: \"session-123\",\n  mode: \"BUILD\",\n  weight: 0.85,\n  tier: \"elite\"\n})\n\n# Publish performance metrics\nTelemetryPublisher.publish_performance_metrics(\"agent-123\", %{\n  tasks_completed: 10,\n  tasks_failed: 1,\n  avg_task_duration: 2.5\n})\n\n# Subscribe to Kernel commands\n{:ok, ref} = TelemetryPublisher.subscribe_to_commands(fn command -\u003e\n  IO.puts(\"Received command: #{inspect(command)}\")\nend)\n```\n\n### 4. Integration\n\nOrchestration layer that ties everything together:\n\n```elixir\n# Initialize VAS-Swarm (called automatically on boot)\nIntegration.init()\n\n# Request action token (non-blocking)\n{:ok, ref} = Integration.request_action_token(\n  \"agent-123\",\n  \"session-456\",\n  \"build\",\n  \"Create user authentication module\",\n  %{\"priority\" =\u003e \"high\"}\n)\n\n# Publish agent status\nIntegration.publish_agent_status(\"agent-123\", \"busy\", %{cpu_usage: 45.5})\n\n# Publish performance metrics\nIntegration.publish_performance_metrics(\"agent-123\", %{\n  tasks_completed: 10,\n  avg_task_duration: 2.5\n})\n```\n\n## Configuration\n\n### Enable VAS-Swarm\n\nAdd to your `config/config.exs`:\n\n```elixir\nconfig :optimal_system_agent,\n  vas_swarm_enabled: true\n```\n\n### Kernel Connection (gRPC)\n\n```elixir\nconfig :optimal_system_agent,\n  vas_kernel_url: \"grpc://localhost:50051\"\n```\n\n### AMQP Connection\n\n```elixir\nconfig :optimal_system_agent,\n  amqp_url: \"amqp://guest:guest@localhost:5672\"\n```\n\n## Protobuf Definitions\n\nThe gRPC protocol is defined in `protos/kernel.proto`:\n\n- `KernelService` — Main service interface\n- `TokenRequest/Response` — JWT token requests\n- `TelemetryRequest/Response` — Agent telemetry\n- `RoutingLogRequest/Response` — Signal Theory routing logs\n- `AuditConfirmation/Response` — ALCOA+ audit confirmations\n\nTo regenerate Elixir stubs from protobuf:\n\n```bash\n# Install protoc-gen-grpc-elixir\ngo install github.com/elixir-grpc/protoc-gen-grpc-elixir@latest\n\n# Generate Elixir code\nprotoc --elixir_out=./lib --grpc_out=./lib protos/kernel.proto\n```\n\n## ALCOA+ Compliance\n\nVAS-Swarm maintains ALCOA+ audit trails for all agent actions:\n\n| Attribute | Description |\n|-----------|-------------|\n| **Attributable** | Every action is linked to an agent ID and session |\n| **Legible** | Audit records are stored in human-readable Markdown |\n| **Contemporaneous** | Timestamps are captured at time of action |\n| **Original** | Intent hashes prevent tampering |\n| **Accurate** | Full context and metadata are preserved |\n\nAudit records are stored in `~/.osa/vault/facts/intent_hash_*.md`.\n\n## Signal Theory Integration\n\nVAS-Swarm automatically hooks into OSA's Signal Theory classifier:\n\n1. Every classified signal generates an intent hash\n2. Routing decisions are logged to the Kernel via gRPC\n3. Telemetry is published to AMQP for real-time monitoring\n\nExample routing data:\n\n```elixir\n%{\n  session_id: \"session-123\",\n  mode: \"BUILD\",           # Signal Theory mode\n  genre: \"DIRECT\",          # Signal Theory genre\n  type: \"request\",          # Signal Theory type\n  format: \"message\",        # Signal Theory format\n  weight: 0.85,             # Signal Theory weight (0.0-1.0)\n  confidence: \"high\",       # Classification confidence\n  tier: \"elite\",            # Selected compute tier\n  model: \"claude-opus-4-6\", # Selected model\n  provider: \"anthropic\",    # Selected provider\n  intent_hash: \"a1b2c3...\"  # SHA256 hash of intent\n}\n```\n\n## Testing\n\nRun integration tests:\n\n```bash\nmix test test/optimal_system_agent/vas_swarm/\n```\n\nTests cover:\n- Intent hash generation and verification\n- gRPC client behavior (connected/disconnected)\n- AMQP telemetry buffering and publishing\n- Integration orchestration\n\n## Non-Blocking Design\n\nAll VAS-Swarm operations are designed to be non-blocking:\n\n- **Intent hashing** — Fast crypto operations, \u003c1ms\n- **gRPC requests** — Background tasks with fire-and-forget\n- **AMQP publishing** — Buffered with async flush\n- **Audit storage** — Background Task.Supervisor jobs\n\nThis ensures VAS-Swarm never interferes with agent execution.\n\n## Fault Tolerance\n\nVAS-Swarm includes multiple layers of fault tolerance:\n\n1. **Circuit Breaker** — gRPC client opens circuit after 5 failures\n2. **Exponential Backoff** — Automatic reconnection with backoff\n3. **Request Timeouts** — 5-second timeout on all gRPC calls\n4. **Buffered Telemetry** — AMQP data buffered when disconnected\n5. **Graceful Degradation** — Functions return errors when services unavailable\n\n## Performance Impact\n\nMinimal impact on OSA performance:\n\n- **Intent hashing** — \u003c1ms per classification\n- **Telemetry buffering** — ETS write, negligible\n- **AMQP flush** — Batched every 1s, non-blocking\n- **gRPC calls** — Background tasks, no blocking\n\n## Security\n\n- JWT tokens signed by Kernel, validated by Kernel\n- Intent hashes prevent tampering with audit trails\n- AMQP connection over TLS in production\n- gRPC connection over TLS in production\n\n## Troubleshooting\n\n### VAS-Swarm not starting\n\nCheck configuration:\n\n```elixir\nApplication.get_env(:optimal_system_agent, :vas_swarm_enabled)\nApplication.get_env(:optimal_system_agent, :vas_kernel_url)\nApplication.get_env(:optimal_system_agent, :amqp_url)\n```\n\n### gRPC connection failing\n\nCheck Kernel is running and accessible:\n\n```bash\n# Check if Kernel is running\ncurl http://localhost:50051/health\n\n# Check VAS-Swarm logs\ngrep \"GrpcClient\" ~/.osa/logs/osa.log\n```\n\n### AMQP telemetry not publishing\n\nCheck RabbitMQ is running:\n\n```bash\n# Check RabbitMQ status\nrabbitmqctl status\n\n# Check queues\nrabbitmqctl list_queues\n```\n\n## Future Enhancements\n\n- [ ] Generate actual gRPC stubs from protobuf definitions\n- [ ] Add JWT validation middleware\n- [ ] Implement Kernel command handlers (pause/resume/shutdown)\n- [ ] Add metrics dashboard for VAS-Swarm telemetry\n- [ ] Implement batch audit record upload\n- [ ] Add encryption for sensitive audit data\n\n## References\n\n- **Signal Theory**: [Luna, R. (2026)](https://zenodo.org/records/18774174)\n- **ALCOA+**: FDA guidance on data integrity\n- **gRPC Protocol**: `protos/kernel.proto`\n\n---\n\n**Built as part of V.A.O.S. (Vault Agent Operating System)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmanhype%2Fvaos-daemon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmanhype%2Fvaos-daemon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmanhype%2Fvaos-daemon/lists"}