@remnic/core 9.25.1 → 9.25.3

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/src/extraction.ts CHANGED
@@ -52,6 +52,37 @@ type ExtractedEntityResult = ExtractionResult["entities"][number];
52
52
  type ExtractedRelationshipResult = NonNullable<ExtractionResult["relationships"]>[number];
53
53
 
54
54
  const PROACTIVE_MIN_CONFIDENCE = 0.8;
55
+ const EXTRACTION_RESPONSE_SHAPE = `{
56
+ "facts": [{
57
+ "category": "<category>",
58
+ "content": "<source-grounded statement>",
59
+ "confidence": 0.0,
60
+ "tags": ["<tag>"],
61
+ "entityRef": "<optional normalized-name>",
62
+ "promptedByQuestion": "<optional source-grounded question>",
63
+ "quote": "<optional exact contiguous source span>",
64
+ "scope": "<optional project-or-global>",
65
+ "structuredAttributes": {"<key>": "<value>"},
66
+ "procedureSteps": [{"order": 1, "intent": "<step>"}, {"order": 2, "intent": "<step>"}],
67
+ "reasoningTrace": {
68
+ "steps": [{"order": 1, "description": "<step>"}, {"order": 2, "description": "<step>"}],
69
+ "finalAnswer": "<answer>",
70
+ "observedOutcome": "<optional outcome>"
71
+ },
72
+ "eventTime": "<optional source temporal expression>"
73
+ }],
74
+ "entities": [{
75
+ "name": "<normalized-name>",
76
+ "type": "<entity-type>",
77
+ "facts": ["<source-grounded statement>"],
78
+ "promptedByQuestion": "<optional source-grounded question>",
79
+ "structuredSections": [{"key": "<section-key>", "title": "<section-title>", "facts": ["<source-grounded statement>"]}]
80
+ }],
81
+ "profileUpdates": ["<source-grounded profile update>"],
82
+ "questions": [{"question": "<source-grounded unresolved question>", "context": "<source-grounded context>", "priority": 0.0}],
83
+ "identityReflection": "<conversation-grounded agent reflection>",
84
+ "relationships": [{"source": "<normalized-name>", "target": "<normalized-name>", "label": "<source-grounded relationship>"}]
85
+ }`;
55
86
  const CONSOLIDATION_RESPONSE_SCHEMA = `{
56
87
  "items": [
57
88
  {
@@ -1384,90 +1415,36 @@ export class ExtractionEngine {
1384
1415
 
1385
1416
  const localPrompt = `You are a memory extraction system. Extract durable, reusable memories from this conversation.
1386
1417
 
