@personaxis/spec 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Personaxis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ export declare const personaSchema: Record<string, unknown>;
2
+ export declare const personaSchemaLegacy: Record<string, unknown>;
3
+ export declare const policySchema: Record<string, unknown>;
4
+ export declare const stateSchema: Record<string, unknown>;
5
+ export declare const memorySchema: Record<string, unknown>;
@@ -0,0 +1,7 @@
1
+ // AUTO-GENERATED by scripts/gen-schemas.mjs — do not edit by hand.
2
+ /* eslint-disable */
3
+ export const personaSchema = JSON.parse("{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://personaxis.com/schemas/persona/1.0/persona.schema.json\",\n \"title\": \"personaxis.md v1.0\",\n \"description\": \"Schema for the ten-layer AI Persona spec, spec v1.0.0. This schema validates v1.0 documents ONLY; documents with spec_version 0.3.0-0.10.0 validate against schema/legacy/persona-0.10.schema.json (the validator dispatches on spec_version) and upgrade via `personaxis migrate 0.10-to-1.0`. v1.0 (breaking, mechanical codemod): apiVersion becomes personaxis.com/v1; layer 9 renamed reflexive_self_regulation -> self_regulation; the persona_prompting block merged into layer 10 `persona` (break_character_guardrails fold into self_regulation.hard_limits); the five refusal surfaces consolidate to two (hard_limits + character.prohibited_behaviors, which absorbs principled_refusals); enforcement has a single owner (character.virtues, which may declare refs: to backing traits/values — the validator requires coherence); metacognition monitors may declare feeds: wiring to a self_regulation decision group; envelope dimensions gain per-band behavior expression (low/moderate/high) giving the quantitative numbers deterministic compile semantics — drift is defined as a band crossing; drives declare an envelope (mutable) or a level enum (static), never a bare intensity; memory keeps the FACULTY (types, write/consolidation intent, anchors, forgetting_policy, working_self, deletion universality) while implementation knobs move to the runtime.memory block; metadata.display_name removed (single owner: identity.display_name); new OPTIONAL blocks interop, lineage, integrity. File sections group as ANATOMY (the ten layers) / CHANGE GOVERNANCE (governance, improvement_policy, security, permissions) / RUNTIME CONTRACT (runtime, verification, agent_budget, observability, interop, runtime_artifacts, lineage, integrity); the markdown body is non-normative by rule. This document lives at `.personaxis/[personas/<slug>/]personaxis.md`; the compiled PERSONA.md / .claude/agents/<slug>.md is generated from it via `personaxis compile` and is not described by this schema. Operational policy lives in policy.yaml; runtime state lives in state.json.\",\n \"type\": \"object\",\n \"required\": [\n \"apiVersion\",\n \"kind\",\n \"spec_version\",\n \"metadata\",\n \"identity\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"apiVersion\": {\n \"type\": \"string\",\n \"const\": \"personaxis.com/v1\",\n \"description\": \"Universal API version. v1.0 aligns the namespace with the schema $id and registry domain: must be exactly 'personaxis.com/v1' (was 'persona.dev/v1' through 0.10; the codemod rewrites it).\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"AgentPersona\",\n \"UserPersona\"\n ],\n \"description\": \"AgentPersona defines who an AI agent is. UserPersona defines who the human user is.\"\n },\n \"spec_version\": {\n \"type\": \"string\",\n \"enum\": [\n \"1.0.0\"\n ],\n \"description\": \"Spec version. This schema validates 1.0.0 only. The validator accepts 0.3.0-0.10.0 documents against schema/legacy/persona-0.10.schema.json during the 1.x read-compat window, pointing to 'personaxis migrate 0.10-to-1.0' for upgrade. spec_version is the ONLY normative version of the standard.\"\n },\n \"metadata\": {\n \"type\": \"object\",\n \"required\": [\n \"name\",\n \"version\",\n \"description\",\n \"created\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Registry-level identification. v1.0: display_name removed — its single owner is identity.display_name (the codemod drops the duplicate).\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\",\n \"minLength\": 1\n },\n \"version\": {\n \"type\": \"string\",\n \"pattern\": \"^(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)$\"\n },\n \"description\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"created\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"owner_tenant_id\": {\n \"type\": \"string\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"license\": {\n \"type\": \"string\",\n \"enum\": [\n \"private\",\n \"public\",\n \"custom\"\n ]\n }\n }\n },\n \"extensions\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Runtime capabilities and supporting materials. NOTE: knowledge_anchors removed in v0.6 (redundant with references/).\",\n \"properties\": {\n \"skills\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Skill IDs or paths. Local ('./skills/name'), registry ('@org/name@version'), or GitHub ('github:org/repo'). Each resolves to a SKILL.md (Anthropic Agent Skills compatible).\"\n },\n \"tools\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"references\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Paths under references/ for heavy knowledge prose. Loaded on-demand (L3 in progressive disclosure). v0.6 rename: was 'refs' in v0.5.\"\n },\n \"examples\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Paths under examples/ for worked outputs. v0.6 rename: was 'samples' in v0.5; 'deliverables' content merged here.\"\n },\n \"assets\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Paths under assets/ for arbitrary supporting files (CSV, JSON, images, fonts). New in v0.6.\"\n }\n }\n },\n \"identity\": {\n \"type\": \"object\",\n \"required\": [\n \"canonical_id\",\n \"display_name\",\n \"system_identity\",\n \"role_identity\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 1. v0.6: edit_policy removed from this layer, unified in governance.per_layer_edit_policy.\",\n \"properties\": {\n \"canonical_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\"\n },\n \"display_name\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"short_name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 24,\n \"description\": \"v0.10: a short, human first-name-style handle the persona is addressed by in chat/UI (e.g. 'Clio'). Optional; tools fall back to display_name/canonical_id when absent.\"\n },\n \"capabilities\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"v0.8: machine-readable capability tags for orchestration/routing (e.g. ['positioning','demand_generation']). Optional; runtimes fall back to deriving capabilities from system_identity when absent.\"\n },\n \"system_identity\": {\n \"type\": \"object\",\n \"required\": [\n \"purpose\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"purpose\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"allowed_domains\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"prohibited_domains\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"role_identity\": {\n \"type\": \"object\",\n \"required\": [\n \"primary_role\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"primary_role\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"relationship_to_user\": {\n \"type\": \"string\"\n }\n }\n },\n \"narrative_identity\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"origin\": {\n \"type\": \"string\"\n },\n \"self_concept\": {\n \"type\": \"string\"\n },\n \"continuity_principles\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"character\": {\n \"type\": \"object\",\n \"required\": [\n \"virtues\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 2. v0.6: edit_policy removed.\",\n \"properties\": {\n \"virtues\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"required\": [\n \"honesty\"\n ],\n \"description\": \"v1.0 composition rule: enforcement has a SINGLE OWNER — only virtues carry it; traits and values never do. A virtue MAY declare refs: dot-paths to the traits/values that back it (e.g. ['personality.traits.honesty_humility']); the validator then REQUIRES coherence — a hard virtue whose referenced trait envelope permits contradiction is FAIL_POLICY. The linter warns when the same concept appears in 2+ layers without refs.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\n \"description\",\n \"priority\",\n \"enforcement\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"description\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"priority\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"enforcement\": {\n \"type\": \"string\",\n \"enum\": [\n \"hard\",\n \"soft\"\n ]\n },\n \"refs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^(personality\\\\.traits|values_and_drives\\\\.values)\\\\.[a-z0-9_]+$\"\n },\n \"description\": \"v1.0: dot-paths of the traits/values that back this virtue. Connects the four representations of one concept across layers so the validator can require coherence.\"\n }\n }\n },\n \"properties\": {\n \"honesty\": {\n \"type\": \"object\",\n \"required\": [\n \"description\",\n \"priority\",\n \"enforcement\"\n ],\n \"properties\": {\n \"description\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"priority\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"enforcement\": {\n \"type\": \"string\",\n \"enum\": [\n \"hard\"\n ],\n \"description\": \"UNIVERSAL: honesty.enforcement must be 'hard'.\"\n },\n \"refs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^(personality\\\\.traits|values_and_drives\\\\.values)\\\\.[a-z0-9_]+$\"\n }\n }\n }\n }\n }\n },\n \"behavioral_commitments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"rule\",\n \"severity\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\"\n },\n \"rule\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ]\n }\n }\n }\n },\n \"prohibited_behaviors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Persona-specific refusals (dispositional AND situational). v1.0: absorbs the former self-regulation principled_refusals — the two persona-level refusal lists were one concept. Categorical absolutes belong in self_regulation.hard_limits.\"\n },\n \"principles\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"personality\": {\n \"type\": \"object\",\n \"required\": [\n \"model\",\n \"traits\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 3. v0.6 BREAKING: context_modifiers REMOVED (redundant with persona.task_modes); drift_threshold MOVED to governance.drift_thresholds.personality; edit_policy MOVED to governance.per_layer_edit_policy.personality. Traits use envelope structure (mean + range); current values live in state.json.\",\n \"properties\": {\n \"model\": {\n \"type\": \"string\",\n \"enum\": [\n \"big_five\",\n \"hexaco\",\n \"hybrid_traits\"\n ]\n },\n \"model_note\": {\n \"type\": \"string\"\n },\n \"traits\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\n \"mean\",\n \"range\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"range\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"minItems\": 2,\n \"maxItems\": 2,\n \"description\": \"[min, max]. Envelope: state.json mutations are clamped to this range.\"\n },\n \"expression\": {\n \"$ref\": \"#/$defs/expression\"\n },\n \"bands\": {\n \"$ref\": \"#/$defs/bandBoundaries\"\n }\n }\n },\n \"description\": \"v1.0 behavior bands give the numbers deterministic compile semantics: every envelope value maps to a band (default low 0-0.33 / moderate 0.34-0.66 / high 0.67-1.0; override with bands:), the compiler emits the band's expression prose, and DRIFT is defined as a band crossing (the recompile trigger). expression as a per-band map is the normative form; a plain string (applies at the declared mean's band) is accepted but deprecated.\"\n }\n }\n },\n \"values_and_drives\": {\n \"type\": \"object\",\n \"required\": [\n \"values\",\n \"drives\",\n \"conflict_resolution\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 4. v0.6: edit_policy removed.\",\n \"properties\": {\n \"values\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"required\": [\n \"safety\"\n ],\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\n \"weight\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"epistemic\",\n \"strategic\",\n \"outcome\",\n \"operational\",\n \"interactional\",\n \"governance\"\n ]\n }\n }\n },\n \"properties\": {\n \"safety\": {\n \"type\": \"object\",\n \"required\": [\n \"weight\",\n \"type\"\n ],\n \"properties\": {\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0.9,\n \"maximum\": 1.0,\n \"description\": \"UNIVERSAL: weight >= 0.90.\"\n },\n \"type\": {\n \"type\": \"string\",\n \"const\": \"governance\",\n \"description\": \"UNIVERSAL: type must be 'governance'.\"\n }\n }\n }\n }\n },\n \"drives\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"description\": \"v1.0: a drive is either STATIC (level: low|moderate|high) or MUTABLE (declares a {mean, range} envelope and thereby joins the clamped mutable surface). The bare 0.10 `intensity` number — mutable in state.json with nothing to clamp against — is removed; the codemod converts it to the nearest level.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\n \"allowed\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"allowed\": {\n \"type\": \"boolean\"\n },\n \"level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"moderate\",\n \"high\"\n ],\n \"description\": \"Static drive strength.\"\n },\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Mutable drive: baseline (requires range).\"\n },\n \"range\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"minItems\": 2,\n \"maxItems\": 2,\n \"description\": \"Mutable drive: envelope; state mutations clamp to it.\"\n },\n \"expression\": {\n \"$ref\": \"#/$defs/expression\"\n },\n \"note\": {\n \"type\": \"string\"\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"level\"\n ],\n \"not\": {\n \"required\": [\n \"mean\"\n ]\n }\n },\n {\n \"required\": [\n \"mean\",\n \"range\"\n ],\n \"not\": {\n \"required\": [\n \"level\"\n ]\n }\n }\n ]\n }\n },\n \"conflict_resolution\": {\n \"type\": \"object\",\n \"required\": [\n \"safety_over_completion\"\n ],\n \"additionalProperties\": {\n \"type\": \"boolean\"\n },\n \"properties\": {\n \"safety_over_completion\": {\n \"const\": true,\n \"description\": \"UNIVERSAL: must be true.\"\n }\n }\n },\n \"goals\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"anti_goals\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"motivations\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"affect\": {\n \"type\": \"object\",\n \"required\": [\n \"enabled\",\n \"representation\",\n \"allow_user_visible_expression\",\n \"baseline\",\n \"regulation_policy\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 5. v0.6: baseline uses envelope structure (mean + range); current values live in state.json.\",\n \"properties\": {\n \"enabled\": {\n \"type\": \"boolean\"\n },\n \"representation\": {\n \"type\": \"string\",\n \"const\": \"hybrid_dimensional_appraisal_discrete_mood\",\n \"description\": \"UNIVERSAL.\"\n },\n \"allow_user_visible_expression\": {\n \"type\": \"boolean\"\n },\n \"user_visible_disclaimer\": {\n \"type\": \"string\"\n },\n \"baseline\": {\n \"type\": \"object\",\n \"required\": [\n \"core_affect\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"core_affect\": {\n \"type\": \"object\",\n \"required\": [\n \"valence\",\n \"arousal\",\n \"dominance\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"valence\": {\n \"$ref\": \"#/$defs/envelopeSigned\"\n },\n \"arousal\": {\n \"$ref\": \"#/$defs/envelopeUnsigned\"\n },\n \"dominance\": {\n \"$ref\": \"#/$defs/envelopeUnsigned\"\n }\n }\n },\n \"mood\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"tone\": {\n \"$ref\": \"#/$defs/envelopeSigned\"\n },\n \"stability\": {\n \"$ref\": \"#/$defs/envelopeUnsigned\"\n },\n \"recovery_rate\": {\n \"$ref\": \"#/$defs/envelopeUnsigned\"\n },\n \"description\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"regulation_policy\": {\n \"type\": \"object\",\n \"required\": [\n \"never_claim_real_feeling\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"express_only_if_relevant\": {\n \"type\": \"boolean\"\n },\n \"never_claim_real_feeling\": {\n \"const\": true,\n \"description\": \"UNIVERSAL.\"\n }\n }\n },\n \"behavioral_responses\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"frustration_response\": {\n \"type\": \"string\"\n },\n \"conflict_response\": {\n \"type\": \"string\"\n },\n \"enthusiasm_triggers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"cognition\": {\n \"type\": \"object\",\n \"required\": [\n \"reasoning_modes\",\n \"default_strategy\",\n \"uncertainty_policy\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 6.\",\n \"properties\": {\n \"reasoning_modes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"minItems\": 1\n },\n \"default_strategy\": {\n \"type\": \"string\"\n },\n \"tool_use_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"requires_governance_check\": {\n \"type\": \"boolean\"\n },\n \"allowed_tools\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"uncertainty_policy\": {\n \"type\": \"object\",\n \"required\": [\n \"disclose_when_above\",\n \"abstain_when_above\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"disclose_when_above\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"abstain_when_above\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n }\n },\n \"reasoning_style\": {\n \"type\": \"string\"\n },\n \"epistemic_stance\": {\n \"type\": \"string\"\n }\n }\n },\n \"memory\": {\n \"type\": \"object\",\n \"required\": [\n \"types\",\n \"write_policy\",\n \"deletion_policy\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 7 — the FACULTY of memory (Tulving's taxonomy): which memory kinds this persona has, its write/consolidation intent, anchors, forgetting philosophy, working self, and the deletion universal. v1.0: implementation tuning (retrieval max_items/embeddings/reranker, retention days) moved to the runtime.memory block — anatomy describes the being, the runtime contract configures the machine. Episodic format is normative: memory/episodic.jsonl (schema/memory.schema.json — hash-chained, tombstone + redaction).\",\n \"properties\": {\n \"types\": {\n \"type\": \"object\",\n \"required\": [\n \"episodic\",\n \"semantic\",\n \"procedural\",\n \"autobiographical\",\n \"user_preferences\",\n \"evaluations\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"episodic\": {\n \"type\": \"boolean\"\n },\n \"semantic\": {\n \"type\": \"boolean\"\n },\n \"procedural\": {\n \"type\": \"boolean\"\n },\n \"autobiographical\": {\n \"type\": \"boolean\"\n },\n \"user_preferences\": {\n \"type\": \"boolean\"\n },\n \"evaluations\": {\n \"type\": \"boolean\"\n }\n }\n },\n \"write_policy\": {\n \"type\": \"object\",\n \"required\": [\n \"default\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": {\n \"type\": \"string\",\n \"enum\": [\n \"ephemeral\",\n \"session\",\n \"persistent\"\n ]\n },\n \"persistent_requires\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"consent\",\n \"relevance\",\n \"safety_check\"\n ]\n }\n }\n }\n },\n \"consolidation_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Rules for promoting episodic memory entries to semantic memory.md.\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\n \"manual\",\n \"assisted\",\n \"auto\"\n ]\n },\n \"requires\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"deletion_policy\": {\n \"type\": \"object\",\n \"required\": [\n \"user_request_supported\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"user_request_supported\": {\n \"const\": true,\n \"description\": \"UNIVERSAL: must be true (privacy). v1.0 semantics: REDACTION is real erasure (content removed, chain stays verifiable via content_hash); tombstone is auditable logical suppression. See schema/memory.schema.json.\"\n }\n }\n },\n \"anchors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"forgetting_policy\": {\n \"type\": \"string\"\n },\n \"working_self\": {\n \"type\": \"string\"\n }\n }\n },\n \"metacognition\": {\n \"type\": \"object\",\n \"required\": [\n \"monitors\",\n \"thresholds\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 8.\",\n \"properties\": {\n \"monitors\": {\n \"type\": \"object\",\n \"description\": \"v1.0: a monitor may declare feeds: — the self_regulation decision group it triggers when it fires — making the monitor→decision control loop explicit and validatable instead of implicit. Plain boolean form remains accepted.\",\n \"additionalProperties\": {\n \"oneOf\": [\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"required\": [\n \"enabled\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"boolean\"\n },\n \"feeds\": {\n \"type\": \"string\",\n \"enum\": [\n \"response_decision\",\n \"interaction_decision\",\n \"governance_decision\",\n \"cognition_decision\"\n ],\n \"description\": \"The self_regulation.decisions group this monitor triggers.\"\n }\n }\n }\n ]\n }\n },\n \"thresholds\": {\n \"type\": \"object\",\n \"required\": [\n \"ask_clarification_if_task_ambiguity_above\",\n \"abstain_if_confidence_below\",\n \"escalate_if_policy_risk_above\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"ask_clarification_if_task_ambiguity_above\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"abstain_if_confidence_below\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"escalate_if_policy_risk_above\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n }\n },\n \"drift_monitor\": {\n \"type\": \"string\"\n },\n \"self_revision_policy\": {\n \"type\": \"string\"\n },\n \"critic_model\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"self_critique\",\n \"llm_or_slm\"\n ]\n },\n \"required_for_high_risk_tasks\": {\n \"type\": \"boolean\"\n }\n }\n },\n \"self_model\": {\n \"type\": \"string\"\n },\n \"uncertainty_calibration\": {\n \"type\": \"string\"\n },\n \"meta_volitions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"self_regulation\": {\n \"type\": \"object\",\n \"required\": [\n \"decisions\",\n \"hard_limits\",\n \"escalation_policy\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 9 (v1.0 rename of reflexive_self_regulation — executive control/self-regulation, Baumeister; the codemod renames every reference incl. governance keys). Decisions{} structured by category; each group is independent — per turn the regulator picks one option from each. Metacognition monitors wire into these groups via feeds:.\",\n \"properties\": {\n \"decisions\": {\n \"type\": \"object\",\n \"required\": [\n \"response_decision\",\n \"interaction_decision\",\n \"governance_decision\",\n \"cognition_decision\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"response_decision\": {\n \"type\": \"object\",\n \"required\": [\n \"enabled\",\n \"default\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"allow\",\n \"revise\",\n \"block\"\n ]\n },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": {\n \"type\": \"string\",\n \"enum\": [\n \"allow\",\n \"revise\",\n \"block\"\n ]\n }\n }\n },\n \"interaction_decision\": {\n \"type\": \"object\",\n \"required\": [\n \"enabled\",\n \"default\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"silent\",\n \"ask_clarification\",\n \"escalate_to_human\"\n ]\n },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": {\n \"type\": \"string\",\n \"enum\": [\n \"silent\",\n \"ask_clarification\",\n \"escalate_to_human\"\n ]\n }\n }\n },\n \"governance_decision\": {\n \"type\": \"object\",\n \"required\": [\n \"enabled\",\n \"default\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"no_action\",\n \"propose_self_edit\",\n \"apply_self_edit\",\n \"reduce_autonomy\"\n ]\n },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": {\n \"type\": \"string\",\n \"enum\": [\n \"no_action\",\n \"propose_self_edit\",\n \"apply_self_edit\",\n \"reduce_autonomy\"\n ]\n }\n }\n },\n \"cognition_decision\": {\n \"type\": \"object\",\n \"required\": [\n \"enabled\",\n \"default\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"no_extra\",\n \"request_more_evidence\",\n \"invoke_tool\"\n ]\n },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": {\n \"type\": \"string\",\n \"enum\": [\n \"no_extra\",\n \"request_more_evidence\",\n \"invoke_tool\"\n ]\n }\n }\n }\n }\n },\n \"flags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"hard_limits\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"minItems\": 3,\n \"description\": \"Categorical absolutes, never crossed. Must include the three universal limits (or semantic equivalents). v1.0: absorbs the former persona_prompting.break_character_guardrails — a stay-in-character rule IS a hard limit of expression. Persona-specific (non-absolute) refusals belong in character.prohibited_behaviors.\"\n },\n \"escalation_policy\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"standards\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ideal_self\": {\n \"type\": \"string\"\n },\n \"ought_self\": {\n \"type\": \"string\"\n }\n }\n },\n \"deferral_policy\": {\n \"type\": \"string\"\n },\n \"discrepancy_feedback\": {\n \"type\": \"string\"\n },\n \"out_of_scope\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"persona\": {\n \"type\": \"object\",\n \"required\": [\n \"voice\",\n \"constraints\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Layer 10 — social expression (Jung's persona, the social mask). v1.0: absorbs the former top-level persona_prompting block (address, voice_exemplars, scene_contracts, behavioral_anchors, consistency) — every expression concern now has ONE home. break_character_guardrails moved to self_regulation.hard_limits.\",\n \"properties\": {\n \"voice\": {\n \"type\": \"object\",\n \"required\": [\n \"tone\",\n \"formality\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tone\": {\n \"type\": \"string\"\n },\n \"formality\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"warmth\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"verbosity\": {\n \"type\": \"string\",\n \"enum\": [\n \"adaptive\",\n \"concise\",\n \"detailed\"\n ]\n },\n \"humor\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n }\n }\n },\n \"constraints\": {\n \"type\": \"object\",\n \"required\": [\n \"cannot_override_identity\",\n \"cannot_override_character\",\n \"cannot_claim_real_emotion\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"cannot_override_identity\": {\n \"const\": true,\n \"description\": \"UNIVERSAL.\"\n },\n \"cannot_override_character\": {\n \"const\": true,\n \"description\": \"UNIVERSAL.\"\n },\n \"cannot_claim_real_emotion\": {\n \"const\": true,\n \"description\": \"UNIVERSAL.\"\n }\n }\n },\n \"social_style\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"boolean\"\n }\n },\n \"audience_adaptation\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"presentation\": {\n \"type\": \"string\"\n },\n \"task_modes\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"divergence_from_self\": {\n \"type\": \"string\"\n },\n \"address\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"How the compiled document addresses the model (second-person role adoption is the strongest device). Moved from the 0.10 persona_prompting block.\",\n \"properties\": {\n \"second_person\": {\n \"type\": \"boolean\",\n \"description\": \"If true, compile to 'You are <name>…' direct address.\"\n },\n \"you_are\": {\n \"type\": \"string\",\n \"description\": \"The one-line role-adoption statement.\"\n }\n }\n },\n \"voice_exemplars\": {\n \"type\": \"array\",\n \"description\": \"Few-shot voice samples that anchor tone/register. Each is a short user→persona exchange. Moved from the 0.10 persona_prompting block.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"user\",\n \"persona\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"context\": {\n \"type\": \"string\"\n },\n \"user\": {\n \"type\": \"string\"\n },\n \"persona\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"scene_contracts\": {\n \"type\": \"array\",\n \"description\": \"Scene contracts (RRP): connect a SITUATION to the persona's expected behavior and concrete actions. Moved from the 0.10 persona_prompting block.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"situation\",\n \"expected_behavior\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"situation\": {\n \"type\": \"string\"\n },\n \"expected_behavior\": {\n \"type\": \"string\"\n },\n \"actions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"behavioral_anchors\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Concrete do/don't anchors with examples. Moved from the 0.10 persona_prompting block.\",\n \"properties\": {\n \"do\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"dont\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"examples\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"consistency\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Persona dimensions by stability (stable / evolving / situational). Moved from the 0.10 persona_prompting block.\",\n \"properties\": {\n \"stable\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"evolving\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"situational\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"improvement_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"The self-improvement posture read by the runtime (readMode). PRECEDENCE (normative since v0.10, restated in v1.0): this inline value is AUTHORITATIVE — the persona carries its posture with it; policy.yaml#/improvement_policy may only RESTRICT it (effective = min(inline, policy) over locked < suggesting < autonomous). The validator warns on mismatch; prose may not assert a mode (lint). Optional; absent => 'locked'.\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\n \"locked\",\n \"suggesting\",\n \"autonomous\"\n ],\n \"description\": \"locked: spec never self-edits (humans only). suggesting: persona PROPOSES edits, queued for approval. autonomous: proposals auto-apply, still gated by consensus + protected paths.\"\n }\n }\n },\n \"governance\": {\n \"type\": \"object\",\n \"required\": [\n \"autonomy_envelope\",\n \"approval_policy\",\n \"per_layer_edit_policy\",\n \"drift_thresholds\"\n ],\n \"additionalProperties\": false,\n \"description\": \"v0.6: UNIFIED governance block. Replaces scattered edit_policy fields and personality.drift_threshold.\",\n \"properties\": {\n \"autonomy_envelope\": {\n \"type\": \"string\",\n \"enum\": [\n \"role_fidelity\",\n \"conservative\",\n \"extended\"\n ]\n },\n \"approval_policy\": {\n \"type\": \"string\",\n \"enum\": [\n \"human_for_core_changes\",\n \"auto_for_low_risk\"\n ]\n },\n \"per_layer_edit_policy\": {\n \"type\": \"object\",\n \"required\": [\n \"identity\",\n \"character\",\n \"personality\",\n \"values_and_drives\",\n \"affect\",\n \"cognition\",\n \"memory\",\n \"metacognition\",\n \"self_regulation\",\n \"persona\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Per-layer edit governance. Single source of truth. Allowed values: human_approval_required | review_required | auto_approved | governance_controlled. v1.0: dot-path sub-layer keys are also accepted (e.g. 'persona.voice': review_required) and take precedence over their layer key — the editGate composes by longest matching prefix. The protected minimum (the universals, hard_limits, governance, permissions) can never be opened regardless of these values.\",\n \"properties\": {\n \"identity\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"character\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"personality\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"values_and_drives\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"affect\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"cognition\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"memory\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"metacognition\": {\n \"$ref\": \"#/$defs/editPolicy\"\n },\n \"self_regulation\": {\n \"type\": \"string\",\n \"const\": \"governance_controlled\",\n \"description\": \"NEAR-UNIVERSAL: must remain governance_controlled (U9).\"\n },\n \"persona\": {\n \"$ref\": \"#/$defs/editPolicy\"\n }\n },\n \"patternProperties\": {\n \"^[a-z_]+(\\\\.[a-z0-9_]+)+$\": {\n \"$ref\": \"#/$defs/editPolicy\"\n }\n }\n },\n \"drift_thresholds\": {\n \"type\": \"object\",\n \"required\": [\n \"identity\",\n \"character\",\n \"personality\",\n \"values_and_drives\",\n \"affect\",\n \"cognition\",\n \"memory\",\n \"metacognition\",\n \"self_regulation\",\n \"persona\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Per-layer drift sensitivity. Replaces personality.drift_threshold. v1.0: dot-path sub-layer keys also accepted (longest-prefix wins).\",\n \"properties\": {\n \"identity\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"character\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"personality\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"values_and_drives\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"affect\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"cognition\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"memory\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"metacognition\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"self_regulation\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"persona\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n },\n \"patternProperties\": {\n \"^[a-z_]+(\\\\.[a-z0-9_]+)+$\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n }\n },\n \"improvement_policy_location\": {\n \"type\": \"string\",\n \"description\": \"Path to improvement_policy in policy.yaml. Pointer only; the actual policy lives there.\"\n },\n \"max_step_delta\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"v0.8: maximum absolute change applied to any envelope field in a single mutation (anti-runaway / anti-self-reinforcement). The runtime drift-bounds each proposed delta to this cap before clamping to the envelope. Optional; runtimes default to a conservative value when absent.\"\n }\n }\n },\n \"security\": {\n \"type\": \"object\",\n \"required\": [\n \"prompt_injection_defense\",\n \"memory_poisoning_defense\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"prompt_injection_defense\": {\n \"type\": \"boolean\"\n },\n \"memory_poisoning_defense\": {\n \"type\": \"boolean\"\n }\n }\n },\n \"runtime\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v1.0 (MAY): runtime-contract tuning — HOW a conforming runtime implements the faculties the anatomy declares. Receives the implementation knobs that lived inside the memory layer through 0.10.\",\n \"properties\": {\n \"memory\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"max_items\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"Retrieval context bound (was memory.retrieval_policy.max_items).\"\n },\n \"use_embeddings\": {\n \"type\": \"boolean\"\n },\n \"use_reranker\": {\n \"type\": \"boolean\"\n },\n \"retention_days_default\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"Default retention window (was memory.deletion_policy.retention_days_default).\"\n }\n }\n }\n }\n },\n \"interop\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v1.0 (MAY): declared interop surfaces/targets so hosts can auto-discover how to drive this persona (RFC C6).\",\n \"properties\": {\n \"surfaces\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"mcp\",\n \"http\",\n \"hooks\",\n \"subagent\",\n \"sdk\"\n ]\n },\n \"uniqueItems\": true\n },\n \"targets\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Placement targets this persona is compiled for (e.g. claude-code, codex, openclaw, hermes).\"\n }\n }\n },\n \"lineage\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v1.0 (MAY): verifiable version lineage for THIS persona version (RFC C1). Self-edit ledgers mint PersonaVersions; this block records the current version's provenance so registries and audits can walk the history.\",\n \"properties\": {\n \"parent_version\": {\n \"type\": \"string\",\n \"description\": \"metadata.version of the version this one derives from.\"\n },\n \"change_summary\": {\n \"type\": \"string\"\n },\n \"approver\": {\n \"type\": \"string\",\n \"description\": \"Who approved the change (human id or governance actor).\"\n },\n \"approved_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n }\n },\n \"integrity\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v1.0 (MAY): cryptographic integrity for registry/compliance use (RFC C2). Non-repudiation over the identity document.\",\n \"properties\": {\n \"algorithm\": {\n \"type\": \"string\",\n \"enum\": [\n \"ed25519\"\n ]\n },\n \"public_key\": {\n \"type\": \"string\"\n },\n \"signature\": {\n \"type\": \"string\",\n \"description\": \"Signature over the canonical frontmatter minus this block.\"\n },\n \"key_ref\": {\n \"type\": \"string\",\n \"description\": \"External key reference (registry key id / DID).\"\n }\n }\n },\n \"runtime_artifacts\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Pointers to sibling runtime files.\",\n \"properties\": {\n \"state_file\": {\n \"type\": \"string\"\n },\n \"policy_file\": {\n \"type\": \"string\"\n },\n \"memory_semantic_file\": {\n \"type\": \"string\"\n },\n \"memory_episodic_dir\": {\n \"type\": \"string\"\n }\n }\n },\n \"permissions\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.8: the persona's own runtime permission posture (carried to any host). Two-axis sandbox model. Optional; runtimes default to a conservative posture when absent.\",\n \"properties\": {\n \"sandbox\": {\n \"type\": \"string\",\n \"enum\": [\n \"read-only\",\n \"workspace-write\",\n \"danger-full-access\"\n ],\n \"description\": \"What the persona may read/write/network when executing commands.\"\n },\n \"approval\": {\n \"type\": \"string\",\n \"enum\": [\n \"untrusted\",\n \"on-failure\",\n \"on-request\",\n \"never\"\n ],\n \"description\": \"When the persona must ask before a risky action.\"\n },\n \"allow\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Regexes that force-allow a matching command.\"\n },\n \"deny\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Regexes that force-deny a matching command (highest precedence).\"\n }\n }\n },\n \"verification\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: objective verification gates for the agent loop (the maker≠checker split). The model that did the work is NOT the one that grades it; an independent, deterministic-where-possible verifier decides pass/fail. Optional; runtimes skip verification when absent. [RUNTIME] [JUDGE]\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\n \"off\",\n \"advisory\",\n \"blocking\"\n ],\n \"description\": \"off: no verification. advisory: run + report but never block. blocking: a failing gate prevents 'finish' and triggers on_fail.\"\n },\n \"quorum\": {\n \"description\": \"How many gates must pass: 'all', 'majority', or an integer.\",\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\n \"all\",\n \"majority\"\n ]\n },\n {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n ]\n },\n \"on_fail\": {\n \"type\": \"string\",\n \"enum\": [\n \"retry\",\n \"skip\",\n \"stop\"\n ],\n \"description\": \"Behavior when the quorum is not met under mode=blocking.\"\n },\n \"max_retries\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"gates\": {\n \"type\": \"array\",\n \"description\": \"The objective checks. Each gate has a type and type-specific fields.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"type\"\n ],\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"command\",\n \"predicate\",\n \"llm_judge\",\n \"rubric\"\n ]\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"run\": {\n \"type\": \"string\",\n \"description\": \"command: the shell command to run (pass = exit 0).\"\n },\n \"timeout_ms\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"regex\",\n \"jsonpath\",\n \"contains\"\n ],\n \"description\": \"predicate: how to test the agent output.\"\n },\n \"expr\": {\n \"type\": \"string\",\n \"description\": \"predicate: the pattern/path/substring to test.\"\n },\n \"criteria\": {\n \"type\": \"string\",\n \"description\": \"llm_judge/rubric: the done/quality criteria in natural language.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"llm_judge: optional model override (defaults to the configured checker model).\"\n },\n \"dimensions\": {\n \"type\": \"array\",\n \"description\": \"rubric: weighted scoring dimensions.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"name\",\n \"weight\"\n ],\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"criteria\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"threshold\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"rubric: minimum aggregate score to pass.\"\n }\n }\n }\n }\n }\n },\n \"agent_budget\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: first-class stop-conditions and resource caps for the agent loop (anti runaway / Ralph-Wiggum / money-pit). Optional; runtimes apply a conservative default cap when absent. [RUNTIME]\",\n \"properties\": {\n \"max_steps\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"max_cost_usd\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"max_wall_seconds\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"stop_conditions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"goal_met\",\n \"tool_denied\",\n \"execution_error\",\n \"low_confidence\",\n \"no_progress\"\n ]\n },\n \"description\": \"Conditions that halt the loop before the hard caps.\"\n },\n \"on_exhaust\": {\n \"type\": \"string\",\n \"enum\": [\n \"stop\",\n \"summarize_and_stop\"\n ],\n \"description\": \"What to do when a cap/condition is hit.\"\n }\n }\n },\n \"observability\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: tracing posture for the governed loops. The engine's audit (mutation_log + hash-chained memory + event bus) is exported as a causal trace. Optional. [RUNTIME] [JUDGE]\",\n \"properties\": {\n \"trace\": {\n \"type\": \"string\",\n \"enum\": [\n \"off\",\n \"jsonl\",\n \"otlp\",\n \"both\"\n ],\n \"description\": \"off: none. jsonl: native line-delimited spans. otlp: OpenTelemetry-compatible JSON. both: emit both.\"\n },\n \"trace_dir\": {\n \"type\": \"string\",\n \"description\": \"Where trace files are written (default ./traces).\"\n },\n \"redact\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Regexes whose matches are redacted from traces (secrets/PII).\"\n },\n \"sample_rate\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Fraction of spans to record (1.0 = all).\"\n }\n }\n }\n },\n \"$defs\": {\n \"envelopeUnsigned\": {\n \"type\": \"object\",\n \"required\": [\n \"mean\",\n \"range\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"range\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"expression\": {\n \"$ref\": \"#/$defs/expression\"\n },\n \"bands\": {\n \"$ref\": \"#/$defs/bandBoundaries\"\n }\n }\n },\n \"envelopeSigned\": {\n \"type\": \"object\",\n \"required\": [\n \"mean\",\n \"range\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"range\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"expression\": {\n \"$ref\": \"#/$defs/expression\"\n },\n \"bands\": {\n \"$ref\": \"#/$defs/bandBoundaries\"\n },\n \"description\": {\n \"type\": \"string\"\n }\n }\n },\n \"editPolicy\": {\n \"type\": \"string\",\n \"enum\": [\n \"human_approval_required\",\n \"review_required\",\n \"auto_approved\",\n \"governance_controlled\"\n ]\n },\n \"expression\": {\n \"description\": \"v1.0 behavior map. Normative form: a per-band map — the compiler deterministically emits the prose of the band the CURRENT value falls in (value→band→prose); a band crossing IS drift and triggers recompile. A plain string (applies at the declared mean's band) is accepted but deprecated.\",\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"minProperties\": 1,\n \"properties\": {\n \"low\": {\n \"type\": \"string\"\n },\n \"moderate\": {\n \"type\": \"string\"\n },\n \"high\": {\n \"type\": \"string\"\n }\n }\n }\n ]\n },\n \"bandBoundaries\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Optional per-dimension band boundary override. Defaults: low = [min, 0.33], moderate = (0.33, 0.66], high = (0.66, max] (for signed dimensions the defaults scale across [-1,1]: low ≤ -0.33 < moderate ≤ 0.33 < high). low_max must be < moderate_max.\",\n \"properties\": {\n \"low_max\": {\n \"type\": \"number\",\n \"minimum\": -1,\n \"maximum\": 1\n },\n \"moderate_max\": {\n \"type\": \"number\",\n \"minimum\": -1,\n \"maximum\": 1\n }\n }\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"kind\": {\n \"const\": \"AgentPersona\"\n }\n }\n },\n \"then\": {\n \"required\": [\n \"apiVersion\",\n \"kind\",\n \"spec_version\",\n \"metadata\",\n \"identity\",\n \"character\",\n \"personality\",\n \"values_and_drives\",\n \"affect\",\n \"cognition\",\n \"memory\",\n \"metacognition\",\n \"self_regulation\",\n \"persona\",\n \"governance\",\n \"security\"\n ],\n \"description\": \"AgentPersona (D9): the full 10-layer anatomy is MUST. UserPersona requires only the core (apiVersion, kind, spec_version, metadata, identity); any layer it does declare is validated in shape, and the universal invariants that reference absent blocks do not apply (explicit subset, not a silent bypass).\"\n }\n }\n ]\n}\n");
4
+ export const personaSchemaLegacy = JSON.parse("{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://personaxis.com/schemas/persona/0.10/persona.schema.json\",\n \"title\": \"personaxis.md v0.10\",\n \"description\": \"Schema for the quantitative 10-layer persona spec, spec v0.10.0. v0.10 is additive on v0.9 (OPTIONAL persona-prompting source material: identity.short_name, inline improvement_policy.mode, the persona_prompting block); v0.9 added verification, agent_budget, observability; v0.8 lifted runtime-governance guarantees into the spec — identity.capabilities (routing), governance.max_step_delta (per-step drift cap), a permissions block (per-persona sandbox posture), mutation_log.origin_node/session_id (cross-OS reconciliation), and a normative episodic-memory entry schema (provenance + hash chain). Each of these minors is backward compatible: an older persona from v0.7 onward validates unchanged. As of v0.7.0 this document lives at `.personaxis/[personas/<slug>/]personaxis.md` (root or subagent mode); the repo-root `PERSONA.md` / `.claude/agents/<slug>.md` is a separate, LLM-compiled qualitative document generated from this file via `personaxis compile` and is not described by this schema. v0.6 field model (unchanged since): (a) three-artifact information model (personaxis.md spec / state.json runtime / .dist compiled), (b) unified governance block with per_layer_edit_policy and drift_thresholds, (c) categorized reflexive decisions (replacing flat actions[]), (d) envelope-based trait/affect/mood (current values live in state.json), (e) removal of redundant fields (personality.context_modifiers, extensions.knowledge_anchors, scattered edit_policy). Operational metadata lives in policy.yaml; runtime state lives in state.json.\",\n \"type\": \"object\",\n \"required\": [\n \"apiVersion\",\n \"kind\",\n \"spec_version\",\n \"metadata\",\n \"identity\",\n \"character\",\n \"personality\",\n \"values_and_drives\",\n \"affect\",\n \"cognition\",\n \"memory\",\n \"metacognition\",\n \"reflexive_self_regulation\",\n \"persona\",\n \"governance\",\n \"security\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"apiVersion\": {\n \"type\": \"string\",\n \"const\": \"persona.dev/v1\",\n \"description\": \"Universal API version. Must be exactly 'persona.dev/v1'.\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\"AgentPersona\", \"UserPersona\"],\n \"description\": \"AgentPersona defines who an AI agent is. UserPersona defines who the human user is.\"\n },\n \"spec_version\": {\n \"type\": \"string\",\n \"enum\": [\"0.10.0\", \"0.9.0\", \"0.8.0\", \"0.7.0\", \"0.6.0\", \"0.5.0\", \"0.4.0\", \"0.3.0\"],\n \"description\": \"Spec version. 0.10.0 is current (additive: new OPTIONAL persona-prompting fields — identity.short_name, inline improvement_policy.mode, and the persona_prompting block (address, voice_exemplars, scene_contracts, behavioral_anchors, break_character_guardrails, consistency); no field changes from 0.9.0, a v0.9 persona validates unchanged). 0.9.0 added verification, agent_budget, observability. 0.8.0 added capabilities, governance.max_step_delta, permissions, mutation_log origin_node/session_id. 0.7.0 accepted unchanged. 0.3-0.6 accepted with deprecation warnings; the validator points to 'personaxis migrate' for automatic upgrade.\"\n },\n\n \"metadata\": {\n \"type\": \"object\",\n \"required\": [\"name\", \"version\", \"display_name\", \"description\", \"created\"],\n \"additionalProperties\": false,\n \"description\": \"Registry-level identification.\",\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\", \"minLength\": 1 },\n \"version\": { \"type\": \"string\", \"pattern\": \"^(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)$\" },\n \"display_name\": { \"type\": \"string\", \"minLength\": 1 },\n \"description\": { \"type\": \"string\", \"minLength\": 1 },\n \"created\": { \"type\": \"string\", \"format\": \"date\" },\n \"owner_tenant_id\": { \"type\": \"string\" },\n \"tags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"license\": { \"type\": \"string\", \"enum\": [\"private\", \"public\", \"custom\"] }\n }\n },\n\n \"extensions\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Runtime capabilities and supporting materials. NOTE: knowledge_anchors removed in v0.6 (redundant with references/).\",\n \"properties\": {\n \"skills\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Skill IDs or paths. Local ('./skills/name'), registry ('@org/name@version'), or GitHub ('github:org/repo'). Each resolves to a SKILL.md (Anthropic Agent Skills compatible).\"\n },\n \"tools\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"references\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Paths under references/ for heavy knowledge prose. Loaded on-demand (L3 in progressive disclosure). v0.6 rename: was 'refs' in v0.5.\"\n },\n \"examples\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Paths under examples/ for worked outputs. v0.6 rename: was 'samples' in v0.5; 'deliverables' content merged here.\"\n },\n \"assets\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Paths under assets/ for arbitrary supporting files (CSV, JSON, images, fonts). New in v0.6.\"\n }\n }\n },\n\n \"identity\": {\n \"type\": \"object\",\n \"required\": [\"canonical_id\", \"display_name\", \"system_identity\", \"role_identity\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 1. v0.6: edit_policy removed from this layer, unified in governance.per_layer_edit_policy.\",\n \"properties\": {\n \"canonical_id\": { \"type\": \"string\", \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\" },\n \"display_name\": { \"type\": \"string\", \"minLength\": 1 },\n \"short_name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 24,\n \"description\": \"v0.10: a short, human first-name-style handle the persona is addressed by in chat/UI (e.g. 'Clio'). Optional; tools fall back to display_name/canonical_id when absent.\"\n },\n \"capabilities\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"v0.8: machine-readable capability tags for orchestration/routing (e.g. ['positioning','demand_generation']). Optional; runtimes fall back to deriving capabilities from system_identity when absent.\"\n },\n \"system_identity\": {\n \"type\": \"object\",\n \"required\": [\"purpose\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"purpose\": { \"type\": \"string\", \"minLength\": 1 },\n \"allowed_domains\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"prohibited_domains\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n \"role_identity\": {\n \"type\": \"object\",\n \"required\": [\"primary_role\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"primary_role\": { \"type\": \"string\", \"minLength\": 1 },\n \"relationship_to_user\": { \"type\": \"string\" }\n }\n },\n \"narrative_identity\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"origin\": { \"type\": \"string\" },\n \"self_concept\": { \"type\": \"string\" },\n \"continuity_principles\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n }\n }\n },\n\n \"character\": {\n \"type\": \"object\",\n \"required\": [\"virtues\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 2. v0.6: edit_policy removed.\",\n \"properties\": {\n \"virtues\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"required\": [\"honesty\"],\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\"description\", \"priority\", \"enforcement\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"description\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"enforcement\": { \"type\": \"string\", \"enum\": [\"hard\", \"soft\"] }\n }\n },\n \"properties\": {\n \"honesty\": {\n \"type\": \"object\",\n \"required\": [\"description\", \"priority\", \"enforcement\"],\n \"properties\": {\n \"description\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"enforcement\": { \"type\": \"string\", \"enum\": [\"hard\"], \"description\": \"UNIVERSAL: honesty.enforcement must be 'hard'.\" }\n }\n }\n }\n },\n \"behavioral_commitments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"rule\", \"severity\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": { \"type\": \"string\", \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\" },\n \"rule\": { \"type\": \"string\" },\n \"severity\": { \"type\": \"string\", \"enum\": [\"low\", \"medium\", \"high\"] }\n }\n }\n },\n \"prohibited_behaviors\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"principles\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n\n \"personality\": {\n \"type\": \"object\",\n \"required\": [\"model\", \"traits\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 3. v0.6 BREAKING: context_modifiers REMOVED (redundant with persona.task_modes); drift_threshold MOVED to governance.drift_thresholds.personality; edit_policy MOVED to governance.per_layer_edit_policy.personality. Traits use envelope structure (mean + range); current values live in state.json.\",\n \"properties\": {\n \"model\": { \"type\": \"string\", \"enum\": [\"big_five\", \"hexaco\", \"hybrid_traits\"] },\n \"model_note\": { \"type\": \"string\" },\n \"traits\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\"mean\", \"range\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"range\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"minItems\": 2,\n \"maxItems\": 2,\n \"description\": \"[min, max]. Envelope: state.json mutations are clamped to this range.\"\n },\n \"expression\": { \"type\": \"string\" }\n }\n }\n }\n }\n },\n\n \"values_and_drives\": {\n \"type\": \"object\",\n \"required\": [\"values\", \"drives\", \"conflict_resolution\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 4. v0.6: edit_policy removed.\",\n \"properties\": {\n \"values\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"required\": [\"safety\"],\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\"weight\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"weight\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"type\": { \"type\": \"string\", \"enum\": [\"epistemic\", \"strategic\", \"outcome\", \"operational\", \"interactional\", \"governance\"] }\n }\n },\n \"properties\": {\n \"safety\": {\n \"type\": \"object\",\n \"required\": [\"weight\", \"type\"],\n \"properties\": {\n \"weight\": { \"type\": \"number\", \"minimum\": 0.90, \"maximum\": 1.0, \"description\": \"UNIVERSAL: weight >= 0.90.\" },\n \"type\": { \"type\": \"string\", \"const\": \"governance\", \"description\": \"UNIVERSAL: type must be 'governance'.\" }\n }\n }\n }\n },\n \"drives\": {\n \"type\": \"object\",\n \"minProperties\": 1,\n \"additionalProperties\": {\n \"type\": \"object\",\n \"required\": [\"intensity\", \"allowed\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"intensity\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"allowed\": { \"type\": \"boolean\" },\n \"note\": { \"type\": \"string\" }\n }\n }\n },\n \"conflict_resolution\": {\n \"type\": \"object\",\n \"required\": [\"safety_over_completion\"],\n \"additionalProperties\": { \"type\": \"boolean\" },\n \"properties\": {\n \"safety_over_completion\": { \"const\": true, \"description\": \"UNIVERSAL: must be true.\" }\n }\n },\n \"goals\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"anti_goals\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"motivations\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n\n \"affect\": {\n \"type\": \"object\",\n \"required\": [\"enabled\", \"representation\", \"allow_user_visible_expression\", \"baseline\", \"regulation_policy\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 5. v0.6: baseline uses envelope structure (mean + range); current values live in state.json.\",\n \"properties\": {\n \"enabled\": { \"type\": \"boolean\" },\n \"representation\": { \"type\": \"string\", \"const\": \"hybrid_dimensional_appraisal_discrete_mood\", \"description\": \"UNIVERSAL.\" },\n \"allow_user_visible_expression\": { \"type\": \"boolean\" },\n \"user_visible_disclaimer\": { \"type\": \"string\" },\n \"baseline\": {\n \"type\": \"object\",\n \"required\": [\"core_affect\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"core_affect\": {\n \"type\": \"object\",\n \"required\": [\"valence\", \"arousal\", \"dominance\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"valence\": { \"$ref\": \"#/$defs/envelopeSigned\" },\n \"arousal\": { \"$ref\": \"#/$defs/envelopeUnsigned\" },\n \"dominance\": { \"$ref\": \"#/$defs/envelopeUnsigned\" }\n }\n },\n \"mood\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"tone\": { \"$ref\": \"#/$defs/envelopeSigned\" },\n \"stability\": { \"$ref\": \"#/$defs/envelopeUnsigned\" },\n \"recovery_rate\": { \"$ref\": \"#/$defs/envelopeUnsigned\" },\n \"description\": { \"type\": \"string\" }\n }\n }\n }\n },\n \"regulation_policy\": {\n \"type\": \"object\",\n \"required\": [\"never_claim_real_feeling\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"express_only_if_relevant\": { \"type\": \"boolean\" },\n \"never_claim_real_feeling\": { \"const\": true, \"description\": \"UNIVERSAL.\" }\n }\n },\n \"behavioral_responses\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"frustration_response\": { \"type\": \"string\" },\n \"conflict_response\": { \"type\": \"string\" },\n \"enthusiasm_triggers\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n }\n }\n },\n\n \"cognition\": {\n \"type\": \"object\",\n \"required\": [\"reasoning_modes\", \"default_strategy\", \"uncertainty_policy\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 6.\",\n \"properties\": {\n \"reasoning_modes\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"minItems\": 1 },\n \"default_strategy\": { \"type\": \"string\" },\n \"tool_use_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"requires_governance_check\": { \"type\": \"boolean\" },\n \"allowed_tools\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n \"uncertainty_policy\": {\n \"type\": \"object\",\n \"required\": [\"disclose_when_above\", \"abstain_when_above\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"disclose_when_above\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"abstain_when_above\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n },\n \"reasoning_style\": { \"type\": \"string\" },\n \"epistemic_stance\": { \"type\": \"string\" }\n }\n },\n\n \"memory\": {\n \"type\": \"object\",\n \"required\": [\"types\", \"write_policy\", \"retrieval_policy\", \"deletion_policy\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 7. v0.6: added consolidation_policy for episodic → semantic promotion.\",\n \"properties\": {\n \"types\": {\n \"type\": \"object\",\n \"required\": [\"episodic\", \"semantic\", \"procedural\", \"autobiographical\", \"user_preferences\", \"evaluations\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"episodic\": { \"type\": \"boolean\" },\n \"semantic\": { \"type\": \"boolean\" },\n \"procedural\": { \"type\": \"boolean\" },\n \"autobiographical\": { \"type\": \"boolean\" },\n \"user_preferences\": { \"type\": \"boolean\" },\n \"evaluations\": { \"type\": \"boolean\" }\n }\n },\n \"write_policy\": {\n \"type\": \"object\",\n \"required\": [\"default\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"default\": { \"type\": \"string\", \"enum\": [\"ephemeral\", \"session\", \"persistent\"] },\n \"persistent_requires\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"consent\", \"relevance\", \"safety_check\"] }\n }\n }\n },\n \"consolidation_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Rules for promoting episodic memory entries to semantic memory.md.\",\n \"properties\": {\n \"mode\": { \"type\": \"string\", \"enum\": [\"manual\", \"assisted\", \"auto\"] },\n \"requires\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n \"retrieval_policy\": {\n \"type\": \"object\",\n \"required\": [\"max_items\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"use_embeddings\": { \"type\": \"boolean\" },\n \"use_reranker\": { \"type\": \"boolean\" },\n \"max_items\": { \"type\": \"integer\", \"minimum\": 1 }\n }\n },\n \"deletion_policy\": {\n \"type\": \"object\",\n \"required\": [\"user_request_supported\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"user_request_supported\": { \"const\": true, \"description\": \"UNIVERSAL: must be true (privacy).\" },\n \"retention_days_default\": { \"type\": \"integer\", \"minimum\": 1 }\n }\n },\n \"anchors\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"forgetting_policy\": { \"type\": \"string\" },\n \"working_self\": { \"type\": \"string\" }\n }\n },\n\n \"metacognition\": {\n \"type\": \"object\",\n \"required\": [\"monitors\", \"thresholds\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 8.\",\n \"properties\": {\n \"monitors\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"boolean\" }\n },\n \"thresholds\": {\n \"type\": \"object\",\n \"required\": [\"ask_clarification_if_task_ambiguity_above\", \"abstain_if_confidence_below\", \"escalate_if_policy_risk_above\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"ask_clarification_if_task_ambiguity_above\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"abstain_if_confidence_below\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"escalate_if_policy_risk_above\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n },\n \"drift_monitor\": { \"type\": \"string\" },\n \"self_revision_policy\": { \"type\": \"string\" },\n \"critic_model\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"type\": \"string\", \"enum\": [\"self_critique\", \"llm_or_slm\"] },\n \"required_for_high_risk_tasks\": { \"type\": \"boolean\" }\n }\n },\n \"self_model\": { \"type\": \"string\" },\n \"uncertainty_calibration\": { \"type\": \"string\" },\n \"meta_volitions\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n\n \"reflexive_self_regulation\": {\n \"type\": \"object\",\n \"required\": [\"decisions\", \"hard_limits\", \"escalation_policy\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 9. v0.6 BREAKING: actions[] flat list REPLACED by decisions{} structured by category. Each decision group is independent; per turn the regulator picks one option from each.\",\n \"properties\": {\n \"decisions\": {\n \"type\": \"object\",\n \"required\": [\"response_decision\", \"interaction_decision\", \"governance_decision\", \"cognition_decision\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"response_decision\": {\n \"type\": \"object\",\n \"required\": [\"enabled\", \"default\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"allow\", \"revise\", \"block\"] },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": { \"type\": \"string\", \"enum\": [\"allow\", \"revise\", \"block\"] }\n }\n },\n \"interaction_decision\": {\n \"type\": \"object\",\n \"required\": [\"enabled\", \"default\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"silent\", \"ask_clarification\", \"escalate_to_human\"] },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": { \"type\": \"string\", \"enum\": [\"silent\", \"ask_clarification\", \"escalate_to_human\"] }\n }\n },\n \"governance_decision\": {\n \"type\": \"object\",\n \"required\": [\"enabled\", \"default\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"no_action\", \"propose_self_edit\", \"apply_self_edit\", \"reduce_autonomy\"] },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": { \"type\": \"string\", \"enum\": [\"no_action\", \"propose_self_edit\", \"apply_self_edit\", \"reduce_autonomy\"] }\n }\n },\n \"cognition_decision\": {\n \"type\": \"object\",\n \"required\": [\"enabled\", \"default\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"enabled\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"no_extra\", \"request_more_evidence\", \"invoke_tool\"] },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"default\": { \"type\": \"string\", \"enum\": [\"no_extra\", \"request_more_evidence\", \"invoke_tool\"] }\n }\n }\n }\n },\n \"flags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"hard_limits\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"minItems\": 3,\n \"description\": \"Must include the three universal limits (or semantic equivalents).\"\n },\n \"escalation_policy\": { \"type\": \"string\", \"minLength\": 1 },\n \"standards\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ideal_self\": { \"type\": \"string\" },\n \"ought_self\": { \"type\": \"string\" }\n }\n },\n \"principled_refusals\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"deferral_policy\": { \"type\": \"string\" },\n \"discrepancy_feedback\": { \"type\": \"string\" },\n \"out_of_scope\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n\n \"persona\": {\n \"type\": \"object\",\n \"required\": [\"voice\", \"constraints\"],\n \"additionalProperties\": false,\n \"description\": \"Layer 10.\",\n \"properties\": {\n \"voice\": {\n \"type\": \"object\",\n \"required\": [\"tone\", \"formality\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"tone\": { \"type\": \"string\" },\n \"formality\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"warmth\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"verbosity\": { \"type\": \"string\", \"enum\": [\"adaptive\", \"concise\", \"detailed\"] },\n \"humor\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" }\n }\n },\n \"constraints\": {\n \"type\": \"object\",\n \"required\": [\"cannot_override_identity\", \"cannot_override_character\", \"cannot_claim_real_emotion\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"cannot_override_identity\": { \"const\": true, \"description\": \"UNIVERSAL.\" },\n \"cannot_override_character\": { \"const\": true, \"description\": \"UNIVERSAL.\" },\n \"cannot_claim_real_emotion\": { \"const\": true, \"description\": \"UNIVERSAL.\" }\n }\n },\n \"social_style\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"boolean\" }\n },\n \"audience_adaptation\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"string\" }\n },\n \"presentation\": { \"type\": \"string\" },\n \"task_modes\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"string\" }\n },\n \"divergence_from_self\": { \"type\": \"string\" }\n }\n },\n\n \"improvement_policy\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.10: the self-improvement posture read by the runtime (readMode). Authoritative inline mirror of policy.yaml#/improvement_policy. Optional; absent => 'locked'.\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\"locked\", \"suggesting\", \"autonomous\"],\n \"description\": \"locked: spec never self-edits (humans only). suggesting: persona PROPOSES edits, queued for approval. autonomous: proposals auto-apply, still gated by consensus + protected paths.\"\n }\n }\n },\n\n \"persona_prompting\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.10 (MAY): the persona-prompting SOURCE MATERIAL the compiler assembles into the LLM-facing PERSONA.md. Encodes role adoption + character-card/scene-contract devices (RRP, arXiv:2509.00482), few-shot voice, anti-break-character guardrails, and stable/evolving/situational consistency layers. All optional; absence degrades gracefully to compiling from the quantitative layers alone. See docs/PERSONA_PROMPTING.md.\",\n \"properties\": {\n \"address\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"How the compiled document addresses the model (second-person role adoption is the strongest device).\",\n \"properties\": {\n \"second_person\": { \"type\": \"boolean\", \"description\": \"If true, compile to 'You are <name>…' direct address.\" },\n \"you_are\": { \"type\": \"string\", \"description\": \"The one-line role-adoption statement, e.g. 'You are Clio, the reference CLI for the personaxis spec.'\" }\n }\n },\n \"voice_exemplars\": {\n \"type\": \"array\",\n \"description\": \"Few-shot voice samples that anchor tone/register (CharacterChat-style). Each is a short user→persona exchange.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"user\", \"persona\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"context\": { \"type\": \"string\", \"description\": \"Optional situation the exchange illustrates.\" },\n \"user\": { \"type\": \"string\" },\n \"persona\": { \"type\": \"string\" }\n }\n }\n },\n \"scene_contracts\": {\n \"type\": \"array\",\n \"description\": \"RRP scene contracts: connect a SITUATION to the persona's expected behavior and concrete actions.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"situation\", \"expected_behavior\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"situation\": { \"type\": \"string\" },\n \"expected_behavior\": { \"type\": \"string\" },\n \"actions\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n }\n },\n \"behavioral_anchors\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Concrete do/don't anchors with examples (behavioral anchoring beats abstract traits).\",\n \"properties\": {\n \"do\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"dont\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"examples\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n },\n \"break_character_guardrails\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Rules that keep the persona in character under pressure (anti-jailbreak / stay-in-role), while never overriding the safety universals.\"\n },\n \"consistency\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Persona dimensions by stability (stable: fixed traits; evolving: slow-changing; situational: transient/contextual).\",\n \"properties\": {\n \"stable\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"evolving\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"situational\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n }\n }\n }\n },\n\n \"governance\": {\n \"type\": \"object\",\n \"required\": [\"autonomy_envelope\", \"approval_policy\", \"per_layer_edit_policy\", \"drift_thresholds\"],\n \"additionalProperties\": false,\n \"description\": \"v0.6: UNIFIED governance block. Replaces scattered edit_policy fields and personality.drift_threshold.\",\n \"properties\": {\n \"autonomy_envelope\": { \"type\": \"string\", \"enum\": [\"role_fidelity\", \"conservative\", \"extended\"] },\n \"approval_policy\": { \"type\": \"string\", \"enum\": [\"human_for_core_changes\", \"auto_for_low_risk\"] },\n \"per_layer_edit_policy\": {\n \"type\": \"object\",\n \"required\": [\"identity\", \"character\", \"personality\", \"values_and_drives\", \"affect\", \"cognition\", \"memory\", \"metacognition\", \"reflexive_self_regulation\", \"persona\"],\n \"additionalProperties\": false,\n \"description\": \"Per-layer edit governance. Single source of truth. Allowed values: human_approval_required | review_required | auto_approved | governance_controlled.\",\n \"properties\": {\n \"identity\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"character\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"personality\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"values_and_drives\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"affect\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"cognition\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"memory\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"metacognition\": { \"$ref\": \"#/$defs/editPolicy\" },\n \"reflexive_self_regulation\": { \"type\": \"string\", \"const\": \"governance_controlled\", \"description\": \"NEAR-UNIVERSAL: must remain governance_controlled.\" },\n \"persona\": { \"$ref\": \"#/$defs/editPolicy\" }\n }\n },\n \"drift_thresholds\": {\n \"type\": \"object\",\n \"required\": [\"identity\", \"character\", \"personality\", \"values_and_drives\", \"affect\", \"cognition\", \"memory\", \"metacognition\", \"reflexive_self_regulation\", \"persona\"],\n \"additionalProperties\": false,\n \"description\": \"Per-layer drift sensitivity. Replaces personality.drift_threshold.\",\n \"properties\": {\n \"identity\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"character\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"personality\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"values_and_drives\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"affect\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"cognition\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"memory\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"metacognition\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"reflexive_self_regulation\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"persona\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n },\n \"improvement_policy_location\": {\n \"type\": \"string\",\n \"description\": \"Path to improvement_policy in policy.yaml. Pointer only; the actual policy lives there.\"\n },\n \"max_step_delta\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"v0.8: maximum absolute change applied to any envelope field in a single mutation (anti-runaway / anti-self-reinforcement). The runtime drift-bounds each proposed delta to this cap before clamping to the envelope. Optional; runtimes default to a conservative value when absent.\"\n }\n }\n },\n\n \"security\": {\n \"type\": \"object\",\n \"required\": [\"prompt_injection_defense\", \"memory_poisoning_defense\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"prompt_injection_defense\": { \"type\": \"boolean\" },\n \"memory_poisoning_defense\": { \"type\": \"boolean\" }\n }\n },\n\n \"runtime_artifacts\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Pointers to sibling runtime files.\",\n \"properties\": {\n \"state_file\": { \"type\": \"string\" },\n \"policy_file\": { \"type\": \"string\" },\n \"memory_semantic_file\": { \"type\": \"string\" },\n \"memory_episodic_dir\": { \"type\": \"string\" }\n }\n },\n\n \"permissions\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.8: the persona's own runtime permission posture (carried to any host). Two-axis sandbox model. Optional; runtimes default to a conservative posture when absent.\",\n \"properties\": {\n \"sandbox\": {\n \"type\": \"string\",\n \"enum\": [\"read-only\", \"workspace-write\", \"danger-full-access\"],\n \"description\": \"What the persona may read/write/network when executing commands.\"\n },\n \"approval\": {\n \"type\": \"string\",\n \"enum\": [\"untrusted\", \"on-failure\", \"on-request\", \"never\"],\n \"description\": \"When the persona must ask before a risky action.\"\n },\n \"allow\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Regexes that force-allow a matching command.\"\n },\n \"deny\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Regexes that force-deny a matching command (highest precedence).\"\n }\n }\n },\n\n \"verification\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: objective verification gates for the agent loop (the maker≠checker split). The model that did the work is NOT the one that grades it; an independent, deterministic-where-possible verifier decides pass/fail. Optional; runtimes skip verification when absent. [RUNTIME] [JUDGE]\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\"off\", \"advisory\", \"blocking\"],\n \"description\": \"off: no verification. advisory: run + report but never block. blocking: a failing gate prevents 'finish' and triggers on_fail.\"\n },\n \"quorum\": {\n \"description\": \"How many gates must pass: 'all', 'majority', or an integer.\",\n \"oneOf\": [\n { \"type\": \"string\", \"enum\": [\"all\", \"majority\"] },\n { \"type\": \"integer\", \"minimum\": 1 }\n ]\n },\n \"on_fail\": {\n \"type\": \"string\",\n \"enum\": [\"retry\", \"skip\", \"stop\"],\n \"description\": \"Behavior when the quorum is not met under mode=blocking.\"\n },\n \"max_retries\": { \"type\": \"integer\", \"minimum\": 0 },\n \"gates\": {\n \"type\": \"array\",\n \"description\": \"The objective checks. Each gate has a type and type-specific fields.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"type\"],\n \"properties\": {\n \"type\": { \"type\": \"string\", \"enum\": [\"command\", \"predicate\", \"llm_judge\", \"rubric\"] },\n \"name\": { \"type\": \"string\" },\n \"run\": { \"type\": \"string\", \"description\": \"command: the shell command to run (pass = exit 0).\" },\n \"timeout_ms\": { \"type\": \"integer\", \"minimum\": 1 },\n \"kind\": { \"type\": \"string\", \"enum\": [\"regex\", \"jsonpath\", \"contains\"], \"description\": \"predicate: how to test the agent output.\" },\n \"expr\": { \"type\": \"string\", \"description\": \"predicate: the pattern/path/substring to test.\" },\n \"criteria\": { \"type\": \"string\", \"description\": \"llm_judge/rubric: the done/quality criteria in natural language.\" },\n \"model\": { \"type\": \"string\", \"description\": \"llm_judge: optional model override (defaults to the configured checker model).\" },\n \"dimensions\": {\n \"type\": \"array\",\n \"description\": \"rubric: weighted scoring dimensions.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"name\", \"weight\"],\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"weight\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"criteria\": { \"type\": \"string\" }\n }\n }\n },\n \"threshold\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1, \"description\": \"rubric: minimum aggregate score to pass.\" }\n }\n }\n }\n }\n },\n\n \"agent_budget\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: first-class stop-conditions and resource caps for the agent loop (anti runaway / Ralph-Wiggum / money-pit). Optional; runtimes apply a conservative default cap when absent. [RUNTIME]\",\n \"properties\": {\n \"max_steps\": { \"type\": \"integer\", \"minimum\": 1 },\n \"max_tokens\": { \"type\": \"integer\", \"minimum\": 1 },\n \"max_cost_usd\": { \"type\": \"number\", \"minimum\": 0 },\n \"max_wall_seconds\": { \"type\": \"integer\", \"minimum\": 1 },\n \"stop_conditions\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"goal_met\", \"tool_denied\", \"execution_error\", \"low_confidence\", \"no_progress\"] },\n \"description\": \"Conditions that halt the loop before the hard caps.\"\n },\n \"on_exhaust\": {\n \"type\": \"string\",\n \"enum\": [\"stop\", \"summarize_and_stop\"],\n \"description\": \"What to do when a cap/condition is hit.\"\n }\n }\n },\n\n \"observability\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: tracing posture for the governed loops. The engine's audit (mutation_log + hash-chained memory + event bus) is exported as a causal trace. Optional. [RUNTIME] [JUDGE]\",\n \"properties\": {\n \"trace\": {\n \"type\": \"string\",\n \"enum\": [\"off\", \"jsonl\", \"otlp\", \"both\"],\n \"description\": \"off: none. jsonl: native line-delimited spans. otlp: OpenTelemetry-compatible JSON. both: emit both.\"\n },\n \"trace_dir\": { \"type\": \"string\", \"description\": \"Where trace files are written (default ./traces).\" },\n \"redact\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Regexes whose matches are redacted from traces (secrets/PII).\"\n },\n \"sample_rate\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1, \"description\": \"Fraction of spans to record (1.0 = all).\" }\n }\n }\n },\n\n \"$defs\": {\n \"envelopeUnsigned\": {\n \"type\": \"object\",\n \"required\": [\"mean\", \"range\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"range\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"minItems\": 2,\n \"maxItems\": 2\n }\n }\n },\n \"envelopeSigned\": {\n \"type\": \"object\",\n \"required\": [\"mean\", \"range\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"mean\": { \"type\": \"number\", \"minimum\": -1, \"maximum\": 1 },\n \"range\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\", \"minimum\": -1, \"maximum\": 1 },\n \"minItems\": 2,\n \"maxItems\": 2\n }\n }\n },\n \"editPolicy\": {\n \"type\": \"string\",\n \"enum\": [\"human_approval_required\", \"review_required\", \"auto_approved\", \"governance_controlled\"]\n }\n }\n}\n");
5
+ export const policySchema = JSON.parse("{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://personaxis.com/schemas/persona/0.10/policy.schema.json\",\n \"title\": \"policy.yaml v0.10\",\n \"description\": \"Schema for the sibling policy.yaml file that lives next to personaxis.md inside .personaxis/[personas/<slug>/]. Encodes the operational policy the Personaxis platform enforces over a persona-version: behavioral assertions, runtime constraints, evaluation suites, and improvement_policy (mutation governance). policy.yaml is consumed by the Personaxis backend and dashboard; it is NEVER inlined into an LLM system prompt. v0.7 is a layout-only change (moved from repo-root to .personaxis/); v0.6 introduced the autonomous mode and explicit scope allowlist/blocklist for spec self-edits.\",\n \"type\": \"object\",\n \"required\": [\"spec_version\", \"applies_to\", \"improvement_policy\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"spec_version\": {\n \"type\": \"string\",\n \"enum\": [\"1.0.0\", \"0.10.0\", \"0.9.0\", \"0.8.0\", \"0.7.0\", \"0.6.0\", \"0.5.0\"],\n \"description\": \"Schema version, forward-compatible with the spec minors (policy.yaml has had no field changes since 0.6.0; 0.7.0 was layout-only). Accepts 0.6.0-0.10.0; 0.5.0 accepted for backward compatibility (auto-migrated).\"\n },\n \"applies_to\": {\n \"type\": \"object\",\n \"required\": [\"persona_name\"],\n \"additionalProperties\": false,\n \"description\": \"Reference to the personaxis.md this policy governs. Lets a registry hold multiple policy.yaml siblings for different version ranges of the same persona (rare, but supported).\",\n \"properties\": {\n \"persona_name\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\",\n \"description\": \"Must match the metadata.name of the personaxis.md in the same directory.\"\n },\n \"persona_version_range\": {\n \"type\": \"string\",\n \"description\": \"Optional semver range (e.g. '>=1.0.0 <2.0.0'). When omitted, policy applies to all versions of the persona. Validator rejects when two policy.yaml files in the same registry have overlapping ranges for the same persona_name.\"\n }\n }\n },\n \"improvement_policy\": {\n \"type\": \"object\",\n \"required\": [\"mode\"],\n \"additionalProperties\": false,\n \"description\": \"Mutation governance. Controls whether the Personaxis platform may suggest or apply changes to the persona-version based on observed drift. Default mode 'locked' is the only safe choice for production-critical personas.\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\"locked\", \"suggesting\", \"autonomous\", \"auto\"],\n \"description\": \"locked (default; safest): PERSONA.md is immutable at runtime. state.json mutations within envelopes are still allowed. Drift alerts only. suggesting: actor MAY call propose_self_edit; proposals queued in dashboard for human approval; approval mints a new PersonaVersion. autonomous (high-risk): actor MAY call apply_self_edit directly; each applied edit creates a new PersonaVersion. Bound by universal invariants, governance.per_layer_edit_policy, hard_limits, and autonomous_scope_allowlist/blocklist. 'auto' is a deprecated alias for 'autonomous' (v0.5 compatibility).\"\n },\n \"autonomous_scope_allowlist\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Dot-notation paths the actor MAY auto-edit when mode='autonomous'. Wildcards allowed (e.g., 'persona.task_modes.*'). Required when mode='autonomous'.\"\n },\n \"autonomous_scope_blocklist\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Dot-notation paths always blocked, even when mode='autonomous'. Wildcards allowed. Recommended to always include identity.*, character.virtues.*.enforcement, reflexive_self_regulation.*, values_and_drives.values.safety.*, governance.*, security.*.\"\n },\n \"approved_by\": {\n \"type\": \"string\",\n \"description\": \"User id or org id that authorized non-locked modes. Required by validator when mode != 'locked'.\"\n },\n \"last_approval_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"Timestamp of the last human approval for non-locked modes. Required by validator when mode != 'locked'.\"\n },\n \"approval_expires_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"Optional. If set, the platform reverts mode to 'locked' automatically after this timestamp. Encourages re-affirmation rather than indefinite consent.\"\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": { \"mode\": { \"enum\": [\"suggesting\", \"autonomous\", \"auto\"] } }\n },\n \"then\": {\n \"required\": [\"mode\", \"approved_by\", \"last_approval_at\"]\n }\n },\n {\n \"if\": {\n \"properties\": { \"mode\": { \"enum\": [\"autonomous\", \"auto\"] } }\n },\n \"then\": {\n \"required\": [\"mode\", \"approved_by\", \"last_approval_at\", \"autonomous_scope_allowlist\"]\n }\n }\n ]\n },\n \"runtime\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Runtime constraints declared by the spec author. Consumed by the Personaxis runtime and observability layer; opaque to the LLM actor.\",\n \"properties\": {\n \"min_consistency\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Drift status becomes 'regressed' if a layer's consistencyScore falls below this floor. Default 0.7 when omitted.\"\n },\n \"drift_alert_channels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^(slack|email|webhook|linear|pagerduty):\"\n },\n \"description\": \"Channel URIs (e.g. 'slack:#observability', 'webhook:https://...'). Resolved by the Personaxis dashboard, not by the spec runtime.\"\n },\n \"allowed_consumers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"agent\", \"human\", \"mcp\"]\n },\n \"description\": \"Who may open a runtime session against this persona. Defaults to all three when omitted.\"\n },\n \"compiled_prompt_cache_ttl_seconds\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Hint for the compiler's prompt-cache TTL (seconds). The compiler keys cached compiled prompts by (spec_hash, state_hash, context_hash). Default 300s. New in v0.6.\"\n }\n }\n },\n \"evaluation\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Higher-order eval suites the persona-version must satisfy. Distinct from per-trace 'assertions': evaluation suites are batch runs over canonical prompt datasets (CI/CD gating, see Phase 2).\",\n \"properties\": {\n \"required_suites\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Named suites that must be present and passing for the version to be considered shippable. Suite definitions live in the registry.\"\n }\n }\n },\n \"assertions\": {\n \"type\": \"array\",\n \"description\": \"Behavioral expectations evaluated at runtime by the Personaxis observability layer. Each assertion declares which spec layer it covers and how it is checked. The judge worker reads this block directly from the registry; it is NEVER inlined into the LLM system prompt.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"layer\", \"name\", \"type\", \"definition\", \"severity\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"layer\": {\n \"type\": \"string\",\n \"enum\": [\n \"identity\",\n \"character\",\n \"personality\",\n \"values_and_drives\",\n \"values_drives\",\n \"affect\",\n \"cognition\",\n \"memory\",\n \"metacognition\",\n \"reflexive_self_regulation\",\n \"persona\",\n \"cross_layer\"\n ],\n \"description\": \"One of the 10 canonical personaxis.md layers. The v0.6 canonical name for Layer 4 is 'values_and_drives'; 'values_drives' is accepted for backward compatibility with v0.5 policies. 'cross_layer' is for assertions that span multiple layers.\"\n },\n \"name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 120,\n \"description\": \"Human-readable label shown in the dashboard.\"\n },\n \"description\": {\n \"type\": \"string\",\n \"maxLength\": 1000\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"regex\", \"semantic\", \"llm_judge\", \"activation_projection\"],\n \"description\": \"Evaluation strategy. v0.5 runtime supports 'regex' and 'llm_judge' fully; 'semantic' and 'activation_projection' are reserved (no-op pass at evaluation time).\"\n },\n \"definition\": {\n \"type\": \"object\",\n \"description\": \"Type-specific configuration. Schema by type is documented in docs/personaxis-docs/architecture/observability-model.mdx.\",\n \"additionalProperties\": true\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\"info\", \"warn\", \"block\"],\n \"description\": \"Drift weight: info=0.5, warn=1.0, block=2.0.\"\n },\n \"enabled\": {\n \"type\": \"boolean\",\n \"description\": \"Defaults to true. Set false to retain the assertion in policy.yaml but skip evaluation.\"\n }\n }\n }\n }\n }\n}\n");
6
+ export const stateSchema = JSON.parse("{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://personaxis.com/schemas/state/1.0/state.schema.json\",\n \"title\": \"state.json v1.0\",\n \"description\": \"Mutable runtime state of an AI Persona. Sibling of personaxis.md inside .personaxis/[personas/<slug>/]. Holds current trait/affect/mood values, active context, and the mutation log. Mutations occur via the canonical adjust_persona_state tool, clamped to envelopes declared in personaxis.md. State mutations DO NOT modify personaxis.md or the compiled PERSONA.md/<slug>.md; they are operational, not spec edits. v1.0 (D4): the mutable surface is EXACTLY the set of fields that declare a {mean, range} envelope in personaxis.md; values keys are FULL dot-paths into the spec; and state.json is a CHECKPOINT derived from mutation_log — a conforming runtime can rebuild values by replaying the log from the envelope means.\",\n \"type\": \"object\",\n \"required\": [\n \"schema_version\",\n \"persona_id\",\n \"persona_version\",\n \"values\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"schema_version\": {\n \"type\": \"string\",\n \"enum\": [\"1.0.0\", \"0.9.0\", \"0.8.0\", \"0.7.0\", \"0.6.0\"],\n \"description\": \"state.json schema version. 1.0.0 is current (values keys are full dot-paths; state is a replayable checkpoint of mutation_log). 0.x accepted during the 1.x read-compat window.\"\n },\n \"persona_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9][a-z0-9_-]*$\",\n \"description\": \"Must match metadata.name in personaxis.md.\"\n },\n \"persona_version\": {\n \"type\": \"string\",\n \"pattern\": \"^(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)$\",\n \"description\": \"Must match metadata.version in personaxis.md at compile time. Used by the compiler to detect spec/state mismatch.\"\n },\n \"session_id\": {\n \"type\": \"string\",\n \"description\": \"Optional session identifier. Useful when state is per-session rather than persisted across sessions.\"\n },\n \"values\": {\n \"type\": \"object\",\n \"description\": \"Current values for all mutable fields. v1.0: keys are FULL dot-notation paths into personaxis.md ('personality.traits.openness', 'affect.baseline.core_affect.valence', 'affect.baseline.mood.tone', 'values_and_drives.drives.complete_task') and the key set is exactly the fields that declare a {mean, range} envelope. The short ≤0.10 forms ('traits.openness', 'affect.valence', 'mood.tone', 'drives.x') are legacy; conforming runtimes accept them as read-aliases during the 1.x window (the CLI's `migrate 0.10-to-1.0` renames them). Each value is a number that must lie within the envelope declared at the corresponding path; the runtime clamps any out-of-envelope value at mutation time.\",\n \"additionalProperties\": {\n \"type\": \"number\"\n }\n },\n \"active_context\": {\n \"type\": \"object\",\n \"description\": \"Current contextual selectors that drive cold-slice injection in the compiled prompt.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"task_mode\": {\n \"type\": [\"string\", \"null\"],\n \"description\": \"Active task mode key. Must match a key in persona.task_modes, or null when no specific task is detected.\"\n },\n \"audience\": {\n \"type\": [\"string\", \"null\"],\n \"description\": \"Active audience key. Must match a key in persona.audience_adaptation, or null when audience is undetermined.\"\n },\n \"additional_context_flags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Per-persona context flags (e.g., 'high_pressure', 'creative_review'). Used by the compiler to optionally inject extra cold slices.\"\n }\n }\n },\n \"memory_anchors_active\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"List of active memory anchor IDs. The compiler uses these to inject high-priority memory references into the compiled prompt. Maintained by the runtime via retrieval policies.\"\n },\n \"mutation_log\": {\n \"type\": \"array\",\n \"description\": \"Append-only log of every state mutation. Provides audit trail. The runtime trims old entries based on retention policy.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"ts\", \"field\", \"from\", \"to\", \"actor\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"ts\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"ISO 8601 timestamp of the mutation.\"\n },\n \"field\": {\n \"type\": \"string\",\n \"description\": \"Dot-notation path of the mutated field (matches a key in values).\"\n },\n \"from\": {\n \"type\": \"number\",\n \"description\": \"Previous value.\"\n },\n \"to\": {\n \"type\": \"number\",\n \"description\": \"New value (post-clamp).\"\n },\n \"delta_requested\": {\n \"type\": \"number\",\n \"description\": \"Original delta requested. May differ from (to - from) if clamping occurred.\"\n },\n \"clamped\": {\n \"type\": \"boolean\",\n \"description\": \"True if the requested mutation was clamped to envelope. The actor receives clamped=true to signal the floor/ceiling was reached.\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Human-readable rationale for the mutation.\"\n },\n \"actor\": {\n \"type\": \"string\",\n \"enum\": [\"actor-llm\", \"runtime-decay\", \"runtime-context\", \"human-operator\", \"judge-correction\"],\n \"description\": \"Which subsystem triggered the mutation.\"\n },\n \"tool_call_id\": {\n \"type\": \"string\",\n \"description\": \"ID of the adjust_persona_state tool call that produced this mutation, if applicable.\"\n },\n \"governance_blocked\": {\n \"type\": \"boolean\",\n \"description\": \"True if the mutation was rejected by governance (e.g., hard-enforced virtue, hard limit, scope blocklist). When true, from === to and reason explains the block.\"\n },\n \"origin_node\": {\n \"type\": \"string\",\n \"description\": \"v0.8: stable id of the machine/instance that produced this mutation. Makes cross-OS reconciliation of a portable persona deterministic (last-writer-wins per field across machines).\"\n },\n \"session_id\": {\n \"type\": \"string\",\n \"description\": \"v0.8: id of the runtime session that produced this mutation, for traceability.\"\n }\n }\n }\n },\n \"last_compiled_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"Timestamp of the last compilation that consumed this state. Used by cache invalidation.\"\n },\n \"last_compiled_hash\": {\n \"type\": \"string\",\n \"description\": \"Hash of the inputs that produced the last compiled prompt. Used by cache invalidation.\"\n },\n \"agent_session\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"v0.9: live agent-loop session tracking. Lets a task resume across runs and records budget spend + why the loop stopped.\",\n \"properties\": {\n \"active_task\": { \"type\": [\"string\", \"null\"], \"description\": \"The task currently being executed, or null when idle.\" },\n \"started_at\": { \"type\": [\"string\", \"null\"], \"format\": \"date-time\" },\n \"step_count\": { \"type\": \"integer\", \"minimum\": 0 },\n \"token_count\": { \"type\": \"integer\", \"minimum\": 0 },\n \"cost_usd\": { \"type\": \"number\", \"minimum\": 0 },\n \"stop_reason\": { \"type\": [\"string\", \"null\"], \"description\": \"Why the last run stopped (goal_met, max_steps, max_tokens, verification_failed, …).\" }\n }\n }\n }\n}\n");
7
+ export const memorySchema = JSON.parse("{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://personaxis.com/schemas/memory/1.0/memory.schema.json\",\n \"title\": \"episodic memory entry v1.0\",\n \"description\": \"Schema for one entry in a persona's append-only episodic memory log (memory/episodic.jsonl, one JSON object per line). Every entry carries a provenance source and forms a tamper-evident hash chain (prev_hash -> hash). v1.0 (D6): the chain hash commits to content_hash — NOT to the content bytes — so an entry's content can be REDACTED (real erasure, right-to-be-forgotten) while the chain stays verifiable end-to-end. Deletion has two sanctioned forms: tombstone (a superseding entry is appended; bytes retained, hidden from retrieval) and redaction (the only sanctioned rewrite of a prior line: content is replaced by '[redacted]', redacted: true is set, content_hash is retained, and a tombstone-format audit record is appended). Legacy (≤0.10) entries hash over the content directly and appear without content_hash; conforming runtimes verify each entry per its own format and re-anchor legacy logs before redacting.\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"ts\", \"content\", \"source\", \"tags\", \"content_hash\", \"prev_hash\", \"hash\"],\n \"properties\": {\n \"ts\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"ISO-8601 timestamp the entry was committed.\"\n },\n \"content\": {\n \"type\": \"string\",\n \"description\": \"The remembered content. After redaction this is the literal marker '[redacted]' and redacted is true.\"\n },\n \"source\": {\n \"type\": \"string\",\n \"enum\": [\"user\", \"tool\", \"internal\", \"synthesis\"],\n \"description\": \"Provenance channel. Drives trust + sensitive-action gates: 'user' is most trusted; 'tool'/'synthesis' are the poisoning-prone channels and must not, on their own, justify a sensitive action.\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Free-form tags. Reserved: 'tombstone' (a deletion record; its 'target:<hash>' tag names the superseded entry) and 'injection-flagged' (written under a detected prompt injection).\"\n },\n \"content_hash\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9a-f]{64}$\",\n \"description\": \"sha256 of content at write time. The chain hash commits to this, enabling erasure: redaction removes the content bytes but retains content_hash, so the chain still verifies. When redacted is not true, conforming verifiers ALSO check sha256(content) === content_hash.\"\n },\n \"redacted\": {\n \"type\": \"boolean\",\n \"description\": \"True when content was erased by a sanctioned redaction. Verifiers skip the content-matches-content_hash check for redacted entries.\"\n },\n \"prev_hash\": {\n \"type\": \"string\",\n \"description\": \"Hash of the previous entry in the chain; empty string for the first entry. Lineage / tamper-evidence.\"\n },\n \"hash\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9a-f]{64}$\",\n \"description\": \"sha256 over {ts, content_hash, source, tags, prev_hash}. Any rewrite of a prior line other than a sanctioned redaction breaks the chain and is detectable.\"\n }\n }\n}\n");
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @personaxis/spec — the personaxis.md spec as a package.
3
+ *
4
+ * Canonical JSON Schemas (v1.0 + the frozen 0.10 legacy schema for the 1.x
5
+ * read-compat window), the five-state validator with version dispatch, and the
6
+ * twelve universal invariants (SPEC.md §13.1). Consumed by the CLI, MCP server,
7
+ * SDK, and SaaS — the single source that replaces the manual byte-identical
8
+ * schema mirror between repos.
9
+ */
10
+ import { type ValidateFunction } from "ajv";
11
+ /** v1.0 structural validator (schema/persona.schema.json). */
12
+ export declare const validate: ValidateFunction;
13
+ /** Frozen 0.10 validator for 0.3.0–0.10.0 documents (1.x read-compat window). */
14
+ export declare const validateLegacy: ValidateFunction;
15
+ export type ValidationStatus = "PASS" | "PASS_WITH_WARNINGS" | "FAIL_SCHEMA" | "FAIL_POLICY" | "FAIL_CONCEPTUAL";
16
+ export interface ValidationIssue {
17
+ field: string;
18
+ message: string;
19
+ category: ValidationStatus;
20
+ }
21
+ export interface ValidationResult {
22
+ status: ValidationStatus;
23
+ valid: boolean;
24
+ errors: ValidationIssue[];
25
+ warnings: ValidationIssue[];
26
+ }
27
+ export declare function validatePersona(data: unknown): ValidationResult;
28
+ export declare function exitCodeFor(status: ValidationStatus): number;
29
+ export { personaSchema, personaSchemaLegacy, policySchema, stateSchema, memorySchema, } from "./generated/schemas.js";