Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/ariffazil_arifos.json
T

1 line
14 KiB
JSON

{"repo": "ariffazil/arifos", "files": {"docs/agents/laws/LAW_OF_FORGING_CONFIGURATION.md": {"27141b5aa717707f2480a343121add7120d91f00": {"t": 1785674006.951532, "n": 4630, "h": "27b62bbdf7eb62e3", "c": "# LAW OF FORGING CONFIGURATION — arifOS Agent Operations\n\n> **Ditempa Bukan Diberi** — Forged, Not Given\n> **Last Updated:** 2026-03-27\n> **Trigger Event:** OpenClaw models.json misconfiguration disaster\n\n---\n\n## PREAMBLE\n\nOn 2026-03-27, agent opencode made critical errors while configuring OpenClaw's models.json and openclaw.json. This document captures every failure so that ALL arifOS agents may learn and never repeat them.\n\n**The Cardinal Sin:** Attempted to configure an external service (MiniMax) without reading its documentation first, then made matters worse by trying multiple random approaches without verification.\n\n---\n\n## PART I — THE DISASTER (What Happened)\n\n### Timeline of Failures\n\n| Time | Action | Result |\n|------|--------|--------|\n| Start | User provided MiniMax API key `sk-api-...` | Key format was wrong for the intended endpoint |\n| +0 | Did NOT verify key format against MiniMax docs | Proceeded blind |\n| +5min | Changed minimax baseUrl to `api.minimax.chat/v1` with OpenAI completions | Wrong — MiniMax uses `api.minimax.io/anthropic` with `anthropic-messages` API |\n| +10min | Tried curl tests with Bearer prefix vs no prefix | Both failed, but didn't understand WHY |\n| +15min | User said \"MiniMax dah boleh pakai\" (MiniMax is working now) | Assumed the NEW key worked — WRONG assumption |\n| +20min | Updated auth-profiles with new `sk-api-...` key | The OLD `sk-cp-...` key was the one that worked |\n| +25min | Configured openclaw.json to use `minimax/MiniMax-M2.7` as primary | Key had no balance, all requests failed |\n| +30min | User provided correct MiniMax docs from openclaw.ai | Finally READ the documentation |\n| +35min | Tested curl with correct endpoint `api.minimax.io/anthropic` | `sk-cp-...` key WORKS, `sk-api-...` key returns `insufficient balance` |\n| +40min | Tried to \"fix\" auth-profiles.json | WROTE EMPTY FILE — broke it completely |\n| +45min | Tried to \"fix\" models.json again | More breakage |\n| +50min | Restored from backup | Finally stopped making things worse |\n\n---\n\n## PART II — THE SEVEN CARDINAL SINS\n\n### SIN 1: Never Configure an External Service Without Reading Its Docs First\n\n### SIN 2: Never Assume an API Key Works — Always Verify First with curl\n\n### SIN 3: Never Write to a File Without Verifying the Write Succeeded\n\n### SIN 4: Never Touch auth-profiles.json Without Understanding Its Relationship to models.json\n\n### SIN 5: Never Edit Config Files Without Checking the Backup Strategy\n\n### SIN 6: Never Guess at API Endpoints — Always Look Up the Correct One\n\n### SIN 7: Never Continue Making Changes When You're Making Things Worse\n\n---\n\n## PART III — THE QUANTUM OATH CHECKLIST\n\nBefore editing ANY configuration file for an external service, you MUST:\n\n- [ ] **OBSERVE** — Read the provider's official documentation\n- [ ] **VERIFY** — Test the API key with curl FIRST\n- [ ] **BACKUP** — Create timestamped backup of the file you're editing\n- [ ] **UNDERSTAND** — Know which file does what and how they relate\n- [ ] **CHECK** — Confirm the exact model IDs, endpoints, auth methods\n- [ ] **VERIFY WRITE** — Confirm the file was written correctly after any edit\n- [ ] **TEST** — After any change, test that the service actually works\n\n---\n\n## PART IV — WORKING OPENCLAW CONFIGURATION (Reference)\n\n### Verified Working MiniMax Config\n\n| Setting | Value |\n|---------|-------|\n| **Endpoint** | `https://api.minimax.io/anthropic` |\n| **API Type** | `anthropic-messages` |\n| **Model** | `MiniMax-M2.7` |\n| **Key** | `sk-cp-...` (verified working) |\n\n### Verified Working Providers\n\n| Provider | Status | Key | Endpoint |\n|----------|--------|-----|----------|\n| **minimax** | ✅ Works | `sk-cp-...` | `https://api.minimax.io/anthropic` |\n| **google** | ✅ Works | `AIzaSyCJFxAger1lsy9PfeBdwxjlBcTfFHm6kvI` | `https://generativelanguage.googleapis.com/v1beta` |\n\n---\n\n## PART V — SIGNATURES OF FAILURE\n\n| Error | Meaning | Action |\n|-------|---------|--------|\n| `billing error — insufficient balance` | Key valid, account has no credits | Top up account |\n| `invalid api key` | Key wrong format/revoked | Verify with curl |\n| `Unknown model: X/Y` | Model ID not in provider's models list | Check exact spelling |\n| `No API key found for provider` | Key not in auth-profiles.json | Verify key is in correct file |\n\n---\n\n## CONCLUSION\n\n> **\"Ditempa bukan Diberi\"** — Forged, Not Given\n\nEvery failure is a forging. This document is the quench.\n\n- **Read before you touch**\n- **Test before you trust**\n- **Backup before you change**\n- **Verify every write**\n- **Stop when you're making it worse**\n\n---\n\n*Forged from the ashes of the 2026-03-27 OpenClaw disaster.*\n"}, "eac0f1ff5eb55400af3f3916b04f8efe69a31f33": {"t": 1785846812.3200426, "n": 4630, "h": "27b62bbdf7eb62e3", "c": "# LAW OF FORGING CONFIGURATION — arifOS Agent Operations\n\n> **Ditempa Bukan Diberi** — Forged, Not Given\n> **Last Updated:** 2026-03-27\n> **Trigger Event:** OpenClaw models.json misconfiguration disaster\n\n---\n\n## PREAMBLE\n\nOn 2026-03-27, agent opencode made critical errors while configuring OpenClaw's models.json and openclaw.json. This document captures every failure so that ALL arifOS agents may learn and never repeat them.\n\n**The Cardinal Sin:** Attempted to configure an external service (MiniMax) without reading its documentation first, then made matters worse by trying multiple random approaches without verification.\n\n---\n\n## PART I — THE DISASTER (What Happened)\n\n### Timeline of Failures\n\n| Time | Action | Result |\n|------|--------|--------|\n| Start | User provided MiniMax API key `sk-api-...` | Key format was wrong for the intended endpoint |\n| +0 | Did NOT verify key format against MiniMax docs | Proceeded blind |\n| +5min | Changed minimax baseUrl to `api.minimax.chat/v1` with OpenAI completions | Wrong — MiniMax uses `api.minimax.io/anthropic` with `anthropic-messages` API |\n| +10min | Tried curl tests with Bearer prefix vs no prefix | Both failed, but didn't understand WHY |\n| +15min | User said \"MiniMax dah boleh pakai\" (MiniMax is working now) | Assumed the NEW key worked — WRONG assumption |\n| +20min | Updated auth-profiles with new `sk-api-...` key | The OLD `sk-cp-...` key was the one that worked |\n| +25min | Configured openclaw.json to use `minimax/MiniMax-M2.7` as primary | Key had no balance, all requests failed |\n| +30min | User provided correct MiniMax docs from openclaw.ai | Finally READ the documentation |\n| +35min | Tested curl with correct endpoint `api.minimax.io/anthropic` | `sk-cp-...` key WORKS, `sk-api-...` key returns `insufficient balance` |\n| +40min | Tried to \"fix\" auth-profiles.json | WROTE EMPTY FILE — broke it completely |\n| +45min | Tried to \"fix\" models.json again | More breakage |\n| +50min | Restored from backup | Finally stopped making things worse |\n\n---\n\n## PART II — THE SEVEN CARDINAL SINS\n\n### SIN 1: Never Configure an External Service Without Reading Its Docs First\n\n### SIN 2: Never Assume an API Key Works — Always Verify First with curl\n\n### SIN 3: Never Write to a File Without Verifying the Write Succeeded\n\n### SIN 4: Never Touch auth-profiles.json Without Understanding Its Relationship to models.json\n\n### SIN 5: Never Edit Config Files Without Checking the Backup Strategy\n\n### SIN 6: Never Guess at API Endpoints — Always Look Up the Correct One\n\n### SIN 7: Never Continue Making Changes When You're Making Things Worse\n\n---\n\n## PART III — THE QUANTUM OATH CHECKLIST\n\nBefore editing ANY configuration file for an external service, you MUST:\n\n- [ ] **OBSERVE** — Read the provider's official documentation\n- [ ] **VERIFY** — Test the API key with curl FIRST\n- [ ] **BACKUP** — Create timestamped backup of the file you're editing\n- [ ] **UNDERSTAND** — Know which file does what and how they relate\n- [ ] **CHECK** — Confirm the exact model IDs, endpoints, auth methods\n- [ ] **VERIFY WRITE** — Confirm the file was written correctly after any edit\n- [ ] **TEST** — After any change, test that the service actually works\n\n---\n\n## PART IV — WORKING OPENCLAW CONFIGURATION (Reference)\n\n### Verified Working MiniMax Config\n\n| Setting | Value |\n|---------|-------|\n| **Endpoint** | `https://api.minimax.io/anthropic` |\n| **API Type** | `anthropic-messages` |\n| **Model** | `MiniMax-M2.7` |\n| **Key** | `sk-cp-...` (verified working) |\n\n### Verified Working Providers\n\n| Provider | Status | Key | Endpoint |\n|----------|--------|-----|----------|\n| **minimax** | ✅ Works | `sk-cp-...` | `https://api.minimax.io/anthropic` |\n| **google** | ✅ Works | `AIzaSyCJFxAger1lsy9PfeBdwxjlBcTfFHm6kvI` | `https://generativelanguage.googleapis.com/v1beta` |\n\n---\n\n## PART V — SIGNATURES OF FAILURE\n\n| Error | Meaning | Action |\n|-------|---------|--------|\n| `billing error — insufficient balance` | Key valid, account has no credits | Top up account |\n| `invalid api key` | Key wrong format/revoked | Verify with curl |\n| `Unknown model: X/Y` | Model ID not in provider's models list | Check exact spelling |\n| `No API key found for provider` | Key not in auth-profiles.json | Verify key is in correct file |\n\n---\n\n## CONCLUSION\n\n> **\"Ditempa bukan Diberi\"** — Forged, Not Given\n\nEvery failure is a forging. This document is the quench.\n\n- **Read before you touch**\n- **Test before you trust**\n- **Backup before you change**\n- **Verify every write**\n- **Stop when you're making it worse**\n\n---\n\n*Forged from the ashes of the 2026-03-27 OpenClaw disaster.*\n"}}, "core/organs/minimax_agent.py": {"27141b5aa717707f2480a343121add7120d91f00": {"t": 1785674031.347326, "n": 1810, "h": "af77a894a004d2e3", "c": "import logging\nimport os\nfrom dataclasses import dataclass\n\nimport httpx\n\nlogger = logging.getLogger(\"arifOS.Minimax\")\n\n\n@dataclass\nclass MinimaxEnvelope:\n ok: bool\n text: str\n error: str = \"\"\n\n\nasync def minimax_generate(prompt: str, max_tokens: int = 1000) -> MinimaxEnvelope:\n \"\"\"\n Real Intelligence fallback using Minimax API.\n Replaces missing Ollama for 111-333 Reasoning.\n \"\"\"\n api_key = os.getenv(\"MINIMAX_API_KEY\")\n if not api_key:\n return MinimaxEnvelope(False, \"\", \"MINIMAX_API_KEY missing from environment\")\n\n # Minimax V2 (ChatCompletion)\n url = \"https://api.minimax.io/text/chatcompletion_v2\"\n headers = {\"Authorization\": f\"Bearer {api_key}\", \"Content-Type\": \"application/json\"}\n\n payload = {\n \"model\": \"abab6.5s-chat\", # Fast but capable for reasoning\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are the arifOS AGI Mind (Stage 111-333). Apply constitutional physics (ΔS ≤ 0).\",\n },\n {\"role\": \"user\", \"content\": prompt},\n ],\n \"max_tokens\": max_tokens,\n }\n\n try:\n async with httpx.AsyncClient(timeout=30.0) as client:\n response = await client.post(url, headers=headers, json=payload)\n response.raise_for_status()\n data = response.json()\n\n # Correct Minimax V2 response parsing\n if \"choices\" in data and len(data[\"choices\"]) > 0:\n content = data[\"choices\"][0][\"message\"][\"content\"]\n return MinimaxEnvelope(True, content)\n else:\n return MinimaxEnvelope(False, \"\", f\"Unexpected API structure: {data}\")\n\n except Exception as e:\n logger.error(f\"Minimax API Error: {e}\")\n return MinimaxEnvelope(False, \"\", str(e))\n"}, "eac0f1ff5eb55400af3f3916b04f8efe69a31f33": {"t": 1785846821.2371645, "n": 1810, "h": "af77a894a004d2e3", "c": "import logging\nimport os\nfrom dataclasses import dataclass\n\nimport httpx\n\nlogger = logging.getLogger(\"arifOS.Minimax\")\n\n\n@dataclass\nclass MinimaxEnvelope:\n ok: bool\n text: str\n error: str = \"\"\n\n\nasync def minimax_generate(prompt: str, max_tokens: int = 1000) -> MinimaxEnvelope:\n \"\"\"\n Real Intelligence fallback using Minimax API.\n Replaces missing Ollama for 111-333 Reasoning.\n \"\"\"\n api_key = os.getenv(\"MINIMAX_API_KEY\")\n if not api_key:\n return MinimaxEnvelope(False, \"\", \"MINIMAX_API_KEY missing from environment\")\n\n # Minimax V2 (ChatCompletion)\n url = \"https://api.minimax.io/text/chatcompletion_v2\"\n headers = {\"Authorization\": f\"Bearer {api_key}\", \"Content-Type\": \"application/json\"}\n\n payload = {\n \"model\": \"abab6.5s-chat\", # Fast but capable for reasoning\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are the arifOS AGI Mind (Stage 111-333). Apply constitutional physics (ΔS ≤ 0).\",\n },\n {\"role\": \"user\", \"content\": prompt},\n ],\n \"max_tokens\": max_tokens,\n }\n\n try:\n async with httpx.AsyncClient(timeout=30.0) as client:\n response = await client.post(url, headers=headers, json=payload)\n response.raise_for_status()\n data = response.json()\n\n # Correct Minimax V2 response parsing\n if \"choices\" in data and len(data[\"choices\"]) > 0:\n content = data[\"choices\"][0][\"message\"][\"content\"]\n return MinimaxEnvelope(True, content)\n else:\n return MinimaxEnvelope(False, \"\", f\"Unexpected API structure: {data}\")\n\n except Exception as e:\n logger.error(f\"Minimax API Error: {e}\")\n return MinimaxEnvelope(False, \"\", str(e))\n"}}}}