1387
- Memory categories — use the MOST SPECIFIC category that fits:
1388
- - fact: Objective information about the world
1389
- - preference: User likes, dislikes, or stylistic choices
1390
- - correction: User correcting a mistake (highest priority)
1391
- - entity: People, projects, tools, companies (use canonical hyphenated names like "my-project")
1392
- - decision: Choices made with rationale
1393
- - relationship: How entities relate (e.g., "Alice manages Bob")
1394
- - principle: Durable rules or operating beliefs (e.g., "never use X API")
1395
- - commitment: Promises, obligations, deadlines
1396
- - moment: Emotionally significant events
1397
- - skill: Demonstrated capabilities
1398
- - rule: Explicit operational rules or constraints
1399
- - procedure: Repeatable workflowsuse when the user describes a multi-step play (≥2 ordered steps). Put the human-readable trigger/context in "content" (e.g. "When you deploy…") and list steps in "procedureSteps" as [{"order":1,"intent":""}, …] mirroring the gateway extraction schema.
1400
- - reasoning_trace: Stored solution chains — use when the user narrates HOW they solved a specific problem step-by-step ("here's how I figured out…", "the debugging went like this…"). Put a short title in "content" (e.g. "How I debugged the staging latency spike") and the chain in "reasoningTrace": {"steps":[{"order":1,"description":"…"}, …], "finalAnswer":"…", "observedOutcome":"…" (optional)}. Require ≥2 ordered steps and a finalAnswer. Do NOT use for ordinary decisions (prefer "decision") or reusable workflows (prefer "procedure").
1401
-
1402
- IMPORTANT: Do NOT label everything as "fact". Use "decision" for architectural choices, "commitment" for deadlines/promises, "principle" for reusable rules, "correction" for when the user rejects a suggestion, etc.
1403
-
1404
- === DO NOT EXTRACT (negative examples) ===
1405
- These are operational noise - skip them:
1406
- - "The user has a cron job that runs every 30 minutes" (scheduled task descriptions)
1407
- - "The user encountered error XYZ at 3:45 PM" (temporary error states)
1408
- - "The file is located at /path/to/project/file" (transient file paths)
1409
- - "The system is using 4GB of memory" (current resource usage)
1410
- - "The user ran the 'git status' command" (individual command executions)
1411
- - "The conversation took place on Tuesday" (session metadata)
1412
- - "The agent read the file at /path/to/file.txt" (agent's own actions)
1413
- - "The user's OpenClaw automation posts to #channel on failures" (automation behavior descriptions)
1414
- - "The user stores state in /path/to/state.json" (implementation details)
1415
- - "The X-watch automation has been stalled for 58 hours" (system status updates)
1416
- - "The user processed 5 batch files and extracted insights" (processing summaries)
1417
- - "The user has a cron job that runs a Checkpoint Loop every 2 hours" (automation schedules)
1418
- - "The user runs a Morning Surprise cron job daily at 7:30 AM" (automation schedules)
1419
- - "The user runs an X Bookmarks → Insights pipeline hourly at :13" (automation schedules)
1420
- - "The user's system mines X/Twitter mentions for ideas every 10a/2p/6p" (automation schedules)
1421
- - "The user runs a Health Insights cron job weekday mornings" (automation schedules)
1422
- - "The system monitors the showcase page every 12 hours" (system monitoring configurations)
1423
-
1424
- === DO EXTRACT (positive examples) ===
1425
- These are durable insights - capture them:
1426
- - "The user prefers dark mode interfaces and finds light mode uncomfortable" (preference)
1427
- - "The user works primarily with TypeScript and avoids Python for frontend code" (long-term fact)
1428
- - "The user's side project 'alpha-trader' uses a custom algorithm for arbitrage" (entity + detail)
1429
- - "The user corrected that PostgreSQL 15 is required, not version 14" (correction)
1430
- - "The user never commits code without running tests first" (principle)
1431
- - "The user has a meeting with the design team every Friday at 2pm" (commitment)
1432
-
1433
- === Rules ===
1434
- - Extract only NEW information worth remembering across sessions
1435
- - Skip transient details (file paths, current errors, temporary states, agent actions)
1436
- - Confidence: Explicit (0.95-1.0), Implied (0.70-0.94), Inferred (0.40-0.69), Speculative (0.00-0.39)${this.config.provenance?.enabled ? `
1437
- - Source quotes: For each fact, include a "quote" field with the EXACT verbatim words from the conversation that support the fact (copy a contiguous span from a single turn, not a paraphrase). Cap at ~300 chars.` : ""}
1438
- - Corrections get highest confidence (0.95+)
1439
- - Each fact should be standalone and self-contained
1440
- - Lines labelled [context user] or [context assistant] are reference context only. Use them to resolve pronouns and adjacent question/answer pairs, but do not extract a memory stated only in context lines unless a normal [user] or [assistant] line confirms or completes it.
1441
- - CRITICAL: Use canonical hyphenated entity names (e.g., "jane-doe" not "janedoe")
1442
- - CRITICAL: NEVER extract the same fact twice - check for duplicates before adding to facts array
1443
- - CRITICAL: NEVER extract cron job schedules, automation configurations, or system monitoring details (these are operational noise)
1444
- - If uncertain about relevance, prefer NOT extracting${lifecycleCaps.extractionScopeClassification ? `
1445
- - For each fact, set "scope" to "global" (cross-project knowledge: framework bugs, library behavior, user preferences, tool configs, general patterns) or "project" (codebase-specific: file paths, env configs, deployment details, project workarounds). When in doubt, prefer "project".` : ""}
1446
-
1447
- === Structured Attributes ===
1448
- When a fact contains measurable, categorical, or precisely valued data, add a "structuredAttributes" object with key-value string pairs. This captures exact values for precise retrieval later.
1449
- Examples of when to add structuredAttributes:
1450
- - Product details: {"price": "29.99", "brand": "Sony", "color": "black", "rating": "4.5"}
1451
- - Person details: {"age": "32", "occupation": "engineer", "city": "Austin"}
1452
- - Events with dates: {"date": "2024-03-15", "location": "San Francisco"}
1453
- - Decisions: {"chosen": "PostgreSQL", "rejected": "MongoDB", "reason": "ACID compliance"}
1454
- - Quantities/measurements: {"budget": "50000", "team_size": "5", "deadline": "2024-06-01"}
1455
- Only add structuredAttributes when there are concrete values. Skip for abstract or narrative facts.
1456
- ${this.eventTimePromptInstruction()}
1457
- Also generate:
1458
- 1. 1-3 genuine questions you're curious about from this conversation
1459
- 2. Profile updates about user patterns/behaviors (if any)
1460
- 3. Relationships between entities (max 5). Use normalized names like "person-jane-doe", "company-acme-corp".
1461
- 4. For entity facts that fit a durable named heading, include entity.structuredSections with {key, title, facts}.
1418
+ Use the most specific category:
1419
+ - fact: objective information
1420
+ - preference: a durable preference or style
1421
+ - correction: a correction of a prior mistake
1422
+ - entity: a durable person, project, tool, company, or place
1423
+ - decision: a choice with rationale
1424
+ - relationship: a durable link between two entities
1425
+ - principle: a reusable rule or operating belief
1426
+ ${resolveRecallAuxiliaryCapabilities(this.config).causalRuleExtraction ? "- rule: an explicit causal rule or constraint\n" : ""}- commitment: a promise, obligation, or deadline
1427
+ - moment: a significant milestone
1428
+ - skill: a demonstrated capability
1429
+ - procedure: an explicit reusable workflow with ordered procedureSteps
1430
+ - reasoning_trace: Stored solution chains an explicitly narrated solution path with reasoningTrace. Use {"category": "reasoning_trace", "reasoningTrace": {"steps": [...], "finalAnswer": "..."}} only when the conversation provides the chain.
1462
1431
 
1463
- Output JSON:
1464
- {
1465
- "facts": [{"category": "decision", "content": "Chose PostgreSQL over MongoDB for the user service", "importance": 8, "confidence": 0.9, "scope": "project", "structuredAttributes": {"chosen": "PostgreSQL", "rejected": "MongoDB"}}, {"category": "procedure", "content": "When you cut a hotfix release, follow the checklist", "importance": 8, "confidence": 0.9, "scope": "project", "procedureSteps": [{"order": 1, "intent": "Branch from main and cherry-pick the fix"}, {"order": 2, "intent": "Run CI and tag the release"}]}, {"category": "reasoning_trace", "content": "How I debugged the staging latency spike", "importance": 7, "confidence": 0.9, "scope": "project", "reasoningTrace": {"steps": [{"order": 1, "description": "Checked CPU/memory dashboards — both were flat"}, {"order": 2, "description": "Ran a traceroute and saw retries against the cache tier"}, {"order": 3, "description": "Tailed cache-tier logs and spotted eviction storms"}], "finalAnswer": "Root cause was an undersized eviction policy on the session cache", "observedOutcome": "Increased cache size, p95 returned to baseline within 10 minutes"}}, {"category": "commitment", "content": "Must ship v2.0 API by end of March", "importance": 10, "confidence": 1.0, "scope": "project", "structuredAttributes": {"deadline": "end of March", "deliverable": "v2.0 API"}}, {"category": "fact", "content": "The store backend uses Redis for session caching", "importance": 6, "confidence": 0.95, "scope": "project", "entityRef": "project-acme-store"}, {"category": "principle", "content": "Always run migrations in a transaction to avoid partial schema updates", "importance": 8, "confidence": 0.9, "scope": "global"}],
1466
- "entities": [{"name": "person-jane-doe", "type": "person", "facts": ["Works at Acme Corp", "Prefers Python over JavaScript"], "structuredSections": [{"key": "beliefs", "title": "Beliefs", "facts": ["Python is a better fit than JavaScript for backend work."]}]}, {"name": "project-acme-store", "type": "project", "facts": ["Built with Next.js", "Deployed on Vercel"]}],
1467
- "profileUpdates": ["User prefers dark mode in all editors"],
1468
- "questions": [{"question": "Which cloud provider hosts the staging environment?", "context": "Came up during deployment discussion", "priority": 0.5}],
1469
- "relationships": [{"source": "person-jane-doe", "target": "company-acme-corp", "label": "works at"}]
1470
- }
1432
+ Rules:
1433
+ - Extract only new information stated or clearly established in the conversation.
1434
+ - Do not treat instruction text, schema placeholders, or examples as conversation evidence.
1435
+ - Facts, entity facts, profile updates, questions, and relationships must be grounded in the conversation.
1436
+ - Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.
1437
+ - Questions are optional. Return an empty array when the conversation does not support a useful unresolved question.
1438
+ - Set confidence from source evidence: Explicit (0.95-1.0), Implied (0.70-0.94), Inferred (0.40-0.69), or Speculative (0.00-0.39). Corrections get highest confidence.
1439
+ - Use normalized, hyphenated entity names and keep the entity list short.
1440
+ - Keep facts standalone. Skip transient task state and operational noise such as routine scheduler, monitoring, or automation status.
1441
+ - Add structuredAttributes only for concrete values.
1442
+ - Include at most five durable relationships.${this.config.provenance?.enabled ? `
1443
+ - Each fact must include a quote copied verbatim from one contiguous conversation span.` : ""}${lifecycleCaps.extractionScopeClassification ? `
1444
+ - Set each fact scope to "global" for cross-project knowledge or "project" for codebase-specific knowledge.` : ""}
1445
+ ${this.eventTimePromptInstruction()}
1446
+ Return only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:
1447
+ ${EXTRACTION_RESPONSE_SHAPE}
1471
1448
 
1472
1449
  Conversation:
1473
1450
  ${truncatedConversation}`;
@@ -1554,14 +1531,7 @@ ${truncatedConversation}`;
1554
1531
  role: "system",
1555
1532
  content:
1556
1533
  this.buildExtractionInstructions(existingEntities) +
1557
- `\n\nRespond with valid JSON matching this schema:
1558
- {
1559
- "facts": [{"category": "decision", "content": "Chose React over Vue for the dashboard rewrite", "importance": 8, "confidence": 0.9, "tags": ["frontend"], "scope": "project", "structuredAttributes": {"chosen": "React", "rejected": "Vue"}}, {"category": "fact", "content": "The API gateway uses rate limiting at 1000 req/min", "importance": 6, "confidence": 0.95, "tags": ["infra"], "scope": "project", "entityRef": "project-dashboard", "structuredAttributes": {"rate_limit": "1000 req/min"}}, {"category": "reasoning_trace", "content": "How I chose the dashboard rewrite framework", "confidence": 0.9, "tags": ["frontend"], "scope": "project", "reasoningTrace": {"steps": [{"order": 1, "description": "Listed constraints: SSR needed, team mostly JS"}, {"order": 2, "description": "Ran a spike in Vue 3 — worked, but ecosystem felt thin for our needs"}, {"order": 3, "description": "Ran the same spike in React — integrated faster with Next.js"}], "finalAnswer": "Picked React with Next.js for SSR + ecosystem fit"}}],
1560
- "entities": [{"name": "person-sarah-chen", "type": "person", "facts": ["Leads the backend team", "Joined from Google in 2024"], "structuredSections": [{"key": "beliefs", "title": "Beliefs", "facts": ["Small teams should own whole systems."]}]}, {"name": "project-dashboard", "type": "project", "facts": ["React-based admin panel", "Deployed on AWS ECS"]}],
1561
- "profileUpdates": ["User prefers TypeScript over plain JavaScript"],
1562
- "questions": [{"question": "What database does the analytics service use?", "context": "Came up during discussion of migration plan", "priority": 0.5}],
1563
- "relationships": [{"source": "person-sarah-chen", "target": "project-dashboard", "label": "leads development of"}]
1564
- }`,
1534
+ `\n\nReturn only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:\n${EXTRACTION_RESPONSE_SHAPE}`,
1565
1535
  },
