docs: document archon deployment and interfaces - #40
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughExpanded docs/PMOVES.md with detailed Archon Service Operations content: components, ports and compose targets, required environment variables, build/startup steps, Supabase schema expectations, MCP and realtime interfaces, and runtime API endpoints. Includes references to upstream scaffolds and docker-compose usage. The diff shows duplicated Archon documentation blocks. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free 📒 Files selected for processing (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…cumentation-to-pmoves.md docs: document archon deployment and interfaces
Task #40: Wire MACA consensus through TensorZero gateway Features: - LLM-backed consensus voting on geometric proposals - Structured output parsing (JSON response format) - Multi-round consensus with transformation aggregation - Service discovery integration (env → service registry → DNS) - Entropy-based acceptance criteria (ΔS > 0) - ClickHouse observability via TensorZero gateway Files: - pmoves/tools/maca_tensorzero.py: Complete MACA/TensorZero integration - pmoves/docs/PRODUCTION_READINESS_AUDIT_2026-02-07.md: Mark Task #40 complete Usage: from pmoves.tools.maca_tensorzero import MACATensorZeroConsensus maca = MACATensorZeroConsensus(agent_id="agent-1") result = await maca.propose_and_vote(cgp_packet) if result.accepted: print("Consensus reached!") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(ci): Migrate all workflows to self-hosted runners Migrate all applicable CI workflows from GitHub-hosted runners to self-hosted runners per production security requirements. **Workflows Migrated:** - codeql.yml: ubuntu-latest → [self-hosted, vps] - python-tests.yml: ubuntu-latest → [self-hosted, vps] - deploy-gateway-agent.yml: ubuntu-latest → [self-hosted, vps] - integrations-ghcr.yml: ubuntu-latest → [self-hosted, vps] - sql-policy-lint.yml: ubuntu-latest → [self-hosted, vps] - yt-dlp-bump.yml: ubuntu-latest → [self-hosted, vps] - env-preflight.yml: Added note about windows-latest requirement **Documentation Updated:** - pmoves/docs/PRODUCTION_MERGE_TRACKER.md: Added PMOVES.YT PR #1, CI infrastructure audit section - pmoves/docs/PRODUCTION_READINESS_AUDIT_2026-02-07.md: Added Section 6 (CI/CD Infrastructure) and CI issues - pmoves/docs/CI_INFRASTRUCTURE_AUDIT_2026-02-08.md: Complete CI infrastructure audit and migration documentation **Rationale:** Production CI should run locally or on self-hosted runners for: 1. Security: Code processed within controlled infrastructure 2. Consistency: Same environment as production deployments 3. Compliance: Production code not processed by external systems Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): Fix workflow issues found during audit - codeql.yml: Move paths-ignore from job to workflow level (GitHub Actions doesn't support paths-ignore at job level) - deploy-gateway-agent.yml: Add submodules: false to checkout (Gateway agent doesn't need submodules; fixes e2b submodule error) These fixes address workflow failures that occurred when migrating to self-hosted runners. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(ci): Update CI infrastructure audit with workflow fixes - Add Workflow Fixes Applied section documenting: - codeql.yml paths-ignore placement fix - deploy-gateway-agent.yml submodule checkout fix - pmoves-e2b-mcp-server submodule initialization - Update success criteria to reflect completion status - Add Production PR Summary section for PMOVES.AI-Edition-Hardened Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * security: Add .env.bootstrap* to .gitignore Prevent accidental commit of .env.bootstrap files which contain actual API keys and secrets generated during bootstrap process. Security issue discovered during audit of untracked files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): Remove duplicate paths-ignore entries from codeql.yml The paths-ignore entries were incorrectly placed after continue-on-error, creating invalid YAML syntax. The paths-ignore is already at the workflow level (lines 22-29). This fixes CI workflow failures on all PR branches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): Add PMOVES.AI-Edition-Hardened to CodeQL trigger branches CodeQL workflow only triggered on 'main' branch, so it wasn't running for PRs targeting PMOVES.AI-Edition-Hardened (production). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: Mark CI migration action items as completed Update PRODUCTION_MERGE_TRACKER.md and PRODUCTION_READINESS_AUDIT_2026-02-07.md to reflect that CI self-hosted runner migration is complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(ci): Document CodeQL 0s failure and recommendation Document the CodeQL workflow failure (0s runtime) and recommend keeping CodeQL on GitHub-hosted runners as a security exception. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(chit): Add geometric intelligence analysis and CGP schema fixes This commit addresses the comprehensive AGENTS & GEOMETRIC INTELLIGENCE audit completed on 2026-02-08 by 4 specialized agents. ## Analysis Documentation - **TBE_IMPLEMENTATION_CROSS_REFERENCE.md**: Thread-Based Engineering patterns vs implementation across PMOVES.AI and submodules - **CHIT_IMPLEMENTATION_AUDIT_2026-02-08.md**: Five mathematical pillars implementation status (75% complete) - **SUBMODULE_GEOMETRIC_INTEGRATION_SURVEY.md**: 27+ submodule geometric capabilities and CHIT integration status - **BOTZ_GATEWAY_AGENT_INTEGRATION.md**: Service coordination architecture analysis for BoTZ framework and Gateway Agent ## CGP Schema Fixes - **consciousness-service/cgp_mapper.py**: Standardize to chit.cgp.v0.2 - Changed from custom "version": "cgp.v1" to standard "spec": "chit.cgp.v0.2" - Added proper super_nodes/constellations structure - Added spectrum normalization (sums to 1.0) - Updated publish method documentation ## NATS JetStream Streams - **scripts/nats/setup_geometry_streams.sh**: Stream setup script for GEOMETRY_BUS - GEOMETRY_CGP stream: 720h retention, file storage - TOKENISM_ATTRIBUTION stream: 2160h retention, interest policy - BOTZ_COORDINATION stream: 168h retention, limits policy ## Production Audit Updates - **PRODUCTION_READINESS_AUDIT_2026-02-07.md**: Added AGENTS & GEOMETRIC INTELLIGENCE section - Thread-Based Engineering status matrix - CHIT implementation status (75% complete) - Critical issues found with Priority 1/2/3 action items - Links to all generated analysis reports Related Reports: - pmoves/docs/AGENTS/TBE_IMPLEMENTATION_CROSS_REFERENCE.md - pmoves/docs/PMOVESCHIT/CHIT_IMPLEMENTATION_AUDIT_2026-02-08.md - pmoves/docs/SUBMODULE_GEOMETRIC_INTEGRATION_SURVEY.md - pmoves/docs/AGENTS/BOTZ_GATEWAY_AGENT_INTEGRATION.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(agent-zero): Add security hooks for MCP tool execution Implements Priority 2 security enhancement: Pre-execution validation for Agent Zero MCP tools following BoTZ "defense in depth" specification. Changes: - Add security/validator.py: In-process security validation module - Add security/hooks/pre_command.py: Standalone pre-command hook - Update security/patterns.yaml: Agent Zero specific security rules - Update mcp_server.py: Integrate security validation - Update main.py: Return HTTP 403 for security blocks Security Features: 1. Deterministic regex pattern matching (40+ blocked commands) 2. Path protection (zero-access, read-only, no-delete) 3. Agent-specific protections (docker rm, kubectl delete, helm uninstall) 4. Audit logging to runtime/audit/agent_actions.jsonl 5. HTTP 403 Forbidden response for blocked operations Blocked Operations: - System destruction (rm -rf /, dd if=/dev/zero, mkfs.*) - Git history manipulation (git push --force, git reset --hard) - Database destruction (drop database, truncate table) - Permission escalation (chmod 777, chown root, sudo chmod) - User manipulation (useradd, userdel, passwd root) - Code injection (| bash, | sh, eval $(curl, eval $(wget) - System control (shutdown, reboot, systemctl poweroff) - Agent operations (docker rm -f, kubectl delete, helm uninstall) Protected Paths: - Zero-access: .env*, *.pem, *.key, **/secrets/** - Read-only: .git/, patterns.yaml, *.lock, requirements*.txt - No-delete: src/core/**, features/**, docs/**, pmoves/services/agent-zero/** Related: Priority 2 from AGENTS & GEOMETRIC INTELLIGENCE AUDIT See: pmoves/docs/PRODUCTION_READINESS_AUDIT_2026-02-07.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(gateway-agent): Add NATS integration for BoTZ coordination Implements Priority 2: Gateway Agent NATS integration for work coordination with BoTZ Gateway. New Files: - pmoves/services/gateway-agent/nats_integration.py Updated Files: - pmoves/services/gateway-agent/app.py NATS Integration Features: 1. Subscribe to BoTZ Gateway work availability events - Subject: botz.workitem.available.v1 - Callback: Check if Gateway Agent has matching tools - Auto-claim work items when tools available 2. Publish work item status events - botz.workitem.claimed.v1 - Work item claimed notification - botz.workitem.completed.v1 - Work item completion notification - gateway.tool.executed.v1 - Tool execution results 3. Gateway Agent heartbeat (15s interval) - Subject: gateway.agent.heartbeat.v1 - Announces port, skill levels, health status 4. Credential sharing with BoTZ Gateway - Subscribe: gateway.credential.request.v1 - Respond: gateway.credential.response.v1 - Announce: gateway.credential.request.available 5. Tool category to BoTZ skill level mapping - basic: general, api, documents - tac_enabled: automation, infrastructure - mcp_augmented: memory, execution - agentic: research, vision Integration Points: - Tool execution publishes to NATS with skill level - Work item availability triggers automatic claiming - Credential requests from BoTZ Gateway handled - Heartbeat announces Gateway Agent availability Environment Variables: - NATS_URL: NATS server URL (default: nats://localhost:4222) - NATS_USER/NATS_PASS: Optional authentication - NATS_ENABLED: Enable/disable NATS (default: true) Related: Priority 2 from AGENTS & GEOMETRIC INTELLIGENCE AUDIT See: pmoves/docs/AGENTS/BOTZ_GATEWAY_AGENT_INTEGRATION.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(chit): Add CHIT Security Validation Layer Implements Priority 3 security enhancement for CHIT Geometry Packets. New File: - pmoves/tools/chit_security_validator.py Features: 1. Schema Validation - Validates CGP versions (v0.1, v0.2, v1.0) - Pydantic models for type-safe validation - Spectrum normalization verification 2. Security Validation - HMAC-SHA256 signature verification (via chit_security.py) - AES-GCM anchor decryption support - Signature expiration checking (configurable) - Access control by source 3. Access Control - Trusted sources: consciousness-service, tokenism-simulator, agent-zero - Security levels: PUBLIC, SIGNED, ENCRYPTED, STRICT - Source-based policy enforcement 4. Audit Logging - JSONL audit log at memory/audit/cgp_validation.jsonl - Records validation results, errors, timing - Tracks source and CGP ID for traceability 5. FastAPI Integration - GeometryEventValidator dependency for FastAPI - validate_and_publish() for gateway integration - CLI for standalone validation: python -m chit_security_validator Usage: from pmoves.tools.chit_security_validator import validate_cgp # Validate a CGP packet validate_cgp(cgp_packet, source="consciousness-service") # Validate and publish to Hi-RAG await validate_and_publish(cgp_packet, gateway_url="http://localhost:8086") Security Levels: - PUBLIC: No verification (internal trusted services) - SIGNED: HMAC signature verification required - ENCRYPTED: Anchor encryption required - STRICT: Full validation with source checking Integration: - Builds on existing chit_security.py (signing, encryption) - Ready for integration with Hi-RAG geometry events endpoint - Enables secure multi-service geometry publishing Related: Priority 3 from AGENTS & GEOMETRIC INTELLIGENCE AUDIT Resolves: chit_security.py layer referenced but not implemented Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: Update production audit with completed priority items Mark completed items: - Priority 1: CGP Schema Fix ✅ - Priority 1: NATS JetStream Streams ✅ - Priority 2: Agent Zero Security Hooks ✅ - Priority 2: Gateway Agent NATS Integration ✅ - Priority 3: CHIT Security Validation Layer ✅ Remaining items: - Priority 1: Long Thread (Z) Persistence - Priority 2: Zeta filtering in CGP pipeline - Priority 2: MACA consensus via TensorZero - Priority 3: Multi-Modal Decoder - Priority 3: CGP v1.0 specification * feat(chit): Add Zeta Spectral Filtering to CGP Pipeline Implements Priority 2: Enable Zeta filtering in CGP pipeline. New File: - pmoves/tools/zeta_filter.py Updated Files: - pmoves/services/consciousness-service/cgp_mapper.py Features: 1. Python Zeta Filter Implementation - Port of TypeScript zeta-filter.ts to Python - Uses first 20 non-trivial Riemann zeta zeros (γ_n) - Creates harmonic weights from 1/log(γ_n) decay patterns - Scale-invariant filtering across hierarchical data 2. Zeta Filter Operations - filter_spectrum(): Apply zeta-weighted filtering to spectra - analyze_spectrum(): Full spectral analysis (entropy, concentration, dominant index) - spectral_similarity(): Cosine similarity in zeta-filtered space - multi_scale_filter(): Generate spectra at multiple scales - compute_resonance(): Measure harmonic structure alignment - optimize_spectrum_scale(): Find optimal scale for a spectrum 3. Integration with CGP Mapper - Automatic zeta filtering of consciousness theory spectra - Environment configuration: ZETA_FILTER_ENABLED, ZETA_NUM_ZEROS, ZETA_DECAY_FACTOR - Zeta analysis metadata added to CGP packets 4. Mathematical Foundation - Riemann zeta zeros: γ₁≈14.13, γ₂≈21.02, γ₃≈25.01, ... - Weight formula: w_n = decay^n / log(γ_n) - Creates emphasis on lower harmonics while respecting logarithmic spacing Usage: from pmoves.tools.zeta_filter import ZetaInspiredFilter, optimize_spectrum_scale # Create filter and apply to spectrum zeta = ZetaInspiredFilter(num_zeros=10) filtered = zeta.filter_spectrum([0.8, 0.6, 0.3, 0.1]) # Analyze spectrum analysis = zeta.analyze_spectrum(spectrum) print(f"Entropy: {analysis['entropy']}, Concentration: {analysis['concentration']}") # Find optimal scale optimal = optimize_spectrum_scale(spectrum, scales=[3,5,7,10]) print(f"Best scale: {optimal['best_scale']}") Environment Variables: - ZETA_FILTER_ENABLED: Enable/disable zeta filtering (default: true) - ZETA_NUM_ZEROS: Number of zeta zeros to use (default: 10) - ZETA_DECAY_FACTOR: Exponential decay for higher zeros (default: 0.9) Related: Priority 2 from AGENTS & GEOMETRIC INTELLIGENCE AUDIT Depends on: CHIT Security Validation Layer (#42) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(pmoves): Add MACA TensorZero Integration for LLM-backed consensus Task #40: Wire MACA consensus through TensorZero gateway Features: - LLM-backed consensus voting on geometric proposals - Structured output parsing (JSON response format) - Multi-round consensus with transformation aggregation - Service discovery integration (env → service registry → DNS) - Entropy-based acceptance criteria (ΔS > 0) - ClickHouse observability via TensorZero gateway Files: - pmoves/tools/maca_tensorzero.py: Complete MACA/TensorZero integration - pmoves/docs/PRODUCTION_READINESS_AUDIT_2026-02-07.md: Mark Task #40 complete Usage: from pmoves.tools.maca_tensorzero import MACATensorZeroConsensus maca = MACATensorZeroConsensus(agent_id="agent-1") result = await maca.propose_and_vote(cgp_packet) if result.accepted: print("Consensus reached!") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(agent-zero): Add Long Thread (Z) Persistence with Checkpointing Task #38: Implement task checkpointing and recovery for long-running agent tasks Features: - CheckpointManager class for state persistence to Supabase - Local file-based fallback for development - PersistentLongThread with automatic checkpointing - Thread recovery from last checkpoint on restart - Progress tracking (0.0 to 1.0) and iteration counting - Graceful shutdown with final checkpoint - Supabase agent_threads table schema Files: - pmoves/services/agent-zero/python/checkpointing.py: Core checkpointing logic - pmoves/services/agent-zero/python/gateway/threads_persistent.py: PersistentLongThread class - pmoves/supabase/initdb/16_agent_threads.sql: Database schema - pmoves/docs/PRODUCTION_READINESS_AUDIT_2026-02-07.md: Mark Task #38 complete Usage: from pmoves.services.agent_zero.python.gateway.threads_persistent import ( PersistentLongThread ) thread = PersistentLongThread( thread_id="monitor-1", context={"source": "youtube"}, task=my_async_task, interval_seconds=60, enable_checkpointing=True ) # Automatically checkpoints and can be resumed after failure result = await thread.execute() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(infrastructure): Add Supabase init schema, mesh agent, and credential tools Add comprehensive Supabase initialization schema, mesh agent service, and credential management utilities. Files: - pmoves/supabase/initdb/*.sql: Complete Supabase schema (16 migration files) - pmoves/services/mesh-agent/main.py: Mesh agent for multi-host orchestration - pmoves/services/mesh-agent/README.md: Mesh agent documentation - pmoves/scripts/fetch_credentials.sh: Credential fetching utility - pmoves/tools/credential_setup.sh: Credential setup helper - pmoves/scripts/fix-docker-compose-env-defaults.sh: Environment fixer - pmoves/scripts/update_env_from_cgp.py: CGP environment updater - pmoves/docs/PRODUCTION_VALIDATION_PLAN.md: Validation checklist - pmoves/env.publisher.enrich.additions: Publisher environment additions - pmoves/env.render_webhook.additions: Render webhook environment additions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Testing
https://chatgpt.com/codex/tasks/task_b_68ce1dddc2408324997c861e8b8677e8
Summary by CodeRabbit