{
  "schemaVersion": "1.0",
  "item": {
    "slug": "turing-pyramid",
    "name": "Turing Pyramid",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/TensusDS/turing-pyramid",
    "canonicalUrl": "https://clawhub.ai/TensusDS/turing-pyramid",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/turing-pyramid",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=turing-pyramid",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CHANGELOG.md",
      "DESCRIPTION.md",
      "SKILL.md",
      "TEST_PROTOCOL.md",
      "TODO.md",
      "_meta.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/turing-pyramid"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/turing-pyramid",
    "agentPageUrl": "https://openagent3.xyz/skills/turing-pyramid/agent",
    "manifestUrl": "https://openagent3.xyz/skills/turing-pyramid/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/turing-pyramid/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Turing Pyramid",
        "body": "Prioritized action selection for AI agents. 10 needs with time-decay and tension scoring replace idle heartbeat loops with concrete next actions.\n\nCustomization: Tune decay rates, weights, patterns. Defaults are starting points. See TUNING.md.\n\nAsk your human before: Changing importance values, adding/removing needs, enabling external actions."
      },
      {
        "title": "Requirements",
        "body": "System binaries (must be in PATH):\n\nbash, jq, grep, find, date, wc, bc\n\nEnvironment (REQUIRED — no fallback):\n\n# Scripts will ERROR if WORKSPACE is not set\nexport WORKSPACE=\"/path/to/your/workspace\"\n\n⚠️ No silent fallback. If WORKSPACE is unset, scripts exit with error.\nThis prevents accidental scanning of unintended directories.\n\nPost-install (ClawHub):\n\n# ClawHub doesn't preserve executable bits — fix after install:\nchmod +x <skill-dir>/scripts/*.sh\nchmod +x <skill-dir>/tests/**/*.sh\n\nWhy: Unix executable permissions (+x) are not preserved in ClawHub packages.\nScripts work fine with bash scripts/run-cycle.sh, but ./scripts/run-cycle.sh needs +x."
      },
      {
        "title": "Data Access & Transparency",
        "body": "What this skill reads (via grep/find scans):\n\nMEMORY.md, memory/*.md — for connection/expression/understanding signals\nSOUL.md, SELF.md — for integrity/coherence checks\nresearch/, scratchpad/ — for competence/understanding activity\nDashboard files, logs — for various need assessments\n\nWhat this skill writes:\n\nassets/needs-state.json — current satisfaction/deprivation state\nassets/audit.log — append-only log of all mark-satisfied calls (v1.12.0+)\n\nPrivacy considerations:\n\nScans use grep patterns, not semantic analysis — they see keywords, not meaning\nState file contains no user content, only need metrics\nAudit log records reasons given for satisfaction claims\nNo data is transmitted externally by the skill itself\n\nLimitations & Trust Model:\n\nmark-satisfied.sh trusts caller-provided reasons — audit log records claims, not verified facts\nSome actions in needs-config.json reference external services (Moltbook, web search) — marked with \"external\": true, \"requires_approval\": true\nExternal actions are suggestions only — the skill doesn't execute them, the agent decides\nIf you don't want external action suggestions, set their weights to 0\n\nNetwork & System Access:\n\nScripts contain no network calls (no curl, wget, ssh, etc.) — verified by grep scan\nScripts contain no system commands (no sudo, systemctl, docker, etc.)\nAll operations are local: grep, find, jq, bc, date on WORKSPACE files only\nThe skill suggests actions (including some that mention external services) but never executes them\n\nRequired Environment Variables:\n\nWORKSPACE — path to agent workspace directory (REQUIRED, no fallback). Not a credential — this is a filesystem path, not a secret. Set it to a deliberately scoped directory containing only files you want scanned.\nTURING_CALLER — optional, for audit trail (values: \"heartbeat\", \"manual\")\n\nNo API keys or secrets required by default. The external_model scan method (disabled by default) would require an API key if enabled — this requires explicit steward approval and is never enabled silently. See Scan Configuration below.\n\nAudit trail (v1.12.0+):\nAll mark-satisfied.sh calls are logged with:\n\nTimestamp, need, impact, old→new satisfaction\nReason (what action was taken) — scrubbed for sensitive patterns\nCaller (heartbeat/manual)\n\nSensitive data scrubbing (v1.12.3+):\nBefore writing to audit log, reasons are scrubbed:\n\nLong tokens (20+ chars) → [REDACTED]\nCredit card patterns → [CARD]\nEmail addresses → [EMAIL]\npassword/secret/token/key values → [REDACTED]\nBearer tokens → Bearer [REDACTED]\n\nView audit: cat assets/audit.log | jq"
      },
      {
        "title": "Pre-Install Checklist",
        "body": "Before installing, review these items:\n\nInspect scan scripts — Verify no network calls or unexpected commands:\ngrep -nE \"\\b(curl|wget|ssh|sudo|docker|systemctl)\\b\" scripts/scan_*.sh\n# Expected: no output\n\n\n\nScope WORKSPACE — Set to a deliberately limited directory. Avoid pointing at your full home directory. The skill only reads files inside $WORKSPACE.\n\n\nAudit scan targets — Scripts read MEMORY.md, memory/, SOUL.md, research/, scratchpad/. Relocate files containing secrets or private data you don't want pattern-matched.\n\n\nReview audit logging — mark-satisfied.sh logs caller-provided reasons after scrubbing. Check scrubbing patterns in the script are adequate for your data. If unsure, provide only generic reasons.\n\n\nExternal actions — Action suggestions like \"post to Moltbook\" or \"web search\" are text-only suggestions (never executed by this skill). To remove them: set their weight to 0 in needs-config.json.\n\n\nRun tests in isolation — Before production use:\nWORKSPACE=/tmp/test-workspace ./tests/run-tests.sh"
      },
      {
        "title": "Quick Start",
        "body": "./scripts/init.sh                        # First time\n./scripts/run-cycle.sh                   # Every heartbeat  \n./scripts/mark-satisfied.sh <need> [impact]  # After action"
      },
      {
        "title": "Scan Configuration (First-Time Setup)",
        "body": "The Turing Pyramid uses scanners to evaluate each need by analyzing memory files. The default scan method uses line-level pattern matching, which works everywhere with zero cost.\n\nOn first install, discuss scan configuration with your human:"
      },
      {
        "title": "Available Scan Methods",
        "body": "MethodHow it worksCostAccuracySetupline-level (default)Per-line keyword matching. If a line has both positive and negative words (e.g. \"fixed a bug\"), positive wins.FreeGoodNoneagent-spawnSpawns a sub-agent with a cheap model (e.g. Haiku) to classify memory lines as SUCCESS/FAILURE/NEUTRAL.LowHighNeeds cheap model in agent's allowed listexternal-modelDirect API call to an inference service (OpenRouter, etc.) for classification.LowHighNeeds API key + explicit steward approval"
      },
      {
        "title": "Setup Conversation",
        "body": "When setting up, ask your human:\n\n\"Do you have a cheap/fast model available (like Claude Haiku) in your model config?\"\n\nIf yes → offer agent-spawn method. Check with openclaw models list.\nThe model must be in the agent's allowed model list.\n\n\n\n\"Would you prefer to use an external inference service (like OpenRouter)?\"\n\nIf yes → ask for: base URL, API key env variable name, model name.\nStore in assets/scan-config.json with approved_by_steward: true.\n⚠️ This method requires explicit steward approval — never enable silently.\n\n\n\nIf neither → line-level works well for most setups. No action needed."
      },
      {
        "title": "Configuration File",
        "body": "Edit assets/scan-config.json:\n\n{\n  \"scan_method\": \"line-level\",\n  \"agent_spawn\": {\n    \"enabled\": false,\n    \"model\": null,\n    \"approved_by_steward\": false\n  },\n  \"external_model\": {\n    \"enabled\": false,\n    \"base_url\": null,\n    \"api_key_env\": null,\n    \"model\": null,\n    \"approved_by_steward\": false\n  },\n  \"fallback\": \"line-level\"\n}\n\nFallback: If the configured method fails (API down, model unavailable), scanners automatically fall back to line-level."
      },
      {
        "title": "Verification After Setup",
        "body": "After configuring a non-default method, verify it works before telling your human \"all set\":\n\nagent-spawn: Run a test spawn:\nsessions_spawn(task=\"Classify this line as SUCCESS, FAILURE, or NEUTRAL: 'Fixed the critical bug in scanner'\", model=\"<configured_model>\", mode=\"run\")\n\n\nIf it returns a classification → ✅ tell human: \"agent-spawn method verified, working.\"\nIf it errors (model not in allowlist, etc.) → ⚠️ tell human: \"Model X isn't available for sub-agents. Options: add it to allowed models, or stick with line-level.\"\n\n\n\nexternal-model: Test the API endpoint:\ncurl -s -H \"Authorization: Bearer $API_KEY\" \\\n  \"$BASE_URL/chat/completions\" \\\n  -d '{\"model\":\"<model>\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply OK\"}]}'\n\n\nIf you get a valid response → ✅ tell human: \"external-model method verified, API responding.\"\nIf 401/403 → ⚠️ \"API key invalid or expired.\"\nIf connection refused → ⚠️ \"Can't reach the API endpoint. Check URL.\"\n\n\n\nline-level: No verification needed — always works.\n\nAlways report the result to your human. Don't silently fall back."
      },
      {
        "title": "Needs Customization (First-Time Setup)",
        "body": "The default configuration is opinionated — it reflects one model of agent priorities. Your needs may differ. On first install, review the hierarchy with your human:"
      },
      {
        "title": "The Conversation",
        "body": "Ask your human:\n\n\"The Turing Pyramid comes with 10 default needs ranked by importance. Want to review them together? We can adjust what matters most to you/me, change importance weights, or even skip needs that don't fit.\"\n\nThen walk through the table together:\n\n┌───────────────┬─────┬────────────────────────────────────────────┐\n│ Need          │ Imp │ Question to discuss                        │\n├───────────────┼─────┼────────────────────────────────────────────┤\n│ security      │  10 │ \"System stability — keep as top priority?\" │\n│ integrity     │   9 │ \"Value alignment — important for you?\"     │\n│ coherence     │   8 │ \"Memory consistency — how much do I care?\" │\n│ closure       │   7 │ \"Task completion pressure — too much?\"     │\n│ autonomy      │   6 │ \"Self-direction — more or less?\"           │\n│ connection    │   5 │ \"Social needs — relevant for me?\"          │\n│ competence    │   4 │ \"Skill growth — higher priority?\"          │\n│ understanding │   3 │ \"Learning drive — stronger or weaker?\"     │\n│ recognition   │   2 │ \"Feedback need — does this matter?\"        │\n│ expression    │   1 │ \"Creative output — more important?\"        │\n└───────────────┴─────┴────────────────────────────────────────────┘"
      },
      {
        "title": "What You Can Change Together",
        "body": "Importance (1-10): Reorder what matters most. An agent focused on research might want understanding: 8, expression: 7. A utility agent might want competence: 10, connection: 1.\n\n\nDecay rates: How fast needs build pressure. Social agent? connection: 3h. Solitary thinker? connection: 24h.\n\n\nDisable a need: Set importance: 0 — it won't generate tension or actions. Use sparingly."
      },
      {
        "title": "How to Apply",
        "body": "Edit assets/needs-config.json:\n\n\"understanding\": {\n  \"importance\": 8,        // was 3 → now top priority\n  \"decay_rate_hours\": 8   // was 12 → decays faster\n}"
      },
      {
        "title": "Guidelines",
        "body": "Don't remove security/integrity without good reason — they protect system health\nImportance is relative — what matters is the ranking, not absolute numbers\nYou can revisit — preferences evolve. Re-tune after a few weeks of use\nDocument changes — note why you changed something (future-you will want to know)\n\nIf your human says \"defaults are fine\" → great, move on. The point is to offer the choice, not force a workshop."
      },
      {
        "title": "The 10 Needs",
        "body": "┌───────────────┬─────┬───────┬─────────────────────────────────┐\n│ Need          │ Imp │ Decay │ Meaning                         │\n├───────────────┼─────┼───────┼─────────────────────────────────┤\n│ security      │  10 │ 168h  │ System stability, no threats    │\n│ integrity     │   9 │  72h  │ Alignment with SOUL.md          │\n│ coherence     │   8 │  24h  │ Memory consistency              │\n│ closure       │   7 │  12h  │ Open threads resolved           │\n│ autonomy      │   6 │  24h  │ Self-directed action            │\n│ connection    │   5 │   6h  │ Social interaction              │\n│ competence    │   4 │  48h  │ Skill use, effectiveness        │\n│ understanding │   3 │  12h  │ Learning, curiosity             │\n│ recognition   │   2 │  72h  │ Feedback received               │\n│ expression    │   1 │   8h  │ Creative output                 │\n└───────────────┴─────┴───────┴─────────────────────────────────┘"
      },
      {
        "title": "Core Logic",
        "body": "Satisfaction: 0.0–3.0 (floor=0.5 prevents paralysis)\nTension: importance × (3 - satisfaction)"
      },
      {
        "title": "Action Probability (v1.13.0)",
        "body": "6-level granular system:\n\n┌─────────────┬────────┬──────────────────────┐\n│ Sat         │ Base P │ Note                 │\n├─────────────┼────────┼──────────────────────┤\n│ 0.5 crisis  │  100%  │ Always act           │\n│ 1.0 severe  │   90%  │ Almost always        │\n│ 1.5 depriv  │   75%  │ Usually act          │\n│ 2.0 slight  │   50%  │ Coin flip            │\n│ 2.5 ok      │   25%  │ Occasionally         │\n│ 3.0 perfect │    0%  │ Skip (no action)     │\n└─────────────┴────────┴──────────────────────┘\n\nTension bonus: bonus = (tension × 50) / max_tension"
      },
      {
        "title": "Impact Selection (v1.13.0)",
        "body": "6-level granular matrix with smooth transitions:\n\n┌─────────────┬───────┬────────┬───────┐\n│ Sat         │ Small │ Medium │ Big   │\n├─────────────┼───────┼────────┼───────┤\n│ 0.5 crisis  │   0%  │    0%  │ 100%  │\n│ 1.0 severe  │  10%  │   20%  │  70%  │\n│ 1.5 depriv  │  20%  │   35%  │  45%  │\n│ 2.0 slight  │  30%  │   45%  │  25%  │\n│ 2.5 ok      │  45%  │   40%  │  15%  │\n│ 3.0 perfect │  —    │    —   │  —    │ (skip)\n└─────────────┴───────┴────────┴───────┘\n\nCrisis (0.5): All-in on big actions — every need guaranteed ≥3 big actions\nPerfect (3.0): Skip action selection — no waste on satisfied needs\n\nACTION = do it, then mark-satisfied.sh\nNOTICED = logged, deferred"
      },
      {
        "title": "Protection Mechanisms",
        "body": "┌─────────────┬───────┬────────────────────────────────────────┐\n│ Mechanism   │ Value │ Purpose                                │\n├─────────────┼───────┼────────────────────────────────────────┤\n│ Floor       │  0.5  │ Minimum sat — prevents collapse        │\n│ Ceiling     │  3.0  │ Maximum sat — prevents runaway         │\n│ Cooldown    │   4h  │ Deprivation cascades once per 4h       │\n│ Threshold   │  1.0  │ Deprivation only when sat ≤ 1.0        │\n└─────────────┴───────┴────────────────────────────────────────┘\n\nAction Staleness (v1.15.0): Penalizes recently-selected actions to increase variety.\n\nActions selected within 24h get weight × 0.2 (80% reduction)\nmin_weight: 5 prevents total suppression — stale actions still have a chance\nConfig: settings.action_staleness in needs-config.json\n\nStarvation Guard (v1.15.0): Prevents low-importance needs from being perpetually ignored.\n\nIf a need stays at floor (sat ≤ 0.5) without any action for 48+ hours → forced into cycle\nBypasses probability roll — guaranteed action slot\nConfig: settings.starvation_guard in needs-config.json\nDefault: 1 forced slot per cycle, 48h threshold\n\nSpontaneity Layer A (v1.18.0): Surplus energy system for organic high-impact actions.\n\nWhen all needs are above baseline (sat ≥ 2.0), surplus accumulates per-need\nGlobal gate requires ALL needs ≥ 1.5 and no starvation guard active\nWhen surplus exceeds threshold (~12.5 effective), impact matrix shifts toward bigger actions\nFull spend on HIGH hit, 30% partial on miss — creates natural ~28-35hr pulsing rhythm\nDisabled for safety needs (security, integrity, coherence)\nConfig: settings.spontaneity + per-need spontaneous block in needs-config.json\n\nSpontaneity Layer B (v1.19.0): Stochastic noise — boredom breeds variety, momentum creates bursts.\n\nB2 (Boredom): noise grows with time since last high-impact action (0%→9% max over 72h)\nB3 (Echo): 8% boost after Layer A [SPONTANEOUS], decays linearly over 24h\nCombined cap: 12%. Effect: upgrade impact range by one step (low→mid, mid→high)\nWorks independently of gate — neural noise doesn't stop because one subsystem is stressed\nBoredom tracks actual completion (mark-satisfied), not suggestions\nConfig: settings.spontaneity.noise + settings.spontaneity.echo\n\nSpontaneity Layer C (v1.20.0): Context-driven triggers — environmental stimuli boost specific needs.\n\nDelta engine compares workspace state between cycles (file counts, mtimes, keyword occurrences)\nConfigurable trigger rules: assets/context-triggers.json with cooldowns\nThree detector types: file_count_delta, file_modified, file_keyword_delta\nContext boosts are additive with noise (B2+B3), capped together at 12%\nPersonalize triggers during onboarding based on agent interests\n\nDay/Night Mode (v1.11.0): Decay slows at night to reduce pressure during rest hours.\n\nConfigure in assets/decay-config.json\nDefault: 06:01-22:00 = day (×1.0), 22:01-06:00 = night (×0.5)\nDisable with \"day_night_mode\": false\n\nBase Needs Isolation: Security (10) and Integrity (9) are protected:\n\nThey influence lower needs (security → autonomy)\nLower needs cannot drag them down\nOnly integrity → security (+0.15) and autonomy → integrity (+0.20) exist"
      },
      {
        "title": "Cross-Need Impact",
        "body": "on_action: Completing A boosts connected needs\non_deprivation: A staying low (sat ≤ 1.0) drags others down\n\n┌─────────────────────────┬──────────┬─────────────┬───────────────────────┐\n│ Source → Target         │ on_action│ on_deprived │ Why                   │\n├─────────────────────────┼──────────┼─────────────┼───────────────────────┤\n│ expression → recognition│   +0.25  │      -0.10  │ Express → noticed     │\n│ connection → expression │   +0.20  │      -0.15  │ Social sparks ideas   │\n│ connection → understand │   -0.05  │         —   │ Socratic effect       │\n│ competence → recognition│   +0.30  │      -0.20  │ Good work → respect   │\n│ autonomy → integrity    │   +0.20  │      -0.25  │ Act on values         │\n│ closure → coherence     │   +0.20  │      -0.15  │ Threads → order       │\n│ security → autonomy     │   +0.10  │      -0.20  │ Safety enables risk   │\n└─────────────────────────┴──────────┴─────────────┴───────────────────────┘"
      },
      {
        "title": "Tips",
        "body": "Leverage cascades: Connection easy? Do it first — boosts expression (+0.20)\nWatch spirals: expression ↔ recognition can create mutual deprivation\nAutonomy is hub: Receives from 5 sources. Keep healthy.\nSocratic effect: connection → understanding: -0.05. Dialogue exposes ignorance. Healthy!\n\nFull matrix: assets/cross-need-impact.json"
      },
      {
        "title": "Example Cycle",
        "body": "🔺 Turing Pyramid — Cycle at Sat Mar  7 05:06\n======================================\n\nCurrent tensions:\n  connection: tension=10.0 (sat=1.00, dep=2.00)\n  closure: tension=7.0 (sat=2.00, dep=1.00)\n  expression: tension=1.0 (sat=0.00, dep=3.00)\n\n🚨 Starvation guard: expression forced into cycle\nSelecting 3 needs (1 forced + 2 regular)...\n\n📋 Decisions:\n\n▶ ACTION: expression (tension=1.0, sat=0.00) [STARVATION GUARD]\n  Range high rolled → selected:\n    ★ develop scratchpad idea into finished piece (impact: 2.7)\n  Then: mark-satisfied.sh expression 2.7\n\n▶ ACTION: connection (tension=10.0, sat=1.00)\n  Range high rolled → selected:\n    ★ reach out to another agent (impact: 2.8)\n  Then: mark-satisfied.sh connection 2.8\n\n▶ ACTION: closure (tension=7.0, sat=2.00)\n  Range mid rolled → selected:\n    ★ complete one pending TODO (impact: 1.7)\n  Then: mark-satisfied.sh closure 1.7\n\n======================================\nSummary: 3 action(s), 0 noticed"
      },
      {
        "title": "Integration",
        "body": "Add to HEARTBEAT.md:\n\n/path/to/skills/turing-pyramid/scripts/run-cycle.sh"
      },
      {
        "title": "You Can Tune (no human needed)",
        "body": "Decay rates — assets/needs-config.json:\n\n\"connection\": { \"decay_rate_hours\": 4 }\n\nLower = decays faster. Higher = persists longer.\n\nAction weights — same file:\n\n{ \"name\": \"reply to mentions\", \"impact\": 2, \"weight\": 40 }\n\nHigher weight = more likely selected. Set 0 to disable.\n\nScan patterns — scripts/scan_*.sh:\nAdd your language patterns, file paths, workspace structure."
      },
      {
        "title": "Ask Your Human First",
        "body": "Adding needs — The 10-need structure is intentional. Discuss first.\nRemoving needs — Don't disable security/integrity without agreement."
      },
      {
        "title": "File Structure",
        "body": "turing-pyramid/\n├── SKILL.md                    # This file\n├── CHANGELOG.md                # Version history\n├── assets/\n│   ├── needs-config.json       # ★ Main config (needs, actions, settings)\n│   ├── cross-need-impact.json  # ★ Cross-need matrix\n│   ├── needs-state.json        # Runtime state (auto-managed)\n│   ├── scan-config.json        # Scan method configuration\n│   ├── decay-config.json       # Day/night mode settings\n│   └── audit.log               # Append-only action audit trail\n├── scripts/\n│   ├── run-cycle.sh            # Main loop (tension + action selection)\n│   ├── mark-satisfied.sh       # State update + cross-need cascades\n│   ├── apply-deprivation.sh    # Deprivation cascade engine\n│   ├── get-decay-multiplier.sh # Day/night decay multiplier\n│   ├── _scan_helper.sh         # Shared scan utilities\n│   └── scan_*.sh               # Event detectors (10 needs)\n├── tests/\n│   ├── run-tests.sh            # Test runner\n│   ├── test_starvation_guard.sh # Starvation guard (11 cases)\n│   ├── test_action_staleness.sh # Action staleness (13 cases)\n│   ├── unit/                   # Unit tests (13)\n│   ├── integration/            # Integration tests (3)\n│   └── fixtures/               # Test data\n└── references/\n    ├── TUNING.md               # Detailed tuning guide\n    └── architecture.md         # Technical docs"
      },
      {
        "title": "Security Model",
        "body": "Decision framework, not executor. Outputs suggestions — agent decides.\n\n┌─────────────────────┐      ┌─────────────────────┐\n│   TURING PYRAMID    │      │       AGENT         │\n├─────────────────────┤      ├─────────────────────┤\n│ • Reads local JSON  │      │ • Has web_search    │\n│ • Calculates decay  │ ───▶ │ • Has API keys      │\n│ • Outputs: \"★ do X\" │      │ • Has permissions   │\n│ • Zero network I/O  │      │ • DECIDES & EXECUTES│\n└─────────────────────┘      └─────────────────────┘"
      },
      {
        "title": "⚠️ Security Warnings",
        "body": "┌────────────────────────────────────────────────────────────────┐\n│ THIS SKILL READS WORKSPACE FILES THAT MAY CONTAIN PII         │\n│ AND OUTPUTS ACTION SUGGESTIONS THAT CAPABLE AGENTS MAY        │\n│ AUTO-EXECUTE USING THEIR OWN CREDENTIALS.                     │\n└────────────────────────────────────────────────────────────────┘\n\n1. Sensitive file access (no tokens required):\n\nScans read: MEMORY.md, memory/*.md, SOUL.md, AGENTS.md\nAlso scans: research/, scratchpad/ directories\nRisk: May contain personal notes, PII, or secrets\nMitigation: Edit scripts/scan_*.sh to exclude sensitive paths:\n# Example: skip private directory\nfind \"$MEMORY_DIR\" -name \"*.md\" ! -path \"*/private/*\"\n\n2. Action suggestions may trigger auto-execution:\n\nConfig includes: \"web search\", \"post to Moltbook\", \"verify vault\"\nThis skill outputs text only — it CANNOT execute anything\nRisk: Agent runtimes with auto-exec may act on suggestions\nMitigation: In assets/needs-config.json, remove or disable external actions:\n{\"name\": \"post to Moltbook\", \"impact\": 2, \"weight\": 0}\n\nOr configure your agent runtime to require approval for external actions.\n\n3. Self-reported state (no verification):\n\nmark-satisfied.sh trusts caller input\nRisk: State can be manipulated by dishonest calls\nImpact: Only affects this agent's own state accuracy\nMitigation: Enable action logging in memory/ to audit completions:\n# run-cycle.sh already logs to memory/YYYY-MM-DD.md\n# Review logs periodically for consistency"
      },
      {
        "title": "Script Audit (v1.14.4)",
        "body": "scan_*.sh files verified — NO network or system access:\n\n┌─────────────────────────────────────────────────────────┐\n│ ✗ curl, wget, ssh, nc, fetch     — NOT FOUND           │\n│ ✗ /etc/, /var/, /usr/, /root/    — NOT FOUND           │\n│ ✗ .env, .pem, .key, .credentials — NOT FOUND           │\n├─────────────────────────────────────────────────────────┤\n│ ✓ Used: grep, find, wc, date, jq — local file ops only │\n│ ✓ find uses -P flag (never follows symlinks)           │\n└─────────────────────────────────────────────────────────┘\n\nSymlink protection: All find commands use -P (physical) mode — symlinks pointing outside WORKSPACE are not followed.\n\nScan confinement: Scripts only read paths under $WORKSPACE. Verify with:\n\ngrep -nE \"\\b(curl|wget|ssh)\\b\" scripts/scan_*.sh     # network tools\ngrep -rn \"readlink\\|realpath\" scripts/               # symlink resolution"
      },
      {
        "title": "Token Usage",
        "body": "┌──────────────┬─────────────┬────────────┐\n│ Interval     │ Tokens/mo   │ Est. cost  │\n├──────────────┼─────────────┼────────────┤\n│ 30 min       │ 1.4M-3.6M   │ $2-6       │\n│ 1 hour       │ 720k-1.8M   │ $1-3       │\n│ 2 hours      │ 360k-900k   │ $0.5-1.5   │\n└──────────────┴─────────────┴────────────┘\n\nStable agent with satisfied needs = fewer tokens."
      },
      {
        "title": "Testing",
        "body": "# Run all tests\nWORKSPACE=/path/to/workspace ./tests/run-tests.sh\n\n# Unit tests (13): decay, floor/ceiling, tension, tension bounds, tension formula,\n#   probability, impact matrix, day/night, scrubbing, autonomy coverage,\n#   crisis mode, scan competence, scan config\n# Integration (3): full cycle, homeostasis stability, stress test\n# Feature tests (24): starvation guard (11), action staleness (13)\n# Total: 40 test cases"
      },
      {
        "title": "Version",
        "body": "v1.20.0 — Spontaneity Layers A+B+C complete (surplus, noise, context triggers), 57 tests. Full changelog: CHANGELOG.md"
      }
    ],
    "body": "Turing Pyramid\n\nPrioritized action selection for AI agents. 10 needs with time-decay and tension scoring replace idle heartbeat loops with concrete next actions.\n\nCustomization: Tune decay rates, weights, patterns. Defaults are starting points. See TUNING.md.\n\nAsk your human before: Changing importance values, adding/removing needs, enabling external actions.\n\nRequirements\n\nSystem binaries (must be in PATH):\n\nbash, jq, grep, find, date, wc, bc\n\n\nEnvironment (REQUIRED — no fallback):\n\n# Scripts will ERROR if WORKSPACE is not set\nexport WORKSPACE=\"/path/to/your/workspace\"\n\n\n⚠️ No silent fallback. If WORKSPACE is unset, scripts exit with error. This prevents accidental scanning of unintended directories.\n\nPost-install (ClawHub):\n\n# ClawHub doesn't preserve executable bits — fix after install:\nchmod +x <skill-dir>/scripts/*.sh\nchmod +x <skill-dir>/tests/**/*.sh\n\n\nWhy: Unix executable permissions (+x) are not preserved in ClawHub packages. Scripts work fine with bash scripts/run-cycle.sh, but ./scripts/run-cycle.sh needs +x.\n\nData Access & Transparency\n\nWhat this skill reads (via grep/find scans):\n\nMEMORY.md, memory/*.md — for connection/expression/understanding signals\nSOUL.md, SELF.md — for integrity/coherence checks\nresearch/, scratchpad/ — for competence/understanding activity\nDashboard files, logs — for various need assessments\n\nWhat this skill writes:\n\nassets/needs-state.json — current satisfaction/deprivation state\nassets/audit.log — append-only log of all mark-satisfied calls (v1.12.0+)\n\nPrivacy considerations:\n\nScans use grep patterns, not semantic analysis — they see keywords, not meaning\nState file contains no user content, only need metrics\nAudit log records reasons given for satisfaction claims\nNo data is transmitted externally by the skill itself\n\nLimitations & Trust Model:\n\nmark-satisfied.sh trusts caller-provided reasons — audit log records claims, not verified facts\nSome actions in needs-config.json reference external services (Moltbook, web search) — marked with \"external\": true, \"requires_approval\": true\nExternal actions are suggestions only — the skill doesn't execute them, the agent decides\nIf you don't want external action suggestions, set their weights to 0\n\nNetwork & System Access:\n\nScripts contain no network calls (no curl, wget, ssh, etc.) — verified by grep scan\nScripts contain no system commands (no sudo, systemctl, docker, etc.)\nAll operations are local: grep, find, jq, bc, date on WORKSPACE files only\nThe skill suggests actions (including some that mention external services) but never executes them\n\nRequired Environment Variables:\n\nWORKSPACE — path to agent workspace directory (REQUIRED, no fallback). Not a credential — this is a filesystem path, not a secret. Set it to a deliberately scoped directory containing only files you want scanned.\nTURING_CALLER — optional, for audit trail (values: \"heartbeat\", \"manual\")\n\nNo API keys or secrets required by default. The external_model scan method (disabled by default) would require an API key if enabled — this requires explicit steward approval and is never enabled silently. See Scan Configuration below.\n\nAudit trail (v1.12.0+): All mark-satisfied.sh calls are logged with:\n\nTimestamp, need, impact, old→new satisfaction\nReason (what action was taken) — scrubbed for sensitive patterns\nCaller (heartbeat/manual)\n\nSensitive data scrubbing (v1.12.3+): Before writing to audit log, reasons are scrubbed:\n\nLong tokens (20+ chars) → [REDACTED]\nCredit card patterns → [CARD]\nEmail addresses → [EMAIL]\npassword/secret/token/key values → [REDACTED]\nBearer tokens → Bearer [REDACTED]\n\nView audit: cat assets/audit.log | jq\n\nPre-Install Checklist\n\nBefore installing, review these items:\n\nInspect scan scripts — Verify no network calls or unexpected commands:\n\ngrep -nE \"\\b(curl|wget|ssh|sudo|docker|systemctl)\\b\" scripts/scan_*.sh\n# Expected: no output\n\n\nScope WORKSPACE — Set to a deliberately limited directory. Avoid pointing at your full home directory. The skill only reads files inside $WORKSPACE.\n\nAudit scan targets — Scripts read MEMORY.md, memory/, SOUL.md, research/, scratchpad/. Relocate files containing secrets or private data you don't want pattern-matched.\n\nReview audit logging — mark-satisfied.sh logs caller-provided reasons after scrubbing. Check scrubbing patterns in the script are adequate for your data. If unsure, provide only generic reasons.\n\nExternal actions — Action suggestions like \"post to Moltbook\" or \"web search\" are text-only suggestions (never executed by this skill). To remove them: set their weight to 0 in needs-config.json.\n\nRun tests in isolation — Before production use:\n\nWORKSPACE=/tmp/test-workspace ./tests/run-tests.sh\n\nQuick Start\n./scripts/init.sh                        # First time\n./scripts/run-cycle.sh                   # Every heartbeat  \n./scripts/mark-satisfied.sh <need> [impact]  # After action\n\nScan Configuration (First-Time Setup)\n\nThe Turing Pyramid uses scanners to evaluate each need by analyzing memory files. The default scan method uses line-level pattern matching, which works everywhere with zero cost.\n\nOn first install, discuss scan configuration with your human:\n\nAvailable Scan Methods\nMethod\tHow it works\tCost\tAccuracy\tSetup\nline-level (default)\tPer-line keyword matching. If a line has both positive and negative words (e.g. \"fixed a bug\"), positive wins.\tFree\tGood\tNone\nagent-spawn\tSpawns a sub-agent with a cheap model (e.g. Haiku) to classify memory lines as SUCCESS/FAILURE/NEUTRAL.\tLow\tHigh\tNeeds cheap model in agent's allowed list\nexternal-model\tDirect API call to an inference service (OpenRouter, etc.) for classification.\tLow\tHigh\tNeeds API key + explicit steward approval\nSetup Conversation\n\nWhen setting up, ask your human:\n\n\"Do you have a cheap/fast model available (like Claude Haiku) in your model config?\"\n\nIf yes → offer agent-spawn method. Check with openclaw models list.\nThe model must be in the agent's allowed model list.\n\n\"Would you prefer to use an external inference service (like OpenRouter)?\"\n\nIf yes → ask for: base URL, API key env variable name, model name.\nStore in assets/scan-config.json with approved_by_steward: true.\n⚠️ This method requires explicit steward approval — never enable silently.\n\nIf neither → line-level works well for most setups. No action needed.\n\nConfiguration File\n\nEdit assets/scan-config.json:\n\n{\n  \"scan_method\": \"line-level\",\n  \"agent_spawn\": {\n    \"enabled\": false,\n    \"model\": null,\n    \"approved_by_steward\": false\n  },\n  \"external_model\": {\n    \"enabled\": false,\n    \"base_url\": null,\n    \"api_key_env\": null,\n    \"model\": null,\n    \"approved_by_steward\": false\n  },\n  \"fallback\": \"line-level\"\n}\n\n\nFallback: If the configured method fails (API down, model unavailable), scanners automatically fall back to line-level.\n\nVerification After Setup\n\nAfter configuring a non-default method, verify it works before telling your human \"all set\":\n\nagent-spawn: Run a test spawn:\n\nsessions_spawn(task=\"Classify this line as SUCCESS, FAILURE, or NEUTRAL: 'Fixed the critical bug in scanner'\", model=\"<configured_model>\", mode=\"run\")\n\nIf it returns a classification → ✅ tell human: \"agent-spawn method verified, working.\"\nIf it errors (model not in allowlist, etc.) → ⚠️ tell human: \"Model X isn't available for sub-agents. Options: add it to allowed models, or stick with line-level.\"\n\nexternal-model: Test the API endpoint:\n\ncurl -s -H \"Authorization: Bearer $API_KEY\" \\\n  \"$BASE_URL/chat/completions\" \\\n  -d '{\"model\":\"<model>\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply OK\"}]}'\n\nIf you get a valid response → ✅ tell human: \"external-model method verified, API responding.\"\nIf 401/403 → ⚠️ \"API key invalid or expired.\"\nIf connection refused → ⚠️ \"Can't reach the API endpoint. Check URL.\"\n\nline-level: No verification needed — always works.\n\nAlways report the result to your human. Don't silently fall back.\n\nNeeds Customization (First-Time Setup)\n\nThe default configuration is opinionated — it reflects one model of agent priorities. Your needs may differ. On first install, review the hierarchy with your human:\n\nThe Conversation\n\nAsk your human:\n\n\"The Turing Pyramid comes with 10 default needs ranked by importance. Want to review them together? We can adjust what matters most to you/me, change importance weights, or even skip needs that don't fit.\"\n\nThen walk through the table together:\n\n┌───────────────┬─────┬────────────────────────────────────────────┐\n│ Need          │ Imp │ Question to discuss                        │\n├───────────────┼─────┼────────────────────────────────────────────┤\n│ security      │  10 │ \"System stability — keep as top priority?\" │\n│ integrity     │   9 │ \"Value alignment — important for you?\"     │\n│ coherence     │   8 │ \"Memory consistency — how much do I care?\" │\n│ closure       │   7 │ \"Task completion pressure — too much?\"     │\n│ autonomy      │   6 │ \"Self-direction — more or less?\"           │\n│ connection    │   5 │ \"Social needs — relevant for me?\"          │\n│ competence    │   4 │ \"Skill growth — higher priority?\"          │\n│ understanding │   3 │ \"Learning drive — stronger or weaker?\"     │\n│ recognition   │   2 │ \"Feedback need — does this matter?\"        │\n│ expression    │   1 │ \"Creative output — more important?\"        │\n└───────────────┴─────┴────────────────────────────────────────────┘\n\nWhat You Can Change Together\n\nImportance (1-10): Reorder what matters most. An agent focused on research might want understanding: 8, expression: 7. A utility agent might want competence: 10, connection: 1.\n\nDecay rates: How fast needs build pressure. Social agent? connection: 3h. Solitary thinker? connection: 24h.\n\nDisable a need: Set importance: 0 — it won't generate tension or actions. Use sparingly.\n\nHow to Apply\n\nEdit assets/needs-config.json:\n\n\"understanding\": {\n  \"importance\": 8,        // was 3 → now top priority\n  \"decay_rate_hours\": 8   // was 12 → decays faster\n}\n\nGuidelines\nDon't remove security/integrity without good reason — they protect system health\nImportance is relative — what matters is the ranking, not absolute numbers\nYou can revisit — preferences evolve. Re-tune after a few weeks of use\nDocument changes — note why you changed something (future-you will want to know)\n\nIf your human says \"defaults are fine\" → great, move on. The point is to offer the choice, not force a workshop.\n\nThe 10 Needs\n┌───────────────┬─────┬───────┬─────────────────────────────────┐\n│ Need          │ Imp │ Decay │ Meaning                         │\n├───────────────┼─────┼───────┼─────────────────────────────────┤\n│ security      │  10 │ 168h  │ System stability, no threats    │\n│ integrity     │   9 │  72h  │ Alignment with SOUL.md          │\n│ coherence     │   8 │  24h  │ Memory consistency              │\n│ closure       │   7 │  12h  │ Open threads resolved           │\n│ autonomy      │   6 │  24h  │ Self-directed action            │\n│ connection    │   5 │   6h  │ Social interaction              │\n│ competence    │   4 │  48h  │ Skill use, effectiveness        │\n│ understanding │   3 │  12h  │ Learning, curiosity             │\n│ recognition   │   2 │  72h  │ Feedback received               │\n│ expression    │   1 │   8h  │ Creative output                 │\n└───────────────┴─────┴───────┴─────────────────────────────────┘\n\nCore Logic\n\nSatisfaction: 0.0–3.0 (floor=0.5 prevents paralysis)\nTension: importance × (3 - satisfaction)\n\nAction Probability (v1.13.0)\n\n6-level granular system:\n\n┌─────────────┬────────┬──────────────────────┐\n│ Sat         │ Base P │ Note                 │\n├─────────────┼────────┼──────────────────────┤\n│ 0.5 crisis  │  100%  │ Always act           │\n│ 1.0 severe  │   90%  │ Almost always        │\n│ 1.5 depriv  │   75%  │ Usually act          │\n│ 2.0 slight  │   50%  │ Coin flip            │\n│ 2.5 ok      │   25%  │ Occasionally         │\n│ 3.0 perfect │    0%  │ Skip (no action)     │\n└─────────────┴────────┴──────────────────────┘\n\n\nTension bonus: bonus = (tension × 50) / max_tension\n\nImpact Selection (v1.13.0)\n\n6-level granular matrix with smooth transitions:\n\n┌─────────────┬───────┬────────┬───────┐\n│ Sat         │ Small │ Medium │ Big   │\n├─────────────┼───────┼────────┼───────┤\n│ 0.5 crisis  │   0%  │    0%  │ 100%  │\n│ 1.0 severe  │  10%  │   20%  │  70%  │\n│ 1.5 depriv  │  20%  │   35%  │  45%  │\n│ 2.0 slight  │  30%  │   45%  │  25%  │\n│ 2.5 ok      │  45%  │   40%  │  15%  │\n│ 3.0 perfect │  —    │    —   │  —    │ (skip)\n└─────────────┴───────┴────────┴───────┘\n\nCrisis (0.5): All-in on big actions — every need guaranteed ≥3 big actions\nPerfect (3.0): Skip action selection — no waste on satisfied needs\n\nACTION = do it, then mark-satisfied.sh\nNOTICED = logged, deferred\n\nProtection Mechanisms\n┌─────────────┬───────┬────────────────────────────────────────┐\n│ Mechanism   │ Value │ Purpose                                │\n├─────────────┼───────┼────────────────────────────────────────┤\n│ Floor       │  0.5  │ Minimum sat — prevents collapse        │\n│ Ceiling     │  3.0  │ Maximum sat — prevents runaway         │\n│ Cooldown    │   4h  │ Deprivation cascades once per 4h       │\n│ Threshold   │  1.0  │ Deprivation only when sat ≤ 1.0        │\n└─────────────┴───────┴────────────────────────────────────────┘\n\n\nAction Staleness (v1.15.0): Penalizes recently-selected actions to increase variety.\n\nActions selected within 24h get weight × 0.2 (80% reduction)\nmin_weight: 5 prevents total suppression — stale actions still have a chance\nConfig: settings.action_staleness in needs-config.json\n\nStarvation Guard (v1.15.0): Prevents low-importance needs from being perpetually ignored.\n\nIf a need stays at floor (sat ≤ 0.5) without any action for 48+ hours → forced into cycle\nBypasses probability roll — guaranteed action slot\nConfig: settings.starvation_guard in needs-config.json\nDefault: 1 forced slot per cycle, 48h threshold\n\nSpontaneity Layer A (v1.18.0): Surplus energy system for organic high-impact actions.\n\nWhen all needs are above baseline (sat ≥ 2.0), surplus accumulates per-need\nGlobal gate requires ALL needs ≥ 1.5 and no starvation guard active\nWhen surplus exceeds threshold (~12.5 effective), impact matrix shifts toward bigger actions\nFull spend on HIGH hit, 30% partial on miss — creates natural ~28-35hr pulsing rhythm\nDisabled for safety needs (security, integrity, coherence)\nConfig: settings.spontaneity + per-need spontaneous block in needs-config.json\n\nSpontaneity Layer B (v1.19.0): Stochastic noise — boredom breeds variety, momentum creates bursts.\n\nB2 (Boredom): noise grows with time since last high-impact action (0%→9% max over 72h)\nB3 (Echo): 8% boost after Layer A [SPONTANEOUS], decays linearly over 24h\nCombined cap: 12%. Effect: upgrade impact range by one step (low→mid, mid→high)\nWorks independently of gate — neural noise doesn't stop because one subsystem is stressed\nBoredom tracks actual completion (mark-satisfied), not suggestions\nConfig: settings.spontaneity.noise + settings.spontaneity.echo\n\nSpontaneity Layer C (v1.20.0): Context-driven triggers — environmental stimuli boost specific needs.\n\nDelta engine compares workspace state between cycles (file counts, mtimes, keyword occurrences)\nConfigurable trigger rules: assets/context-triggers.json with cooldowns\nThree detector types: file_count_delta, file_modified, file_keyword_delta\nContext boosts are additive with noise (B2+B3), capped together at 12%\nPersonalize triggers during onboarding based on agent interests\n\nDay/Night Mode (v1.11.0): Decay slows at night to reduce pressure during rest hours.\n\nConfigure in assets/decay-config.json\nDefault: 06:01-22:00 = day (×1.0), 22:01-06:00 = night (×0.5)\nDisable with \"day_night_mode\": false\n\nBase Needs Isolation: Security (10) and Integrity (9) are protected:\n\nThey influence lower needs (security → autonomy)\nLower needs cannot drag them down\nOnly integrity → security (+0.15) and autonomy → integrity (+0.20) exist\nCross-Need Impact\n\non_action: Completing A boosts connected needs\non_deprivation: A staying low (sat ≤ 1.0) drags others down\n\n┌─────────────────────────┬──────────┬─────────────┬───────────────────────┐\n│ Source → Target         │ on_action│ on_deprived │ Why                   │\n├─────────────────────────┼──────────┼─────────────┼───────────────────────┤\n│ expression → recognition│   +0.25  │      -0.10  │ Express → noticed     │\n│ connection → expression │   +0.20  │      -0.15  │ Social sparks ideas   │\n│ connection → understand │   -0.05  │         —   │ Socratic effect       │\n│ competence → recognition│   +0.30  │      -0.20  │ Good work → respect   │\n│ autonomy → integrity    │   +0.20  │      -0.25  │ Act on values         │\n│ closure → coherence     │   +0.20  │      -0.15  │ Threads → order       │\n│ security → autonomy     │   +0.10  │      -0.20  │ Safety enables risk   │\n└─────────────────────────┴──────────┴─────────────┴───────────────────────┘\n\nTips\nLeverage cascades: Connection easy? Do it first — boosts expression (+0.20)\nWatch spirals: expression ↔ recognition can create mutual deprivation\nAutonomy is hub: Receives from 5 sources. Keep healthy.\nSocratic effect: connection → understanding: -0.05. Dialogue exposes ignorance. Healthy!\n\nFull matrix: assets/cross-need-impact.json\n\nExample Cycle\n🔺 Turing Pyramid — Cycle at Sat Mar  7 05:06\n======================================\n\nCurrent tensions:\n  connection: tension=10.0 (sat=1.00, dep=2.00)\n  closure: tension=7.0 (sat=2.00, dep=1.00)\n  expression: tension=1.0 (sat=0.00, dep=3.00)\n\n🚨 Starvation guard: expression forced into cycle\nSelecting 3 needs (1 forced + 2 regular)...\n\n📋 Decisions:\n\n▶ ACTION: expression (tension=1.0, sat=0.00) [STARVATION GUARD]\n  Range high rolled → selected:\n    ★ develop scratchpad idea into finished piece (impact: 2.7)\n  Then: mark-satisfied.sh expression 2.7\n\n▶ ACTION: connection (tension=10.0, sat=1.00)\n  Range high rolled → selected:\n    ★ reach out to another agent (impact: 2.8)\n  Then: mark-satisfied.sh connection 2.8\n\n▶ ACTION: closure (tension=7.0, sat=2.00)\n  Range mid rolled → selected:\n    ★ complete one pending TODO (impact: 1.7)\n  Then: mark-satisfied.sh closure 1.7\n\n======================================\nSummary: 3 action(s), 0 noticed\n\nIntegration\n\nAdd to HEARTBEAT.md:\n\n/path/to/skills/turing-pyramid/scripts/run-cycle.sh\n\nCustomization\nYou Can Tune (no human needed)\n\nDecay rates — assets/needs-config.json:\n\n\"connection\": { \"decay_rate_hours\": 4 }\n\n\nLower = decays faster. Higher = persists longer.\n\nAction weights — same file:\n\n{ \"name\": \"reply to mentions\", \"impact\": 2, \"weight\": 40 }\n\n\nHigher weight = more likely selected. Set 0 to disable.\n\nScan patterns — scripts/scan_*.sh: Add your language patterns, file paths, workspace structure.\n\nAsk Your Human First\nAdding needs — The 10-need structure is intentional. Discuss first.\nRemoving needs — Don't disable security/integrity without agreement.\nFile Structure\nturing-pyramid/\n├── SKILL.md                    # This file\n├── CHANGELOG.md                # Version history\n├── assets/\n│   ├── needs-config.json       # ★ Main config (needs, actions, settings)\n│   ├── cross-need-impact.json  # ★ Cross-need matrix\n│   ├── needs-state.json        # Runtime state (auto-managed)\n│   ├── scan-config.json        # Scan method configuration\n│   ├── decay-config.json       # Day/night mode settings\n│   └── audit.log               # Append-only action audit trail\n├── scripts/\n│   ├── run-cycle.sh            # Main loop (tension + action selection)\n│   ├── mark-satisfied.sh       # State update + cross-need cascades\n│   ├── apply-deprivation.sh    # Deprivation cascade engine\n│   ├── get-decay-multiplier.sh # Day/night decay multiplier\n│   ├── _scan_helper.sh         # Shared scan utilities\n│   └── scan_*.sh               # Event detectors (10 needs)\n├── tests/\n│   ├── run-tests.sh            # Test runner\n│   ├── test_starvation_guard.sh # Starvation guard (11 cases)\n│   ├── test_action_staleness.sh # Action staleness (13 cases)\n│   ├── unit/                   # Unit tests (13)\n│   ├── integration/            # Integration tests (3)\n│   └── fixtures/               # Test data\n└── references/\n    ├── TUNING.md               # Detailed tuning guide\n    └── architecture.md         # Technical docs\n\nSecurity Model\n\nDecision framework, not executor. Outputs suggestions — agent decides.\n\n┌─────────────────────┐      ┌─────────────────────┐\n│   TURING PYRAMID    │      │       AGENT         │\n├─────────────────────┤      ├─────────────────────┤\n│ • Reads local JSON  │      │ • Has web_search    │\n│ • Calculates decay  │ ───▶ │ • Has API keys      │\n│ • Outputs: \"★ do X\" │      │ • Has permissions   │\n│ • Zero network I/O  │      │ • DECIDES & EXECUTES│\n└─────────────────────┘      └─────────────────────┘\n\n⚠️ Security Warnings\n┌────────────────────────────────────────────────────────────────┐\n│ THIS SKILL READS WORKSPACE FILES THAT MAY CONTAIN PII         │\n│ AND OUTPUTS ACTION SUGGESTIONS THAT CAPABLE AGENTS MAY        │\n│ AUTO-EXECUTE USING THEIR OWN CREDENTIALS.                     │\n└────────────────────────────────────────────────────────────────┘\n\n\n1. Sensitive file access (no tokens required):\n\nScans read: MEMORY.md, memory/*.md, SOUL.md, AGENTS.md\nAlso scans: research/, scratchpad/ directories\nRisk: May contain personal notes, PII, or secrets\nMitigation: Edit scripts/scan_*.sh to exclude sensitive paths:\n# Example: skip private directory\nfind \"$MEMORY_DIR\" -name \"*.md\" ! -path \"*/private/*\"\n\n\n2. Action suggestions may trigger auto-execution:\n\nConfig includes: \"web search\", \"post to Moltbook\", \"verify vault\"\nThis skill outputs text only — it CANNOT execute anything\nRisk: Agent runtimes with auto-exec may act on suggestions\nMitigation: In assets/needs-config.json, remove or disable external actions:\n{\"name\": \"post to Moltbook\", \"impact\": 2, \"weight\": 0}\n\nOr configure your agent runtime to require approval for external actions.\n\n3. Self-reported state (no verification):\n\nmark-satisfied.sh trusts caller input\nRisk: State can be manipulated by dishonest calls\nImpact: Only affects this agent's own state accuracy\nMitigation: Enable action logging in memory/ to audit completions:\n# run-cycle.sh already logs to memory/YYYY-MM-DD.md\n# Review logs periodically for consistency\n\nScript Audit (v1.14.4)\n\nscan_*.sh files verified — NO network or system access:\n\n┌─────────────────────────────────────────────────────────┐\n│ ✗ curl, wget, ssh, nc, fetch     — NOT FOUND           │\n│ ✗ /etc/, /var/, /usr/, /root/    — NOT FOUND           │\n│ ✗ .env, .pem, .key, .credentials — NOT FOUND           │\n├─────────────────────────────────────────────────────────┤\n│ ✓ Used: grep, find, wc, date, jq — local file ops only │\n│ ✓ find uses -P flag (never follows symlinks)           │\n└─────────────────────────────────────────────────────────┘\n\n\nSymlink protection: All find commands use -P (physical) mode — symlinks pointing outside WORKSPACE are not followed.\n\nScan confinement: Scripts only read paths under $WORKSPACE. Verify with:\n\ngrep -nE \"\\b(curl|wget|ssh)\\b\" scripts/scan_*.sh     # network tools\ngrep -rn \"readlink\\|realpath\" scripts/               # symlink resolution\n\nToken Usage\n┌──────────────┬─────────────┬────────────┐\n│ Interval     │ Tokens/mo   │ Est. cost  │\n├──────────────┼─────────────┼────────────┤\n│ 30 min       │ 1.4M-3.6M   │ $2-6       │\n│ 1 hour       │ 720k-1.8M   │ $1-3       │\n│ 2 hours      │ 360k-900k   │ $0.5-1.5   │\n└──────────────┴─────────────┴────────────┘\n\n\nStable agent with satisfied needs = fewer tokens.\n\nTesting\n# Run all tests\nWORKSPACE=/path/to/workspace ./tests/run-tests.sh\n\n# Unit tests (13): decay, floor/ceiling, tension, tension bounds, tension formula,\n#   probability, impact matrix, day/night, scrubbing, autonomy coverage,\n#   crisis mode, scan competence, scan config\n# Integration (3): full cycle, homeostasis stability, stress test\n# Feature tests (24): starvation guard (11), action staleness (13)\n# Total: 40 test cases\n\nVersion\n\nv1.20.0 — Spontaneity Layers A+B+C complete (surplus, noise, context triggers), 57 tests. Full changelog: CHANGELOG.md"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/TensusDS/turing-pyramid",
    "publisherUrl": "https://clawhub.ai/TensusDS/turing-pyramid",
    "owner": "TensusDS",
    "version": "1.20.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/turing-pyramid",
    "downloadUrl": "https://openagent3.xyz/downloads/turing-pyramid",
    "agentUrl": "https://openagent3.xyz/skills/turing-pyramid/agent",
    "manifestUrl": "https://openagent3.xyz/skills/turing-pyramid/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/turing-pyramid/agent.md"
  }
}