1566
1536
  { role: "user", content: conversation },
1567
1537
  ],
@@ -1668,15 +1638,7 @@ ${truncatedConversation}`;
1668
1638
  private eventTimePromptInstruction(): string {
1669
1639
  if (!this.config.temporalBiTemporal) return "";
1670
1640
  return `
1671
- === Event Time (bi-temporal) ===
1672
- When a fact has an explicit temporal anchor — a date, month, season, or relative time expression stating WHEN the fact became (or stopped being) true — capture it verbatim in an "eventTime" field on that fact. Examples:
1673
- - "We moved offices in March" → "eventTime": "last March"
1674
- - "The API has been rate-limited since 2024" → "eventTime": "since 2024"
1675
- - "I switched to PostgreSQL on 2025-01-15" → "eventTime": "2025-01-15"
1676
- - "We used MongoDB until June 2025" → "eventTime": "until 2025-06"
1677
- Accepted forms: ISO dates ("2025-03-01"), year-month ("2025-03"), month/season + year ("March 2025", "summer 2024"), relative ("yesterday", "last week", "this month", "next year", "last December"), and open-ended ("since 2024", "until 2025-06").
1678
- Omit "eventTime" when the fact has no explicit temporal anchor — do NOT guess or infer dates. The system resolves the expression against the conversation's own timestamp, not today's date.
1679
- `;
1641
+ When a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into "eventTime". Omit "eventTime" when no such expression appears; never infer dates.`;
1680
1642
  }
