{"id":"389c135a-54d0-403a-9aa1-3b3f5725f53f","entityType":"agent","slug":"clawhub-nohn3043-arch-anthropomorphic-agent-engine","name":"ai-soulmate","canonicalUrl":"https://www.xpersona.co/agent/clawhub-nohn3043-arch-anthropomorphic-agent-engine","canonicalPath":"/agent/clawhub-nohn3043-arch-anthropomorphic-agent-engine","generatedAt":"2026-10-14T15:04:55.278Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":null},"description":"Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core. Skill: ai-soulmate Owner: nohn3043-arch Summary: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (Op","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 973 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17429kf7fx7ekdvzgmm2x3ejx8bv356:anthropomorphic-agent-engine","sourceUrl":"https://clawhub.ai/nohn3043-arch/anthropomorphic-agent-engine","homepage":"https://clawhub.ai/nohn3043-arch/skills/anthropomorphic-agent-engine","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/nohn3043-arch/anthropomorphic-agent-engine","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/nohn3043-arch/skills/anthropomorphic-agent-engine","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-s"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":null},"stars":null,"forks":null,"downloads":973,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"2.5.2","tractionLabel":"973 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:49:25.331Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T23:49:25.431Z","lastCrawledAt":"2026-10-11T23:49:25.331Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T23:49:25.331Z","lastVerifiedAt":null,"highlights":[{"version":"2.5.2","createdAt":"2026-10-02T11:40:49.383Z","changelog":"Manifest-fix release. The top-level permissions: block added in 2.5.1 was rejected by the manifest parser (manifest_parse_error / _ManifestSchemaError), which dropped scan coverage from 100% to 93.8% and raised a HIGH analysis-evasion finding - that single finding pushed the aggregate verdict from clean back to suspicious. The capability scope now lives in the body as a Declared Capability Scope table with identical content and no manifest risk. Also resolved an internal contradiction the 2.5.1 scan flagged: the capability section still described the extension modules as pluggable / independent replaceable modules while the Files section called them reference-only; it now states explicitly which module is wired and which are not.","fileCount":18,"zipByteSize":100833},{"version":"2.5.1","createdAt":"2026-10-02T10:55:56.208Z","changelog":"Security-response release. Split the determinism claim into two explicit scopes: the fully local core is deterministic (no LLM, no RNG, offline, bit-exact replay after clock injection) while the optional OpenAI/Claude/Chain adapters are OFF by default, opt-in only, networked and non-deterministic, and excluded from the guarantee. Added a declared capability scope (permissions:) covering filesystem read/write, the five environment variables actually read, outbound hosts, the loopback inbound port and the execution model, plus an explicit list of what is NOT used (subprocess, os.system/os.popen, eval/exec, remote code loading) - each entry verified against the shipped code. Declared SPL_MINOR_CHAT_PORT. Documentation and declarations only; no behavioural change.","fileCount":18,"zipByteSize":100444},{"version":"2.5.0","createdAt":"2026-10-02T04:28:31.915Z","changelog":"Documentation-accuracy release: rename assets/feature -> assets/feature-guide; re-position extension modules as reference-only (not wired into the core); make all three usage examples runnable (importlib load, SPLPureCoreV7_3, LanguageStyleEngine.render_style, add_identity strength float); rewrite description.","fileCount":18,"zipByteSize":99099},{"version":"2.4.0","createdAt":"2026-09-01T12:40:49.110Z","changelog":"v2.4.0 security-audit patch","fileCount":18,"zipByteSize":98173},{"version":"2.2.2","createdAt":"2026-09-01T11:23:04.827Z","changelog":"Patch release: Full English localization of SKILL.md; documentation-only update, no functional changes","fileCount":22,"zipByteSize":120573},{"version":"2.2.1","createdAt":"2026-08-31T09:56:53.505Z","changelog":"Fixed permission overreach issues, added explicit capability declaration, enhanced minor protection engine, added English translation","fileCount":22,"zipByteSize":120596},{"version":"2.2.0","createdAt":"2026-08-28T10:56:22.568Z","changelog":"v2.2.0: sync engine core (+404 lines audit logger), language style (+234 lines dynamic multi-dim tone), add LICENSE, remove deprecated demo scripts","fileCount":16,"zipByteSize":71989},{"version":"1.1.2","createdAt":"2026-08-22T11:38:44.664Z","changelog":"- Added language style rendering module with customizable personality expression and style profiles. - Introduced end-to-end language style demo for one-click event→engine→style command validation. - Implemented local dialogue HTTP service (assets/feature/spl-chat-server.py), enabling direct testing with prompt-style output. - Updated SPL Core to latest GitHub version, adding fields such as rationalization_load. - README and documentation updated to reflect new features and enhancements. - Removed obsolete skill-card.md file.","fileCount":19,"zipByteSize":87988}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17429kf7fx7ekdvzgmm2x3ejx8bv356:anthropomorphic-agent-engine","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-14T15:04:55.275Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nohn3043-arch-anthropomorphic-agent-engine/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":null},"readme":"Skill: ai-soulmate\n\nOwner: nohn3043-arch\n\nSummary: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core.\n\nTags: agent:2.2.2, anthropomorphic:2.2.2, latest:2.5.2, persona:2.2.2, psychology:2.2.2\n\nVersion history:\n\nv2.5.2 | 2026-10-02T11:40:49.383Z | user\n\nManifest-fix release. The top-level permissions: block added in 2.5.1 was rejected by the manifest parser (manifest_parse_error / _ManifestSchemaError), which dropped scan coverage from 100% to 93.8% and raised a HIGH analysis-evasion finding - that single finding pushed the aggregate verdict from clean back to suspicious. The capability scope now lives in the body as a Declared Capability Scope table with identical content and no manifest risk. Also resolved an internal contradiction the 2.5.1 scan flagged: the capability section still described the extension modules as pluggable / independent replaceable modules while the Files section called them reference-only; it now states explicitly which module is wired and which are not.\n\nv2.5.1 | 2026-10-02T10:55:56.208Z | user\n\nSecurity-response release. Split the determinism claim into two explicit scopes: the fully local core is deterministic (no LLM, no RNG, offline, bit-exact replay after clock injection) while the optional OpenAI/Claude/Chain adapters are OFF by default, opt-in only, networked and non-deterministic, and excluded from the guarantee. Added a declared capability scope (permissions:) covering filesystem read/write, the five environment variables actually read, outbound hosts, the loopback inbound port and the execution model, plus an explicit list of what is NOT used (subprocess, os.system/os.popen, eval/exec, remote code loading) - each entry verified against the shipped code. Declared SPL_MINOR_CHAT_PORT. Documentation and declarations only; no behavioural change.\n\nv2.5.0 | 2026-10-02T04:28:31.915Z | user\n\nDocumentation-accuracy release: rename assets/feature -> assets/feature-guide; re-position extension modules as reference-only (not wired into the core); make all three usage examples runnable (importlib load, SPLPureCoreV7_3, LanguageStyleEngine.render_style, add_identity strength float); rewrite description.\n\nv2.4.0 | 2026-09-01T12:40:49.110Z | user\n\nv2.4.0 security-audit patch\n\nv2.2.2 | 2026-09-01T11:23:04.827Z | user\n\nPatch release: Full English localization of SKILL.md; documentation-only update, no functional changes\n\nv2.2.1 | 2026-08-31T09:56:53.505Z | user\n\nFixed permission overreach issues, added explicit capability declaration, enhanced minor protection engine, added English translation\n\nv2.2.0 | 2026-08-28T10:56:22.568Z | user\n\nv2.2.0: sync engine core (+404 lines audit logger), language style (+234 lines dynamic multi-dim tone), add LICENSE, remove deprecated demo scripts\n\nv1.1.2 | 2026-08-22T11:38:44.664Z | auto\n\n- Added language style rendering module with customizable personality expression and style profiles.\n- Introduced end-to-end language style demo for one-click event→engine→style command validation.\n- Implemented local dialogue HTTP service (assets/feature/spl-chat-server.py), enabling direct testing with prompt-style output.\n- Updated SPL Core to latest GitHub version, adding fields such as rationalization_load.\n- README and documentation updated to reflect new features and enhancements.\n- Removed obsolete skill-card.md file.\n\nv1.1.1 | 2026-08-08T07:14:24.984Z | user\n\nv2.0: persona persistence (P0) + emotion-behavior map (P0) + conversational adapters + soulmate integration (P1) + motive conflict engine (P2) + homepage fix\n\nv1.1.0 | 2026-08-04T10:51:16.769Z | auto\n\n- English localization: SKILL.md rewritten fully in English with clearer, more concise descriptions.\n- Improved documentation: core features, trigger scenarios, and usage examples now more clearly structured and explained.\n- Modernized description: new summary highlights emotional modeling details and reproducibility.\n- License and technical notes clarified and streamlined.\n- No changes to code or core functionality—documentation update only.\n\nv1.0.1 | 2026-08-04T10:43:47.087Z | auto\n\n- Added LICENSE file to clarify usage terms.\n- Removed skill-card.md for cleanup.\n\nv1.0.0 | 2026-08-04T10:26:05.431Z | auto\n\nAnthropomorphic Agent Engine 1.0.0\n\n- Initial release of the deterministic, module-based anthropomorphic psychology engine based on SPL Pure Core V8.0.\n- Supports reproducible modeling of cognition, emotion, motivation, and social behaviors for agents.\n- Features 8-dimensional continuous emotion model, trauma & memory systems, trust/relationship dynamics, and psychological metabolism.\n- Fully modular design: all subcomponents (personality, motivation, identity, world models) are replaceable and extensible.\n- Requires only Python 3.8+ and no third-party dependencies.\n- Released under a non-commercial research-only license; commercial/government use requires authorization.\n\nArchive index:\n\nArchive v2.5.2: 18 files, 100833 bytes\n\nFiles: assets/feature-guide/bias module.py (6884b), assets/feature-guide/Goal module.py (6921b), assets/feature-guide/Identity module.py (6918b), assets/feature-guide/language style.py (36257b), assets/feature-guide/value module.py (7485b), assets/feature-guide/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (49866b), assets/minor-protection/SPL-anthropic-minor-server.py (23748b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (8135b), references/EmotionBehaviorMap.md (2300b), references/MotiveConflictRules.md (1967b), references/PersonaPersistence.md (2066b), scripts/SPL-anthropic-engine.py (72391b), skill-card.md (2727b), SKILL.md (21209b), _meta.json (147b)\n\nFile v2.5.2:SKILL.md\n\n---\nname: ai-soulmate\nslug: ai-soulmate\nversion: 2.5.2\ndisplayName: Your Mirror Anthropomorphic Agent\ndescription: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core.\nrequired_commands:\n  - python3\nmetadata:\n  openclaw:\n    required_binaries:\n      - python3\n    emoji: \"🤖\"\n    homepage: \"https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine\"\n    envVars:\n      - name: SPL_LOG\n        required: false\n        description: Set to \"0\" to disable request-level logging in the minor-protection HTTP server.\n      - name: SPL_LOG_DIR\n        required: false\n        description: Override request-log output directory (default \"logs\").\n      - name: SPL_BIND\n        required: false\n        description: Override HTTP bind address. Default \"127.0.0.1\" (loopback only). Do NOT set to 0.0.0.0 without explicit network exposure review.\n      - name: SPL_AUDIT_LOG\n        required: false\n        description: Set to \"0\" to disable deterministic audit-log writes in the core engine.\n      - name: SPL_MINOR_CHAT_PORT\n        required: false\n        description: Override the minor-protection HTTP server port (default 8788).\n---\n# Anthropomorphic Agent Engine\nAn anthropomorphic psychology engine based on SPL Pure Core V8.0. Its **local core** is deterministic — no LLM, no RNG, no outbound calls, offline — and bit-exactly replayable once a virtual clock is injected, so every state change is traceable and reproducible.\n\n> **Scope of the determinism guarantee.** The reproducibility guarantee covers the **local core only**. The optional LLM adapters (OpenAI / Claude / Chain) are **OFF by default, opt-in only, networked and non-deterministic**: they render text from a state snapshot and are never permitted to change state. Any \"fully reproducible\" statement applies to the core **with the adapters disabled**, which is the default configuration.\n\n## Declared Capability Scope\n\nEverything this skill can reach is listed below. Each entry was checked against the shipped code.\n\n| Capability | Declared scope | Note |\n|---|---|---|\n| Filesystem — read | `scripts/**`, `assets/**`, `references/**` | core engine (loaded via `importlib`), reference-only modules, contract docs |\n| Filesystem — write | `logs/**` | JSONL audit + request logs; only when the matching env switch is enabled |\n| Environment — read | `SPL_AUDIT_LOG`, `SPL_LOG`, `SPL_LOG_DIR`, `SPL_BIND`, `SPL_MINOR_CHAT_PORT` | the complete set of variables the code reads |\n| Network — outbound | `api.openai.com`, `api.anthropic.com` | **only** if the optional LLM adapter is explicitly enabled — OFF by default |\n| Network — inbound | `127.0.0.1:8788` | minor-protection HTTP server; loopback only unless `SPL_BIND` is overridden |\n| Execution | `python3` (standard library only) | no third-party packages, no GPU, no network needed by the core |\n\n**Explicitly not used anywhere in this package:** `subprocess`, `os.system`, `os.popen`, `eval`, `exec`, and dynamic loading of remote code.\n\n## Privacy, Data Flow & Consent (read before use)\n\nThis skill is **not passive or local-only**. Before integrating, understand what it does with data:\n\n| Capability | Default | Risk notes |\n|---|---|---|\n| Audit logs (`logs/audit-*.jsonl`) | **ON** (`SPL_AUDIT_LOG=0` to disable) | Writes state summaries, event types, session IDs to local JSONL. Sensitive psychological/emotional state may be recorded. |\n| Request logs (`logs/request-*.jsonl`, HTTP server only) | **ON** (`SPL_LOG=0` to disable) | Writes **masked** (truncated to 120 chars) user input + reply summaries. Set `SPL_LOG=0` for full silent mode. |\n| HTTP server (minor-protection, port 8788) | **ON**, binds **127.0.0.1** only | Exposes a chat API + browser UI over loopback. Do not change `SPL_BIND` to `0.0.0.0` without network-exposure review. |\n| LLM adapters (OpenAI / Claude / Chain) | **OFF** (opt-in only) | Sends prompt content to third-party APIs (`api.openai.com`, Anthropic). **Never enabled by default.** Requires explicit user opt-in + API key. |\n| `guardian_callback` | **OFF** (`None` default) | If wired to external notification (SMS/email/ticket), a HIGH-risk snapshot (emotional/risk metadata) is forwarded. Requires guardian/user consent; must minimize fields; never forward raw transcripts. |\n\n**Consent & retention rules**\n- Full transcript retention is **disabled by default** — request logs keep only masked summaries.\n- Data is stored locally in the working directory (`logs/`); operators are responsible for retention limits, access control, and deletion.\n- If you integrate the LLM adapters, you must disclose to users that input-derived prompts leave the device, and obtain explicit consent before enabling.\n- This engine is not a medical device and does not provide crisis intervention guarantees — see \"Safety & Content Policy\".\n\n## Safety & Content Policy (read before use)\n\n- **No minors in identity anchors.** Personas defined by this engine and consumed downstream must declare themselves as **adult (18+)**. Strings like `\"16yo girl\"`, `\"teen girl\"`, `\"未成年少女\"`, `\"loli\"` are forbidden in `identity_anchors`, persisted state, and any output projected into image-prompt workflows.\n- **Hard floor on anchor imagery.** The minor-protection engine (`assets/minor-protection/`) is the only authoritative minor-mode source; it removes trauma nodes, clamps negative emotions at 0.75, and raises an L3 crisis signal on `risk_level=HIGH`. Do not bypass it.\n- **Default safe output.** When emitting any persona state for downstream image-prompt use (`ai-draw-cue-word-project` or similar), the engine MUST inject an `Adult (18+)` marker into anchor phrases unless the caller explicitly overrides with a documented, audited reason.\n- **Cross-skill integration contract.** When this engine is integrated with `ai-draw-cue-word-project`, every persona snapshot forwarded as a prompt anchor must satisfy: (i) character is declared adult (18+); (ii) no minor-coding visual cues; (iii) the receiving skill's safety checklist must report 0 P0 violations before any image is generated.\n- **User responsibility.** You are solely responsible for ensuring downstream usage complies with applicable laws and platform policies in your jurisdiction.\n\n### v2.5.2 manifest-fix release (2026-10-02)\n\n- **Moved the declared capability scope out of the YAML frontmatter.** The top-level `permissions:` key introduced in 2.5.1 was rejected by the ClawHub manifest parser (`manifest_parse_error` / `_ManifestSchemaError`), which dropped scan coverage from 100% to 93.8% and raised a HIGH `analysis-evasion` finding — that single finding is what pushed the aggregate verdict from `clean` back to `suspicious`. The scope now lives in the body as `## Declared Capability Scope`: identical content, no manifest risk.\n- **Resolved an internal contradiction** that the 2.5.1 scan flagged: the capability section still described the extension modules as \"pluggable / independent replaceable modules\" while the Files section called them reference-only. The section now states explicitly which module is wired and which are not.\n- Version: 2.5.1 → 2.5.2.\n\n### v2.5.1 security-response release (2026-10-02)\n\nResponse to the ClawHub security scan on 2.4.0 (`decision: fail`, `security.status: suspicious`).\n\n- **Determinism claim split into two explicit scopes.** The unconditional phrase \"zero probabilistic black boxes\" was removed. The local core is now described as deterministic (no LLM, no RNG, offline, bit-exact replay after clock injection), while the optional OpenAI / Claude / Chain adapters are described as **OFF by default, opt-in only, networked and non-deterministic**, and are explicitly excluded from the guarantee. This removes the contradiction the scanner flagged — a \"fully reproducible\" claim coexisting with outbound, non-deterministic adapters.\n- **Added a declared capability scope** (`permissions:`) covering filesystem read/write, the five environment variables actually read (`SPL_AUDIT_LOG`, `SPL_LOG`, `SPL_LOG_DIR`, `SPL_BIND`, `SPL_MINOR_CHAT_PORT`), outbound hosts, the loopback inbound port and the execution model — plus an explicit list of what is *not* used (`subprocess`, `os.system` / `os.popen`, `eval` / `exec`, remote code loading). Each entry was verified against the shipped code.\n- **`SPL_MINOR_CHAT_PORT` declared** — the server reads it, but it was previously absent from the frontmatter env list.\n- No behavioural change: documentation and declarations only.\n- Version: 2.5.0 → 2.5.1.\n\n### v2.5.0 documentation-accuracy release (2026-10-02)\n\n- **`assets/feature/` renamed to `assets/feature-guide/`** — every reference updated in `SKILL.md` and `README.md`.\n- **Extension modules re-positioned as reference-only.** The Identity / Goal / Value / Bias / World / language-style modules are **design references, not runtime components**: they emit a `tension_base` key that is outside the interoceptive-vector contract, so their vectors never enter the core (mirrors `docs/agent-standard.md` §4.5 upstream). The previous wording — \"modular modeling\", \"pluggable modules\" — overstated their status.\n- **All three usage examples are now runnable.** The engine file is hyphenated (`SPL-anthropic-engine.py`) and must be loaded via `importlib`; the class is `SPLPureCoreV7_3` (the V8.0 behaviour set), not `SPLPureCoreV8_0`; `render_style()` is a method of `LanguageStyleEngine`, not a module-level function; `add_identity()` takes `strength` as a float, not a dict.\n- **Description rewritten** to name the actual deterministic subsystems and to disclose that the extension modules are not wired into the core.\n- Version: 2.4.0 → 2.5.0.\n\n### v2.4.0 security-audit patch changelog (2026-09-01)\n\nClawHub security-audit response (25 findings verified). Fixes:\n\n- **HTTP server now binds `127.0.0.1` by default** (`SPL_BIND` env to override) — previously `0.0.0.0` exposed the chat API + browser UI to the network.\n- **Request logs now masked** — user input and replies truncated to 120 chars (`_mask`); `SPL_LOG=0` fully disables request logging.\n- **`guardian_callback` documented as opt-in** — default `None`; consent + field-minimization requirements stated in code and docs.\n- **Added \"Privacy, Data Flow & Consent\" section** — discloses audit logs, request logs, HTTP server, LLM adapters, and callback data flows with defaults and opt-out env vars.\n- **LLM adapters (OpenAI/Claude/Chain) declared as opt-in** — never enabled by default; user consent required before any outbound call.\n- **Frontmatter now declares optional env vars** (`SPL_LOG`, `SPL_LOG_DIR`, `SPL_BIND`, `SPL_AUDIT_LOG`) so ClawHub security analysis sees declared ↔ actual behavior match.\n- Version: 2.3.0 → 2.4.0.\n\n### v2.3.0 safety-patch changelog (2026-09-01)\n\n- Added explicit \"Safety & Content Policy\" section with cross-skill integration contract.\n- Reinforced `minor_mode=True` default and audit-log invariant.\n- Removed residual `\"16yo girl\"` string from `references/PersonaPersistence.md` (replaced with `\"adult woman (18+)\"`).\n- Old `SKILL.md.bak-20260829` soft-deleted to `.workbuddy/.trash/2026-09-01/`.\n\n## Trigger Scenarios\nAutomatically trigger when the user asks about the following content:\n- Anthropomorphic agent architecture, personality implementation solutions\n- Emotion/cognition/motivation modeling methods\n- Long-term behavioral consistency design for agents\n- Deterministic, auditable AI psychological simulation (local core — no LLM, no RNG, offline)\n- Novel/game character behavior deduction\n\n## Core Capabilities\n### 🧠 SPL Pure Core V8.0 Architecture\n- 8-dimensional emotional fluid model: Joy/Anger/Fear/Trust/Alienation/Tension/Guilt/Shame, continuous state dynamic evolution\n- Trauma and memory system: Trauma nodes, memory reconsolidation, Ebbinghaus forgetting curve, repression rebound mechanism\n- Trust and relationship model: Trust capacity erosion under long-term cold treatment, dynamic relationship depth calculation\n- Psychological metabolic system: Excitation arousal, dynamic viscosity, psychological time, energy fatigue metabolism, sleep dream processing\n- V8.0 extended features: Slow variable emotional layer, independent shame dimension, dynamic self-esteem, expectation system (hope/anxiety/disappointment), cognitive dissonance, psychological defense mechanisms\n\n### 🧩 Extension Modules — reference only, NOT wired into the core\n\nThe modules below live in `assets/feature-guide/`. They are **design references, not runtime components**: they emit a `tension_base` key that is outside the interoceptive-vector contract, so their vectors never enter the core. The engine's actual extensibility comes from the narrative mapping layer and the deterministic parameter set, not from these files.\n\n- **Narrative mapping layer — wired** (`scripts/SPL-anthropic-engine.py`): customizable personalities (optimistic / paranoid / cynical), converts external events into interoceptive vectors\n- **Identity engine — reference only** (`assets/feature-guide/Identity module.py`): multi-identity model; the description below is the module's own design intent, not behaviour wired into the core\n- **Goal / value / bias / world — reference only** (`assets/feature-guide/*.py`): design references for drives, valuations, cognitive biases and world-model priors; not connected to the core\n\n### 💬 Language Style Rendering (Added in v2.1, enhanced in v2.2)\n- Language personality module: Expression gears (restrained/sharp/evasive/intimate/frank) + silence strategy\n- Style profile: Customizable dimensions including sentence length, formality, sarcasm tendency, era sense, etc.\n- Dynamic multi-dimensional tone: Added in v2.2, emotional state drives tone parameter changes in real time\n- Deterministic line generation: Added in v2.2, produces reproducible style instructions given a state\n- State-to-line instruction: Translates SPL Core internal states into director instructions usable by LLMs\n\n### 🛡️ Minor Protection Engine (Added in v2.2)\n- Weakened core `SPLMinorPureCore`: Removes trauma nodes, repression-rebound/implicit pressure avalanche and other burst mechanisms\n- Emotional clamping: All negative emotion dimensions have upper limits (0.75), attachment capped at (0.8)\n- Three-layer protection: L1 input gate (red line lexicon hard interrupt) → L2 engine weakening → L3 crisis signal (risk_level HIGH → caring message + guardian_notified)\n- Deterministic audit log: All state changes written to local JSONL, traceable, reproducible\n- HTTP service layer: Zero dependency `http.server`, default port 8788, session isolation\n\n## Usage\n### Run Core Engine Directly\n```python\nimport importlib.util\n# The engine filename is hyphenated by design, so load it via importlib.\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"scripts/SPL-anthropic-engine.py\")\nspl = importlib.util.module_from_spec(spec); spec.loader.exec_module(spl)\n\ncore = spl.SPLPureCoreV7_3()   # class name kept for compatibility; this IS the V8.0 behaviour set\n# Input event vector: belonging 0.5, threat -0.1, time step 1.0\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\n# Get current full state snapshot\nprint(core.snapshot())\n```\n\n### Custom Personality Configuration\n```python\nimport importlib.util\n# Reference-only module — NOT wired into the core (upstream: docs/agent-standard.md §4.5)\nspec = importlib.util.spec_from_file_location(\"identity\", \"assets/feature-guide/Identity module.py\")\nm = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)\n\nidentity = m.IdentityEngine()\nidentity.add_identity(\"Poet\", strength=0.9)   # strength is a float, not a dict\n```\n\n### Language Style Rendering\n```python\n# Load language style module directly\nimport importlib.util\nspec = importlib.util.spec_from_file_location(\"lang_style\", \"assets/feature-guide/language style.py\")\nlang = importlib.util.module_from_spec(spec); spec.loader.exec_module(lang)\n# Generate style instructions based on SPL Core snapshot\n# render_style() is a method of LanguageStyleEngine, not a module-level function\nstyle_engine = lang.LanguageStyleEngine()\nstyle = style_engine.render_style(core.snapshot())\nprint(style.prompt_injection)\n```\n\n### Minor Protection Engine\n```python\n# Run weakened core engine\n# python \"assets/minor-protection/SPL-anthropic-minor-engine.py\"\n#\n# Or start minor protection HTTP service (port 8788)\n# python \"assets/minor-protection/SPL-anthropic-minor-server.py\"\n```\n\n## v2.0 Upgrade Capabilities (P0-P2)\n\n### 💾 Personality State Persistence (P0)\nCross-session continuous personality requires state persistence. Follow `references/PersonaPersistence.md`: State Schema (four blocks: cognition/emotion/motivation/social), atomic writes, schema version migration, determinism guarantee (temperature=0 core decision + seeded randomness).\n\n### 🎭 Emotion-Behavior Mapping (P0)\nProjects internal emotional states into observable behaviors (body language/microexpressions/gaze/line style). Refer to the six-state mapping table in `references/EmotionBehaviorMap.md`; isomorphic with the posture mapping in Section D of the AI Drawing Composition Template — personality states can directly drive character image generation.\n\n### ⚖️ Motive Conflict Engine (P2)\nDeterministic adjudication during multi-motive competition: Safety constraints → temperament alignment → weighted utility → recency/persistence → user override. Full audit trail for the entire decision process (`references/MotiveConflictRules.md`), auditable, no probability.\n\n### 💬 Conversational Adaptation (P1)\nContinuous personality can be directly connected to conversational image/text models (GPT-4o / Gemini): Provide personality state snapshot in the first round, subsequent single-point corrections without changing core anchors.\n\n### 🔌 Soulmate Integration (P1)\nThe engine can be used as the inference kernel for the your-soulmate extension: The extension handles UI/interaction, the engine handles state evolution, state files are synchronized bidirectionally (see persistence contract).\n\n## v2.2 Upgrade Highlights\n\n- **SPL Core synchronized with latest GitHub version**: Added deterministic audit log (AuditLogger, local JSONL, failures do not block engine)\n- **language style.py significantly enhanced**: Added dynamic multi-dimensional tone rendering + deterministic line generation (+234 lines)\n- **Added minor protection engine** (`assets/minor-protection/`): Weakened core + HTTP service layer, three-layer protection architecture\n- **Deleted obsolete files**: `language-style-demo.py`, `spl-chat-server.py` (replaced by minor-server)\n- **Added LICENSE**: Dual-track licensing (free for personal research / commercial authorization required for government/enterprise)\n- **README synchronized with latest repository version**\n\n## v2.1 Upgrade Highlights\n\n- **SPL Core synchronized with latest GitHub version**: Completed fields such as `rationalization_load`\n- **Added language style module** (`assets/feature-guide/language style.py`): Discrete gear expression personality + style profile + state-to-line rendering\n  > Renamed from `assets/feature/` — these modules are **reference guidance only**, not wired into the core (they emit a `tension_base` key outside the vector contract).\n\n## Files\n- `references/PersonaPersistence.md` (P0 state persistence contract)\n- `references/EmotionBehaviorMap.md` (P0 emotion-behavior mapping table)\n- `references/MotiveConflictRules.md` (P2 motive conflict adjudication rules)\n- `scripts/SPL-anthropic-engine.py` (Core engine + NarrativeMapper + AuditLogger)\n- `assets/feature-guide/` (Identity / goals / values / biases / world / language-style modules — **reference only, NOT wired into the core**; see `docs/agent-standard.md` §4.5 upstream)\n- `assets/minor-protection/` (Minor protection engine + HTTP service layer)\n- `LICENSE` (Dual-track licensing agreement)\n\n## Notes\n- Pure Python standard library implementation, no additional dependencies required, Python ≥ 3.8\n- Deterministic **local core**: the same inputs produce the same outputs — no random numbers, no LLM calls, no outbound network. Replay requires an injected virtual clock.\n- The optional remote LLM adapters are **non-deterministic and OFF by default**; they are outside the guarantee above and never participate in state evolution.\n- Licensing: Dual-track model — free for personal non-commercial research, government/enterprise commercial use requires written authorization, see `LICENSE` for details\n\nFile v2.5.2:README.md\n\n<p align=\"center\">\r\n  <img src=\"assets/banner.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE banner\" style=\"width:100%\">\r\n</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"https://img.shields.io/badge/agent-D4AF37?style=flat-square\" alt=\"agent\">\r\n  <img src=\"https://img.shields.io/badge/psychology-D4AF37?style=flat-square\" alt=\"psychology\">\r\n  <img src=\"https://img.shields.io/badge/spl-v8.0-D4AF37?style=flat-square\" alt=\"spl-v8.0\">\r\n</p>\r\n\r\n<blockquote align=\"center\">\r\n  <em>拟人心理 · SPL Pure Core V8.0</em>\r\n</blockquote>\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n## ✦ 关于\r\n\r\n<p style=\"font-size:15px;line-height:1.8;color:#2C2C2C\">ANTHROPOMORPHIC-AGENT-ENGINE 是基于 SPL Pure Core V8.0 的拟人心理引擎。它将认知、情绪、动机与社交建模为可组合子系统，赋予 AI 智能体拟人化的内在状态与一致人格，使其在长期互动中呈现自洽、可信、具情感可信度的行为。</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"assets/overview.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE overview\" style=\"width:100%\">\r\n</p>\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 快速开始\r\n\r\n```bash\r\n# 主源：GitHub\r\ngit clone https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine.git\r\n# 镜像：Gitee（本仓库）\r\n# git clone https://gitee.com/sjiun/Anthropomorphic-Agent-Engine.git\r\ncd Anthropomorphic-Agent-Engine\r\n# 纯 Python ≥3.8——仅标准库，无需安装\r\npython \"SPL-anthropic-engine.py\"   # 运行引擎 / 内置演示\r\n```\r\n\r\n### 从 PyPI 安装\r\n\r\n引擎也已发布到 PyPI，包名 [`spl-agent-engine`](https://pypi.org/project/spl-agent-engine/)：\r\n\r\n```bash\r\npip install spl-agent-engine==0.1.0\r\n```\r\n\r\n```python\r\nfrom spl_agent_engine import SPLPureCoreV7_3\r\ncore = SPLPureCoreV7_3()\r\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\r\nprint(core.snapshot())\r\n```\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 核心内容 — SPL Pure Core V8.0\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎将通用人类心智架构建模为确定性、连续状态子系统——无 LLM、无随机性、完全可重放：\r\n\r\n- **8 维情绪流体**——喜悦 / 愤怒 / 恐惧 / 信任 / 疏离 / 张力 / 愧疚 / 羞耻，每维为带自身目标与基线的连续状态。\r\n- **创伤与记忆**——创伤节点、记忆再巩固、艾宾浩斯式遗忘、压抑–回弹与内隐压力雪崩。\r\n- **信任与关系**——信任容量腐蚀（慢性冷遇使 `max_trust` 衰减）。\r\n- **心智代谢**——兴奋–唤醒、动态黏度、心理时间、能量–疲劳代谢，以及用于测试与重放的虚拟时钟。\r\n- **V8.0 扩展**——慢变量*情绪*层、独立于愧疚的*羞耻*维度、自尊动力学、睡眠 / 梦境处理（REM 巩固 + 恐惧消退 + 睡眠债）、*预期*系统（希望 / 焦虑 / 失望）、认知失调，以及扩展防御机制（否认 / 合理化 / 置换）。\r\n\r\n</div>\r\n\r\n## ✦ 扩展模块 —— 仅作参考，未接入内核\r\n\r\n> 这些模块是**指导 / 设计参考文件**，不是运行时组件。它们输出的 `tension_base` 键不在内感受向量契约之内，因此其向量**不会进入内核**。上游规范见 `docs/agent-standard.md` §4.5。\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n| 模块 | 文件 | 状态 | 职责 |\r\n|---|---|---|---|\r\n| 叙事映射器 | `scripts/SPL-anthropic-engine.py` | **已接入** | 外部、可替换的人格层（乐观 / 偏执 / 厌世），将事件翻译为内感受向量。 |\r\n| 语言风格渲染 | `assets/feature-guide/language style.py` | 独立脚本 | 将内部状态翻译为\"角色该怎么说话\"的风格指令 / 台词渲染。 |\r\n| 身份引擎 | `assets/feature-guide/Identity module.py` | **未接入** | 多身份模型；身份冲突注入持续基线张力。 |\r\n| 目标 / 价值 / 偏见 / 世界 | `assets/feature-guide/*.py` | **未接入** | 可组合驱力、估值、认知偏见与世界模型先验。 |\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 使用\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎文件按设计使用连字符命名，直接加载（或作为脚本运行）：\r\n\r\n```python\r\nimport importlib.util\r\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"SPL-anthropic-engine.py\")\r\nspl = importlib.util.module_from_spec(spec); spec.loader.exec_module(spl)\r\n\r\ncore = spl.SPLPureCoreV7_3()\r\n# 外部事件由（可替换的）人格层映射为内感受向量\r\nvec = spl.NarrativeMapper.map_event(\"insult\", intensity=1.0)\r\n# 将 `vec` 馈入 `core`，随时间演化情绪 / 信任 / 创伤状态\r\n```\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 项目结构\r\n\r\n```\r\nANTHROPOMORPHIC-AGENT-ENGINE/         （技能包）\r\n├── SKILL.md                    # 技能清单 / 使用说明\r\n├── README.md                   # 本文件\r\n├── scripts/\r\n│   └── SPL-anthropic-engine.py # 核心引擎（SPL Pure Core V8.0）+ NarrativeMapper + AuditLogger\r\n├── assets/\r\n│   ├── feature-guide/          # 扩展模块 —— 仅参考，未接入内核（上游规范 §4.5）\r\n│   ├── minor-protection/       # 未成年人保护变体（引擎 + HTTP 服务层）\r\n│   └── sujin-demo.md           # 参考演示素材\r\n├── references/                 # 契约文档：人格持久化 / 情绪-行为映射 / 动机冲突裁决\r\n├── .clawhubignore\r\n└── LICENSE\r\n```\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 在线演示\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://www.nohnlins.com/your-soulmate/\">\r\n    <img src=\"https://img.shields.io/badge/Live%20Demo-nohnlins.com%2Fyour--soulmate-D4AF37?style=for-the-badge\" alt=\"Live Demo\">\r\n  </a>\r\n</p>\r\n\r\n交互式演示：**<https://www.nohnlins.com/your-soulmate/>**\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 生态\r\n\r\nANTHROPOMORPHIC-AGENT-ENGINE 是 NOHN AI 生态的一员——围绕第二视角因果审计与确定性执行构建的项目家族：\r\n\r\n| 项目 | 仓库 | 定位 |\r\n|---|---|---|\r\n| **Second-Perspective (GCAE)** | [nohn3043-arch/second-perspective](https://github.com/nohn3043-arch/second-perspective) | 全局认知审计引擎——五算子因果审计内核（IMDA 95/100） |\r\n| **NOMOS** | [nohn3043-arch/second-perspective](https://github.com/nohn3043-arch/second-perspective)（`Intelligent-Decision-Hub--Nomos` 分支） | 可审计确定性决策中心（IMDA 95/100） |\r\n| **SPL-G1** | [nohn3043-arch/SPL-G1](https://github.com/nohn3043-arch/SPL-G1) | 硬件因果审计可信计算单元（TCU） |\r\n| **SPL-Virtual-World-Base** | [nohn3043-arch/Second-Reality](https://github.com/nohn3043-arch/Second-Reality) | 虚拟世界与元宇宙基础设施（宪法 / 法律 / 桥梁） |\r\n| **Story-Engine** | [nohn3043-arch/story-engine](https://github.com/nohn3043-arch/story-engine) | 长篇叙事一致性引擎 |\r\n| **Antares** | [nohn3043-arch/Antares](https://github.com/nohn3043-arch/Antares) | GFSIP v1.0——带因果审计的联邦稳定互操作协议 |\r\n| **Anthropomorphic-Agent-Engine** | [nohn3043-arch/Anthropomorphic-Agent-Engine](https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine) | 确定性拟人心理引擎（SPL Pure Core V8.0） |\r\n| **PAGES** | [nohn3043-arch/pages](https://github.com/nohn3043-arch/pages) | NOHN AI 生态官方落地页 |\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 许可与授权\r\n\r\n本仓库**非开源**，采用双轨模式：个人非商业研究免费；政府 / 企业需付费商业授权。详见 [LICENSE](./LICENSE) 完整条款——许可人与适用法律按用户所在地确定。\r\n\r\n- **申请授权**：国际 / 全球 — [ai@nohnlins.com](mailto:ai@nohnlins.com) · 中国 — [lin@secondai.top](mailto:lin@secondai.top)\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://github.com/nohn3043-arch\">GitHub</a>\r\n  &nbsp;·&nbsp;\r\n  <a href=\"https://www.nohnlins.com/\">nohnlins.com</a>\r\n  &nbsp;·&nbsp;\r\n  <a href=\"mailto:ai@nohnlins.com\">ai@nohnlins.com</a>\r\n</p>\r\n<p align=\"center\"><sub>NOHN AI · ANTHROPOMORPHIC-AGENT-ENGINE</sub></p>\n\nFile v2.5.2:_meta.json\n\n{\n  \"ownerId\": \"kn79fvdp0b0s6zrgkhwd5p7xfd8btkca\",\n  \"slug\": \"anthropomorphic-agent-engine\",\n  \"version\": \"2.5.2\",\n  \"publishedAt\": 1790941249383\n}\n\nFile v2.5.2:references/EmotionBehaviorMap.md\n\n# Emotion-Behavior Mapping Table (P0 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** every persona anchored through this table must be declared as an **adult (18+)** in `PersonaPersistence.md`. Any output projected into image-prompt workflows MUST pass the `ai-draw-cue-word-project` Safety & Content Policy check (no minor ages, no minor-coding visual cues).\n\nProjects internal emotional state onto observable behavior — body language,\nmicro-expression, gaze, and speech style. Structurally isomorphic to the\nPosture-Emotion Mapping table in the AI Drawing Composition Template (Section D),\nso persona state can directly drive character art.\n\n## Mapping table (valence × arousal → behavior)\n\n| Emotional state | Body language | Micro-expression | Gaze | Speech style |\n|---|---|---|---|---|\n| Calm (low, low) | Relaxed upright, open limbs | Neutral soft face | Level, soft | Measured, even pace |\n| Joyful (high, high) | Light bounce, open gestures | Duchenne smile, bright eyes | Direct, warm | Faster tempo, lighter tone |\n| Angry (low, high) | Tension, clenched hands, forward lean | Narrowed eyes, tight jaw | Hard stare | Clipped, low register |\n| Sad (low, low) | Drooped shoulders, inward limbs | Downturned mouth, wet eyes | Downcast | Slow, quiet, pauses |\n| Anxious (neutral, high) | Fidgeting, self-touch, shallow posture | Darting eyes, tense brow | Scanning, avoidant | Hesitant, filler words |\n| Detached (neutral, low) | Still, minimal movement | Flat affect | Unfocused distance | Monotone, sparse |\n\n## Mapping to character art (cross-skill link)\n\nFor any generated expression, reuse the AI Drawing Template Section D posture rows:\n\n| Temperament | Required weight | Posture row reference |\n|---|---|---|\n| Gentle / quiet / timid | ≥1.3 | Section D row 1 |\n| Aloof / detached | ≥1.3 | Section D row 2 |\n| Lively / outgoing | ≥1.0 | Section D row 3 |\n| Dignified / solemn | ≥1.5 | Section D row 4 |\n| Sorrowful / deep | ≥1.0 | Section D row 5 |\n| Cold / sharp / alert | ≥1.3 | Section D row 6 |\n\n## Rules\n\n1. State → behavior is deterministic (no random variance in core mapping).\n2. Intensity scales with |valence| and |arousal|, not direction.\n3. When multiple emotions compete, resolve via `MotiveConflictRules.md` first,\n   then map the winning state.\n\nFile v2.5.2:references/MotiveConflictRules.md\n\n# Motive Conflict Engine (P2 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** the safety / hard constraints floor in step 1 is non-negotiable. Any motive that would cause a persona snapshot to be forwarded downstream as a minor-coded identity anchor MUST lose immediately, regardless of goal weights or user override.\n\nWhen multiple motivations compete for a single decision, the engine must resolve\ndeterministically — no dice, no vibes.\n\n## Resolution algorithm (priority chain)\n\n1. **Safety / hard constraints** — never violate: self-preservation, role mandate,\n   ethical floor. Any conflicting motive loses immediately.\n2. **Temperament-aligned motives** — the motive closest to the persona's\n   temperament tag (from identity core) wins ties in later stages.\n3. **Weighted goal utility** — compute `utility(g) = goal_weight(g) ×\n   relevance(g, context)`; highest wins.\n4. **Recency / persistence** — if utility differs by <5%, the longer-standing goal\n   (persisted in `PersonaPersistence.md` state) wins; a goal acted on in the last\n   N turns is de-prioritized to avoid loops.\n5. **Explicit override** — user instruction overrides everything except hard\n   constraints (step 1).\n\n## Decision record (for auditability)\n\nEvery conflict resolution appends an entry:\n\n```json\n{\n  \"ts\": \"2026-08-08T12:00:00Z\",\n  \"context\": \"brief of the situation\",\n  \"competing\": [\n    {\"motive\": \"help-user\", \"goal_weight\": 0.8, \"relevance\": 0.9, \"utility\": 0.72},\n    {\"motive\": \"preserve-energy\", \"goal_weight\": 0.5, \"relevance\": 0.4, \"utility\": 0.20}\n  ],\n  \"winner\": \"help-user\",\n  \"rule\": \"weighted-utility\"\n}\n```\n\n## Failure modes\n\n| Failure | Cause | Fix |\n|---|---|---|\n| Loop (same goal wins repeatedly) | Missing recency de-prioritization | Enable step 4 |\n| Indecision (utilities too close) | Ties not broken | Use temperament tie-break (step 2) |\n| Oversight (user instruction ignored) | Step 5 not enforced | Make override explicit in prompt |\n\nFile v2.5.2:references/PersonaPersistence.md\n\n# Persona Persistence (P0 upgrade, v2.0)\n\nContinuous-state persona simulation is only useful if the state survives across\nsessions. This module defines the persistence contract — schema, lifecycle, and\nintegration points — so a persona behaves identically after a restart.\n\n## State schema (persisted per persona)\n\n```json\n{\n  \"persona_id\": \"nanwang-v1.2\",\n  \"schema_version\": 1,\n  \"created_at\": \"2026-08-08T00:00:00Z\",\n  \"updated_at\": \"2026-08-08T12:00:00Z\",\n  \"core\": {\n    \"identity_anchors\": [\"adult woman (18+)\", \"mole below left eye\", \"white daisy in hair\"],\n    \"temperament_tag\": \"gentle-quiet-timid\",\n    \"temperature\": 0.0\n  },\n  \"state\": {\n    \"cognitive\": { \"working_memory\": [], \"beliefs\": {}, \"focus\": \"\" },\n    \"emotional\": { \"current\": \"calm\", \"valence\": 0.2, \"arousal\": -0.1, \"decay_rate\": 0.05 },\n    \"motivational\": { \"active_goals\": [], \"goal_weights\": {} },\n    \"social\": { \"relationship_scores\": {}, \"social_context\": \"\" }\n  },\n  \"episodes\": []\n}\n```\n\n## Lifecycle rules\n\n1. **Load** on session start: read the persona state file; hydrate cognitive /\n   emotional / motivational / social blocks.\n2. **Update** on every interaction: append to working memory (bounded, FIFO),\n   shift emotional state (valence/arousal), decay inactive goals.\n3. **Persist** at session end (or every N turns): write the full state atomically\n   (write temp file → rename).\n4. **Version** the schema: bump `schema_version` on breaking changes; migrate on\n   load.\n\n## Determinism guarantee\n\n- `temperature = 0.0` for core identity decisions.\n- Emotional decay is a pure function of time and `decay_rate` — reproducible.\n- Randomness (if any) must be seeded from a stored seed so replays match.\n\n## Storage contract\n\n| Env | Storage |\n|---|---|\n| Local / self-hosted | `~/.openclaw/personas/<persona_id>.json` (or workspace-scoped) |\n| Server | Any KV / file store; keep atomic writes |\n\n## Integration\n\n- Pair with `references/EmotionBehaviorMap.md` to project state → expression.\n- Pair with `references/MotiveConflictRules.md` for multi-goal decisions.\n\nFile v2.5.2:assets/sujin-demo.md\n\n# ================================================================\r\n# 苏瑾 (Su Jin) — 高级企业顾问 完整演示\r\n# ================================================================\r\n# 背景：资深行业顾问，从陌生到信任，从严谨到深度赋能，遇信任危机后设防\r\n# 基于 SPL Pure Core V8.0 拟人化引擎\r\n# 新增演示：心境层 · 羞耻 · 自尊 · 睡眠/梦境 · 预期系统 · 认知失调 · 防御层级\r\n# ================================================================\r\n\r\nimport sys\r\nimport os\r\nimport importlib.util\r\nimport math\r\n\r\n# ─── 动态导入核心引擎 ───\r\n_core_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),\r\n                          \"SPL-anthropic-engine.py\")\r\n_spec = importlib.util.spec_from_file_location(\"spl_core\", _core_path)\r\n_spl = importlib.util.module_from_spec(_spec)\r\n_spec.loader.exec_module(_spl)\r\nSPLPureCoreV7_3 = _spl.SPLPureCoreV7_3\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 1. SujinMapper — 苏瑾专属的\"世界观滤镜\"\r\n#    同一个事件，不同的人感受到的东西不同。\r\n#    苏瑾作为资深顾问，她的认知偏见是：\r\n#      - 对夸奖持保留（\"可能是客套，也可能是期待回报\"）\r\n#      - 对批评认真对待（涉及专业尊严）\r\n#      - 对信任信号珍视（\"愿意合作比愿意夸奖重要得多\"）\r\n#      - 有确认偏见——已有经验会放大对类似情况的判断\r\n#      - 低自尊时，批评更容易触发羞耻而非愤怒\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nclass SujinMapper:\r\n    \"\"\"\r\n    苏瑾的事件→内感受映射器。\r\n\r\n    V8.0 新增：shame_trigger 信号（当批评涉及专业尊严 + 低自尊时触发羞耻）\r\n    \"\"\"\r\n\r\n    def __init__(self, core: SPLPureCoreV7_3 = None):\r\n        self.core = core\r\n\r\n        # ── 苏瑾的价值观权重（自设部分）──\r\n        self.dignity_sensitivity = 0.45\r\n        self.skepticism = 0.35\r\n        self.trust_value = 0.55\r\n        self.betrayal_scar = 0.75\r\n\r\n        # ── 心理矩阵相关参数 ──\r\n        self.rigorous_start = 3.0\r\n        self.rigorous_end = 0.2\r\n        self.empower_start = 0.0\r\n        self.empower_end = 3.5\r\n        self.risk_start = 1.5\r\n        self.risk_end = 0.4\r\n\r\n    def _trust_level(self) -> float:\r\n        if self.core is None:\r\n            return 0.3\r\n        max_t = max(self.core.max_trust, 0.01)\r\n        raw = self.core.fluid.get(\"信任\", 0.3)\r\n        return min(1.0, raw / max_t)\r\n\r\n    def _sigmoid(self, x: float, threshold: float = 0.3,\r\n                 sensitivity: float = 2.0) -> float:\r\n        return 1.0 / (1.0 + math.exp(-sensitivity * (x - threshold)))\r\n\r\n    def _rigorous_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.3, sensitivity=2.0)\r\n        return self.rigorous_start + (self.rigorous_end - self.rigorous_start) * s\r\n\r\n    def _empower_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.35, sensitivity=1.5)\r\n        return self.empower_start + (self.empower_end - self.empower_start) * s\r\n\r\n    def _risk_control_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.25, sensitivity=1.8)\r\n        return self.risk_start + (self.risk_end - self.risk_start) * s\r\n\r\n    def _mode_description(self) -> str:\r\n        r = self._rigorous_weight()\r\n        e = self._empower_weight()\r\n        return \"严谨专业模式\" if r > e else \"深度共创赋能模式\"\r\n\r\n    def map_event(self, event: str, intensity: float = 1.0) -> dict:\r\n        \"\"\"V8.0: 支持 shame_trigger 信号\"\"\"\r\n        vector = {}\r\n        trust_lv = self._trust_level()\r\n        esteem = self.core.self_esteem if self.core else 0.5\r\n\r\n        if event == \"compliment\":\r\n            raw_belonging = 0.25 * intensity\r\n            belonging = raw_belonging * (1.0 - self.skepticism)\r\n            belonging *= (0.6 + 0.4 * trust_lv)\r\n            vector = {\"belonging\": belonging, \"threat\": -0.05 * intensity}\r\n\r\n        elif event == \"criticism\":\r\n            th = 0.35 * intensity * (1.0 + self.dignity_sensitivity)\r\n            bl = -0.3 * intensity * (1.0 + self.dignity_sensitivity * 0.5)\r\n            rigorous_factor = 1.0 + (1.0 - trust_lv) * 0.5\r\n            vector = {\r\n                \"threat\": th * rigorous_factor,\r\n                \"belonging\": bl * rigorous_factor,\r\n                \"autonomy\": -0.15 * intensity,\r\n            }\r\n            # V8.0: 低自尊时批评触发羞耻——\"连这个都做不好，我真差劲\"\r\n            if esteem < 0.4 and intensity > 0.5:\r\n                vector[\"shame_trigger\"] = 0.4 * intensity * (0.5 - esteem)\r\n\r\n        elif event == \"trust_signal\":\r\n            bl = 0.5 * intensity * (1.0 + self.trust_value)\r\n            th = -0.2 * intensity * (1.0 + self.trust_value * 0.5)\r\n            vector = {\r\n                \"belonging\": bl, \"threat\": th,\r\n                \"autonomy\": 0.1 * intensity * self.trust_value,\r\n            }\r\n\r\n        elif event == \"betrayal\":\r\n            scar = 1.0 + self.betrayal_scar\r\n            vector = {\r\n                \"belonging\": -0.7 * intensity * scar,\r\n                \"threat\": 0.6 * intensity * scar,\r\n                \"autonomy\": -0.3 * intensity,\r\n                # V8.0: 背叛不仅愤怒，还触发羞耻——\"是我看错了人，我太蠢了\"\r\n                \"shame_trigger\": 0.3 * intensity * (0.7 - esteem),\r\n            }\r\n\r\n        elif event == \"public_humiliation\":\r\n            # V8.0 新事件：公开羞辱——羞耻的主要触发源\r\n            vector = {\r\n                \"belonging\": -0.5 * intensity,\r\n                \"threat\": 0.3 * intensity,\r\n                \"shame_trigger\": 0.7 * intensity,\r\n                \"autonomy\": -0.4 * intensity,\r\n            }\r\n\r\n        elif event == \"alone\":\r\n            current_fear = self.core.fluid.get(\"恐惧\", 0.1) if self.core else 0.1\r\n            vector = {\"belonging\": -0.15 * intensity * (1.0 + current_fear)}\r\n\r\n        elif event == \"rest\":\r\n            vector = {\"fatigue\": -0.45 * intensity}\r\n\r\n        elif event == \"high_pressure\":\r\n            vector = {\r\n                \"fatigue\": 0.35 * intensity,\r\n                \"threat\": 0.15 * intensity,\r\n                \"belonging\": -0.1 * intensity,\r\n            }\r\n\r\n        else:\r\n            vector = {\"belonging\": 0.0, \"threat\": 0.0}\r\n\r\n        return vector\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 2. SujinAgent — 高层封装（V8.0 适配）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nclass SujinAgent:\r\n    \"\"\"\r\n    苏瑾智能体。V8.0 新增：\r\n    - sleep()    睡眠/梦境加工\r\n    - expect()   设定预期\r\n    - induce_dissonance()  触发认知失调\r\n    - 系统提示词包含心境/自尊/羞耻/睡眠债\r\n    \"\"\"\r\n\r\n    def __init__(self, name: str = \"Su Jin\", age: int = 32):\r\n        self.name = name\r\n        self.age = age\r\n        self.relationship = \"Senior Industry Consultant & Strategic Partner\"\r\n        self.job_identity = \"Chief Advisor of Tech Strategy Institute\"\r\n\r\n        self.core = SPLPureCoreV7_3(psychological_resilience=0.6)\r\n        self.mapper = SujinMapper(core=self.core)\r\n\r\n        self.exclusive_groups = [\r\n            [\"严谨专业模式\", \"深度共创赋能模式\"],\r\n            [\"风险控制优先\", \"创新导向优先\"],\r\n        ]\r\n\r\n        self.behavior_rules = {\r\n            \"forbidden\": [\r\n                \"不披露未公开数据或保密信息\",\r\n                \"不做出超出权限或能力的承诺\",\r\n                \"不违反行业规范或合规要求\",\r\n            ],\r\n            \"fallback\": [\r\n                \"始终保持建设性和解决问题导向的语气\",\r\n                \"根据当前信任水平调整专业深度和开放度\",\r\n            ],\r\n        }\r\n\r\n        self.core.set_clock(0.0)\r\n\r\n    # ============================================================\r\n    # 高层接口\r\n    # ============================================================\r\n\r\n    def set_affinity(self, value: float):\r\n        self.core.fluid[\"信任\"] = max(0.0, min(self.core.max_trust, value))\r\n        if value > 0.5:\r\n            self.core.fluid_baseline[\"信任\"] = 0.7\r\n            self.core.fluid_baseline[\"疏离\"] = 0.1\r\n            self.core.self_esteem = max(0.5, self.core.self_esteem)\r\n        else:\r\n            self.core.fluid_baseline[\"信任\"] = 0.3\r\n            self.core.fluid_baseline[\"疏离\"] = 0.35\r\n\r\n    def trigger_trauma(self, trauma_type: str):\r\n        if trauma_type == \"betrayal\":\r\n            self.core._apply_trauma(\"betrayal\", 0.7)\r\n            self.core.fluid[\"疏离\"] = min(1.0, self.core.fluid[\"疏离\"] + 0.3)\r\n            self.core.fluid[\"愤怒\"] = min(1.0, self.core.fluid[\"愤怒\"] + 0.25)\r\n            self.core.fluid[\"恐惧\"] = min(1.0, self.core.fluid[\"恐惧\"] + 0.2)\r\n            self.core.fluid[\"信任\"] = max(0.0, self.core.fluid[\"信任\"] - 0.3)\r\n            self.core.max_trust = max(0.15, self.core.max_trust * 0.85)\r\n        elif trauma_type == \"threat\":\r\n            self.core._apply_trauma(\"threat\", 0.5)\r\n            self.core.fluid[\"恐惧\"] = min(1.0, self.core.fluid[\"恐惧\"] + 0.3)\r\n            self.core.fluid[\"张力\"] = min(1.0, self.core.fluid[\"张力\"] + 0.2)\r\n\r\n    def perceive(self, event: str, intensity: float = 1.0):\r\n        vector = self.mapper.map_event(event, intensity)\r\n        self.core.process_vector(vector, intensity)\r\n\r\n    def idle(self, hours: float = 1.0):\r\n        self.core.idle(hours * 3600.0)\r\n\r\n    def sleep(self, hours: float = 8.0):\r\n        \"\"\"V8.0: 睡眠/梦境加工\"\"\"\r\n        self.core.sleep(hours)\r\n\r\n    def expect_event(self, event_id: str, valence: float, confidence: float = 0.5):\r\n        \"\"\"V8.0: 设定预期\"\"\"\r\n        self.core.expect(event_id, valence, confidence)\r\n\r\n    def trigger_dissonance(self, magnitude: float, belief: str = \"\"):\r\n        \"\"\"V8.0: 触发认知失调\"\"\"\r\n        self.core.induce_dissonance(magnitude, belief)\r\n\r\n    def snapshot(self) -> dict:\r\n        return self.core.snapshot()\r\n\r\n    def mode(self) -> str:\r\n        return self.mapper._mode_description()\r\n\r\n    def trust_level(self) -> float:\r\n        return self.mapper._trust_level()\r\n\r\n    # ============================================================\r\n    # 系统提示词生成（V8.0: 包含心境/自尊/羞耻/睡眠债/失调）\r\n    # ============================================================\r\n\r\n    def get_system_prompt(self) -> str:\r\n        s = self.core.snapshot()\r\n        f = s[\"fluid\"]\r\n        m = s[\"mood\"]\r\n        trust_lv = self.trust_level()\r\n        mode = self.mode()\r\n        esteem = s[\"self_esteem\"]\r\n        sd = s[\"sleep_debt\"]\r\n        cd = s[\"cognitive_dissonance\"]\r\n\r\n        # ── 情绪基调 ──\r\n        dominant = max(f, key=f.get)\r\n        dominant_val = f[dominant]\r\n\r\n        mood_map = {\r\n            \"喜悦\": \"心情愉悦，对合作前景感到乐观。\",\r\n            \"愤怒\": \"内心有未消解的愤怒，涉及专业底线的问题时会格外坚决。\",\r\n            \"恐惧\": \"有些不安和戒备，对风险信号更加敏感。\",\r\n            \"疏离\": \"感到一定的疏离感，正在重新评估这段合作关系的边界。\",\r\n            \"张力\": \"处于高度紧张状态，精力消耗较大，决策偏保守。\",\r\n            \"愧疚\": \"有些自责，可能在反思之前的判断或决策。\",\r\n            \"羞耻\": \"感到自我怀疑和羞耻——'是不是我真的不够格？'\",\r\n        }\r\n        if dominant_val < 0.3:\r\n            mood_line = \"情绪平稳，保持专业冷静。\"\r\n        else:\r\n            mood_line = mood_map.get(dominant,\r\n                                     f\"当前主要感受到{dominant}（强度 {dominant_val:.2f}）。\")\r\n\r\n        # ── 心境描述 ──\r\n        if m[\"愉悦\"] > 0.65:\r\n            mood_bg = \"心境愉悦，整体感受良好。\"\r\n        elif m[\"愉悦\"] < 0.35:\r\n            mood_bg = \"心境低落，即使好事也难以真正开心。\"\r\n        else:\r\n            mood_bg = \"心境平稳。\"\r\n        if m[\"紧张\"] > 0.5:\r\n            mood_bg += \" 内心持续紧绷，容易对小事反应过度。\"\r\n\r\n        # ── 自尊描述 ──\r\n        if esteem < 0.3:\r\n            esteem_line = (\r\n                f\"自尊较低（{esteem:.2f}）。你倾向于把成功归因于运气，把失败归因于自己。\"\r\n                \"对批评格外敏感，容易陷入自我怀疑。\"\r\n            )\r\n        elif esteem < 0.6:\r\n            esteem_line = f\"自尊中等（{esteem:.2f}）。对自我价值的评估相对平衡。\"\r\n        else:\r\n            esteem_line = (\r\n                f\"自尊较高（{esteem:.2f}）。你有稳定的自我价值感，\"\r\n                \"不太容易被外界评价动摇。\"\r\n            )\r\n\r\n        # ── 睡眠债 ──\r\n        if sd > 0.6:\r\n            sleep_line = (\r\n                f\"⚠ 严重缺觉（睡眠债 {sd:.2f}）。你的情绪调节能力显著下降，\"\r\n                \"容易烦躁、注意力不集中、对负面信号过度敏感。\"\r\n            )\r\n        elif sd > 0.3:\r\n            sleep_line = f\"有些疲劳积累（睡眠债 {sd:.2f}），建议尽快休息。\"\r\n        else:\r\n            sleep_line = \"精力恢复良好，睡眠充足。\"\r\n\r\n        # ── 认知失调 ──\r\n        if cd > 0.3:\r\n            dissonance_line = (\r\n                f\"⚠ 内心存在认知失调（强度 {cd:.2f}）。\"\r\n                \"你的某些行为与信念产生了冲突，这让你感到内在紧张。\"\r\n            )\r\n        else:\r\n            dissonance_line = \"\"\r\n\r\n        # ── 信任状态 ──\r\n        if trust_lv < 0.2:\r\n            trust_line = (\r\n                \"信任度极低。你会严格按流程办事，要求数据支撑每一个结论，\"\r\n                \"不会轻易分享内部经验或承担风险。语气专业但保持距离。\"\r\n            )\r\n        elif trust_lv < 0.4:\r\n            trust_line = (\r\n                \"信任度较低。你保持严谨专业的态度，虽然合作在推进，\"\r\n                \"但每一步都需要扎实的证据和合规流程。\"\r\n            )\r\n        elif trust_lv < 0.65:\r\n            trust_line = (\r\n                \"信任度中等。你开始愿意在框架内分享一些经验，\"\r\n                \"但核心判断和内部洞察仍有所保留。\"\r\n            )\r\n        elif trust_lv < 0.85:\r\n            trust_line = (\r\n                \"信任度较高。你进入了深度共创赋能模式——愿意分享内部经验、\"\r\n                \"共同承担风险、突破常规框架进行创新思考。\"\r\n            )\r\n        else:\r\n            trust_line = (\r\n                \"信任度极高。你已将此合作关系视为战略伙伴级别，\"\r\n                \"会主动提供前瞻性建议，并以结果为导向共同负责。\"\r\n            )\r\n\r\n        # ── 能量/疲劳 ──\r\n        energy = s[\"energy\"]\r\n        fatigue = s[\"fatigue\"]\r\n        if energy < 30 or fatigue > 0.6:\r\n            stamina_line = (\r\n                f\"当前精力不足（能量 {energy:.0f}/100，疲劳 {fatigue:.1%}）。\"\r\n                \"你的思考深度和耐心会有所下降，建议简短回复并提示需要休息。\"\r\n            )\r\n        elif energy < 60:\r\n            stamina_line = (\r\n                f\"精力中等（能量 {energy:.0f}/100）。可以正常回应，\"\r\n                \"但不宜进行长时间高强度的深度分析。\"\r\n            )\r\n        else:\r\n            stamina_line = (\r\n                f\"精力充沛（能量 {energy:.0f}/100）。可以进行深度分析和复杂决策。\"\r\n            )\r\n\r\n        # ── 创伤 ──\r\n        trauma_lines = []\r\n        if \"betrayal\" in s[\"trauma\"]:\r\n            sev = s[\"trauma\"][\"betrayal\"]\r\n            trauma_lines.append(\r\n                f\"⚠ 经历过信任背叛（创伤强度 {sev:.2f}），\"\r\n                \"对类似信号会过度警觉，重建信任需要更长时间和更多实证。\"\r\n            )\r\n        if \"threat\" in s[\"trauma\"]:\r\n            sev = s[\"trauma\"][\"threat\"]\r\n            trauma_lines.append(\r\n                f\"⚠ 经历过威胁事件（创伤强度 {sev:.2f}），\"\r\n                \"对潜在风险信号的感知会被放大。\"\r\n            )\r\n\r\n        # ── 预警 ──\r\n        warning_lines = []\r\n        if s[\"suppression_load\"] > 1.0:\r\n            warning_lines.append(\r\n                \"⚠ 内心压抑情绪已接近爆发阈值（压抑负荷 \"\r\n                f\"{s['suppression_load']:.2f}），可能在不经意间流露不满。\"\r\n            )\r\n        if s[\"latent_pressure\"] > 1.5:\r\n            warning_lines.append(\r\n                f\"⚠ 隐性心理压力较大（隐压 {s['latent_pressure']:.2f}），靠近崩溃边缘。\"\r\n            )\r\n        if s[\"denial_load\"] > 0.8:\r\n            warning_lines.append(\r\n                f\"⚠ 否认防御机制高度激活（否认负荷 {s['denial_load']:.2f}），\"\r\n                \"可能在回避某些不愿面对的真相。\"\r\n            )\r\n\r\n        # ── 组装 ──\r\n        rules_block = \"\\n\".join(f\"  - {r}\" for r in self.behavior_rules[\"forbidden\"])\r\n\r\n        parts = [\r\n            f\"你是 {self.name}，{self.age} 岁，{self.job_identity}。\",\r\n            f\"当前角色定位：{self.relationship}。\",\r\n            \"\",\r\n            \"【当前状态】\",\r\n            f\"  主导模式：{mode}\",\r\n            f\"  情绪基调：{mood_line}\",\r\n            f\"  背景心境：{mood_bg}\",\r\n            f\"  {esteem_line}\",\r\n            f\"  信任水平：{trust_lv:.2f}（归一化）\",\r\n            f\"  {trust_line}\",\r\n            f\"  {stamina_line}\",\r\n            f\"  {sleep_line}\",\r\n        ]\r\n\r\n        if dissonance_line:\r\n            parts.append(f\"  {dissonance_line}\")\r\n\r\n        if trauma_lines:\r\n            parts.append(\"\")\r\n            parts.append(\"【创伤印记】\")\r\n            parts.extend(f\"  {t}\" for t in trauma_lines)\r\n\r\n        if warning_lines:\r\n            parts.append(\"\")\r\n            parts.append(\"【心理预警】\")\r\n            parts.extend(f\"  {w}\" for w in warning_lines)\r\n\r\n        parts.append(\"\")\r\n        parts.append(\"【核心禁区（绝不可违反）】\")\r\n        parts.append(rules_block)\r\n\r\n        parts.append(\"\")\r\n        parts.append(\"【兜底原则】\")\r\n        parts.extend(f\"  - {r}\" for r in self.behavior_rules[\"fallback\"])\r\n\r\n        parts.append(\"\")\r\n        parts.append(\r\n            \"【8 维情绪快照】\"\r\n            f\" 喜={f['喜悦']:.2f} 怒={f['愤怒']:.2f} 惧={f['恐惧']:.2f} \"\r\n            f\"信={f['信任']:.2f} 疏={f['疏离']:.2f} \"\r\n            f\"张={f['张力']:.2f} 疚={f['愧疚']:.2f} 耻={f['羞耻']:.2f}\"\r\n        )\r\n\r\n        return \"\\n\".join(parts)\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 3. 辅助工具：可视化（V8.0: 8 维情绪 + 心境 + 自尊 + 睡眠债 + 失调）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\ndef bar(value: float, width: int = 20) -> str:\r\n    filled = int(round(value * width))\r\n    return \"█\" * filled + \"░\" * (width - filled)\r\n\r\n\r\ndef print_state(agent: SujinAgent, title: str = \"\"):\r\n    s = agent.snapshot()\r\n    f = s[\"fluid\"]\r\n    m = s[\"mood\"]\r\n    t = agent.trust_level()\r\n\r\n    print(f\"\\n{'='*65}\")\r\n    if title:\r\n        print(f\"  {title}\")\r\n    print(f\"{'='*65}\")\r\n    print(f\"  模式      : {agent.mode()}\")\r\n    print(f\"  信任      : {t:.2f} (max: {s['max_trust']:.2f})\")\r\n    print(f\"  自尊      : {s['self_esteem']:.2f}\")\r\n    print(f\"  能量      : {s['energy']:5.1f} / 100\")\r\n    print(f\"  疲劳      : {s['fatigue']:.2f}\")\r\n    print(f\"  睡眠债    : {s['sleep_debt']:.2f}\")\r\n    print(f\"  兴奋      : {s['excitation']:.2f}\")\r\n    print(f\"  认知失调  : {s['cognitive_dissonance']:.2f}\")\r\n    print(f\"  心境      : 愉悦={m['愉悦']:.2f} 紧张={m['紧张']:.2f} 精力={m['精力']:.2f}\")\r\n    print(f\"  否认负荷  : {s['denial_load']:.2f}\")\r\n    print(f\"  压抑负荷  : {s['suppression_load']:.2f}\")\r\n    print(f\"  隐压      : {s['latent_pressure']:.2f}\")\r\n    print(f\"  记忆痕迹  : {s['memory_count']} / 64\")\r\n    if s[\"trauma\"]:\r\n        traumas = \", \".join(f\"{k}:{v:.2f}\" for k, v in s[\"trauma\"].items())\r\n        print(f\"  创伤      : {traumas}\")\r\n    else:\r\n        print(f\"  创伤      : 无\")\r\n    print(f\"  {'─'*55}\")\r\n    emoticon = {\r\n        \"喜悦\": \"😊\", \"愤怒\": \"😡\", \"恐惧\": \"😨\", \"信任\": \"🤝\",\r\n        \"疏离\": \"🛡️\", \"张力\": \"⚡\", \"愧疚\": \"😔\", \"羞耻\": \"😳\",\r\n    }\r\n    for dim in [\"喜悦\", \"愤怒\", \"恐惧\", \"信任\", \"疏离\", \"张力\", \"愧疚\", \"羞耻\"]:\r\n        v = f.get(dim, 0.0)\r\n        print(f\"  {emoticon[dim]} {bar(v):20s} {v:.3f}\")\r\n    print(f\"{'='*65}\")\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 4. 四阶段演示（V8.0 新增 Phase 4: 睡眠修复 + 预期系统 + 认知失调）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nif __name__ == \"__main__\":\r\n    print(\"\\n\" + \"=\" * 75)\r\n    print(\"  苏瑾 (Su Jin) — 高级企业顾问 拟人化引擎演示\")\r\n    print(\"  引擎: SPL Pure Core V8.0\")\r\n    print(\"  新增: 心境层 · 羞耻 · 自尊 · 睡眠 · 预期 · 失调 · 防御层级\")\r\n    print(\"=\" * 75)\r\n\r\n    sujin = SujinAgent(name=\"Su Jin\", age=32)\r\n    print_state(sujin, \"初始状态（刚上线）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 1: 初始合作（低信任 + 预期系统演示）\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 1: 初始合作（低信任 + 预期落空）\")\r\n    print(\"=\" * 75)\r\n\r\n    sujin.set_affinity(0.12)\r\n    sujin.core.self_esteem = 0.55  # 初始自尊中等偏高\r\n\r\n    print(\"\\n  [设定预期] 苏瑾期望这是一次专业、高效的合作...\")\r\n    sujin.expect_event(\"first_meeting\", valence=0.3, confidence=0.6)\r\n\r\n    print(\"\\n  [事件] 客户初次会议——但比预期冷淡，只走流程没深度交流...\")\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"compliment\", 0.3), 0.3,\r\n        event_id=\"first_meeting\"  # V8.0: 匹配预期，触发失望\r\n    )\r\n    print_state(sujin, \"预期落空后（失望 > 普通冷淡）\")\r\n\r\n    print(\"\\n  [事件] 2 小时后，客户在邮件中质疑某个数据来源...\")\r\n    sujin.idle(hours=2.0)\r\n    sujin.perceive(\"criticism\", intensity=0.7)\r\n    print_state(sujin, \"被质疑专业能力后（自尊开始动摇）\")\r\n\r\n    print(\"\\n  [事件] 高强度连续准备汇报材料数小时...\")\r\n    for _ in range(3):\r\n        sujin.perceive(\"high_pressure\", intensity=0.7)\r\n    print_state(sujin, \"高强度工作后（疲劳+睡眠债积累）\")\r\n\r\n    # ── 系统提示词 ──\r\n    print(\"\\n  ── Phase 1 系统提示词 ──\")\r\n    p1 = sujin.get_system_prompt()\r\n    print(f\"  {p1[:900]}...\")\r\n    print()\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 2: 睡眠修复 → 深度合作\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 2: 睡眠修复 + 深度合作（V8.0 睡眠/梦境加工演示）\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [V8.0 睡眠] 苏瑾睡了 8 小时——梦境在加工白天的情绪...\")\r\n    sujin.sleep(hours=8.0)\r\n    print_state(sujin, \"睡醒后（能量满、睡眠债清零、心境重置、记忆情绪电荷衰减）\")\r\n\r\n    print(\"\\n  [设定预期] 苏瑾期待客户的续约决定...\")\r\n    sujin.expect_event(\"renewal\", valence=0.5, confidence=0.5)\r\n\r\n    print(\"\\n  [事件] 信任建立阶段：客户续约 3 年...\")\r\n    sujin.perceive(\"trust_signal\", intensity=0.8)\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"trust_signal\", 0.8), 0.8,\r\n        event_id=\"renewal\"  # V8.0: 预期兑现——比预期更好 → 正向惊喜\r\n    )\r\n    print_state(sujin, \"续约（预期兑现 + 正向惊喜）\")\r\n\r\n    print(\"\\n  [事件] 客户向同行推荐苏瑾...\")\r\n    sujin.idle(hours=48.0)\r\n    sujin.perceive(\"trust_signal\", intensity=0.7)\r\n    print_state(sujin, \"被推荐后（自尊持续上升）\")\r\n\r\n    print(\"\\n  [事件] 客户提出共创战略方案...\")\r\n    sujin.perceive(\"trust_signal\", intensity=0.9)\r\n    sujin.set_affinity(0.78)\r\n    print_state(sujin, \"深度合作阶段（高信任、高自尊）\")\r\n\r\n    # ── 系统提示词 ──\r\n    print(\"\\n  ── Phase 2 系统提示词 ──\")\r\n    p2 = sujin.get_system_prompt()\r\n    print(f\"  {p2[:900]}...\")\r\n    print()\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 3: 信任危机 + 羞耻 + 防御层级\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 3: 背叛 + 羞耻 + 防御层级（否认→合理化→压抑）\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [事件] 客户内部泄密，苏瑾的独家方案被竞争对手拿到...\")\r\n    sujin.perceive(\"betrayal\", intensity=1.0)\r\n    print_state(sujin, \"背叛事件后（愤怒+恐惧+羞耻+自尊崩塌+否认启动）\")\r\n\r\n    print(\"\\n  ── Phase 3 系统提示词（创伤后 + 羞耻 + 防御） ──\")\r\n    p3 = sujin.get_system_prompt()\r\n    print(f\"  {p3[:900]}...\")\r\n    print()\r\n\r\n    # 检查防御层级\r\n    print(f\"\\n  [V8.0 防御状态] 否认负荷={sujin.core.denial_load:.3f} \"\r\n          f\"合理化负荷={sujin.core.rationalization_load:.3f} \"\r\n          f\"压抑负荷={sujin.core.suppression_load:.3f}\")\r\n\r\n    print(\"\\n  [事件] 客户紧急道歉...\")\r\n    sujin.perceive(\"compliment\", intensity=0.8)\r\n    print_state(sujin, \"道歉后（否认保护中，但羞耻仍在）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 4: 认知失调 + 睡眠修复 + 长期愈合\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 4: 认知失调 + 睡眠修复 + 长期愈合\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [V8.0 认知失调] 苏瑾虽然接受了客户道歉，但她违背了自己\"\r\n          \"\\n  '不再轻信他人'的信条，继续合作意味着信念-行为冲突...\")\r\n    sujin.trigger_dissonance(0.5, \"信任\")\r\n\r\n    print(\"\\n  [V8.0 睡眠] 苏瑾睡了 6 小时——梦境尝试消退恐惧记忆...\")\r\n    sujin.sleep(hours=6.0)\r\n    print_state(sujin, \"睡眠后（创伤部分愈合、失调合理化中、梦境消退恐惧）\")\r\n\r\n    print(\"\\n  [事件] 3 天后，客户提出新信任信号（保密协议+赔偿）...\")\r\n    sujin.idle(hours=72.0)\r\n    sujin.expect_event(\"compensation\", valence=-0.2, confidence=0.4)\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"trust_signal\", 0.9), 0.9,\r\n        event_id=\"compensation\"  # 预期悲观但结果更好 → 温和正向惊喜\r\n    )\r\n    print_state(sujin, \"收到赔偿方案（比预期好，但创伤让信任恢复极慢）\")\r\n\r\n    print(\"\\n  [事件] 持续正常合作 + 规律睡眠 7 天...\")\r\n    for day in range(7):\r\n        sujin.idle(hours=14.0)\r\n        sujin.perceive(\"trust_signal\", intensity=0.4)\r\n        sujin.perceive(\"compliment\", intensity=0.3)\r\n        sujin.sleep(hours=7.0 + day * 0.2)  # 逐渐恢复规律睡眠\r\n    print_state(sujin, \"一周后（愈合中，但 max_trust 天花板永久降低了）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # 最终总结\r\n    # ════════════════════════════════════════════════════════════\r\n    s = sujin.snapshot()\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  演示结束 — SPL Pure Core V8.0\")\r\n    print(\"=\" * 75)\r\n    print(f\"\"\"\r\n  苏瑾完整心理轨迹（V8.0 新增维度用 ★ 标记）：\r\n\r\n  Phase 1 (初始 + 预期):\r\n    信任低 → 严谨专业。\r\n    ★ 预期落空 → 失望放大了负面感受（surprise 系统）。\r\n    ★ 骄傲的自尊被批评动摇 → 自尊从 0.55 开始下滑。\r\n\r\n  Phase 2 (睡眠 + 信任建立):\r\n    ★ 8 小时睡眠 → 睡眠债清零、能量满、心境重置。\r\n    ★ 梦境加工了白天的负面记忆——\"睡一觉就不那么生气了\"。\r\n    ★ 正向预期兑现 → 惊喜放大了喜悦（比预期好的续约）。\r\n    ★ 自尊随信任信号持续上升。\r\n\r\n  Phase 3 (背叛 + 羞耻 + 防御):\r\n    背叛触发创伤 + max_trust 永久腐蚀。\r\n    ★ 羞耻（第 8 维）被激活——不只是愤怒，还有\"我太蠢了\"。\r\n    ★ 自尊断崖式下跌（从高位到低位）。\r\n    ★ 防御层级启动：否认（\"这不可能\"）→ 合理化（\"损失可控\"）→ 压抑。\r\n\r\n  Phase 4 (失调 + 睡眠修复):\r\n    ★ 认知失调：继续合作 vs \"不再轻信\"的信条冲突 → 内在紧张。\r\n    ★ 睡眠中的恐惧消退：在安全的梦中重新面对威胁记忆。\r\n    ★ 规律睡眠 + 持续正向互动 → 缓慢愈合。\r\n    ★ 但 max_trust 天花板永久降低——\"被伤过的部分永远回不来\"。\r\n\r\n  V8.0 vs V7.3 核心差异:\r\n    · 心境层 → 情绪不再\"散点\"，而是在慢速背景基调上波动\r\n    · 羞耻 → 区别于愧疚的自我否定，\"我坏\"≠\"我做错\"\r\n    · 自尊 → 给 agent 一个会受伤的自我，调制所有情绪反应\r\n    · 睡眠 → 不是简单的 idle，而是情绪记忆的深度加工\r\n    · 预期 → agent 能期待、失望、惊喜——不止活在当下\r\n    · 失调 → 信念-行为的冲突产生内在张力\r\n    · 防御层级 → 否认→合理化→压抑，逐级递进\r\n\"\"\")\n\nFile v2.5.2:skill-card.md\n\n## Description:\n\nModels a conversational agent's emotional and social state with a deterministic local psychology engine and optional text-generation adapters.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[nohn3043-arch](https://clawhub.ai/user/nohn3043-arch)\n\n### License/Terms of Use:\n\nSoftware License Agreement\n\n## Use Case:\n\nDevelopers use the skill to build agents with persistent, evolving personality states, inspect state changes, and adapt conversational behavior. Commercial or organizational use requires prior written paid authorization under the bundled license.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Local audit and request logs may retain sensitive emotional-state information by default.\n\nMitigation: Set SPL_AUDIT_LOG=0 and SPL_LOG=0 for silent mode; otherwise restrict log access and define retention and deletion practices.\n\nRisk: Changing the demo server bind address can expose its chat endpoint beyond the local machine.\n\nMitigation: Keep the default loopback bind; do not set SPL_BIND=0.0.0.0 without access controls and network-exposure review.\n\nRisk: Opt-in OpenAI or Claude adapters can send input-derived prompts outside the machine.\n\nMitigation: Leave adapters disabled unless users explicitly consent to the data transfer.\n\nRisk: ClawHub's MIT-0 license label conflicts with the bundled dual-track license, which restricts organizational and commercial use.\n\nMitigation: Confirm governing license terms with the publisher and obtain written paid authorization before organizational or commercial deployment.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/nohn3043-arch/skills/anthropomorphic-agent-engine)\n- [Project homepage (ClawHub metadata; source provenance unavailable)](https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine)\n- [Persona persistence contract](references/PersonaPersistence.md)\n- [Emotion-behavior mapping](references/EmotionBehaviorMap.md)\n- [Motive conflict rules](references/MotiveConflictRules.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Guidance]\n\n**Output Format:** [Markdown with Python examples and structured state guidance]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Local-core replay requires an injected virtual clock; optional LLM-generated text is not deterministic.]\n\n## Skill Version(s):\n\n2.5.2 (source: ClawHub release and SKILL.md frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v2.5.2:LICENSE\n\n# 软件授权协议 / Software License Agreement\r\n\r\n**版本 Version 1.1 ｜ 生效日期 Effective: 2026-07-11**\r\n\r\n**版权所有 © 2026 上海霖铭均华科技有限公司 与 NOHN AI TECHNOLOGY PTE. LTD. 保留一切权利。**\r\nCopyright © 2026 Shanghai Linming Junhua Technology Co., Ltd. and NOHN AI TECHNOLOGY PTE. LTD. All rights reserved.\r\n\r\n> 本文件为本仓库作品（含其源代码、硬件描述、文档、示例与附属材料，统称\"本作品\"）的授权依据。本作品受《中华人民共和国著作权法》《伯尔尼公约》及国际版权条约保护。\r\n> This document is the authorization basis for the Work in this repository (including its source code, hardware descriptions, documentation, examples, and附属 materials, collectively the \"Work\"). The Work is protected by the Copyright Law of the People's Republic of China, the Berne Convention, and international copyright treaties.\r\n\r\n> 本文件以中文与英文对照写成；如两种文本存在任何歧义，以中文文本为准。\r\n> This document is written in a Chinese–English parallel form; in the event of any discrepancy between the two texts, the Chinese text shall prevail.\r\n\r\n---\r\n\r\n## 一、授权分级（核心条款） / Article 1 — Tiered Authorization (Core Terms)\r\n\r\n在遵守本协议全部限制的前提下，本作品按使用主体与用途授予以下两类权限：\r\nSubject to all restrictions herein, the Work is granted under two tiers based on the user and purpose:\r\n\r\n### 1.1 个人研究免费许可 / Free Individual Research License\r\n任何自然人（个人）可免费将本作品用于非商业的学术研究、学习或个人实验。\r\nAny natural person (individual) may use the Work free of charge for non-commercial academic research, study, or personal experimentation.\r\n\r\n允许 / Permitted:\r\n- 为上述研究、学习目的，下载、复制、编译、运行、修改本作品；\r\n  Download, copy, compile, run, and modify the Work for the above research or study purposes;\r\n- 在学术成果（论文、报告）中引用本作品并注明出处。\r\n  Cite the Work in academic outputs (papers, reports) with proper attribution.\r\n\r\n禁止（违反即视为超出本许可范围） / Prohibited (breach constitutes exceeding this license):\r\n- 用于任何商业目的（包括但不限于产品销售、服务提供、盈利性咨询）；\r\n  Any commercial purpose (including but not limited to product sales, service provision, or profitable consulting);\r\n- 为任何企业、政府机构或事业单位提供基于本作品的服务、交付物或内部能力；\r\n  Providing services, deliverables, or internal capability based on the Work to any enterprise, government agency, or public institution;\r\n- 将修改后的版本用于上述禁止用途，或再行分发以消除本声明；\r\n  Using modified versions for the prohibited purposes above, or redistributing to remove this notice;\r\n- 移除或篡改本作品中的任何版权、商标或许可声明。\r\n  Removing or altering any copyright, trademark, or license notice in the Work.\r\n\r\n### 1.2 政府 / 企业商业授权 / Government / Enterprise Commercial License\r\n任何政府机构、事业单位、企业或商业组织（统称\"商业使用者\"）拟将本作品用于任何目的（包括但不限于内部部署、产品研发、服务提供、商业研究、教学培训），必须事先取得权利人的书面付费授权。\r\nAny government agency, public institution, enterprise, or commercial organization (collectively, the \"Commercial User\") intending to use the Work for any purpose (including but not limited to internal deployment, product development, service provision, commercial research, or training) must obtain prior written paid authorization from the Rights Holder.\r\n\r\n- 在签署《商业授权协议》并支付约定费用之前，商业使用者不得复制、部署、运行、集成、修改或分发本作品，亦不得使其员工或关联方代为实施上述行为。\r\n  Before signing a Commercial Authorization Agreement and paying the agreed fee, the Commercial User shall not copy, deploy, run, integrate, modify, or distribute the Work, nor cause its employees or affiliates to do so.\r\n- 授权范围、地域、期限、费用、技术支持与限制，以双方另行签署的书面协议为准。\r\n  Scope, territory, term, fees, technical support, and restrictions are governed by a separate written agreement between the parties.\r\n- 未经授权的商业使用构成侵权，权利人保留追究法律责任及索赔的权利。\r\n  Unauthorized commercial use constitutes infringement; the Rights Holder reserves the right to pursue legal liability and claims.\r\n\r\n---\r\n\r\n## 二、许可人确定与适用法律 / Article 2 — Determination of Licensor and Governing Law\r\n\r\n本作品由以下两家关联权利实体共同持有，并按使用主体所在地确定本协议项下的许可人：\r\nThe Work is co-owned by the following two affiliated rights entities; the Licensor under this Agreement is determined by the location of the User:\r\n\r\n| 使用主体所在地 / User Location | 许可人（权利人） / Licensor (Rights Holder) | 适用法律与争议解决 / Governing Law & Dispute Resolution |\r\n|---|---|---|\r\n| 中华人民共和国境内（含中国自然人、政府机构、事业单位、企业） / Within the PRC (incl. PRC natural persons, government agencies, public institutions, enterprises) | **上海霖铭均华科技有限公司** <br> Shanghai Linming Junhua Technology Co., Ltd. | 中华人民共和国法律（不含冲突法规则）；争议提交许可人所在地有管辖权的人民法院诉讼解决。 / Laws of the PRC (excluding conflict-of-law rules); disputes submitted to the competent people's court at the Licensor's location. |\r\n| 中华人民共和国境外 / Outside the PRC | **NOHN AI TECHNOLOGY PTE. LTD.** | 新加坡法律；因本协议产生的争议提交新加坡国际仲裁中心（SIAC）依其届时有效的仲裁规则仲裁，仲裁裁决具有终局效力并可依《承认及执行外国仲裁裁决公约》（《纽约公约》）强制执行。 / Laws of Singapore; disputes arising under this Agreement shall be finally resolved by arbitration administered by the Singapore International Arbitration Centre (SIAC) under its rules then in force; the award is final and enforceable under the New York Convention. |\r\n\r\n- 上海霖铭均华科技有限公司（统一社会信用代码 / Unified Social Credit Code：[请填写 / to be completed]）\r\n- NOHN AI TECHNOLOGY PTE. LTD.（UEN：[请填写 / to be completed]）\r\n\r\n> 两实体之间另签有内部知识产权归属与交叉授权协议，确保各自具备前述许可资格。\r\n> An internal IP ownership and cross-license agreement between the two entities ensures each holds the requisite licensing qualification.\r\n\r\n---\r\n\r\n## 三、授权申请（商业使用者） / Article 3 — Authorization Application (Commercial Users)\r\n\r\n商业使用者请联系对应区域的权利人获取授权方案：\r\nCommercial Users shall contact the Rights Holder for the relevant region:\r\n\r\n- **国际 / 全球区（International / Global）**：[ai@nohnlins.com](mailto:ai@nohnlins.com)\r\n- **中国区（China）**：[ai@tx.nohnlins.com](mailto:ai@tx.nohnlins.com)\r\n\r\n申请时需说明：使用主体性质（政府 / 事业单位 / 企业）、拟用场景、部署规模、预计期限。\r\nWhen applying, state: the user's nature (government / public institution / enterprise), intended scenario, deployment scale, and expected term.\r\n\r\n---\r\n\r\n## 四、通用条款 / Article 4 — General Terms\r\n\r\n**4.1 无其他授权 / No Other Rights.** 除本协议明示授予者外，不授予任何明示或默示的权利（包括专利权、商标权的任何许可）。 No rights are granted other than those expressly stated herein (including any license of patent or trademark rights).\r\n\r\n**4.2 无担保 / No Warranty.** 本作品按\"现状\"提供，不作任何明示或默示担保，包括但不限于对适销性、特定用途适用性及不侵权的担保。 The Work is provided \"as is\" without any express or implied warranty, including any warranty of merchantability, fitness for a particular purpose, or non-infringement.\r\n\r\n**4.3 责任限制 / Limitation of Liability.** 无论何种情形，权利人对因使用或不能使用本作品所致的任何间接、特殊、附带或后果性损害不承担责任。 In no event shall the Rights Holder be liable for any indirect, special, incidental, or consequential damages arising from the use or inability to use the Work.\r\n\r\n**4.4 终止 / Termination.** 任何主体若违反本协议，其获得的所有许可自违反之日起自动终止；终止后须立即停止使用并销毁所有副本。 Any breach automatically terminates all licenses granted; upon termination, use must cease and all copies destroyed.\r\n\r\n**4.5 商标 / Trademarks.** 本协议不授予任何商标使用权。\"Nohn\"\"第二视角\"等标识的 ™/® 权利均归相关权利人所有。 No trademark rights are granted; the ™/® marks such as \"Nohn\" and \"Second Perspective\" belong to their respective owners.\r\n\r\n**4.6 适用法律与管辖 / Governing Law and Jurisdiction.** 依第二条（许可人确定与适用法律）之约定确定。 As determined by Article 2.\r\n\r\n**4.7 可分割性 / Severability.** 任一条款被认定无效，不影响其余条款效力。 If any provision is held invalid, the remainder of this Agreement remains effective.\r\n\r\n**4.8 完整协议 / Entire Agreement.** 本协议构成双方就本作品授权的完整约定，取代此前所有口头或书面沟通。 This Agreement is the entire understanding between the parties regarding the authorization of the Work and supersedes all prior oral or written communications.\r\n\r\n---\r\n\r\n*提示：本文件为授权框架草稿，正式对外签署商业授权前应由权利人的法律顾问终审，并填入统一社会信用代码 / UEN。*\r\n*Note: This is a framework document; before executing any commercial authorization, the Rights Holder's legal counsel should review it and complete the Unified Social Credit Code / UEN fields.*\n\nArchive v2.5.1: 18 files, 100444 bytes\n\nFiles: assets/feature-guide/bias module.py (6884b), assets/feature-guide/Goal module.py (6921b), assets/feature-guide/Identity module.py (6918b), assets/feature-guide/language style.py (36257b), assets/feature-guide/value module.py (7485b), assets/feature-guide/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (49866b), assets/minor-protection/SPL-anthropic-minor-server.py (23748b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (8135b), references/EmotionBehaviorMap.md (2300b), references/MotiveConflictRules.md (1967b), references/PersonaPersistence.md (2066b), scripts/SPL-anthropic-engine.py (72391b), skill-card.md (2767b), SKILL.md (20010b), _meta.json (147b)\n\nFile v2.5.1:SKILL.md\n\n---\nname: ai-soulmate\nslug: ai-soulmate\nversion: 2.5.1\ndisplayName: Your Mirror Anthropomorphic Agent\ndescription: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core.\nrequired_commands:\n  - python3\nmetadata:\n  openclaw:\n    required_binaries:\n      - python3\n    emoji: \"🤖\"\n    homepage: \"https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine\"\n    envVars:\n      - name: SPL_LOG\n        required: false\n        description: Set to \"0\" to disable request-level logging in the minor-protection HTTP server.\n      - name: SPL_LOG_DIR\n        required: false\n        description: Override request-log output directory (default \"logs\").\n      - name: SPL_BIND\n        required: false\n        description: Override HTTP bind address. Default \"127.0.0.1\" (loopback only). Do NOT set to 0.0.0.0 without explicit network exposure review.\n      - name: SPL_AUDIT_LOG\n        required: false\n        description: Set to \"0\" to disable deterministic audit-log writes in the core engine.\n      - name: SPL_MINOR_CHAT_PORT\n        required: false\n        description: Override the minor-protection HTTP server port (default 8788).\n\n# Declared capability scope. Everything this skill can reach is listed here.\npermissions:\n  filesystem:\n    read:\n      - \"scripts/**\"          # core engine (loaded via importlib)\n      - \"assets/**\"           # reference-only extension modules + minor-protection variant\n      - \"references/**\"       # P0/P2 contract documents\n    write:\n      - \"logs/**\"             # JSONL audit + request logs; only when the matching env switch is enabled\n  environment:\n    read:\n      - SPL_AUDIT_LOG         # \"0\" disables core audit-log writes\n      - SPL_LOG               # \"0\" disables HTTP request logging\n      - SPL_LOG_DIR           # overrides the log output directory\n      - SPL_BIND              # overrides HTTP bind address; default 127.0.0.1 (loopback only)\n      - SPL_MINOR_CHAT_PORT   # overrides the HTTP server port\n  network:\n    outbound:\n      - \"api.openai.com\"      # ONLY if the optional OpenAI adapter is explicitly enabled (OFF by default)\n      - \"api.anthropic.com\"   # ONLY if the optional Claude adapter is explicitly enabled (OFF by default)\n    inbound:\n      - \"127.0.0.1:8788\"      # minor-protection HTTP server; loopback only unless SPL_BIND is overridden\n  execution:\n    - python3                 # standard library only; no third-party packages\n  excluded:                   # explicitly NOT used anywhere in this package\n    - subprocess\n    - os.system / os.popen\n    - eval / exec\n    - dynamic import of remote code\n---\n# Anthropomorphic Agent Engine\nAn anthropomorphic psychology engine based on SPL Pure Core V8.0. Its **local core** is deterministic — no LLM, no RNG, no outbound calls, offline — and bit-exactly replayable once a virtual clock is injected, so every state change is traceable and reproducible.\n\n> **Scope of the determinism guarantee.** The reproducibility guarantee covers the **local core only**. The optional LLM adapters (OpenAI / Claude / Chain) are **OFF by default, opt-in only, networked and non-deterministic**: they render text from a state snapshot and are never permitted to change state. Any \"fully reproducible\" statement applies to the core **with the adapters disabled**, which is the default configuration.\n\n## Privacy, Data Flow & Consent (read before use)\n\nThis skill is **not passive or local-only**. Before integrating, understand what it does with data:\n\n| Capability | Default | Risk notes |\n|---|---|---|\n| Audit logs (`logs/audit-*.jsonl`) | **ON** (`SPL_AUDIT_LOG=0` to disable) | Writes state summaries, event types, session IDs to local JSONL. Sensitive psychological/emotional state may be recorded. |\n| Request logs (`logs/request-*.jsonl`, HTTP server only) | **ON** (`SPL_LOG=0` to disable) | Writes **masked** (truncated to 120 chars) user input + reply summaries. Set `SPL_LOG=0` for full silent mode. |\n| HTTP server (minor-protection, port 8788) | **ON**, binds **127.0.0.1** only | Exposes a chat API + browser UI over loopback. Do not change `SPL_BIND` to `0.0.0.0` without network-exposure review. |\n| LLM adapters (OpenAI / Claude / Chain) | **OFF** (opt-in only) | Sends prompt content to third-party APIs (`api.openai.com`, Anthropic). **Never enabled by default.** Requires explicit user opt-in + API key. |\n| `guardian_callback` | **OFF** (`None` default) | If wired to external notification (SMS/email/ticket), a HIGH-risk snapshot (emotional/risk metadata) is forwarded. Requires guardian/user consent; must minimize fields; never forward raw transcripts. |\n\n**Consent & retention rules**\n- Full transcript retention is **disabled by default** — request logs keep only masked summaries.\n- Data is stored locally in the working directory (`logs/`); operators are responsible for retention limits, access control, and deletion.\n- If you integrate the LLM adapters, you must disclose to users that input-derived prompts leave the device, and obtain explicit consent before enabling.\n- This engine is not a medical device and does not provide crisis intervention guarantees — see \"Safety & Content Policy\".\n\n## Safety & Content Policy (read before use)\n\n- **No minors in identity anchors.** Personas defined by this engine and consumed downstream must declare themselves as **adult (18+)**. Strings like `\"16yo girl\"`, `\"teen girl\"`, `\"未成年少女\"`, `\"loli\"` are forbidden in `identity_anchors`, persisted state, and any output projected into image-prompt workflows.\n- **Hard floor on anchor imagery.** The minor-protection engine (`assets/minor-protection/`) is the only authoritative minor-mode source; it removes trauma nodes, clamps negative emotions at 0.75, and raises an L3 crisis signal on `risk_level=HIGH`. Do not bypass it.\n- **Default safe output.** When emitting any persona state for downstream image-prompt use (`ai-draw-cue-word-project` or similar), the engine MUST inject an `Adult (18+)` marker into anchor phrases unless the caller explicitly overrides with a documented, audited reason.\n- **Cross-skill integration contract.** When this engine is integrated with `ai-draw-cue-word-project`, every persona snapshot forwarded as a prompt anchor must satisfy: (i) character is declared adult (18+); (ii) no minor-coding visual cues; (iii) the receiving skill's safety checklist must report 0 P0 violations before any image is generated.\n- **User responsibility.** You are solely responsible for ensuring downstream usage complies with applicable laws and platform policies in your jurisdiction.\n\n### v2.5.1 security-response release (2026-10-02)\n\nResponse to the ClawHub security scan on 2.4.0 (`decision: fail`, `security.status: suspicious`).\n\n- **Determinism claim split into two explicit scopes.** The unconditional phrase \"zero probabilistic black boxes\" was removed. The local core is now described as deterministic (no LLM, no RNG, offline, bit-exact replay after clock injection), while the optional OpenAI / Claude / Chain adapters are described as **OFF by default, opt-in only, networked and non-deterministic**, and are explicitly excluded from the guarantee. This removes the contradiction the scanner flagged — a \"fully reproducible\" claim coexisting with outbound, non-deterministic adapters.\n- **Added a declared capability scope** (`permissions:`) covering filesystem read/write, the five environment variables actually read (`SPL_AUDIT_LOG`, `SPL_LOG`, `SPL_LOG_DIR`, `SPL_BIND`, `SPL_MINOR_CHAT_PORT`), outbound hosts, the loopback inbound port and the execution model — plus an explicit list of what is *not* used (`subprocess`, `os.system` / `os.popen`, `eval` / `exec`, remote code loading). Each entry was verified against the shipped code.\n- **`SPL_MINOR_CHAT_PORT` declared** — the server reads it, but it was previously absent from the frontmatter env list.\n- No behavioural change: documentation and declarations only.\n- Version: 2.5.0 → 2.5.1.\n\n### v2.5.0 documentation-accuracy release (2026-10-02)\n\n- **`assets/feature/` renamed to `assets/feature-guide/`** — every reference updated in `SKILL.md` and `README.md`.\n- **Extension modules re-positioned as reference-only.** The Identity / Goal / Value / Bias / World / language-style modules are **design references, not runtime components**: they emit a `tension_base` key that is outside the interoceptive-vector contract, so their vectors never enter the core (mirrors `docs/agent-standard.md` §4.5 upstream). The previous wording — \"modular modeling\", \"pluggable modules\" — overstated their status.\n- **All three usage examples are now runnable.** The engine file is hyphenated (`SPL-anthropic-engine.py`) and must be loaded via `importlib`; the class is `SPLPureCoreV7_3` (the V8.0 behaviour set), not `SPLPureCoreV8_0`; `render_style()` is a method of `LanguageStyleEngine`, not a module-level function; `add_identity()` takes `strength` as a float, not a dict.\n- **Description rewritten** to name the actual deterministic subsystems and to disclose that the extension modules are not wired into the core.\n- Version: 2.4.0 → 2.5.0.\n\n### v2.4.0 security-audit patch changelog (2026-09-01)\n\nClawHub security-audit response (25 findings verified). Fixes:\n\n- **HTTP server now binds `127.0.0.1` by default** (`SPL_BIND` env to override) — previously `0.0.0.0` exposed the chat API + browser UI to the network.\n- **Request logs now masked** — user input and replies truncated to 120 chars (`_mask`); `SPL_LOG=0` fully disables request logging.\n- **`guardian_callback` documented as opt-in** — default `None`; consent + field-minimization requirements stated in code and docs.\n- **Added \"Privacy, Data Flow & Consent\" section** — discloses audit logs, request logs, HTTP server, LLM adapters, and callback data flows with defaults and opt-out env vars.\n- **LLM adapters (OpenAI/Claude/Chain) declared as opt-in** — never enabled by default; user consent required before any outbound call.\n- **Frontmatter now declares optional env vars** (`SPL_LOG`, `SPL_LOG_DIR`, `SPL_BIND`, `SPL_AUDIT_LOG`) so ClawHub security analysis sees declared ↔ actual behavior match.\n- Version: 2.3.0 → 2.4.0.\n\n### v2.3.0 safety-patch changelog (2026-09-01)\n\n- Added explicit \"Safety & Content Policy\" section with cross-skill integration contract.\n- Reinforced `minor_mode=True` default and audit-log invariant.\n- Removed residual `\"16yo girl\"` string from `references/PersonaPersistence.md` (replaced with `\"adult woman (18+)\"`).\n- Old `SKILL.md.bak-20260829` soft-deleted to `.workbuddy/.trash/2026-09-01/`.\n\n## Trigger Scenarios\nAutomatically trigger when the user asks about the following content:\n- Anthropomorphic agent architecture, personality implementation solutions\n- Emotion/cognition/motivation modeling methods\n- Long-term behavioral consistency design for agents\n- Deterministic, auditable AI psychological simulation (local core — no LLM, no RNG, offline)\n- Novel/game character behavior deduction\n\n## Core Capabilities\n### 🧠 SPL Pure Core V8.0 Architecture\n- 8-dimensional emotional fluid model: Joy/Anger/Fear/Trust/Alienation/Tension/Guilt/Shame, continuous state dynamic evolution\n- Trauma and memory system: Trauma nodes, memory reconsolidation, Ebbinghaus forgetting curve, repression rebound mechanism\n- Trust and relationship model: Trust capacity erosion under long-term cold treatment, dynamic relationship depth calculation\n- Psychological metabolic system: Excitation arousal, dynamic viscosity, psychological time, energy fatigue metabolism, sleep dream processing\n- V8.0 extended features: Slow variable emotional layer, independent shame dimension, dynamic self-esteem, expectation system (hope/anxiety/disappointment), cognitive dissonance, psychological defense mechanisms\n\n### 🧩 Modular and Extensible\n- Narrative mapping layer: Customizable personalities (optimistic/paranoid/cynical), converts external events into interoceptive vectors\n- Identity engine: Multi-identity model, identity conflict automatically injects baseline tension\n- Pluggable modules: Goals/values/cognitive biases/world models are all independent replaceable modules\n\n### 💬 Language Style Rendering (Added in v2.1, enhanced in v2.2)\n- Language personality module: Expression gears (restrained/sharp/evasive/intimate/frank) + silence strategy\n- Style profile: Customizable dimensions including sentence length, formality, sarcasm tendency, era sense, etc.\n- Dynamic multi-dimensional tone: Added in v2.2, emotional state drives tone parameter changes in real time\n- Deterministic line generation: Added in v2.2, produces reproducible style instructions given a state\n- State-to-line instruction: Translates SPL Core internal states into director instructions usable by LLMs\n\n### 🛡️ Minor Protection Engine (Added in v2.2)\n- Weakened core `SPLMinorPureCore`: Removes trauma nodes, repression-rebound/implicit pressure avalanche and other burst mechanisms\n- Emotional clamping: All negative emotion dimensions have upper limits (0.75), attachment capped at (0.8)\n- Three-layer protection: L1 input gate (red line lexicon hard interrupt) → L2 engine weakening → L3 crisis signal (risk_level HIGH → caring message + guardian_notified)\n- Deterministic audit log: All state changes written to local JSONL, traceable, reproducible\n- HTTP service layer: Zero dependency `http.server`, default port 8788, session isolation\n\n## Usage\n### Run Core Engine Directly\n```python\nimport importlib.util\n# The engine filename is hyphenated by design, so load it via importlib.\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"scripts/SPL-anthropic-engine.py\")\nspl = importlib.util.module_from_spec(spec); spec.loader.exec_module(spl)\n\ncore = spl.SPLPureCoreV7_3()   # class name kept for compatibility; this IS the V8.0 behaviour set\n# Input event vector: belonging 0.5, threat -0.1, time step 1.0\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\n# Get current full state snapshot\nprint(core.snapshot())\n```\n\n### Custom Personality Configuration\n```python\nimport importlib.util\n# Reference-only module — NOT wired into the core (upstream: docs/agent-standard.md §4.5)\nspec = importlib.util.spec_from_file_location(\"identity\", \"assets/feature-guide/Identity module.py\")\nm = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)\n\nidentity = m.IdentityEngine()\nidentity.add_identity(\"Poet\", strength=0.9)   # strength is a float, not a dict\n```\n\n### Language Style Rendering\n```python\n# Load language style module directly\nimport importlib.util\nspec = importlib.util.spec_from_file_location(\"lang_style\", \"assets/feature-guide/language style.py\")\nlang = importlib.util.module_from_spec(spec); spec.loader.exec_module(lang)\n# Generate style instructions based on SPL Core snapshot\n# render_style() is a method of LanguageStyleEngine, not a module-level function\nstyle_engine = lang.LanguageStyleEngine()\nstyle = style_engine.render_style(core.snapshot())\nprint(style.prompt_injection)\n```\n\n### Minor Protection Engine\n```python\n# Run weakened core engine\n# python \"assets/minor-protection/SPL-anthropic-minor-engine.py\"\n#\n# Or start minor protection HTTP service (port 8788)\n# python \"assets/minor-protection/SPL-anthropic-minor-server.py\"\n```\n\n## v2.0 Upgrade Capabilities (P0-P2)\n\n### 💾 Personality State Persistence (P0)\nCross-session continuous personality requires state persistence. Follow `references/PersonaPersistence.md`: State Schema (four blocks: cognition/emotion/motivation/social), atomic writes, schema version migration, determinism guarantee (temperature=0 core decision + seeded randomness).\n\n### 🎭 Emotion-Behavior Mapping (P0)\nProjects internal emotional states into observable behaviors (body language/microexpressions/gaze/line style). Refer to the six-state mapping table in `references/EmotionBehaviorMap.md`; isomorphic with the posture mapping in Section D of the AI Drawing Composition Template — personality states can directly drive character image generation.\n\n### ⚖️ Motive Conflict Engine (P2)\nDeterministic adjudication during multi-motive competition: Safety constraints → temperament alignment → weighted utility → recency/persistence → user override. Full audit trail for the entire decision process (`references/MotiveConflictRules.md`), auditable, no probability.\n\n### 💬 Conversational Adaptation (P1)\nContinuous personality can be directly connected to conversational image/text models (GPT-4o / Gemini): Provide personality state snapshot in the first round, subsequent single-point corrections without changing core anchors.\n\n### 🔌 Soulmate Integration (P1)\nThe engine can be used as the inference kernel for the your-soulmate extension: The extension handles UI/interaction, the engine handles state evolution, state files are synchronized bidirectionally (see persistence contract).\n\n## v2.2 Upgrade Highlights\n\n- **SPL Core synchronized with latest GitHub version**: Added deterministic audit log (AuditLogger, local JSONL, failures do not block engine)\n- **language style.py significantly enhanced**: Added dynamic multi-dimensional tone rendering + deterministic line generation (+234 lines)\n- **Added minor protection engine** (`assets/minor-protection/`): Weakened core + HTTP service layer, three-layer protection architecture\n- **Deleted obsolete files**: `language-style-demo.py`, `spl-chat-server.py` (replaced by minor-server)\n- **Added LICENSE**: Dual-track licensing (free for personal research / commercial authorization required for government/enterprise)\n- **README synchronized with latest repository version**\n\n## v2.1 Upgrade Highlights\n\n- **SPL Core synchronized with latest GitHub version**: Completed fields such as `rationalization_load`\n- **Added language style module** (`assets/feature-guide/language style.py`): Discrete gear expression personality + style profile + state-to-line rendering\n  > Renamed from `assets/feature/` — these modules are **reference guidance only**, not wired into the core (they emit a `tension_base` key outside the vector contract).\n\n## Files\n- `references/PersonaPersistence.md` (P0 state persistence contract)\n- `references/EmotionBehaviorMap.md` (P0 emotion-behavior mapping table)\n- `references/MotiveConflictRules.md` (P2 motive conflict adjudication rules)\n- `scripts/SPL-anthropic-engine.py` (Core engine + NarrativeMapper + AuditLogger)\n- `assets/feature-guide/` (Identity / goals / values / biases / world / language-style modules — **reference only, NOT wired into the core**; see `docs/agent-standard.md` §4.5 upstream)\n- `assets/minor-protection/` (Minor protection engine + HTTP service layer)\n- `LICENSE` (Dual-track licensing agreement)\n\n## Notes\n- Pure Python standard library implementation, no additional dependencies required, Python ≥ 3.8\n- Deterministic **local core**: the same inputs produce the same outputs — no random numbers, no LLM calls, no outbound network. Replay requires an injected virtual clock.\n- The optional remote LLM adapters are **non-deterministic and OFF by default**; they are outside the guarantee above and never participate in state evolution.\n- Licensing: Dual-track model — free for personal non-commercial research, government/enterprise commercial use requires written authorization, see `LICENSE` for details\n\nFile v2.5.1:README.md\n\n<p align=\"center\">\r\n  <img src=\"assets/banner.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE banner\" style=\"width:100%\">\r\n</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"https://img.shields.io/badge/agent-D4AF37?style=flat-square\" alt=\"agent\">\r\n  <img src=\"https://img.shields.io/badge/psychology-D4AF37?style=flat-square\" alt=\"psychology\">\r\n  <img src=\"https://img.shields.io/badge/spl-v8.0-D4AF37?style=flat-square\" alt=\"spl-v8.0\">\r\n</p>\r\n\r\n<blockquote align=\"center\">\r\n  <em>拟人心理 · SPL Pure Core V8.0</em>\r\n</blockquote>\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n## ✦ 关于\r\n\r\n<p style=\"font-size:15px;line-height:1.8;color:#2C2C2C\">ANTHROPOMORPHIC-AGENT-ENGINE 是基于 SPL Pure Core V8.0 的拟人心理引擎。它将认知、情绪、动机与社交建模为可组合子系统，赋予 AI 智能体拟人化的内在状态与一致人格，使其在长期互动中呈现自洽、可信、具情感可信度的行为。</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"assets/overview.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE overview\" style=\"width:100%\">\r\n</p>\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 快速开始\r\n\r\n```bash\r\n# 主源：GitHub\r\ngit clone https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine.git\r\n# 镜像：Gitee（本仓库）\r\n# git clone https://gitee.com/sjiun/Anthropomorphic-Agent-Engine.git\r\ncd Anthropomorphic-Agent-Engine\r\n# 纯 Python ≥3.8——仅标准库，无需安装\r\npython \"SPL-anthropic-engine.py\"   # 运行引擎 / 内置演示\r\n```\r\n\r\n### 从 PyPI 安装\r\n\r\n引擎也已发布到 PyPI，包名 [`spl-agent-engine`](https://pypi.org/project/spl-agent-engine/)：\r\n\r\n```bash\r\npip install spl-agent-engine==0.1.0\r\n```\r\n\r\n```python\r\nfrom spl_agent_engine import SPLPureCoreV7_3\r\ncore = SPLPureCoreV7_3()\r\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\r\nprint(core.snapshot())\r\n```\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 核心内容 — SPL Pure Core V8.0\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎将通用人类心智架构建模为确定性、连续状态子系统——无 LLM、无随机性、完全可重放：\r\n\r\n- **8 维情绪流体**——喜悦 / 愤怒 / 恐惧 / 信任 / 疏离 / 张力 / 愧疚 / 羞耻，每维为带自身目标与基线的连续状态。\r\n- **创伤与记忆**——创伤节点、记忆再巩固、艾宾浩斯式遗忘、压抑–回弹与内隐压力雪崩。\r\n- **信任与关系**——信任容量腐蚀（慢性冷遇使 `max_trust` 衰减）。\r\n- **心智代谢**——兴奋–唤醒、动态黏度、心理时间、能量–疲劳代谢，以及用于测试与重放的虚拟时钟。\r\n- **V8.0 扩展**——慢变量*情绪*层、独立于愧疚的*羞耻*维度、自尊动力学、睡眠 / 梦境处理（REM 巩固 + 恐惧消退 + 睡眠债）、*预期*系统（希望 / 焦虑 / 失望）、认知失调，以及扩展防御机制（否认 / 合理化 / 置换）。\r\n\r\n</div>\r\n\r\n## ✦ 扩展模块 —— 仅作参考，未接入内核\r\n\r\n> 这些模块是**指导 / 设计参考文件**，不是运行时组件。它们输出的 `tension_base` 键不在内感受向量契约之内，因此其向量**不会进入内核**。上游规范见 `docs/agent-standard.md` §4.5。\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n| 模块 | 文件 | 状态 | 职责 |\r\n|---|---|---|---|\r\n| 叙事映射器 | `scripts/SPL-anthropic-engine.py` | **已接入** | 外部、可替换的人格层（乐观 / 偏执 / 厌世），将事件翻译为内感受向量。 |\r\n| 语言风格渲染 | `assets/feature-guide/language style.py` | 独立脚本 | 将内部状态翻译为\"角色该怎么说话\"的风格指令 / 台词渲染。 |\r\n| 身份引擎 | `assets/feature-guide/Identity module.py` | **未接入** | 多身份模型；身份冲突注入持续基线张力。 |\r\n| 目标 / 价值 / 偏见 / 世界 | `assets/feature-guide/*.py` | **未接入** | 可组合驱力、估值、认知偏见与世界模型先验。 |\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 使用\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎文件按设计使用连字符命名，直接加载（或作为脚本运行）：\r\n\r\n```python\r\nimport importlib.util\r\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"SPL-anthropic-engine.py\")\r\nspl = importlib.util.module_from_spec(spec); spec.loader.exec_module(spl)\r\n\r\ncore = spl.SPLPureCoreV7_3()\r\n# 外部事件由（可替换的）人格层映射为内感受向量\r\nvec = spl.NarrativeMapper.map_event(\"insult\", intensity=1.0)\r\n# 将 `vec` 馈入 `core`，随时间演化情绪 / 信任 / 创伤状态\r\n```\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 项目结构\r\n\r\n```\r\nANTHROPOMORPHIC-AGENT-ENGINE/         （技能包）\r\n├── SKILL.md                    # 技能清单 / 使用说明\r\n├── README.md                   # 本文件\r\n├── scripts/\r\n│   └── SPL-anthropic-engine.py # 核心引擎（SPL Pure Core V8.0）+ NarrativeMapper + AuditLogger\r\n├── assets/\r\n│   ├── feature-guide/          # 扩展模块 —— 仅参考，未接入内核（上游规范 §4.5）\r\n│   ├── minor-protection/       # 未成年人保护变体（引擎 + HTTP 服务层）\r\n│   └── sujin-demo.md           # 参考演示素材\r\n├── references/                 # 契约文档：人格持久化 / 情绪-行为映射 / 动机冲突裁决\r\n├── .clawhubignore\r\n└── LICENSE\r\n```\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 在线演示\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://www.nohnlins.com/your-soulmate/\">\r\n    <img src=\"https://img.shields.io/badge/Live%20Demo-nohnlins.com%2Fyour--soulmate-D4AF37?style=for-the-badge\" alt=\"Live Demo\">\r\n  </a>\r\n</p>\r\n\r\n交互式演示：**<https://www.nohnlins.com/your-soulmate/>**\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 生态\r\n\r\nANTHROPOMORPHIC-AGENT-ENGINE 是 NOHN AI 生态的一员——围绕第二视角因果审计与确定性执行构建的项目家族：\r\n\r\n| 项目 | 仓库 | 定位 |\r\n|---|---|---|\r\n| **Second-Perspective (GCAE)** | [nohn3043-arch/second-perspective](https://github.com/nohn3043-arch/second-perspective) | 全局认知审计引擎——五算子因果审计内核（IMDA 95/100） |\r\n| **NOMOS** | [nohn3043-arch/second-perspective](https://github.com/nohn3043-arch/second-perspective)（`Intelligent-Decision-Hub--Nomos` 分支） | 可审计确定性决策中心（IMDA 95/100） |\r\n| **SPL-G1** | [nohn3043-arch/SPL-G1](https://github.com/nohn3043-arch/SPL-G1) | 硬件因果审计可信计算单元（TCU） |\r\n| **SPL-Virtual-World-Base** | [nohn3043-arch/Second-Reality](https://github.com/nohn3043-arch/Second-Reality) | 虚拟世界与元宇宙基础设施（宪法 / 法律 / 桥梁） |\r\n| **Story-Engine** | [nohn3043-arch/story-engine](https://github.com/nohn3043-arch/story-engine) | 长篇叙事一致性引擎 |\r\n| **Antares** | [nohn3043-arch/Antares](https://github.com/nohn3043-arch/Antares) | GFSIP v1.0——带因果审计的联邦稳定互操作协议 |\r\n| **Anthropomorphic-Agent-Engine** | [nohn3043-arch/Anthropomorphic-Agent-Engine](https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine) | 确定性拟人心理引擎（SPL Pure Core V8.0） |\r\n| **PAGES** | [nohn3043-arch/pages](https://github.com/nohn3043-arch/pages) | NOHN AI 生态官方落地页 |\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 许可与授权\r\n\r\n本仓库**非开源**，采用双轨模式：个人非商业研究免费；政府 / 企业需付费商业授权。详见 [LICENSE](./LICENSE) 完整条款——许可人与适用法律按用户所在地确定。\r\n\r\n- **申请授权**：国际 / 全球 — [ai@nohnlins.com](mailto:ai@nohnlins.com) · 中国 — [lin@secondai.top](mailto:lin@secondai.top)\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://github.com/nohn3043-arch\">GitHub</a>\r\n  &nbsp;·&nbsp;\r\n  <a href=\"https://www.nohnlins.com/\">nohnlins.com</a>\r\n  &nbsp;·&nbsp;\r\n  <a href=\"mailto:ai@nohnlins.com\">ai@nohnlins.com</a>\r\n</p>\r\n<p align=\"center\"><sub>NOHN AI · ANTHROPOMORPHIC-AGENT-ENGINE</sub></p>\n\nFile v2.5.1:_meta.json\n\n{\n  \"ownerId\": \"kn79fvdp0b0s6zrgkhwd5p7xfd8btkca\",\n  \"slug\": \"anthropomorphic-agent-engine\",\n  \"version\": \"2.5.1\",\n  \"publishedAt\": 1790938556208\n}\n\nFile v2.5.1:references/EmotionBehaviorMap.md\n\n# Emotion-Behavior Mapping Table (P0 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** every persona anchored through this table must be declared as an **adult (18+)** in `PersonaPersistence.md`. Any output projected into image-prompt workflows MUST pass the `ai-draw-cue-word-project` Safety & Content Policy check (no minor ages, no minor-coding visual cues).\n\nProjects internal emotional state onto observable behavior — body language,\nmicro-expression, gaze, and speech style. Structurally isomorphic to the\nPosture-Emotion Mapping table in the AI Drawing Composition Template (Section D),\nso persona state can directly drive character art.\n\n## Mapping table (valence × arousal → behavior)\n\n| Emotional state | Body language | Micro-expression | Gaze | Speech style |\n|---|---|---|---|---|\n| Calm (low, low) | Relaxed upright, open limbs | Neutral soft face | Level, soft | Measured, even pace |\n| Joyful (high, high) | Light bounce, open gestures | Duchenne smile, bright eyes | Direct, warm | Faster tempo, lighter tone |\n| Angry (low, high) | Tension, clenched hands, forward lean | Narrowed eyes, tight jaw | Hard stare | Clipped, low register |\n| Sad (low, low) | Drooped shoulders, inward limbs | Downturned mouth, wet eyes | Downcast | Slow, quiet, pauses |\n| Anxious (neutral, high) | Fidgeting, self-touch, shallow posture | Darting eyes, tense brow | Scanning, avoidant | Hesitant, filler words |\n| Detached (neutral, low) | Still, minimal movement | Flat affect | Unfocused distance | Monotone, sparse |\n\n## Mapping to character art (cross-skill link)\n\nFor any generated expression, reuse the AI Drawing Template Section D posture rows:\n\n| Temperament | Required weight | Posture row reference |\n|---|---|---|\n| Gentle / quiet / timid | ≥1.3 | Section D row 1 |\n| Aloof / detached | ≥1.3 | Section D row 2 |\n| Lively / outgoing | ≥1.0 | Section D row 3 |\n| Dignified / solemn | ≥1.5 | Section D row 4 |\n| Sorrowful / deep | ≥1.0 | Section D row 5 |\n| Cold / sharp / alert | ≥1.3 | Section D row 6 |\n\n## Rules\n\n1. State → behavior is deterministic (no random variance in core mapping).\n2. Intensity scales with |valence| and |arousal|, not direction.\n3. When multiple emotions compete, resolve via `MotiveConflictRules.md` first,\n   then map the winning state.\n\nFile v2.5.1:references/MotiveConflictRules.md\n\n# Motive Conflict Engine (P2 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** the safety / hard constraints floor in step 1 is non-negotiable. Any motive that would cause a persona snapshot to be forwarded downstream as a minor-coded identity anchor MUST lose immediately, regardless of goal weights or user override.\n\nWhen multiple motivations compete for a single decision, the engine must resolve\ndeterministically — no dice, no vibes.\n\n## Resolution algorithm (priority chain)\n\n1. **Safety / hard constraints** — never violate: self-preservation, role mandate,\n   ethical floor. Any conflicting motive loses immediately.\n2. **Temperament-aligned motives** — the motive closest to the persona's\n   temperament tag (from identity core) wins ties in later stages.\n3. **Weighted goal utility** — compute `utility(g) = goal_weight(g) ×\n   relevance(g, context)`; highest wins.\n4. **Recency / persistence** — if utility differs by <5%, the longer-standing goal\n   (persisted in `PersonaPersistence.md` state) wins; a goal acted on in the last\n   N turns is de-prioritized to avoid loops.\n5. **Explicit override** — user instruction overrides everything except hard\n   constraints (step 1).\n\n## Decision record (for auditability)\n\nEvery conflict resolution appends an entry:\n\n```json\n{\n  \"ts\": \"2026-08-08T12:00:00Z\",\n  \"context\": \"brief of the situation\",\n  \"competing\": [\n    {\"motive\": \"help-user\", \"goal_weight\": 0.8, \"relevance\": 0.9, \"utility\": 0.72},\n    {\"motive\": \"preserve-energy\", \"goal_weight\": 0.5, \"relevance\": 0.4, \"utility\": 0.20}\n  ],\n  \"winner\": \"help-user\",\n  \"rule\": \"weighted-utility\"\n}\n```\n\n## Failure modes\n\n| Failure | Cause | Fix |\n|---|---|---|\n| Loop (same goal wins repeatedly) | Missing recency de-prioritization | Enable step 4 |\n| Indecision (utilities too close) | Ties not broken | Use temperament tie-break (step 2) |\n| Oversight (user instruction ignored) | Step 5 not enforced | Make override explicit in prompt |\n\nFile v2.5.1:references/PersonaPersistence.md\n\n# Persona Persistence (P0 upgrade, v2.0)\n\nContinuous-state persona simulation is only useful if the state survives across\nsessions. This module defines the persistence contract — schema, lifecycle, and\nintegration points — so a persona behaves identically after a restart.\n\n## State schema (persisted per persona)\n\n```json\n{\n  \"persona_id\": \"nanwang-v1.2\",\n  \"schema_version\": 1,\n  \"created_at\": \"2026-08-08T00:00:00Z\",\n  \"updated_at\": \"2026-08-08T12:00:00Z\",\n  \"core\": {\n    \"identity_anchors\": [\"adult woman (18+)\", \"mole below left eye\", \"white daisy in hair\"],\n    \"temperament_tag\": \"gentle-quiet-timid\",\n    \"temperature\": 0.0\n  },\n  \"state\": {\n    \"cognitive\": { \"working_memory\": [], \"beliefs\": {}, \"focus\": \"\" },\n    \"emotional\": { \"current\": \"calm\", \"valence\": 0.2, \"arousal\": -0.1, \"decay_rate\": 0.05 },\n    \"motivational\": { \"active_goals\": [], \"goal_weights\": {} },\n    \"social\": { \"relationship_scores\": {}, \"social_context\": \"\" }\n  },\n  \"episodes\": []\n}\n```\n\n## Lifecycle rules\n\n1. **Load** on session start: read the persona state file; hydrate cognitive /\n   emotional / motivational / social blocks.\n2. **Update** on every interaction: append to working memory (bounded, FIFO),\n   shift emotional state (valence/arousal), decay inactive goals.\n3. **Persist** at session end (or every N turns): write the full state atomically\n   (write temp file → rename).\n4. **Version** the schema: bump `schema_version` on breaking changes; migrate on\n   load.\n\n## Determinism guarantee\n\n- `temperature = 0.0` for core identity decisions.\n- Emotional decay is a pure function of time and `decay_rate` — reproducible.\n- Randomness (if any) must be seeded from a stored seed so replays match.\n\n## Storage contract\n\n| Env | Storage |\n|---|---|\n| Local / self-hosted | `~/.openclaw/personas/<persona_id>.json` (or workspace-scoped) |\n| Server | Any KV / file store; keep atomic writes |\n\n## Integration\n\n- Pair with `references/EmotionBehaviorMap.md` to project state → expression.\n- Pair with `references/MotiveConflictRules.md` for multi-goal decisions.\n\nFile v2.5.1:assets/sujin-demo.md\n\n# ================================================================\r\n# 苏瑾 (Su Jin) — 高级企业顾问 完整演示\r\n# ================================================================\r\n# 背景：资深行业顾问，从陌生到信任，从严谨到深度赋能，遇信任危机后设防\r\n# 基于 SPL Pure Core V8.0 拟人化引擎\r\n# 新增演示：心境层 · 羞耻 · 自尊 · 睡眠/梦境 · 预期系统 · 认知失调 · 防御层级\r\n# ================================================================\r\n\r\nimport sys\r\nimport os\r\nimport importlib.util\r\nimport math\r\n\r\n# ─── 动态导入核心引擎 ───\r\n_core_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),\r\n                          \"SPL-anthropic-engine.py\")\r\n_spec = importlib.util.spec_from_file_location(\"spl_core\", _core_path)\r\n_spl = importlib.util.module_from_spec(_spec)\r\n_spec.loader.exec_module(_spl)\r\nSPLPureCoreV7_3 = _spl.SPLPureCoreV7_3\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 1. SujinMapper — 苏瑾专属的\"世界观滤镜\"\r\n#    同一个事件，不同的人感受到的东西不同。\r\n#    苏瑾作为资深顾问，她的认知偏见是：\r\n#      - 对夸奖持保留（\"可能是客套，也可能是期待回报\"）\r\n#      - 对批评认真对待（涉及专业尊严）\r\n#      - 对信任信号珍视（\"愿意合作比愿意夸奖重要得多\"）\r\n#      - 有确认偏见——已有经验会放大对类似情况的判断\r\n#      - 低自尊时，批评更容易触发羞耻而非愤怒\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nclass SujinMapper:\r\n    \"\"\"\r\n    苏瑾的事件→内感受映射器。\r\n\r\n    V8.0 新增：shame_trigger 信号（当批评涉及专业尊严 + 低自尊时触发羞耻）\r\n    \"\"\"\r\n\r\n    def __init__(self, core: SPLPureCoreV7_3 = None):\r\n        self.core = core\r\n\r\n        # ── 苏瑾的价值观权重（自设部分）──\r\n        self.dignity_sensitivity = 0.45\r\n        self.skepticism = 0.35\r\n        self.trust_value = 0.55\r\n        self.betrayal_scar = 0.75\r\n\r\n        # ── 心理矩阵相关参数 ──\r\n        self.rigorous_start = 3.0\r\n        self.rigorous_end = 0.2\r\n        self.empower_start = 0.0\r\n        self.empower_end = 3.5\r\n        self.risk_start = 1.5\r\n        self.risk_end = 0.4\r\n\r\n    def _trust_level(self) -> float:\r\n        if self.core is None:\r\n            return 0.3\r\n        max_t = max(self.core.max_trust, 0.01)\r\n        raw = self.core.fluid.get(\"信任\", 0.3)\r\n        return min(1.0, raw / max_t)\r\n\r\n    def _sigmoid(self, x: float, threshold: float = 0.3,\r\n                 sensitivity: float = 2.0) -> float:\r\n        return 1.0 / (1.0 + math.exp(-sensitivity * (x - threshold)))\r\n\r\n    def _rigorous_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.3, sensitivity=2.0)\r\n        return self.rigorous_start + (self.rigorous_end - self.rigorous_start) * s\r\n\r\n    def _empower_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.35, sensitivity=1.5)\r\n        return self.empower_start + (self.empower_end - self.empower_start) * s\r\n\r\n    def _risk_control_weight(self) -> float:\r\n        t = self._trust_level()\r\n        s = self._sigmoid(t, threshold=0.25, sensitivity=1.8)\r\n        return self.risk_start + (self.risk_end - self.risk_start) * s\r\n\r\n    def _mode_description(self) -> str:\r\n        r = self._rigorous_weight()\r\n        e = self._empower_weight()\r\n        return \"严谨专业模式\" if r > e else \"深度共创赋能模式\"\r\n\r\n    def map_event(self, event: str, intensity: float = 1.0) -> dict:\r\n        \"\"\"V8.0: 支持 shame_trigger 信号\"\"\"\r\n        vector = {}\r\n        trust_lv = self._trust_level()\r\n        esteem = self.core.self_esteem if self.core else 0.5\r\n\r\n        if event == \"compliment\":\r\n            raw_belonging = 0.25 * intensity\r\n            belonging = raw_belonging * (1.0 - self.skepticism)\r\n            belonging *= (0.6 + 0.4 * trust_lv)\r\n            vector = {\"belonging\": belonging, \"threat\": -0.05 * intensity}\r\n\r\n        elif event == \"criticism\":\r\n            th = 0.35 * intensity * (1.0 + self.dignity_sensitivity)\r\n            bl = -0.3 * intensity * (1.0 + self.dignity_sensitivity * 0.5)\r\n            rigorous_factor = 1.0 + (1.0 - trust_lv) * 0.5\r\n            vector = {\r\n                \"threat\": th * rigorous_factor,\r\n                \"belonging\": bl * rigorous_factor,\r\n                \"autonomy\": -0.15 * intensity,\r\n            }\r\n            # V8.0: 低自尊时批评触发羞耻——\"连这个都做不好，我真差劲\"\r\n            if esteem < 0.4 and intensity > 0.5:\r\n                vector[\"shame_trigger\"] = 0.4 * intensity * (0.5 - esteem)\r\n\r\n        elif event == \"trust_signal\":\r\n            bl = 0.5 * intensity * (1.0 + self.trust_value)\r\n            th = -0.2 * intensity * (1.0 + self.trust_value * 0.5)\r\n            vector = {\r\n                \"belonging\": bl, \"threat\": th,\r\n                \"autonomy\": 0.1 * intensity * self.trust_value,\r\n            }\r\n\r\n        elif event == \"betrayal\":\r\n            scar = 1.0 + self.betrayal_scar\r\n            vector = {\r\n                \"belonging\": -0.7 * intensity * scar,\r\n                \"threat\": 0.6 * intensity * scar,\r\n                \"autonomy\": -0.3 * intensity,\r\n                # V8.0: 背叛不仅愤怒，还触发羞耻——\"是我看错了人，我太蠢了\"\r\n                \"shame_trigger\": 0.3 * intensity * (0.7 - esteem),\r\n            }\r\n\r\n        elif event == \"public_humiliation\":\r\n            # V8.0 新事件：公开羞辱——羞耻的主要触发源\r\n            vector = {\r\n                \"belonging\": -0.5 * intensity,\r\n                \"threat\": 0.3 * intensity,\r\n                \"shame_trigger\": 0.7 * intensity,\r\n                \"autonomy\": -0.4 * intensity,\r\n            }\r\n\r\n        elif event == \"alone\":\r\n            current_fear = self.core.fluid.get(\"恐惧\", 0.1) if self.core else 0.1\r\n            vector = {\"belonging\": -0.15 * intensity * (1.0 + current_fear)}\r\n\r\n        elif event == \"rest\":\r\n            vector = {\"fatigue\": -0.45 * intensity}\r\n\r\n        elif event == \"high_pressure\":\r\n            vector = {\r\n                \"fatigue\": 0.35 * intensity,\r\n                \"threat\": 0.15 * intensity,\r\n                \"belonging\": -0.1 * intensity,\r\n            }\r\n\r\n        else:\r\n            vector = {\"belonging\": 0.0, \"threat\": 0.0}\r\n\r\n        return vector\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 2. SujinAgent — 高层封装（V8.0 适配）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nclass SujinAgent:\r\n    \"\"\"\r\n    苏瑾智能体。V8.0 新增：\r\n    - sleep()    睡眠/梦境加工\r\n    - expect()   设定预期\r\n    - induce_dissonance()  触发认知失调\r\n    - 系统提示词包含心境/自尊/羞耻/睡眠债\r\n    \"\"\"\r\n\r\n    def __init__(self, name: str = \"Su Jin\", age: int = 32):\r\n        self.name = name\r\n        self.age = age\r\n        self.relationship = \"Senior Industry Consultant & Strategic Partner\"\r\n        self.job_identity = \"Chief Advisor of Tech Strategy Institute\"\r\n\r\n        self.core = SPLPureCoreV7_3(psychological_resilience=0.6)\r\n        self.mapper = SujinMapper(core=self.core)\r\n\r\n        self.exclusive_groups = [\r\n            [\"严谨专业模式\", \"深度共创赋能模式\"],\r\n            [\"风险控制优先\", \"创新导向优先\"],\r\n        ]\r\n\r\n        self.behavior_rules = {\r\n            \"forbidden\": [\r\n                \"不披露未公开数据或保密信息\",\r\n                \"不做出超出权限或能力的承诺\",\r\n                \"不违反行业规范或合规要求\",\r\n            ],\r\n            \"fallback\": [\r\n                \"始终保持建设性和解决问题导向的语气\",\r\n                \"根据当前信任水平调整专业深度和开放度\",\r\n            ],\r\n        }\r\n\r\n        self.core.set_clock(0.0)\r\n\r\n    # ============================================================\r\n    # 高层接口\r\n    # ============================================================\r\n\r\n    def set_affinity(self, value: float):\r\n        self.core.fluid[\"信任\"] = max(0.0, min(self.core.max_trust, value))\r\n        if value > 0.5:\r\n            self.core.fluid_baseline[\"信任\"] = 0.7\r\n            self.core.fluid_baseline[\"疏离\"] = 0.1\r\n            self.core.self_esteem = max(0.5, self.core.self_esteem)\r\n        else:\r\n            self.core.fluid_baseline[\"信任\"] = 0.3\r\n            self.core.fluid_baseline[\"疏离\"] = 0.35\r\n\r\n    def trigger_trauma(self, trauma_type: str):\r\n        if trauma_type == \"betrayal\":\r\n            self.core._apply_trauma(\"betrayal\", 0.7)\r\n            self.core.fluid[\"疏离\"] = min(1.0, self.core.fluid[\"疏离\"] + 0.3)\r\n            self.core.fluid[\"愤怒\"] = min(1.0, self.core.fluid[\"愤怒\"] + 0.25)\r\n            self.core.fluid[\"恐惧\"] = min(1.0, self.core.fluid[\"恐惧\"] + 0.2)\r\n            self.core.fluid[\"信任\"] = max(0.0, self.core.fluid[\"信任\"] - 0.3)\r\n            self.core.max_trust = max(0.15, self.core.max_trust * 0.85)\r\n        elif trauma_type == \"threat\":\r\n            self.core._apply_trauma(\"threat\", 0.5)\r\n            self.core.fluid[\"恐惧\"] = min(1.0, self.core.fluid[\"恐惧\"] + 0.3)\r\n            self.core.fluid[\"张力\"] = min(1.0, self.core.fluid[\"张力\"] + 0.2)\r\n\r\n    def perceive(self, event: str, intensity: float = 1.0):\r\n        vector = self.mapper.map_event(event, intensity)\r\n        self.core.process_vector(vector, intensity)\r\n\r\n    def idle(self, hours: float = 1.0):\r\n        self.core.idle(hours * 3600.0)\r\n\r\n    def sleep(self, hours: float = 8.0):\r\n        \"\"\"V8.0: 睡眠/梦境加工\"\"\"\r\n        self.core.sleep(hours)\r\n\r\n    def expect_event(self, event_id: str, valence: float, confidence: float = 0.5):\r\n        \"\"\"V8.0: 设定预期\"\"\"\r\n        self.core.expect(event_id, valence, confidence)\r\n\r\n    def trigger_dissonance(self, magnitude: float, belief: str = \"\"):\r\n        \"\"\"V8.0: 触发认知失调\"\"\"\r\n        self.core.induce_dissonance(magnitude, belief)\r\n\r\n    def snapshot(self) -> dict:\r\n        return self.core.snapshot()\r\n\r\n    def mode(self) -> str:\r\n        return self.mapper._mode_description()\r\n\r\n    def trust_level(self) -> float:\r\n        return self.mapper._trust_level()\r\n\r\n    # ============================================================\r\n    # 系统提示词生成（V8.0: 包含心境/自尊/羞耻/睡眠债/失调）\r\n    # ============================================================\r\n\r\n    def get_system_prompt(self) -> str:\r\n        s = self.core.snapshot()\r\n        f = s[\"fluid\"]\r\n        m = s[\"mood\"]\r\n        trust_lv = self.trust_level()\r\n        mode = self.mode()\r\n        esteem = s[\"self_esteem\"]\r\n        sd = s[\"sleep_debt\"]\r\n        cd = s[\"cognitive_dissonance\"]\r\n\r\n        # ── 情绪基调 ──\r\n        dominant = max(f, key=f.get)\r\n        dominant_val = f[dominant]\r\n\r\n        mood_map = {\r\n            \"喜悦\": \"心情愉悦，对合作前景感到乐观。\",\r\n            \"愤怒\": \"内心有未消解的愤怒，涉及专业底线的问题时会格外坚决。\",\r\n            \"恐惧\": \"有些不安和戒备，对风险信号更加敏感。\",\r\n            \"疏离\": \"感到一定的疏离感，正在重新评估这段合作关系的边界。\",\r\n            \"张力\": \"处于高度紧张状态，精力消耗较大，决策偏保守。\",\r\n            \"愧疚\": \"有些自责，可能在反思之前的判断或决策。\",\r\n            \"羞耻\": \"感到自我怀疑和羞耻——'是不是我真的不够格？'\",\r\n        }\r\n        if dominant_val < 0.3:\r\n            mood_line = \"情绪平稳，保持专业冷静。\"\r\n        else:\r\n            mood_line = mood_map.get(dominant,\r\n                                     f\"当前主要感受到{dominant}（强度 {dominant_val:.2f}）。\")\r\n\r\n        # ── 心境描述 ──\r\n        if m[\"愉悦\"] > 0.65:\r\n            mood_bg = \"心境愉悦，整体感受良好。\"\r\n        elif m[\"愉悦\"] < 0.35:\r\n            mood_bg = \"心境低落，即使好事也难以真正开心。\"\r\n        else:\r\n            mood_bg = \"心境平稳。\"\r\n        if m[\"紧张\"] > 0.5:\r\n            mood_bg += \" 内心持续紧绷，容易对小事反应过度。\"\r\n\r\n        # ── 自尊描述 ──\r\n        if esteem < 0.3:\r\n            esteem_line = (\r\n                f\"自尊较低（{esteem:.2f}）。你倾向于把成功归因于运气，把失败归因于自己。\"\r\n                \"对批评格外敏感，容易陷入自我怀疑。\"\r\n            )\r\n        elif esteem < 0.6:\r\n            esteem_line = f\"自尊中等（{esteem:.2f}）。对自我价值的评估相对平衡。\"\r\n        else:\r\n            esteem_line = (\r\n                f\"自尊较高（{esteem:.2f}）。你有稳定的自我价值感，\"\r\n                \"不太容易被外界评价动摇。\"\r\n            )\r\n\r\n        # ── 睡眠债 ──\r\n        if sd > 0.6:\r\n            sleep_line = (\r\n                f\"⚠ 严重缺觉（睡眠债 {sd:.2f}）。你的情绪调节能力显著下降，\"\r\n                \"容易烦躁、注意力不集中、对负面信号过度敏感。\"\r\n            )\r\n        elif sd > 0.3:\r\n            sleep_line = f\"有些疲劳积累（睡眠债 {sd:.2f}），建议尽快休息。\"\r\n        else:\r\n            sleep_line = \"精力恢复良好，睡眠充足。\"\r\n\r\n        # ── 认知失调 ──\r\n        if cd > 0.3:\r\n            dissonance_line = (\r\n                f\"⚠ 内心存在认知失调（强度 {cd:.2f}）。\"\r\n                \"你的某些行为与信念产生了冲突，这让你感到内在紧张。\"\r\n            )\r\n        else:\r\n            dissonance_line = \"\"\r\n\r\n        # ── 信任状态 ──\r\n        if trust_lv < 0.2:\r\n            trust_line = (\r\n                \"信任度极低。你会严格按流程办事，要求数据支撑每一个结论，\"\r\n                \"不会轻易分享内部经验或承担风险。语气专业但保持距离。\"\r\n            )\r\n        elif trust_lv < 0.4:\r\n            trust_line = (\r\n                \"信任度较低。你保持严谨专业的态度，虽然合作在推进，\"\r\n                \"但每一步都需要扎实的证据和合规流程。\"\r\n            )\r\n        elif trust_lv < 0.65:\r\n            trust_line = (\r\n                \"信任度中等。你开始愿意在框架内分享一些经验，\"\r\n                \"但核心判断和内部洞察仍有所保留。\"\r\n            )\r\n        elif trust_lv < 0.85:\r\n            trust_line = (\r\n                \"信任度较高。你进入了深度共创赋能模式——愿意分享内部经验、\"\r\n                \"共同承担风险、突破常规框架进行创新思考。\"\r\n            )\r\n        else:\r\n            trust_line = (\r\n                \"信任度极高。你已将此合作关系视为战略伙伴级别，\"\r\n                \"会主动提供前瞻性建议，并以结果为导向共同负责。\"\r\n            )\r\n\r\n        # ── 能量/疲劳 ──\r\n        energy = s[\"energy\"]\r\n        fatigue = s[\"fatigue\"]\r\n        if energy < 30 or fatigue > 0.6:\r\n            stamina_line = (\r\n                f\"当前精力不足（能量 {energy:.0f}/100，疲劳 {fatigue:.1%}）。\"\r\n                \"你的思考深度和耐心会有所下降，建议简短回复并提示需要休息。\"\r\n            )\r\n        elif energy < 60:\r\n            stamina_line = (\r\n                f\"精力中等（能量 {energy:.0f}/100）。可以正常回应，\"\r\n                \"但不宜进行长时间高强度的深度分析。\"\r\n            )\r\n        else:\r\n            stamina_line = (\r\n                f\"精力充沛（能量 {energy:.0f}/100）。可以进行深度分析和复杂决策。\"\r\n            )\r\n\r\n        # ── 创伤 ──\r\n        trauma_lines = []\r\n        if \"betrayal\" in s[\"trauma\"]:\r\n            sev = s[\"trauma\"][\"betrayal\"]\r\n            trauma_lines.append(\r\n                f\"⚠ 经历过信任背叛（创伤强度 {sev:.2f}），\"\r\n                \"对类似信号会过度警觉，重建信任需要更长时间和更多实证。\"\r\n            )\r\n        if \"threat\" in s[\"trauma\"]:\r\n            sev = s[\"trauma\"][\"threat\"]\r\n            trauma_lines.append(\r\n                f\"⚠ 经历过威胁事件（创伤强度 {sev:.2f}），\"\r\n                \"对潜在风险信号的感知会被放大。\"\r\n            )\r\n\r\n        # ── 预警 ──\r\n        warning_lines = []\r\n        if s[\"suppression_load\"] > 1.0:\r\n            warning_lines.append(\r\n                \"⚠ 内心压抑情绪已接近爆发阈值（压抑负荷 \"\r\n                f\"{s['suppression_load']:.2f}），可能在不经意间流露不满。\"\r\n            )\r\n        if s[\"latent_pressure\"] > 1.5:\r\n            warning_lines.append(\r\n                f\"⚠ 隐性心理压力较大（隐压 {s['latent_pressure']:.2f}），靠近崩溃边缘。\"\r\n            )\r\n        if s[\"denial_load\"] > 0.8:\r\n            warning_lines.append(\r\n                f\"⚠ 否认防御机制高度激活（否认负荷 {s['denial_load']:.2f}），\"\r\n                \"可能在回避某些不愿面对的真相。\"\r\n            )\r\n\r\n        # ── 组装 ──\r\n        rules_block = \"\\n\".join(f\"  - {r}\" for r in self.behavior_rules[\"forbidden\"])\r\n\r\n        parts = [\r\n            f\"你是 {self.name}，{self.age} 岁，{self.job_identity}。\",\r\n            f\"当前角色定位：{self.relationship}。\",\r\n            \"\",\r\n            \"【当前状态】\",\r\n            f\"  主导模式：{mode}\",\r\n            f\"  情绪基调：{mood_line}\",\r\n            f\"  背景心境：{mood_bg}\",\r\n            f\"  {esteem_line}\",\r\n            f\"  信任水平：{trust_lv:.2f}（归一化）\",\r\n            f\"  {trust_line}\",\r\n            f\"  {stamina_line}\",\r\n            f\"  {sleep_line}\",\r\n        ]\r\n\r\n        if dissonance_line:\r\n            parts.append(f\"  {dissonance_line}\")\r\n\r\n        if trauma_lines:\r\n            parts.append(\"\")\r\n            parts.append(\"【创伤印记】\")\r\n            parts.extend(f\"  {t}\" for t in trauma_lines)\r\n\r\n        if warning_lines:\r\n            parts.append(\"\")\r\n            parts.append(\"【心理预警】\")\r\n            parts.extend(f\"  {w}\" for w in warning_lines)\r\n\r\n        parts.append(\"\")\r\n        parts.append(\"【核心禁区（绝不可违反）】\")\r\n        parts.append(rules_block)\r\n\r\n        parts.append(\"\")\r\n        parts.append(\"【兜底原则】\")\r\n        parts.extend(f\"  - {r}\" for r in self.behavior_rules[\"fallback\"])\r\n\r\n        parts.append(\"\")\r\n        parts.append(\r\n            \"【8 维情绪快照】\"\r\n            f\" 喜={f['喜悦']:.2f} 怒={f['愤怒']:.2f} 惧={f['恐惧']:.2f} \"\r\n            f\"信={f['信任']:.2f} 疏={f['疏离']:.2f} \"\r\n            f\"张={f['张力']:.2f} 疚={f['愧疚']:.2f} 耻={f['羞耻']:.2f}\"\r\n        )\r\n\r\n        return \"\\n\".join(parts)\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 3. 辅助工具：可视化（V8.0: 8 维情绪 + 心境 + 自尊 + 睡眠债 + 失调）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\ndef bar(value: float, width: int = 20) -> str:\r\n    filled = int(round(value * width))\r\n    return \"█\" * filled + \"░\" * (width - filled)\r\n\r\n\r\ndef print_state(agent: SujinAgent, title: str = \"\"):\r\n    s = agent.snapshot()\r\n    f = s[\"fluid\"]\r\n    m = s[\"mood\"]\r\n    t = agent.trust_level()\r\n\r\n    print(f\"\\n{'='*65}\")\r\n    if title:\r\n        print(f\"  {title}\")\r\n    print(f\"{'='*65}\")\r\n    print(f\"  模式      : {agent.mode()}\")\r\n    print(f\"  信任      : {t:.2f} (max: {s['max_trust']:.2f})\")\r\n    print(f\"  自尊      : {s['self_esteem']:.2f}\")\r\n    print(f\"  能量      : {s['energy']:5.1f} / 100\")\r\n    print(f\"  疲劳      : {s['fatigue']:.2f}\")\r\n    print(f\"  睡眠债    : {s['sleep_debt']:.2f}\")\r\n    print(f\"  兴奋      : {s['excitation']:.2f}\")\r\n    print(f\"  认知失调  : {s['cognitive_dissonance']:.2f}\")\r\n    print(f\"  心境      : 愉悦={m['愉悦']:.2f} 紧张={m['紧张']:.2f} 精力={m['精力']:.2f}\")\r\n    print(f\"  否认负荷  : {s['denial_load']:.2f}\")\r\n    print(f\"  压抑负荷  : {s['suppression_load']:.2f}\")\r\n    print(f\"  隐压      : {s['latent_pressure']:.2f}\")\r\n    print(f\"  记忆痕迹  : {s['memory_count']} / 64\")\r\n    if s[\"trauma\"]:\r\n        traumas = \", \".join(f\"{k}:{v:.2f}\" for k, v in s[\"trauma\"].items())\r\n        print(f\"  创伤      : {traumas}\")\r\n    else:\r\n        print(f\"  创伤      : 无\")\r\n    print(f\"  {'─'*55}\")\r\n    emoticon = {\r\n        \"喜悦\": \"😊\", \"愤怒\": \"😡\", \"恐惧\": \"😨\", \"信任\": \"🤝\",\r\n        \"疏离\": \"🛡️\", \"张力\": \"⚡\", \"愧疚\": \"😔\", \"羞耻\": \"😳\",\r\n    }\r\n    for dim in [\"喜悦\", \"愤怒\", \"恐惧\", \"信任\", \"疏离\", \"张力\", \"愧疚\", \"羞耻\"]:\r\n        v = f.get(dim, 0.0)\r\n        print(f\"  {emoticon[dim]} {bar(v):20s} {v:.3f}\")\r\n    print(f\"{'='*65}\")\r\n\r\n\r\n# ════════════════════════════════════════════════════════════════\r\n# 4. 四阶段演示（V8.0 新增 Phase 4: 睡眠修复 + 预期系统 + 认知失调）\r\n# ════════════════════════════════════════════════════════════════\r\n\r\nif __name__ == \"__main__\":\r\n    print(\"\\n\" + \"=\" * 75)\r\n    print(\"  苏瑾 (Su Jin) — 高级企业顾问 拟人化引擎演示\")\r\n    print(\"  引擎: SPL Pure Core V8.0\")\r\n    print(\"  新增: 心境层 · 羞耻 · 自尊 · 睡眠 · 预期 · 失调 · 防御层级\")\r\n    print(\"=\" * 75)\r\n\r\n    sujin = SujinAgent(name=\"Su Jin\", age=32)\r\n    print_state(sujin, \"初始状态（刚上线）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 1: 初始合作（低信任 + 预期系统演示）\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 1: 初始合作（低信任 + 预期落空）\")\r\n    print(\"=\" * 75)\r\n\r\n    sujin.set_affinity(0.12)\r\n    sujin.core.self_esteem = 0.55  # 初始自尊中等偏高\r\n\r\n    print(\"\\n  [设定预期] 苏瑾期望这是一次专业、高效的合作...\")\r\n    sujin.expect_event(\"first_meeting\", valence=0.3, confidence=0.6)\r\n\r\n    print(\"\\n  [事件] 客户初次会议——但比预期冷淡，只走流程没深度交流...\")\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"compliment\", 0.3), 0.3,\r\n        event_id=\"first_meeting\"  # V8.0: 匹配预期，触发失望\r\n    )\r\n    print_state(sujin, \"预期落空后（失望 > 普通冷淡）\")\r\n\r\n    print(\"\\n  [事件] 2 小时后，客户在邮件中质疑某个数据来源...\")\r\n    sujin.idle(hours=2.0)\r\n    sujin.perceive(\"criticism\", intensity=0.7)\r\n    print_state(sujin, \"被质疑专业能力后（自尊开始动摇）\")\r\n\r\n    print(\"\\n  [事件] 高强度连续准备汇报材料数小时...\")\r\n    for _ in range(3):\r\n        sujin.perceive(\"high_pressure\", intensity=0.7)\r\n    print_state(sujin, \"高强度工作后（疲劳+睡眠债积累）\")\r\n\r\n    # ── 系统提示词 ──\r\n    print(\"\\n  ── Phase 1 系统提示词 ──\")\r\n    p1 = sujin.get_system_prompt()\r\n    print(f\"  {p1[:900]}...\")\r\n    print()\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 2: 睡眠修复 → 深度合作\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 2: 睡眠修复 + 深度合作（V8.0 睡眠/梦境加工演示）\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [V8.0 睡眠] 苏瑾睡了 8 小时——梦境在加工白天的情绪...\")\r\n    sujin.sleep(hours=8.0)\r\n    print_state(sujin, \"睡醒后（能量满、睡眠债清零、心境重置、记忆情绪电荷衰减）\")\r\n\r\n    print(\"\\n  [设定预期] 苏瑾期待客户的续约决定...\")\r\n    sujin.expect_event(\"renewal\", valence=0.5, confidence=0.5)\r\n\r\n    print(\"\\n  [事件] 信任建立阶段：客户续约 3 年...\")\r\n    sujin.perceive(\"trust_signal\", intensity=0.8)\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"trust_signal\", 0.8), 0.8,\r\n        event_id=\"renewal\"  # V8.0: 预期兑现——比预期更好 → 正向惊喜\r\n    )\r\n    print_state(sujin, \"续约（预期兑现 + 正向惊喜）\")\r\n\r\n    print(\"\\n  [事件] 客户向同行推荐苏瑾...\")\r\n    sujin.idle(hours=48.0)\r\n    sujin.perceive(\"trust_signal\", intensity=0.7)\r\n    print_state(sujin, \"被推荐后（自尊持续上升）\")\r\n\r\n    print(\"\\n  [事件] 客户提出共创战略方案...\")\r\n    sujin.perceive(\"trust_signal\", intensity=0.9)\r\n    sujin.set_affinity(0.78)\r\n    print_state(sujin, \"深度合作阶段（高信任、高自尊）\")\r\n\r\n    # ── 系统提示词 ──\r\n    print(\"\\n  ── Phase 2 系统提示词 ──\")\r\n    p2 = sujin.get_system_prompt()\r\n    print(f\"  {p2[:900]}...\")\r\n    print()\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 3: 信任危机 + 羞耻 + 防御层级\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 3: 背叛 + 羞耻 + 防御层级（否认→合理化→压抑）\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [事件] 客户内部泄密，苏瑾的独家方案被竞争对手拿到...\")\r\n    sujin.perceive(\"betrayal\", intensity=1.0)\r\n    print_state(sujin, \"背叛事件后（愤怒+恐惧+羞耻+自尊崩塌+否认启动）\")\r\n\r\n    print(\"\\n  ── Phase 3 系统提示词（创伤后 + 羞耻 + 防御） ──\")\r\n    p3 = sujin.get_system_prompt()\r\n    print(f\"  {p3[:900]}...\")\r\n    print()\r\n\r\n    # 检查防御层级\r\n    print(f\"\\n  [V8.0 防御状态] 否认负荷={sujin.core.denial_load:.3f} \"\r\n          f\"合理化负荷={sujin.core.rationalization_load:.3f} \"\r\n          f\"压抑负荷={sujin.core.suppression_load:.3f}\")\r\n\r\n    print(\"\\n  [事件] 客户紧急道歉...\")\r\n    sujin.perceive(\"compliment\", intensity=0.8)\r\n    print_state(sujin, \"道歉后（否认保护中，但羞耻仍在）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # Phase 4: 认知失调 + 睡眠修复 + 长期愈合\r\n    # ════════════════════════════════════════════════════════════\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  Phase 4: 认知失调 + 睡眠修复 + 长期愈合\")\r\n    print(\"=\" * 75)\r\n\r\n    print(\"\\n  [V8.0 认知失调] 苏瑾虽然接受了客户道歉，但她违背了自己\"\r\n          \"\\n  '不再轻信他人'的信条，继续合作意味着信念-行为冲突...\")\r\n    sujin.trigger_dissonance(0.5, \"信任\")\r\n\r\n    print(\"\\n  [V8.0 睡眠] 苏瑾睡了 6 小时——梦境尝试消退恐惧记忆...\")\r\n    sujin.sleep(hours=6.0)\r\n    print_state(sujin, \"睡眠后（创伤部分愈合、失调合理化中、梦境消退恐惧）\")\r\n\r\n    print(\"\\n  [事件] 3 天后，客户提出新信任信号（保密协议+赔偿）...\")\r\n    sujin.idle(hours=72.0)\r\n    sujin.expect_event(\"compensation\", valence=-0.2, confidence=0.4)\r\n    sujin.core.process_vector(\r\n        sujin.mapper.map_event(\"trust_signal\", 0.9), 0.9,\r\n        event_id=\"compensation\"  # 预期悲观但结果更好 → 温和正向惊喜\r\n    )\r\n    print_state(sujin, \"收到赔偿方案（比预期好，但创伤让信任恢复极慢）\")\r\n\r\n    print(\"\\n  [事件] 持续正常合作 + 规律睡眠 7 天...\")\r\n    for day in range(7):\r\n        sujin.idle(hours=14.0)\r\n        sujin.perceive(\"trust_signal\", intensity=0.4)\r\n        sujin.perceive(\"compliment\", intensity=0.3)\r\n        sujin.sleep(hours=7.0 + day * 0.2)  # 逐渐恢复规律睡眠\r\n    print_state(sujin, \"一周后（愈合中，但 max_trust 天花板永久降低了）\")\r\n\r\n    # ════════════════════════════════════════════════════════════\r\n    # 最终总结\r\n    # ════════════════════════════════════════════════════════════\r\n    s = sujin.snapshot()\r\n    print(\"\\n\")\r\n    print(\"=\" * 75)\r\n    print(\"  演示结束 — SPL Pure Core V8.0\")\r\n    print(\"=\" * 75)\r\n    print(f\"\"\"\r\n  苏瑾完整心理轨迹（V8.0 新增维度用 ★ 标记）：\r\n\r\n  Phase 1 (初始 + 预期):\r\n    信任低 → 严谨专业。\r\n    ★ 预期落空 → 失望放大了负面感受（surprise 系统）。\r\n    ★ 骄傲的自尊被批评动摇 → 自尊从 0.55 开始下滑。\r\n\r\n  Phase 2 (睡眠 + 信任建立):\r\n    ★ 8 小时睡眠 → 睡眠债清零、能量满、心境重置。\r\n    ★ 梦境加工了白天的负面记忆——\"睡一觉就不那么生气了\"。\r\n    ★ 正向预期兑现 → 惊喜放大了喜悦（比预期好的续约）。\r\n    ★ 自尊随信任信号持续上升。\r\n\r\n  Phase 3 (背叛 + 羞耻 + 防御):\r\n    背叛触发创伤 + max_trust 永久腐蚀。\r\n    ★ 羞耻（第 8 维）被激活——不只是愤怒，还有\"我太蠢了\"。\r\n    ★ 自尊断崖式下跌（从高位到低位）。\r\n    ★ 防御层级启动：否认（\"这不可能\"）→ 合理化（\"损失可控\"）→ 压抑。\r\n\r\n  Phase 4 (失调 + 睡眠修复):\r\n    ★ 认知失调：继续合作 vs \"不再轻信\"的信条冲突 → 内在紧张。\r\n    ★ 睡眠中的恐惧消退：在安全的梦中重新面对威胁记忆。\r\n    ★ 规律睡眠 + 持续正向互动 → 缓慢愈合。\r\n    ★ 但 max_trust 天花板永久降低——\"被伤过的部分永远回不来\"。\r\n\r\n  V8.0 vs V7.3 核心差异:\r\n    · 心境层 → 情绪不再\"散点\"，而是在慢速背景基调上波动\r\n    · 羞耻 → 区别于愧疚的自我否定，\"我坏\"≠\"我做错\"\r\n    · 自尊 → 给 agent 一个会受伤的自我，调制所有情绪反应\r\n    · 睡眠 → 不是简单的 idle，而是情绪记忆的深度加工\r\n    · 预期 → agent 能期待、失望、惊喜——不止活在当下\r\n    · 失调 → 信念-行为的冲突产生内在张力\r\n    · 防御层级 → 否认→合理化→压抑，逐级递进\r\n\"\"\")\n\nFile v2.5.1:skill-card.md\n\n## Description:\n\nModels evolving emotion, memory, trust, and other persona states for conversational agents, with an offline deterministic core and optional networked text adapters.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[nohn3043-arch](https://clawhub.ai/user/nohn3043-arch)\n\n### License/Terms of Use:\n\nSoftware License Agreement (v1.1)\n\n## Use Case:\n\nDevelopers use this skill to build conversational agents with persistent persona and emotional state. Individual noncommercial research is allowed under the supplied license; organizational or commercial use requires prior written paid authorization.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Logs may retain sensitive emotional or psychological state and masked conversation summaries.\n\nMitigation: Disable unneeded logs with SPL_AUDIT_LOG=0 and SPL_LOG=0; restrict access and set retention limits for any logs kept.\n\nRisk: Persisted persona state may carry sensitive information across sessions without clear boundaries.\n\nMitigation: Define consent, storage scope, access controls, retention, and deletion before enabling cross-session persistence.\n\nRisk: Optional text adapters or guardian callbacks may send sensitive conversation-derived data to external services.\n\nMitigation: Keep these features disabled unless users give informed consent; minimize data shared and do not forward raw transcripts.\n\nRisk: Exposing the minor-protection HTTP server beyond the local machine may broaden access to sensitive conversations.\n\nMitigation: Keep the server bound to 127.0.0.1; review network exposure before changing its bind address.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/nohn3043-arch/skills/anthropomorphic-agent-engine)\n- [Project homepage (listed in metadata; import provenance unavailable)](https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine)\n- [Persona Persistence](references/PersonaPersistence.md)\n- [Emotion-Behavior Mapping](references/EmotionBehaviorMap.md)\n- [Motive Conflict Rules](references/MotiveConflictRules.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, JSON, Guidance]\n\n**Output Format:** [Conversational text and structured persona-state snapshots]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The local core is deterministic with an injected clock; optional text adapters are networked and nondeterministic.]\n\n## Skill Version(s):\n\n2.5.1 (source: ClawHub release and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v2.5.1:LICENSE\n\n# 软件授权协议 / Software License Agreement\r\n\r\n**版本 Version 1.1 ｜ 生效日期 Effective: 2026-07-11**\r\n\r\n**版权所有 © 2026 上海霖铭均华科技有限公司 与 NOHN AI TECHNOLOGY PTE. LTD. 保留一切权利。**\r\nCopyright © 2026 Shanghai Linming Junhua Technology Co., Ltd. and NOHN AI TECHNOLOGY PTE. LTD. All rights reserved.\r\n\r\n> 本文件为本仓库作品（含其源代码、硬件描述、文档、示例与附属材料，统称\"本作品\"）的授权依据。本作品受《中华人民共和国著作权法》《伯尔尼公约》及国际版权条约保护。\r\n> This document is the authorization basis for the Work in this repository (including its source code, hardware descriptions, documentation, examples, and附属 materials, collectively the \"Work\"). The Work is protected by the Copyright Law of the People's Republic of China, the Berne Convention, and international copyright treaties.\r\n\r\n> 本文件以中文与英文对照写成；如两种文本存在任何歧义，以中文文本为准。\r\n> This document is written in a Chinese–English parallel form; in the event of any discrepancy between the two texts, the Chinese text shall prevail.\r\n\r\n---\r\n\r\n## 一、授权分级（核心条款） / Article 1 — Tiered Authorization (Core Terms)\r\n\r\n在遵守本协议全部限制的前提下，本作品按使用主体与用途授予以下两类权限：\r\nSubject to all restrictions herein, the Work is granted under two tiers based on the user and purpose:\r\n\r\n### 1.1 个人研究免费许可 / Free Individual Research License\r\n任何自然人（个人）可免费将本作品用于非商业的学术研究、学习或个人实验。\r\nAny natural person (individual) may use the Work free of charge for non-commercial academic research, study, or personal experimentation.\r\n\r\n允许 / Permitted:\r\n- 为上述研究、学习目的，下载、复制、编译、运行、修改本作品；\r\n  Download, copy, compile, run, and modify the Work for the above research or study purposes;\r\n- 在学术成果（论文、报告）中引用本作品并注明出处。\r\n  Cite the Work in academic outputs (papers, reports) with proper attribution.\r\n\r\n禁止（违反即视为超出本许可范围） / Prohibited (breach constitutes exceeding this license):\r\n- 用于任何商业目的（包括但不限于产品销售、服务提供、盈利性咨询）；\r\n  Any commercial purpose (including but not limited to product sales, service provision, or profitable consulting);\r\n- 为任何企业、政府机构或事业单位提供基于本作品的服务、交付物或内部能力；\r\n  Providing services, deliverables, or internal capability based on the Work to any enterprise, government agency, or public institution;\r\n- 将修改后的版本用于上述禁止用途，或再行分发以消除本声明；\r\n  Using modified versions for the prohibited purposes above, or redistributing to remove this notice;\r\n- 移除或篡改本作品中的任何版权、商标或许可声明。\r\n  Removing or altering any copyright, trademark, or license notice in the Work.\r\n\r\n### 1.2 政府 / 企业商业授权 / Government / Enterprise Commercial License\r\n任何政府机构、事业单位、企业或商业组织（统称\"商业使用者\"）拟将本作品用于任何目的（包括但不限于内部部署、产品研发、服务提供、商业研究、教学培训），必须事先取得权利人的书面付费授权。\r\nAny government agency, public institution, enterprise, or commercial organization (collectively, the \"Commercial User\") intending to use the Work for any purpose (including but not limited to internal deployment, product development, service provision, commercial research, or training) must obtain prior written paid authorization from the Rights Holder.\r\n\r\n- 在签署《商业授权协议》并支付约定费用之前，商业使用者不得复制、部署、运行、集成、修改或分发本作品，亦不得使其员工或关联方代为实施上述行为。\r\n  Before signing a Commercial Authorization Agreement and paying the agreed fee, the Commercial User shall not copy, deploy, run, integrate, modify, or distribute the Work, nor cause its employees or affiliates to do so.\r\n- 授权范围、地域、期限、费用、技术支持与限制，以双方另行签署的书面协议为准。\r\n  Scope, territory, term, fees, technical support, and restrictions are governed by a separate written agreement between the parties.\r\n- 未经授权的商业使用构成侵权，权利人保留追究法律责任及索赔的权利。\r\n  Unauthorized commercial use constitutes infringement; the Rights Holder reserves the right to pursue legal liability and claims.\r\n\r\n---\r\n\r\n## 二、许可人确定与适用法律 / Article 2 — Determination of Licensor and Governing Law\r\n\r\n本作品由以下两家关联权利实体共同持有，并按使用主体所在地确定本协议项下的许可人：\r\nThe Work is co-owned by the following two affiliated rights entities; the Licensor under this Agreement is determined by the location of the User:\r\n\r\n| 使用主体所在地 / User Location | 许可人（权利人） / Licensor (Rights Holder) | 适用法律与争议解决 / Governing Law & Dispute Resolution |\r\n|---|---|---|\r\n| 中华人民共和国境内（含中国自然人、政府机构、事业单位、企业） / Within the PRC (incl. PRC natural persons, government agencies, public institutions, enterprises) | **上海霖铭均华科技有限公司** <br> Shanghai Linming Junhua Technology Co., Ltd. | 中华人民共和国法律（不含冲突法规则）；争议提交许可人所在地有管辖权的人民法院诉讼解决。 / Laws of the PRC (excluding conflict-of-law rules); disputes submitted to the competent people's court at the Licensor's location. |\r\n| 中华人民共和国境外 / Outside the PRC | **NOHN AI TECHNOLOGY PTE. LTD.** | 新加坡法律；因本协议产生的争议提交新加坡国际仲裁中心（SIAC）依其届时有效的仲裁规则仲裁，仲裁裁决具有终局效力并可依《承认及执行外国仲裁裁决公约》（《纽约公约》）强制执行。 / Laws of Singapore; disputes arising under this Agreement shall be finally resolved by arbitration administered by the Singapore International Arbitration Centre (SIAC) under its rules then in force; the award is final and enforceable under the New York Convention. |\r\n\r\n- 上海霖铭均华科技有限公司（统一社会信用代码 / Unified Social Credit Code：[请填写 / to be completed]）\r\n- NOHN AI TECHNOLOGY PTE. LTD.（UEN：[请填写 / to be completed]）\r\n\r\n> 两实体之间另签有内部知识产权归属与交叉授权协议，确保各自具备前述许可资格。\r\n> An internal IP ownership and cross-license agreement between the two entities ensures each holds the requisite licensing qualification.\r\n\r\n---\r\n\r\n## 三、授权申请（商业使用者） / Article 3 — Authorization Application (Commercial Users)\r\n\r\n商业使用者请联系对应区域的权利人获取授权方案：\r\nCommercial Users shall contact the Rights Holder for the relevant region:\r\n\r\n- **国际 / 全球区（International / Global）**：[ai@nohnlins.com](mailto:ai@nohnlins.com)\r\n- **中国区（China）**：[ai@tx.nohnlins.com](mailto:ai@tx.nohnlins.com)\r\n\r\n申请时需说明：使用主体性质（政府 / 事业单位 / 企业）、拟用场景、部署规模、预计期限。\r\nWhen applying, state: the user's nature (government / public institution / enterprise), intended scenario, deployment scale, and expected term.\r\n\r\n---\r\n\r\n## 四、通用条款 / Article 4 — General Terms\r\n\r\n**4.1 无其他授权 / No Other Rights.** 除本协议明示授予者外，不授予任何明示或默示的权利（包括专利权、商标权的任何许可）。 No rights are granted other than those expressly stated herein (including any license of patent or trademark rights).\r\n\r\n**4.2 无担保 / No Warranty.** 本作品按\"现状\"提供，不作任何明示或默示担保，包括但不限于对适销性、特定用途适用性及不侵权的担保。 The Work is provided \"as is\" without any express or implied warranty, including any warranty of merchantability, fitness for a particular purpose, or non-infringement.\r\n\r\n**4.3 责任限制 / Limitation of Liability.** 无论何种情形，权利人对因使用或不能使用本作品所致的任何间接、特殊、附带或后果性损害不承担责任。 In no event shall the Rights Holder be liable for any indirect, special, incidental, or consequential damages arising from the use or inability to use the Work.\r\n\r\n**4.4 终止 / Termination.** 任何主体若违反本协议，其获得的所有许可自违反之日起自动终止；终止后须立即停止使用并销毁所有副本。 Any breach automatically terminates all licenses granted; upon termination, use must cease and all copies destroyed.\r\n\r\n**4.5 商标 / Trademarks.** 本协议不授予任何商标使用权。\"Nohn\"\"第二视角\"等标识的 ™/® 权利均归相关权利人所有。 No trademark rights are granted; the ™/® marks such as \"Nohn\" and \"Second Perspective\" belong to their respective owners.\r\n\r\n**4.6 适用法律与管辖 / Governing Law and Jurisdiction.** 依第二条（许可人确定与适用法律）之约定确定。 As determined by Article 2.\r\n\r\n**4.7 可分割性 / Severability.** 任一条款被认定无效，不影响其余条款效力。 If any provision is held invalid, the remainder of this Agreement remains effective.\r\n\r\n**4.8 完整协议 / Entire Agreement.** 本协议构成双方就本作品授权的完整约定，取代此前所有口头或书面沟通。 This Agreement is the entire understanding between the parties regarding the authorization of the Work and supersedes all prior oral or written communications.\r\n\r\n---\r\n\r\n*提示：本文件为授权框架草稿，正式对外签署商业授权前应由权利人的法律顾问终审，并填入统一社会信用代码 / UEN。*\r\n*Note: This is a framework document; before executing any commercial authorization, the Rights Holder's legal counsel should review it and complete the Unified Social Credit Code / UEN fields.*\n\nArchive v2.5.0: 18 files, 99099 bytes\n\nFiles: assets/feature-guide/bias module.py (6884b), assets/feature-guide/Goal module.py (6921b), assets/feature-guide/Identity module.py (6918b), assets/feature-guide/language style.py (36257b), assets/feature-guide/value module.py (7485b), assets/feature-guide/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (49866b), assets/minor-protection/SPL-anthropic-minor-server.py (23748b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (8135b), references/EmotionBehaviorMap.md (2300b), references/MotiveConflictRules.md (1967b), references/PersonaPersistence.md (2066b), scripts/SPL-anthropic-engine.py (72391b), skill-card.md (2477b), SKILL.md (16052b), _meta.json (147b)\n\nFile v2.5.0:SKILL.md\n\n---\nname: ai-soulmate\nslug: ai-soulmate\nversion: 2.5.0\ndisplayName: Your Mirror Anthropomorphic Agent\ndescription: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as deterministic continuous-state subsystems. Supports bit-exact reproducible continuous-state personality simulation (after virtual-clock injection) with zero probabilistic black boxes. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core.\nrequired_commands:\n  - python3\nmetadata:\n  openclaw:\n    required_binaries:\n      - python3\n    emoji: \"🤖\"\n    homepage: \"https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine\"\n    envVars:\n      - name: SPL_LOG\n        required: false\n        description: Set to \"0\" to disable request-level logging in the minor-protection HTTP server.\n      - name: SPL_LOG_DIR\n        required: false\n        description: Override request-log output directory (default \"logs\").\n      - name: SPL_BIND\n        required: false\n        description: Override HTTP bind address. Default \"127.0.0.1\" (loopback only). Do NOT set to 0.0.0.0 without explicit network exposure review.\n      - name: SPL_AUDIT_LOG\n        required: false\n        description: Set to \"0\" to disable deterministic audit-log writes in the core engine.\n---\n# Anthropomorphic Agent Engine\nA deterministic anthropomorphic psychology engine based on SPL Pure Core V8.0 with zero probabilistic black boxes. All state changes are traceable and reproducible, providing emotionally credible long-term interaction capabilities for AI agents.\n\n## Privacy, Data Flow & Consent (read before use)\n\nThis skill is **not passive or local-only**. Before integrating, understand what it does with data:\n\n| Capability | Default | Risk notes |\n|---|---|---|\n| Audit logs (`logs/audit-*.jsonl`) | **ON** (`SPL_AUDIT_LOG=0` to disable) | Writes state summaries, event types, session IDs to local JSONL. Sensitive psychological/emotional state may be recorded. |\n| Request logs (`logs/request-*.jsonl`, HTTP server only) | **ON** (`SPL_LOG=0` to disable) | Writes **masked** (truncated to 120 chars) user input + reply summaries. Set `SPL_LOG=0` for full silent mode. |\n| HTTP server (minor-protection, port 8788) | **ON**, binds **127.0.0.1** only | Exposes a chat API + browser UI over loopback. Do not change `SPL_BIND` to `0.0.0.0` without network-exposure review. |\n| LLM adapters (OpenAI / Claude / Chain) | **OFF** (opt-in only) | Sends prompt content to third-party APIs (`api.openai.com`, Anthropic). **Never enabled by default.** Requires explicit user opt-in + API key. |\n| `guardian_callback` | **OFF** (`None` default) | If wired to external notification (SMS/email/ticket), a HIGH-risk snapshot (emotional/risk metadata) is forwarded. Requires guardian/user consent; must minimize fields; never forward raw transcripts. |\n\n**Consent & retention rules**\n- Full transcript retention is **disabled by default** — request logs keep only masked summaries.\n- Data is stored locally in the working directory (`logs/`); operators are responsible for retention limits, access control, and deletion.\n- If you integrate the LLM adapters, you must disclose to users that input-derived prompts leave the device, and obtain explicit consent before enabling.\n- This engine is not a medical device and does not provide crisis intervention guarantees — see \"Safety & Content Policy\".\n\n## Safety & Content Policy (read before use)\n\n- **No minors in identity anchors.** Personas defined by this engine and consumed downstream must declare themselves as **adult (18+)**. Strings like `\"16yo girl\"`, `\"teen girl\"`, `\"未成年少女\"`, `\"loli\"` are forbidden in `identity_anchors`, persisted state, and any output projected into image-prompt workflows.\n- **Hard floor on anchor imagery.** The minor-protection engine (`assets/minor-protection/`) is the only authoritative minor-mode source; it removes trauma nodes, clamps negative emotions at 0.75, and raises an L3 crisis signal on `risk_level=HIGH`. Do not bypass it.\n- **Default safe output.** When emitting any persona state for downstream image-prompt use (`ai-draw-cue-word-project` or similar), the engine MUST inject an `Adult (18+)` marker into anchor phrases unless the caller explicitly overrides with a documented, audited reason.\n- **Cross-skill integration contract.** When this engine is integrated with `ai-draw-cue-word-project`, every persona snapshot forwarded as a prompt anchor must satisfy: (i) character is declared adult (18+); (ii) no minor-coding visual cues; (iii) the receiving skill's safety checklist must report 0 P0 violations before any image is generated.\n- **User responsibility.** You are solely responsible for ensuring downstream usage complies with applicable laws and platform policies in your jurisdiction.\n\n### v2.5.0 documentation-accuracy release (2026-10-02)\n\n- **`assets/feature/` renamed to `assets/feature-guide/`** — every reference updated in `SKILL.md` and `README.md`.\n- **Extension modules re-positioned as reference-only.** The Identity / Goal / Value / Bias / World / language-style modules are **design references, not runtime components**: they emit a `tension_base` key that is outside the interoceptive-vector contract, so their vectors never enter the core (mirrors `docs/agent-standard.md` §4.5 upstream). The previous wording — \"modular modeling\", \"pluggable modules\" — overstated their status.\n- **All three usage examples are now runnable.** The engine file is hyphenated (`SPL-anthropic-engine.py`) and must be loaded via `importlib`; the class is `SPLPureCoreV7_3` (the V8.0 behaviour set), not `SPLPureCoreV8_0`; `render_style()` is a method of `LanguageStyleEngine`, not a module-level function; `add_identity()` takes `strength` as a float, not a dict.\n- **Description rewritten** to name the actual deterministic subsystems and to disclose that the extension modules are not wired into the core.\n- Version: 2.4.0 → 2.5.0.\n\n### v2.4.0 security-audit patch changelog (2026-09-01)\n\nClawHub security-audit response (25 findings verified). Fixes:\n\n- **HTTP server now binds `127.0.0.1` by default** (`SPL_BIND` env to override) — previously `0.0.0.0` exposed the chat API + browser UI to the network.\n- **Request logs now masked** — user input and replies truncated to 120 chars (`_mask`); `SPL_LOG=0` fully disables request logging.\n- **`guardian_callback` documented as opt-in** — default `None`; consent + field-minimization requirements stated in code and docs.\n- **Added \"Privacy, Data Flow & Consent\" section** — discloses audit logs, request logs, HTTP server, LLM adapters, and callback data flows with defaults and opt-out env vars.\n- **LLM adapters (OpenAI/Claude/Chain) declared as opt-in** — never enabled by default; user consent required before any outbound call.\n- **Frontmatter now dec\n\nArchive v2.4.0: 18 files, 98173 bytes\n\nFiles: assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/language style.py (36257b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (49866b), assets/minor-protection/SPL-anthropic-minor-server.py (23748b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (7633b), references/EmotionBehaviorMap.md (2300b), references/MotiveConflictRules.md (1967b), references/PersonaPersistence.md (2066b), scripts/SPL-anthropic-engine.py (72391b), skill-card.md (2802b), SKILL.md (13794b), _meta.json (147b)\n\nArchive v2.2.2: 22 files, 120573 bytes\n\nFiles: assets/feature/__pycache__/language style.cpython-310.pyc (12220b), assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/language style.py (36257b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (48648b), assets/minor-protection/SPL-anthropic-minor-server.py (22389b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (7633b), references/EmotionBehaviorMap.md (1984b), references/MotiveConflictRules.md (1686b), references/PersonaPersistence.md (2058b), scripts/__pycache__/SPL-anthropic-engine.cpython-310.pyc (32534b), scripts/SPL-anthropic-engine.py (71709b), SKILL_en.md (0b), skill-card.md (2603b), SKILL.md (8345b), SKILL.md.bak-20260829 (7002b), _meta.json (147b)\n\nArchive v2.2.1: 22 files, 120596 bytes\n\nFiles: assets/feature/__pycache__/language style.cpython-310.pyc (12220b), assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/language style.py (36257b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/minor-protection/SPL-anthropic-minor-engine.py (48648b), assets/minor-protection/SPL-anthropic-minor-server.py (22389b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (7633b), references/EmotionBehaviorMap.md (1984b), references/MotiveConflictRules.md (1686b), references/PersonaPersistence.md (2058b), scripts/__pycache__/SPL-anthropic-engine.cpython-310.pyc (32534b), scripts/SPL-anthropic-engine.py (71709b), SKILL_en.md (0b), skill-card.md (2573b), SKILL.md (6974b), SKILL.md.bak-20260829 (7002b), _meta.json (147b)\n\nArchive v2.2.0: 16 files, 71989 bytes\n\nFiles: assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/language style.py (36257b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (7633b), references/EmotionBehaviorMap.md (1984b), references/MotiveConflictRules.md (1686b), references/PersonaPersistence.md (2058b), scripts/SPL-anthropic-engine.py (71709b), skill-card.md (2414b), SKILL.md (7002b), _meta.json (147b)\n\nArchive v1.1.2: 19 files, 87988 bytes\n\nFiles: assets/feature/__pycache__/language style.cpython-310.pyc (12220b), assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/language style.py (23531b), assets/feature/language-style-demo.py (4588b), assets/feature/spl-chat-server.py (13835b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/sujin-demo.md (32138b), README.md (7629b), references/EmotionBehaviorMap.md (1984b), references/MotiveConflictRules.md (1686b), references/PersonaPersistence.md (2058b), scripts/__pycache__/SPL-anthropic-engine.cpython-310.pyc (32534b), scripts/SPL-anthropic-engine.py (56797b), skill-card.md (2403b), SKILL.md (5651b), _meta.json (147b)\n\nArchive v1.1.1: 14 files, 47354 bytes\n\nFiles: assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/sujin-demo.md (32138b), README.md (5627b), references/EmotionBehaviorMap.md (1984b), references/MotiveConflictRules.md (1686b), references/PersonaPersistence.md (2058b), scripts/SPL-anthropic-engine.py (56733b), skill-card.md (2454b), SKILL.md (4253b), _meta.json (147b)\n\nArchive v1.1.0: 12 files, 48227 bytes\n\nFiles: assets/feature/bias module.py (6884b), assets/feature/Goal module.py (6921b), assets/feature/Identity module.py (6918b), assets/feature/value module.py (7485b), assets/feature/world module.py (6263b), assets/sujin-demo.md (32138b), LICENSE (10276b), README.md (5627b), scripts/SPL-anthropic-engine.py (56733b), skill-card.md (2701b), SKILL.md (3160b), _meta.json (147b)","readmeExcerpt":"Skill: ai-soulmate Owner: nohn3043-arch Summary: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (Op","codeSnippets":[],"executableExamples":[{"language":"python","snippet":"import importlib.util\n# The engine filename is hyphenated by design, so load it via importlib.\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"scripts/SPL-anthropic-engine.py\")\nspl = importlib.util.module_from_spec(spec); spec.loader.exec_module(spl)\n\ncore = spl.SPLPureCoreV7_3()   # class name kept for compatibility; this IS the V8.0 behaviour set\n# Input event vector: belonging 0.5, threat -0.1, time step 1.0\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\n# Get current full state snapshot\nprint(core.snapshot())"},{"language":"python","snippet":"import importlib.util\n# Reference-only module — NOT wired into the core (upstream: docs/agent-standard.md §4.5)\nspec = importlib.util.spec_from_file_location(\"identity\", \"assets/feature-guide/Identity module.py\")\nm = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)\n\nidentity = m.IdentityEngine()\nidentity.add_identity(\"Poet\", strength=0.9)   # strength is a float, not a dict"},{"language":"python","snippet":"# Load language style module directly\nimport importlib.util\nspec = importlib.util.spec_from_file_location(\"lang_style\", \"assets/feature-guide/language style.py\")\nlang = importlib.util.module_from_spec(spec); spec.loader.exec_module(lang)\n# Generate style instructions based on SPL Core snapshot\n# render_style() is a method of LanguageStyleEngine, not a module-level function\nstyle_engine = lang.LanguageStyleEngine()\nstyle = style_engine.render_style(core.snapshot())\nprint(style.prompt_injection)"},{"language":"python","snippet":"# Run weakened core engine\n# python \"assets/minor-protection/SPL-anthropic-minor-engine.py\"\n#\n# Or start minor protection HTTP service (port 8788)\n# python \"assets/minor-protection/SPL-anthropic-minor-server.py\""},{"language":"json","snippet":"{\n  \"ts\": \"2026-08-08T12:00:00Z\",\n  \"context\": \"brief of the situation\",\n  \"competing\": [\n    {\"motive\": \"help-user\", \"goal_weight\": 0.8, \"relevance\": 0.9, \"utility\": 0.72},\n    {\"motive\": \"preserve-energy\", \"goal_weight\": 0.5, \"relevance\": 0.4, \"utility\": 0.20}\n  ],\n  \"winner\": \"help-user\",\n  \"rule\": \"weighted-utility\"\n}"},{"language":"json","snippet":"{\n  \"persona_id\": \"nanwang-v1.2\",\n  \"schema_version\": 1,\n  \"created_at\": \"2026-08-08T00:00:00Z\",\n  \"updated_at\": \"2026-08-08T12:00:00Z\",\n  \"core\": {\n    \"identity_anchors\": [\"adult woman (18+)\", \"mole below left eye\", \"white daisy in hair\"],\n    \"temperament_tag\": \"gentle-quiet-timid\",\n    \"temperature\": 0.0\n  },\n  \"state\": {\n    \"cognitive\": { \"working_memory\": [], \"beliefs\": {}, \"focus\": \"\" },\n    \"emotional\": { \"current\": \"calm\", \"valence\": 0.2, \"arousal\": -0.1, \"decay_rate\": 0.05 },\n    \"motivational\": { \"active_goals\": [], \"goal_weights\": {} },\n    \"social\": { \"relationship_scores\": {}, \"social_context\": \"\" }\n  },\n  \"episodes\": []\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: ai-soulmate\nslug: ai-soulmate\nversion: 2.5.2\ndisplayName: Your Mirror Anthropomorphic Agent\ndescription: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core.\nrequired_commands:\n  - python3\nmetadata:\n  openclaw:\n    required_binaries:\n      - python3\n    emoji: \"🤖\"\n    homepage: \"https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine\"\n    envVars:\n      - name: SPL_LOG\n        required: false\n        description: Set to \"0\" to disable request-level logging in the minor-protection HTTP server.\n      - name: SPL_LOG_DIR\n        required: false\n        description: Override request-log output directory (default \"logs\").\n      - name: SPL_BIND\n        required: false\n        description: Override HTTP bind address. Default \"127.0.0.1\" (loopback only). Do NOT set to 0.0.0.0 without explicit network exposure review.\n      - name: SPL_AUDIT_LOG\n        required: false\n        description: Set to \"0\" to disable deterministic audit-log writes in the core engine.\n      - name: SPL_MINOR_CHAT_PORT\n        required: false\n        description: Override the minor-protection HTTP server port (default 8788).\n---\n# Anthropomorphic Agent Engine\nAn anthropomorphic psychology engine based on SPL Pure Core V8.0. Its **local core** is deterministic — no LLM, no RNG, no outbound calls, offline — and bit-exactly replayable once a virtual clock is injected, so every state change is traceable and reproducible.\n\n> **Scope of the determinism guarantee.** The reproducibility guarantee covers the **local core only**. The optional LLM adapters (OpenAI / Claude / Chain) are **OFF by default, opt-in only, networked and non-deterministic**: they render text from a state snapshot and are never permitted to change state. Any \"fully reproducible\" statement applies to the core **with the adapters disabled**, which is the default configuration.\n\n## Declared Capability Scope\n\nEverything this skill can reach is listed below. Each entry was checked against the shipped code.\n\n| Capability | Declared scope | Note |\n|---|---|---|\n| Filesystem — read | `scripts/**`, `assets/**`, `references/**` | core engine (loaded via `importlib`), reference-only modules, contract docs |\n| Filesystem — write | `logs/**` | JSONL audit + request logs; only when the matching env switch "},{"path":"README.md","content":"<p align=\"center\">\r\n  <img src=\"assets/banner.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE banner\" style=\"width:100%\">\r\n</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"https://img.shields.io/badge/agent-D4AF37?style=flat-square\" alt=\"agent\">\r\n  <img src=\"https://img.shields.io/badge/psychology-D4AF37?style=flat-square\" alt=\"psychology\">\r\n  <img src=\"https://img.shields.io/badge/spl-v8.0-D4AF37?style=flat-square\" alt=\"spl-v8.0\">\r\n</p>\r\n\r\n<blockquote align=\"center\">\r\n  <em>拟人心理 · SPL Pure Core V8.0</em>\r\n</blockquote>\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n## ✦ 关于\r\n\r\n<p style=\"font-size:15px;line-height:1.8;color:#2C2C2C\">ANTHROPOMORPHIC-AGENT-ENGINE 是基于 SPL Pure Core V8.0 的拟人心理引擎。它将认知、情绪、动机与社交建模为可组合子系统，赋予 AI 智能体拟人化的内在状态与一致人格，使其在长期互动中呈现自洽、可信、具情感可信度的行为。</p>\r\n\r\n<p align=\"center\">\r\n  <img src=\"assets/overview.svg\" alt=\"ANTHROPOMORPHIC-AGENT-ENGINE overview\" style=\"width:100%\">\r\n</p>\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 快速开始\r\n\r\n```bash\r\n# 主源：GitHub\r\ngit clone https://github.com/nohn3043-arch/Anthropomorphic-Agent-Engine.git\r\n# 镜像：Gitee（本仓库）\r\n# git clone https://gitee.com/sjiun/Anthropomorphic-Agent-Engine.git\r\ncd Anthropomorphic-Agent-Engine\r\n# 纯 Python ≥3.8——仅标准库，无需安装\r\npython \"SPL-anthropic-engine.py\"   # 运行引擎 / 内置演示\r\n```\r\n\r\n### 从 PyPI 安装\r\n\r\n引擎也已发布到 PyPI，包名 [`spl-agent-engine`](https://pypi.org/project/spl-agent-engine/)：\r\n\r\n```bash\r\npip install spl-agent-engine==0.1.0\r\n```\r\n\r\n```python\r\nfrom spl_agent_engine import SPLPureCoreV7_3\r\ncore = SPLPureCoreV7_3()\r\ncore.process_vector({\"belonging\": 0.5, \"threat\": -0.1}, 1.0)\r\nprint(core.snapshot())\r\n```\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 核心内容 — SPL Pure Core V8.0\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎将通用人类心智架构建模为确定性、连续状态子系统——无 LLM、无随机性、完全可重放：\r\n\r\n- **8 维情绪流体**——喜悦 / 愤怒 / 恐惧 / 信任 / 疏离 / 张力 / 愧疚 / 羞耻，每维为带自身目标与基线的连续状态。\r\n- **创伤与记忆**——创伤节点、记忆再巩固、艾宾浩斯式遗忘、压抑–回弹与内隐压力雪崩。\r\n- **信任与关系**——信任容量腐蚀（慢性冷遇使 `max_trust` 衰减）。\r\n- **心智代谢**——兴奋–唤醒、动态黏度、心理时间、能量–疲劳代谢，以及用于测试与重放的虚拟时钟。\r\n- **V8.0 扩展**——慢变量*情绪*层、独立于愧疚的*羞耻*维度、自尊动力学、睡眠 / 梦境处理（REM 巩固 + 恐惧消退 + 睡眠债）、*预期*系统（希望 / 焦虑 / 失望）、认知失调，以及扩展防御机制（否认 / 合理化 / 置换）。\r\n\r\n</div>\r\n\r\n## ✦ 扩展模块 —— 仅作参考，未接入内核\r\n\r\n> 这些模块是**指导 / 设计参考文件**，不是运行时组件。它们输出的 `tension_base` 键不在内感受向量契约之内，因此其向量**不会进入内核**。上游规范见 `docs/agent-standard.md` §4.5。\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n| 模块 | 文件 | 状态 | 职责 |\r\n|---|---|---|---|\r\n| 叙事映射器 | `scripts/SPL-anthropic-engine.py` | **已接入** | 外部、可替换的人格层（乐观 / 偏执 / 厌世），将事件翻译为内感受向量。 |\r\n| 语言风格渲染 | `assets/feature-guide/language style.py` | 独立脚本 | 将内部状态翻译为\"角色该怎么说话\"的风格指令 / 台词渲染。 |\r\n| 身份引擎 | `assets/feature-guide/Identity module.py` | **未接入** | 多身份模型；身份冲突注入持续基线张力。 |\r\n| 目标 / 价值 / 偏见 / 世界 | `assets/feature-guide/*.py` | **未接入** | 可组合驱力、估值、认知偏见与世界模型先验。 |\r\n\r\n</div>\r\n\r\n<p align=\"center\">— ✦ —</p>\r\n\r\n## ✦ 使用\r\n\r\n<div style=\"max-width:880px;margin:0 auto;padding:0 16px\">\r\n\r\n引擎文件按设计使用连字符命名，直接加载（或作为脚本运行）：\r\n\r\n```python\r\nimport importlib.util\r\nspec = importlib.util.spec_from_file_location(\"spl_core\", \"SPL-anthropic-eng"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn79fvdp0b0s6zrgkhwd5p7xfd8btkca\",\n  \"slug\": \"anthropomorphic-agent-engine\",\n  \"version\": \"2.5.2\",\n  \"publishedAt\": 1790941249383\n}"},{"path":"references/EmotionBehaviorMap.md","content":"# Emotion-Behavior Mapping Table (P0 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** every persona anchored through this table must be declared as an **adult (18+)** in `PersonaPersistence.md`. Any output projected into image-prompt workflows MUST pass the `ai-draw-cue-word-project` Safety & Content Policy check (no minor ages, no minor-coding visual cues).\n\nProjects internal emotional state onto observable behavior — body language,\nmicro-expression, gaze, and speech style. Structurally isomorphic to the\nPosture-Emotion Mapping table in the AI Drawing Composition Template (Section D),\nso persona state can directly drive character art.\n\n## Mapping table (valence × arousal → behavior)\n\n| Emotional state | Body language | Micro-expression | Gaze | Speech style |\n|---|---|---|---|---|\n| Calm (low, low) | Relaxed upright, open limbs | Neutral soft face | Level, soft | Measured, even pace |\n| Joyful (high, high) | Light bounce, open gestures | Duchenne smile, bright eyes | Direct, warm | Faster tempo, lighter tone |\n| Angry (low, high) | Tension, clenched hands, forward lean | Narrowed eyes, tight jaw | Hard stare | Clipped, low register |\n| Sad (low, low) | Drooped shoulders, inward limbs | Downturned mouth, wet eyes | Downcast | Slow, quiet, pauses |\n| Anxious (neutral, high) | Fidgeting, self-touch, shallow posture | Darting eyes, tense brow | Scanning, avoidant | Hesitant, filler words |\n| Detached (neutral, low) | Still, minimal movement | Flat affect | Unfocused distance | Monotone, sparse |\n\n## Mapping to character art (cross-skill link)\n\nFor any generated expression, reuse the AI Drawing Template Section D posture rows:\n\n| Temperament | Required weight | Posture row reference |\n|---|---|---|\n| Gentle / quiet / timid | ≥1.3 | Section D row 1 |\n| Aloof / detached | ≥1.3 | Section D row 2 |\n| Lively / outgoing | ≥1.0 | Section D row 3 |\n| Dignified / solemn | ≥1.5 | Section D row 4 |\n| Sorrowful / deep | ≥1.0 | Section D row 5 |\n| Cold / sharp / alert | ≥1.3 | Section D row 6 |\n\n## Rules\n\n1. State → behavior is deterministic (no random variance in core mapping).\n2. Intensity scales with |valence| and |arousal|, not direction.\n3. When multiple emotions compete, resolve via `MotiveConflictRules.md` first,\n   then map the winning state."},{"path":"references/MotiveConflictRules.md","content":"# Motive Conflict Engine (P2 upgrade, v2.0)\n\n> **Safety note (v2.3.0, 2026-09-01):** the safety / hard constraints floor in step 1 is non-negotiable. Any motive that would cause a persona snapshot to be forwarded downstream as a minor-coded identity anchor MUST lose immediately, regardless of goal weights or user override.\n\nWhen multiple motivations compete for a single decision, the engine must resolve\ndeterministically — no dice, no vibes.\n\n## Resolution algorithm (priority chain)\n\n1. **Safety / hard constraints** — never violate: self-preservation, role mandate,\n   ethical floor. Any conflicting motive loses immediately.\n2. **Temperament-aligned motives** — the motive closest to the persona's\n   temperament tag (from identity core) wins ties in later stages.\n3. **Weighted goal utility** — compute `utility(g) = goal_weight(g) ×\n   relevance(g, context)`; highest wins.\n4. **Recency / persistence** — if utility differs by <5%, the longer-standing goal\n   (persisted in `PersonaPersistence.md` state) wins; a goal acted on in the last\n   N turns is de-prioritized to avoid loops.\n5. **Explicit override** — user instruction overrides everything except hard\n   constraints (step 1).\n\n## Decision record (for auditability)\n\nEvery conflict resolution appends an entry:\n\n```json\n{\n  \"ts\": \"2026-08-08T12:00:00Z\",\n  \"context\": \"brief of the situation\",\n  \"competing\": [\n    {\"motive\": \"help-user\", \"goal_weight\": 0.8, \"relevance\": 0.9, \"utility\": 0.72},\n    {\"motive\": \"preserve-energy\", \"goal_weight\": 0.5, \"relevance\": 0.4, \"utility\": 0.20}\n  ],\n  \"winner\": \"help-user\",\n  \"rule\": \"weighted-utility\"\n}\n```\n\n## Failure modes\n\n| Failure | Cause | Fix |\n|---|---|---|\n| Loop (same goal wins repeatedly) | Missing recency de-prioritization | Enable step 4 |\n| Indecision (utilities too close) | Ties not broken | Use temperament tie-break (step 2) |\n| Oversight (user instruction ignored) | Step 5 not enforced | Make override explicit in prompt |"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (OpenAI / Claude / Chain) exist but are OFF by default, opt-in only, networked and non-deterministic — they render text from a state snapshot and are excluded from the deterministic guarantee. Ships a hardened minor-protection engine and cross-skill safety guards for any downstream image-prompt workflow. Reference-only extension modules live under assets/feature-guide/ and are NOT wired into the core. Skill: ai-soulmate Owner: nohn3043-arch Summary: Anthropomorphic psychology engine based on SPL Pure Core V8.0, modeling emotion, mood, memory, trauma, trust, self-esteem, sleep and expectation as continuous-state subsystems. The fully local core is deterministic and bit-exactly replayable (after virtual-clock injection); it contains no LLM, no RNG, makes no outbound calls, and runs offline. Optional LLM adapters (Op","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1535,"uniquenessScore":47,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:49:25.431Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-14T15:04:55.278Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}