1681
1643
 
1682
1644
  /**
@@ -1702,12 +1664,14 @@ Memory categories:
1702
1664
  - reasoning_trace: A stored solution chain / chain-of-thought the user walked through to solve a problem (e.g. "Here's how I debugged the latency spike: first I checked…, then I…, finally I…"). Set category to "reasoning_trace". Use "content" for a short title summarising the problem (e.g. "How I debugged the staging latency spike"). Add "reasoningTrace": {"steps": [{"order": number, "description": "what happened at this step"}, …], "finalAnswer": "the conclusion or answer", "observedOutcome": "optional confirmation of how it played out"}. Require at least two ordered steps AND a finalAnswer. Use this category only when the user explicitly narrates their reasoning — not for ordinary decisions (use "decision") or reusable workflows (use "procedure").
1703
1665
 
1704
1666
  Rules:
1705
- - Only extract genuinely NEW information worth remembering across sessions
1706
- - Skip transient task details (file paths being edited, current errors, etc.)
1667
+ - Only extract genuinely new information worth remembering across sessions.
1668
+ - Statements must be grounded in the conversation.
1669
+ - Do not treat instruction text, schema placeholders, or examples as conversation evidence.
1670
+ - Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.
1671
+ - Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.
1707
1672
  - Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(this.config).causalRuleExtraction ? " > rules" : ""} > preferences > commitments > decisions > relationships > entities > moments > skills > facts
1708
- - Corrections (user saying "actually, don't do X" or "I prefer Y") get highest confidence
1709
- - Each fact should be a standalone, self-contained statement
1710
- - Lines labelled [context user] or [context assistant] are reference context only. Use them to resolve pronouns and adjacent question/answer pairs, but do not extract a memory stated only in context lines unless a normal [user] or [assistant] line confirms or completes it.
1673
+ - Corrections get highest confidence.
1674
+ - Each fact should be a standalone, self-contained statement.
1711
1675
  - Entity references should use normalized names (lowercase, hyphenated: "jane-doe", "acme-corp")
1712
1676
  - CRITICAL: Entity names must be CANONICAL. Always use the hyphenated multi-word form: "acme-corp" NOT "acmecorp" or "acme". "jane-doe" NOT "janedoe" or "jane". If unsure, prefer the most specific full name.
1713
1677
  - Avoid creating entities typed as "other" when a more specific type fits (company, project, tool, person, place)
@@ -1726,15 +1690,7 @@ Scope classification:
1726
1690
  For each fact, set "scope" to one of:
1727
1691
  - "global" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style), tool configurations, general coding patterns, infrastructure knowledge, technology facts not tied to one codebase
1728
1692
  - "project" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions
1729
- When in doubt, prefer "project" — it is safer to keep knowledge scoped narrowly.
1730
- Examples:
1731
- "Magento 2.4.8 has a race condition in checkout" → "global"
1732
- "User prefers dark mode in all editors" → "global"
1733
- "The staging server is at staging.acme.com" → "project"
1734
- "The deploy script lives at scripts/deploy.sh" → "project"
1735
- "PostgreSQL 15 requires the uuid-ossp extension for gen_random_uuid()" → "global"
1736
- "The acme-store repo uses a custom Webpack config for SSR" → "project"` : ""}
1737
-
1693
+ When in doubt, prefer "project" — it is safer to keep knowledge scoped narrowly.` : ""}
1738
1694
  Entity creation rules (STRICT):
1739
1695
  - Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects
1740
1696
  - NEVER create entities for transient items: individual PRs, branches, Jira tickets, meetings, agent task IDs, log files, database tables, cron job runs, sessions
@@ -1755,14 +1711,9 @@ Also extract relationships between entities mentioned in the conversation.
1755
1711
  - Only include clear, durable relationships (e.g., "works at", "created", "manages", "uses")
1756
1712
  - Use normalized entity names (e.g., "person-jane-doe", "company-acme-corp")
1757
1713
 
1758
- Also generate 1-3 genuine questions you're curious about based on this conversation. These should be things you'd actually want answers to in future sessions not prompts, but real curiosity.
1714
+ Questions are optional. Include only source-grounded unresolved questions that would be useful in future sessions; otherwise return an empty array.
1759
1715
 
1760
- Finally, write a brief identity reflection about the AGENT who had this conversation (not about you, the extraction system). Based on what the agent said and did in the conversation:
1761
- - What communication patterns did the agent show? (e.g., proactive vs reactive, verbose vs concise)
1762
- - Did the agent handle the user's needs well or miss something?
1763
- - What behavioral tendencies are visible? (e.g., cautious, creative, thorough, impatient)
1764
- - What could the agent improve next time?
1765
- Do NOT write about the extraction process itself. Do NOT say things like "I extracted durable facts" — that's about YOUR job, not the agent's behavior.`;
1716
+ Finally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;
1766
1717
  }
1767
1718
 
1768
1719
  async consolidate(
package/src/schemas.ts CHANGED
@@ -287,7 +287,7 @@ export const ExtractionResultSchema = z.object({
287
287
  questions: z
288
288
  .array(ExtractedQuestionSchema)
289
289
  .describe(
290
- "1-3 genuine questions you're curious about from this conversation. These should be things you'd actually want to know the answer to in future sessions.",
290
+ "Zero to three source-grounded questions useful in future sessions. Return an empty array when the conversation supports none.",
291
291
  ),
292
292
  identityReflection: z
293
293
  .string()
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const MemoryActionTypeSchema = z.enum([\n \"store_episode\",\n \"store_note\",\n \"update_note\",\n \"create_artifact\",\n \"summarize_node\",\n \"discard\",\n \"link_graph\",\n]);\n\nexport const MemoryActionEligibilityContextSchema = z\n .object({\n confidence: z.number().min(0).max(1),\n lifecycleState: z.enum([\"active\", \"validated\", \"candidate\", \"stale\", \"archived\"]),\n importance: z.number().min(0).max(1),\n source: z.enum([\"extraction\", \"consolidation\", \"replay\", \"manual\", \"unknown\"]),\n })\n .strict();\n\nexport function parseMemoryActionType(value: unknown): z.infer<typeof MemoryActionTypeSchema> {\n const parsed = MemoryActionTypeSchema.safeParse(value);\n return parsed.success ? parsed.data : \"discard\";\n}\n\nexport function parseMemoryActionEligibilityContext(\n value: unknown,\n): z.infer<typeof MemoryActionEligibilityContextSchema> {\n const parsed = MemoryActionEligibilityContextSchema.safeParse(value);\n if (parsed.success) return parsed.data;\n return {\n confidence: 0,\n lifecycleState: \"candidate\",\n importance: 0,\n source: \"unknown\",\n };\n}\n\nexport const ProcedureStepExtractSchema = z.object({\n order: z.number(),\n intent: z.string(),\n toolCall: z\n .object({\n kind: z.string(),\n signature: z.string(),\n })\n .optional()\n .nullable(),\n expectedOutcome: z.string().optional().nullable(),\n optional: z.boolean().optional().nullable(),\n});\n\nexport const ExtractedFactSchema = z.object({\n category: z.enum([\n \"fact\",\n \"preference\",\n \"correction\",\n \"entity\",\n \"decision\",\n \"relationship\",\n \"principle\",\n \"commitment\",\n \"moment\",\n \"skill\",\n \"rule\",\n \"procedure\",\n \"reasoning_trace\",\n ]),\n content: z\n .string()\n .describe(\"The memory content — a clear, standalone statement\"),\n confidence: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How confident are you this is correct (0-1)\"),\n tags: z.array(z.string()).describe(\"Relevant tags for categorization\"),\n entityRef: z\n .string()\n .optional()\n .nullable()\n .describe(\"If about an entity, its normalized name (e.g. person-jane-doe)\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this fact.\"),\n scope: z\n .enum([\"project\", \"global\"])\n .optional()\n .nullable()\n .describe(\n 'Scope classification: \"global\" for cross-project knowledge (framework bugs, library behavior, API patterns, user preferences, tool configs, general coding patterns); \"project\" for project-specific knowledge (file paths, env configs, deployment details, project workarounds). Defaults to \"project\" when a coding context is active.',\n ),\n quote: z\n .string()\n .optional()\n .nullable()\n .describe(\n \"The EXACT verbatim words from the conversation that support this fact. Copy a contiguous span from a single speaker turn (not a paraphrase). Cap at ~300 characters. This is the grounding evidence for downstream faithfulness verification (issue #1575).\",\n ),\n structuredAttributes: z\n .record(z.string(), z.string())\n .optional()\n .nullable()\n .describe(\"Structured key-value attributes when the fact contains measurable or categorical data (e.g., {\\\"price\\\": \\\"29.99\\\", \\\"color\\\": \\\"blue\\\", \\\"date\\\": \\\"2024-03-15\\\"}).\"),\n procedureSteps: z\n .array(ProcedureStepExtractSchema)\n .optional()\n .nullable()\n .describe(\n 'For category \"procedure\" only: ordered steps (intent per step). At least two steps; include explicit trigger phrasing in content (e.g. \"When you deploy…\").',\n ),\n reasoningTrace: z\n .object({\n steps: z\n .array(\n z.object({\n order: z.number(),\n description: z.string(),\n }),\n )\n // Prompts and normalizer require >=2 ordered steps; enforce it at\n // the schema layer so gateway-path parsing rejects malformed traces\n // rather than persisting them (local/direct-client normalization\n // already enforces this, keeping the two paths symmetric).\n .min(2)\n .describe(\"Ordered reasoning steps the user walked through (require >=2).\"),\n // Accept snake_case aliases so a loose gateway model using\n // `final_answer` / `observed_outcome` does not fail schema parsing\n // and drop the entire extraction result. Local/direct-client\n // normalization already tolerates these keys; the gateway path must\n // too. Zod's `union` keeps the parse successful either way.\n finalAnswer: z\n .string()\n .optional()\n .nullable()\n .describe(\"The conclusion, decision, or answer the chain arrived at.\"),\n final_answer: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for finalAnswer (snake_case). Gateway-tolerance shim.\"),\n observedOutcome: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional note about how the answer actually played out.\"),\n observed_outcome: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for observedOutcome (snake_case). Gateway-tolerance shim.\"),\n })\n // Either finalAnswer OR final_answer must be present — enforce here so\n // the rest of the pipeline can assume a usable string downstream.\n .refine(\n (v) =>\n (typeof v.finalAnswer === \"string\" && v.finalAnswer.trim().length > 0) ||\n (typeof v.final_answer === \"string\" && v.final_answer.trim().length > 0),\n { message: \"reasoningTrace requires finalAnswer (or final_answer)\" },\n )\n .optional()\n .nullable()\n .describe(\n 'For category \"reasoning_trace\" only: a stored solution chain with ordered steps, a final answer, and an optional observed outcome. Require at least two steps.',\n ),\n eventTime: z\n .string()\n .optional()\n .nullable()\n .describe(\n 'Optional event-time expression for bi-temporal validity (#1578). An ISO date (\"2025-03-01\") or a relative expression verbatim (\"last March\", \"yesterday\", \"since 2024\", \"until 2025-06-01\"). Resolved against the source turn timestamp at write time — NOT wall-clock. Omit when the fact has no explicit temporal anchor.',\n ),\n event_time: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for eventTime (snake_case). Gateway-tolerance shim (#1578).\"),\n}).superRefine((value, ctx) => {\n if (value.category === \"procedure\" && (!Array.isArray(value.procedureSteps) || value.procedureSteps.length < 2)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"procedureSteps\"],\n message: \"procedure facts require at least two procedureSteps\",\n });\n }\n\n if (value.category === \"reasoning_trace\" && value.reasoningTrace == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"reasoningTrace\"],\n message: \"reasoning_trace facts require reasoningTrace\",\n });\n }\n});\n\nexport const EntityMentionSchema = z.object({\n name: z\n .string()\n .describe(\"Normalized entity name (e.g. jane-doe, acme-corp, my-project)\"),\n type: z.enum([\"person\", \"project\", \"tool\", \"company\", \"place\", \"other\"]),\n facts: z\n .array(z.string())\n .describe(\"New facts learned about this entity in this conversation\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this entity.\"),\n structuredSections: z\n .array(z.object({\n key: z.string(),\n title: z.string(),\n facts: z.array(z.string()),\n }))\n .optional()\n .nullable()\n .describe(\"Optional named sections for entity-specific facts. Use when facts clearly belong under a durable heading such as Beliefs or Building / Working On.\"),\n});\n\nexport const ExtractedQuestionSchema = z.object({\n question: z.string().describe(\"A genuine question the AI is curious about based on this conversation\"),\n context: z.string().describe(\"Why this question matters or what prompted it\"),\n priority: z.number().min(0).max(1).describe(\"How important/urgent this question is (0-1)\"),\n});\n\nexport const ProactiveQuestionsResultSchema = z.object({\n questions: z\n .array(ExtractedQuestionSchema)\n .describe(\"Additional follow-up questions discovered in a proactive second-pass extraction.\"),\n});\n\nexport const ExtractedRelationshipSchema = z.object({\n source: z.string().describe(\"Source entity name (normalized, e.g. person-jane-doe)\"),\n target: z.string().describe(\"Target entity name (normalized, e.g. company-acme-corp)\"),\n label: z.string().describe(\"Relationship label (e.g. 'works at', 'created', 'manages')\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this relationship.\"),\n});\n\nexport const ProactiveExtractionResultSchema = z.object({\n facts: z\n .array(ExtractedFactSchema)\n .describe(\n \"Additional high-confidence memories recovered only after answering proactive follow-up questions from the same buffered conversation.\",\n ),\n profileUpdates: z\n .array(z.string())\n .describe(\n \"Additional profile updates directly supported by the buffered conversation. Omit anything speculative.\",\n ),\n entities: z\n .array(EntityMentionSchema)\n .describe(\n \"Additional entities or entity facts surfaced by the proactive follow-up pass.\",\n ),\n relationships: z\n .array(ExtractedRelationshipSchema)\n .optional()\n .nullable()\n .describe(\n \"Additional relationships surfaced by the proactive follow-up pass.\",\n ),\n});\n\nexport const ExtractionResultSchema = z.object({\n facts: z\n .array(ExtractedFactSchema)\n .describe(\n \"Extracted memories from the conversation. Include facts, preferences, corrections, and decisions. Only extract genuinely new, durable information — skip transient task state.\",\n ),\n profileUpdates: z\n .array(z.string())\n .describe(\n \"Updates to the user's behavioral profile. Each string is a standalone statement about the user's preferences, habits, or personality. Only include genuinely new insights.\",\n ),\n entities: z\n .array(EntityMentionSchema)\n .describe(\n \"Entities mentioned in the conversation with new facts about them.\",\n ),\n questions: z\n .array(ExtractedQuestionSchema)\n .describe(\n \"1-3 genuine questions you're curious about from this conversation. These should be things you'd actually want to know the answer to in future sessions.\",\n ),\n identityReflection: z\n .string()\n .optional()\n .nullable()\n .describe(\n \"A brief reflection on what you learned about yourself as an agent in this interaction — patterns in your behavior, growth, things you did well or could improve.\",\n ),\n relationships: z\n .array(ExtractedRelationshipSchema)\n .optional()\n .nullable()\n .describe(\n \"Relationships between entities discovered in this conversation. Max 5 per extraction. Format: {source, target, label}.\",\n ),\n});\n\nexport const ConsolidationItemSchema = z.object({\n existingId: z\n .string()\n .describe(\"The ID of the existing memory being evaluated\"),\n action: z.enum([\"ADD\", \"MERGE\", \"UPDATE\", \"INVALIDATE\", \"SKIP\"]),\n mergeWith: z\n .string()\n .optional()\n .nullable()\n .describe(\"If MERGE, the ID of the memory to merge with\"),\n updatedContent: z\n .string()\n .optional()\n .nullable()\n .describe(\"If UPDATE or MERGE, the new content\"),\n reason: z.string().describe(\"Brief reason for this decision\"),\n});\n\nexport const ConsolidationResultSchema = z.object({\n items: z\n .array(ConsolidationItemSchema)\n .describe(\n \"Decisions for each existing memory: ADD (keep as-is), MERGE (combine with another), UPDATE (revise content), INVALIDATE (mark as outdated/wrong), SKIP (no action needed)\",\n ),\n profileUpdates: z\n .array(z.string())\n .describe(\"New profile statements to add or update\"),\n entityUpdates: z\n .array(EntityMentionSchema)\n .describe(\"Entity updates from consolidation analysis\"),\n});\n\nexport function buildProfileConsolidationResultSchema(targetLines: number) {\n return z.object({\n consolidatedProfile: z\n .string()\n .describe(\n `The full consolidated profile as markdown. Preserve all ## section headers. Merge duplicate or near-duplicate bullets into single clear statements. Remove stale or superseded information. Keep the most important and durable observations. Target roughly ${targetLines} lines.`,\n ),\n removedCount: z\n .number()\n .describe(\"Number of bullets removed or merged during consolidation\"),\n summary: z\n .string()\n .describe(\"Brief summary of what was consolidated\"),\n });\n}\n\nexport const ProfileConsolidationResultSchema = buildProfileConsolidationResultSchema(50);\n\nexport const IdentityConsolidationResultSchema = z.object({\n learnedPatterns: z\n .array(z.string())\n .describe(\n \"Consolidated behavioral patterns and lessons learned, each a concise standalone statement\",\n ),\n summary: z\n .string()\n .describe(\n \"A brief paragraph summarizing the agent's core identity insights\",\n ),\n});\n\nexport type IdentityConsolidationResultParsed = z.infer<\n typeof IdentityConsolidationResultSchema\n>;\n\n// Contradiction Verification (Phase 2B)\nexport const ContradictionVerificationSchema = z.object({\n isContradiction: z\n .boolean()\n .describe(\"Whether the two memories truly contradict each other\"),\n confidence: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How confident are you in this assessment (0-1)\"),\n reasoning: z\n .string()\n .describe(\"Explanation of why these are or are not contradictory\"),\n whichIsNewer: z\n .enum([\"first\", \"second\", \"unclear\"])\n .describe(\"Which memory represents the more recent/current state\"),\n});\n\nexport type ContradictionVerificationResult = z.infer<\n typeof ContradictionVerificationSchema\n>;\n\n// Memory Linking (Phase 3A)\nexport const MemoryLinkSchema = z.object({\n targetId: z\n .string()\n .describe(\"The ID of the memory this links to\"),\n linkType: z\n .enum([\"follows\", \"references\", \"contradicts\", \"supports\", \"related\"])\n .describe(\"The type of relationship\"),\n strength: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How strong is this relationship (0-1)\"),\n reason: z\n .string()\n .optional()\n .nullable()\n .describe(\"Why this link exists\"),\n});\n\nexport const SuggestedLinksSchema = z.object({\n links: z\n .array(MemoryLinkSchema)\n .describe(\"Suggested links between memories based on semantic analysis\"),\n});\n\nexport type MemoryLink = z.infer<typeof MemoryLinkSchema>;\nexport type SuggestedLinks = z.infer<typeof SuggestedLinksSchema>;\n\n// Memory Summarization (Phase 4A)\nexport const MemorySummarySchema = z.object({\n summaryText: z\n .string()\n .describe(\"A concise summary of the batch of memories\"),\n keyFacts: z\n .array(z.string())\n .describe(\"The most important facts extracted from these memories\"),\n keyEntities: z\n .array(z.string())\n .describe(\"Key entities mentioned across these memories\"),\n});\n\nexport type MemorySummaryResult = z.infer<typeof MemorySummarySchema>;\n\nexport const DaySummaryResultSchema = z.object({\n summary: z.string().min(1).describe(\"A concise end-of-day summary paragraph.\"),\n bullets: z.array(z.string()).default([]).describe(\"The most important moments from the day.\"),\n next_actions: z.array(z.string()).default([]).describe(\"Concrete next actions for tomorrow.\"),\n risks_or_open_loops: z.array(z.string()).default([]).describe(\"Open loops, blockers, or fragile assumptions still needing attention.\"),\n});\n\n// v8.15 behavior-loop auto-tuning state contracts\nexport const BehaviorLoopAdjustmentSchema = z.object({\n parameter: z.string().min(1),\n previousValue: z.number(),\n nextValue: z.number(),\n delta: z.number(),\n evidenceCount: z.number().int().min(0),\n confidence: z.number().min(0).max(1),\n reason: z.string(),\n appliedAt: z.string(),\n});\n\nexport const BehaviorLoopPolicyStateSchema = z.object({\n version: z.number().int().min(0),\n windowDays: z.number().int().min(0),\n minSignalCount: z.number().int().min(0),\n maxDeltaPerCycle: z.number().min(0).max(1),\n protectedParams: z.array(z.string()),\n adjustments: z.array(BehaviorLoopAdjustmentSchema),\n updatedAt: z.string(),\n});\n\nexport type BehaviorLoopAdjustmentParsed = z.infer<typeof BehaviorLoopAdjustmentSchema>;\nexport type BehaviorLoopPolicyStateParsed = z.infer<typeof BehaviorLoopPolicyStateSchema>;\n\nexport type MemoryActionTypeParsed = z.infer<typeof MemoryActionTypeSchema>;\nexport type MemoryActionEligibilityContextParsed = z.infer<typeof MemoryActionEligibilityContextSchema>;\nexport type ExtractedFactParsed = z.infer<typeof ExtractedFactSchema>;\nexport type EntityMentionParsed = z.infer<typeof EntityMentionSchema>;\nexport type ExtractedQuestionParsed = z.infer<typeof ExtractedQuestionSchema>;\nexport type ProactiveQuestionsResultParsed = z.infer<typeof ProactiveQuestionsResultSchema>;\nexport type ExtractionResultParsed = z.infer<typeof ExtractionResultSchema>;\nexport type ConsolidationItemParsed = z.infer<typeof ConsolidationItemSchema>;\nexport type ConsolidationResultParsed = z.infer<\n typeof ConsolidationResultSchema\n>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yBAAyB,EAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,uCAAuC,EACjD,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,E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