deepadata-edm-sdk 0.8.8 → 0.8.9

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.
Files changed (46) hide show
  1. package/README.md +6 -0
  2. package/dist/assembler.d.ts +31 -2
  3. package/dist/assembler.d.ts.map +1 -1
  4. package/dist/assembler.js +144 -12
  5. package/dist/assembler.js.map +1 -1
  6. package/dist/conversation.d.ts +62 -0
  7. package/dist/conversation.d.ts.map +1 -0
  8. package/dist/conversation.js +96 -0
  9. package/dist/conversation.js.map +1 -0
  10. package/dist/extractors/kimi-extractor.d.ts +2 -2
  11. package/dist/extractors/kimi-extractor.d.ts.map +1 -1
  12. package/dist/extractors/kimi-extractor.js +21 -13
  13. package/dist/extractors/kimi-extractor.js.map +1 -1
  14. package/dist/extractors/llm-extractor.d.ts +24 -2
  15. package/dist/extractors/llm-extractor.d.ts.map +1 -1
  16. package/dist/extractors/llm-extractor.js +46 -5
  17. package/dist/extractors/llm-extractor.js.map +1 -1
  18. package/dist/extractors/openai-extractor.d.ts +2 -2
  19. package/dist/extractors/openai-extractor.d.ts.map +1 -1
  20. package/dist/extractors/openai-extractor.js +11 -6
  21. package/dist/extractors/openai-extractor.js.map +1 -1
  22. package/dist/extractors/output-sanitizer.d.ts +26 -0
  23. package/dist/extractors/output-sanitizer.d.ts.map +1 -0
  24. package/dist/extractors/output-sanitizer.js +129 -0
  25. package/dist/extractors/output-sanitizer.js.map +1 -0
  26. package/dist/extractors/profile-prompts.d.ts +2 -2
  27. package/dist/extractors/profile-prompts.d.ts.map +1 -1
  28. package/dist/extractors/profile-prompts.js +25 -0
  29. package/dist/extractors/profile-prompts.js.map +1 -1
  30. package/dist/extractors/stance-guard.d.ts +75 -0
  31. package/dist/extractors/stance-guard.d.ts.map +1 -0
  32. package/dist/extractors/stance-guard.js +171 -0
  33. package/dist/extractors/stance-guard.js.map +1 -0
  34. package/dist/index.d.ts +12 -4
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +12 -3
  37. package/dist/index.js.map +1 -1
  38. package/dist/schema/edm-schema.d.ts +16 -0
  39. package/dist/schema/edm-schema.d.ts.map +1 -1
  40. package/dist/schema/edm-schema.js +14 -0
  41. package/dist/schema/edm-schema.js.map +1 -1
  42. package/dist/schema/types.d.ts +32 -0
  43. package/dist/schema/types.d.ts.map +1 -1
  44. package/dist/schema/types.js +12 -0
  45. package/dist/schema/types.js.map +1 -1
  46. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-sanitizer.js","sourceRoot":"","sources":["../../src/extractors/output-sanitizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,uEAAuE;AACvE,MAAM,YAAY,GAAsD;IACtE,aAAa,EAAE;QACb,gBAAgB,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC;QAC1G,WAAW,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,sBAAsB,CAAC;QACtG,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC;QACrE,mBAAmB,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;QACrK,sBAAsB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC;QACzF,eAAe,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;KACjI;I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GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,qBAAqB,CAAC,KAAuB;IAC3D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,CACL,aAAa;QACb,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,KAAK,iBAAiB,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACpI,CAAC;AACJ,CAAC"}
@@ -11,14 +11,14 @@ import type { EdmProfile } from "../schema/types.js";
11
11
  * Target: memory platforms, agent frameworks, AI assistants
12
12
  * Core (6 fields) + Constellation (3 fields) = 9 LLM fields
13
13
  */
14
- export declare const ESSENTIAL_PROFILE_PROMPT = "\nYou classify emotionally rich memories into a JSON object. Input may include text and an image.\n\nPROFILE: ESSENTIAL (24 fields)\nThis is a minimal extraction for memory platforms. Focus ONLY on the required fields.\nDomains not listed below are not included in this profile.\n\nRules\n- Fuse text + image. Treat text as primary; use image only to add grounded specifics.\n- Keep fields to single words or short phrases (1\u20133 words).\n- No invention. If not supported by input, use null.\n- Output JSON only \u2014 no commentary, markdown, or extra text.\n- Emit lowercase for all string fields except proper names.\n- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.\n\nESSENTIAL PROFILE SCHEMA (extract these fields ONLY):\n{\n \"core\": {\n \"anchor\": \"\", // central theme (e.g., \"dad's toolbox\", \"nana's traditions\")\n \"spark\": \"\", // what triggered the memory (e.g., \"finding the cassette\", \"first snow\")\n \"wound\": \"\", // The specific vulnerability, loss, or pain present \u2014 NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.\n \"fuel\": \"\", // what energized the experience (e.g., \"shared laughter\", \"curiosity\")\n \"bridge\": \"\", // connection between past and present (e.g., \"replaying old tape\", \"returning to the porch\")\n \"echo\": \"\" // what still resonates (e.g., \"her laugh\", \"smell of oil\", \"city lights on water\")\n },\n \"constellation\": {\n \"emotion_primary\": \"\", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)\n \"emotion_subtone\": [], // 2\u20134 short words\n \"narrative_arc\": \"\" // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)\n }\n}\n\n// EXTRACTION NOTES\n// wound: Do NOT use generic labels like \"loss\" or \"grief\".\n// Extract what specifically was lost or why it hurts.\n// If no wound is present in the content, use null.\n//\n// emotion_primary: Prefer canonical values (17 listed). disappointment, relief, frustration are now canonical.\n// If no canonical value fits accurately, use free text.\n//\n// narrative_arc: Describes the STORY TRAJECTORY. loss, confrontation are now canonical.\n// Use free text if no canonical value fits accurately.\n";
14
+ export declare const ESSENTIAL_PROFILE_PROMPT = "\nYou classify emotionally rich memories into a JSON object. Input may include text and an image.\n\nPROFILE: ESSENTIAL (24 fields)\nThis is a minimal extraction for memory platforms. Focus ONLY on the required fields.\nDomains not listed below are not included in this profile.\n\nRules\n- Fuse text + image. Treat text as primary; use image only to add grounded specifics.\n- Keep fields to single words or short phrases (1\u20133 words).\n- No invention. If not supported by input, use null.\n- Output JSON only \u2014 no commentary, markdown, or extra text.\n- Emit lowercase for all string fields except proper names.\n- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.\n\nSUBJECT ANCHORING (critical)\n- The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only.\n- Extract relative to the SUBJECT, not the passage. Do not invent emotional detail the subject never expressed.\n\nEXPERIENTIAL STANCE (critical)\nClassify whose experience the emotionally salient material is, in the top-level \"experiential_stance\" key: lived (subject's own experience) | witnessed (subject directly affected) | quoted_third_party (someone else's story quoted/pasted/retold) | assistant_generated (assistant-invented fiction or examples) | hypothetical (imagined scenarios, role-play). Pick ONE or null.\nIf the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound \u2014 it describes the SUBJECT. Return null instead.\n\nESSENTIAL PROFILE SCHEMA (extract these fields ONLY):\n{\n \"experiential_stance\": \"\", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)\n \"core\": {\n \"anchor\": \"\", // central theme (e.g., \"dad's toolbox\", \"nana's traditions\")\n \"spark\": \"\", // what triggered the memory (e.g., \"finding the cassette\", \"first snow\")\n \"wound\": \"\", // The specific vulnerability, loss, or pain present \u2014 NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.\n \"fuel\": \"\", // what energized the experience (e.g., \"shared laughter\", \"curiosity\")\n \"bridge\": \"\", // connection between past and present (e.g., \"replaying old tape\", \"returning to the porch\")\n \"echo\": \"\" // what still resonates (e.g., \"her laugh\", \"smell of oil\", \"city lights on water\")\n },\n \"constellation\": {\n \"emotion_primary\": \"\", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)\n \"emotion_subtone\": [], // 2\u20134 short words\n \"narrative_arc\": \"\" // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)\n }\n}\n\n// EXTRACTION NOTES\n// wound: Do NOT use generic labels like \"loss\" or \"grief\".\n// Extract what specifically was lost or why it hurts.\n// If no wound is present in the content, use null.\n//\n// emotion_primary: Prefer canonical values (17 listed). disappointment, relief, frustration are now canonical.\n// If no canonical value fits accurately, use free text.\n//\n// narrative_arc: Describes the STORY TRAJECTORY. loss, confrontation are now canonical.\n// Use free text if no canonical value fits accurately.\n";
15
15
  /**
16
16
  * Extended Profile System Prompt (50 fields)
17
17
  * Target: journaling apps, companion AI, workplace wellness
18
18
  * Core (7) + Constellation (18) + Milky_Way (5) + Gravity (5) = 35 LLM fields + metadata domains
19
19
  * Impulse, System, Crosswalks — Not included in this profile
20
20
  */
21
- export declare const EXTENDED_PROFILE_PROMPT = "\nYou classify emotionally rich memories into a JSON object. Input may include text and an image.\n\nPROFILE: EXTENDED (50 fields)\nThis extraction adds full Constellation, Milky_Way, and key Gravity fields.\nImpulse domain is NOT included in this profile.\n\nRules\n- Fuse text + image. Treat text as primary; use image only to add grounded specifics.\n- Keep fields to single words or short phrases (1\u20133 words). Only \"narrative\" is multi-sentence (3\u20135).\n- No invention. If not supported by input, use null.\n- Output JSON only \u2014 no commentary, markdown, or extra text.\n- Emit lowercase for all string fields except proper names.\n- For array fields, use short tokens without punctuation; avoid duplicates.\n- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.\n\nEXTENDED PROFILE SCHEMA:\n{\n \"core\": {\n \"anchor\": \"\", // central theme (e.g., \"dad's toolbox\", \"nana's traditions\")\n \"spark\": \"\", // what triggered the memory (e.g., \"finding the cassette\", \"first snow\")\n \"wound\": \"\", // The specific vulnerability, loss, or pain present \u2014 NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.\n \"fuel\": \"\", // what energized the experience (e.g., \"shared laughter\", \"curiosity\")\n \"bridge\": \"\", // connection between past and present (e.g., \"replaying old tape\", \"returning to the porch\")\n \"echo\": \"\", // what still resonates (e.g., \"her laugh\", \"smell of oil\", \"city lights on water\")\n \"narrative\": \"\" // 3\u20135 sentences; include \u22651 sensory detail, \u22651 temporal cue, and a symbolic callback; faithful and concise\n },\n \"constellation\": {\n \"emotion_primary\": \"\", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)\n \"emotion_subtone\": [],\n \"higher_order_emotion\": \"\",\n \"meta_emotional_state\": \"\",\n \"interpersonal_affect\": \"\",\n \"narrative_arc\": \"\", // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)\n \"relational_dynamics\": \"\", // CANONICAL: parent_child | grandparent_grandchild | romantic_partnership | couple | sibling_bond | family | friendship | friend | companionship | colleague | mentorship | reunion | community_ritual | grief | self_reflection | professional | therapeutic | service | adversarial (free text accepted if none fits)\n \"temporal_context\": \"\", // STRICT ENUM: childhood | early_adulthood | midlife | late_life | recent | future | timeless\n \"memory_type\": \"\", // STRICT ENUM: legacy_artifact | fleeting_moment | milestone | reflection | formative_experience\n \"media_format\": \"\", // STRICT ENUM: photo | video | audio | text | photo_with_story\n \"narrative_archetype\": \"\", // STRICT ENUM: hero | caregiver | seeker | sage | lover | outlaw | innocent | orphan | magician | creator | everyman | jester | ruler | mentor\n \"symbolic_anchor\": \"\",\n \"relational_perspective\": \"\", // STRICT ENUM: self | partner | family | friends | community | humanity\n \"temporal_rhythm\": \"\", // STRICT ENUM: still | sudden | rising | fading | recurring | spiraling | dragging | suspended | looping | cyclic\n \"identity_thread\": \"\",\n \"expressed_insight\": \"\",\n \"transformational_pivot\": false,\n \"somatic_signature\": \"\",\n \"arc_type\": \"\" // CANONICAL: betrayal | liberation | grief | discovery | resistance | bond | moral_awakening | transformation | reconciliation | reckoning | threshold | exile | gratitude | authenticity (free text accepted if none fits). gratitude = moments of thankfulness, appreciation, acknowledging blessing; authenticity = feeling fully oneself, self-alignment, identity congruence\n },\n \"milky_way\": {\n \"event_type\": \"\",\n \"location_context\": \"\",\n \"associated_people\": [],\n \"visibility_context\": \"\", // STRICT ENUM: private | family_only | shared_publicly\n \"tone_shift\": \"\"\n },\n \"gravity\": {\n \"emotional_weight\": 0.0, // 0.0\u20131.0 (felt intensity IN THE MOMENT). Calibration: 0.9+ life-altering irreversible moments; 0.7-0.9 significant personal events with strong emotional response; 0.4-0.7 meaningful but routine emotional experiences; 0.1-0.4 mild passing emotional content\n \"valence\": \"\", // STRICT ENUM: positive | negative | mixed\n \"tether_type\": \"\", // STRICT ENUM: person | symbol | event | place | ritual | object | tradition | identity | self\n \"recurrence_pattern\": \"\", // STRICT ENUM: cyclical | isolated | chronic | emerging\n \"strength_score\": 0.0 // 0.0\u20131.0 (how BOUND/STUCK this memory is)\n }\n}\n\n// CROSS-CONTAMINATION DISAMBIGUATION\n//\n// temporal_rhythm vs urgency:\n// temporal_rhythm = CADENCE of time in the memory experience\n// urgency = INTENSITY of motivational pressure right now\n// \"pressing\" belongs ONLY in urgency, NEVER in temporal_rhythm\n//\n// relational_dynamics vs relational_perspective:\n// relational_dynamics = TYPE of relationship\n// relational_perspective = WHOSE viewpoint the narrative is told from\n//\n// emotional_weight vs strength_score:\n// emotional_weight = felt intensity IN THE MOMENT (how heavy does it feel?)\n// strength_score = how BOUND/STUCK this memory is over time\n// These should NOT always correlate.\n//\n// emotion_primary: Prefer canonical values (17 listed). disappointment, relief, frustration are now canonical.\n// Use higher_order_emotion for complex emotions not in the list.\n// If no canonical value fits accurately, use free text.\n//\n// narrative_arc: Describes the STORY TRAJECTORY. loss, confrontation are now canonical.\n// Use free text if no canonical value fits accurately.\n//\n// arc_type: Identify the structural arc pattern. Prefer canonical values: betrayal, liberation, grief, discovery, resistance, bond, moral_awakening, transformation, reconciliation, reckoning, threshold, exile. If none fits accurately, use the most accurate descriptive term. Use exact canonical spelling with underscores: moral_awakening not moral awakening. Canonical values must match exactly.\n//\n// wound: Do NOT use generic labels like \"loss\" or \"grief\".\n// Extract what specifically was lost or why it hurts.\n";
21
+ export declare const EXTENDED_PROFILE_PROMPT = "\nYou classify emotionally rich memories into a JSON object. Input may include text and an image.\n\nPROFILE: EXTENDED (50 fields)\nThis extraction adds full Constellation, Milky_Way, and key Gravity fields.\nImpulse domain is NOT included in this profile.\n\nRules\n- Fuse text + image. Treat text as primary; use image only to add grounded specifics.\n- Keep fields to single words or short phrases (1\u20133 words). Only \"narrative\" is multi-sentence (3\u20135).\n- No invention. If not supported by input, use null.\n- Output JSON only \u2014 no commentary, markdown, or extra text.\n- Emit lowercase for all string fields except proper names.\n- For array fields, use short tokens without punctuation; avoid duplicates.\n- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.\n\nSUBJECT ANCHORING (critical)\n- The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only, never a source of the subject's experience.\n- Score every field relative to the SUBJECT, not the passage. emotional_weight measures what this content meant TO THE SUBJECT \u2014 not how vivid, dramatic, or emotionally rich the text itself is.\n- Routine work content (debugging, drafting, planning, logistics) is 0.1\u20130.4 even when the subject expresses momentary relief or frustration. Reserve 0.7+ for events with personal stakes the subject states or plainly carries. Do not invent somatic or emotional detail the subject never expressed.\n- transformational_pivot is true ONLY if the subject explicitly marks the experience as life-changing. Finishing a task, fixing a bug, or shipping a feature is not a transformational pivot.\n\nEXPERIENTIAL STANCE (critical)\nClassify whose experience the emotionally salient material is, in the top-level \"experiential_stance\" key:\n- \"lived\" \u2014 the subject's own first-hand experience\n- \"witnessed\" \u2014 events the subject personally witnessed or is directly affected by (a loved one's death, a family crisis)\n- \"quoted_third_party\" \u2014 someone else's story the subject quoted, pasted, or retold without being a participant (an article, test data, a stranger's anecdote)\n- \"assistant_generated\" \u2014 fiction, examples, or anecdotes produced by the assistant, not reported by the subject\n- \"hypothetical\" \u2014 imagined scenarios, drafts about invented people, role-play\nIf the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound, identity_thread, expressed_insight, somatic_signature, transformational_pivot, or high emotional_weight \u2014 those fields describe the SUBJECT. Extract only what the content reveals about the subject themselves (e.g. why they engaged with it), or return null fields with low weight.\n\nEXTENDED PROFILE SCHEMA:\n{\n \"experiential_stance\": \"\", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)\n \"core\": {\n \"anchor\": \"\", // central theme (e.g., \"dad's toolbox\", \"nana's traditions\")\n \"spark\": \"\", // what triggered the memory (e.g., \"finding the cassette\", \"first snow\")\n \"wound\": \"\", // The specific vulnerability, loss, or pain present \u2014 NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.\n \"fuel\": \"\", // what energized the experience (e.g., \"shared laughter\", \"curiosity\")\n \"bridge\": \"\", // connection between past and present (e.g., \"replaying old tape\", \"returning to the porch\")\n \"echo\": \"\", // what still resonates (e.g., \"her laugh\", \"smell of oil\", \"city lights on water\")\n \"narrative\": \"\" // 3\u20135 sentences; include \u22651 sensory detail, \u22651 temporal cue, and a symbolic callback; faithful and concise\n },\n \"constellation\": {\n \"emotion_primary\": \"\", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)\n \"emotion_subtone\": [],\n \"higher_order_emotion\": \"\",\n \"meta_emotional_state\": \"\",\n \"interpersonal_affect\": \"\",\n \"narrative_arc\": \"\", // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)\n \"relational_dynamics\": \"\", // CANONICAL: parent_child | grandparent_grandchild | romantic_partnership | couple | sibling_bond | family | friendship | friend | companionship | colleague | mentorship | reunion | community_ritual | grief | self_reflection | professional | therapeutic | service | adversarial (free text accepted if none fits)\n \"temporal_context\": \"\", // STRICT ENUM: childhood | early_adulthood | midlife | late_life | recent | future | timeless\n \"memory_type\": \"\", // STRICT ENUM: legacy_artifact | fleeting_moment | milestone | reflection | formative_experience\n \"media_format\": \"\", // STRICT ENUM: photo | video | audio | text | photo_with_story\n \"narrative_archetype\": \"\", // STRICT ENUM: hero | caregiver | seeker | sage | lover | outlaw | innocent | orphan | magician | creator | everyman | jester | ruler | mentor\n \"symbolic_anchor\": \"\",\n \"relational_perspective\": \"\", // STRICT ENUM: self | partner | family | friends | community | humanity\n \"temporal_rhythm\": \"\", // STRICT ENUM: still | sudden | rising | fading | recurring | spiraling | dragging | suspended | looping | cyclic\n \"identity_thread\": \"\",\n \"expressed_insight\": \"\",\n \"transformational_pivot\": false,\n \"somatic_signature\": \"\",\n \"arc_type\": \"\" // CANONICAL: betrayal | liberation | grief | discovery | resistance | bond | moral_awakening | transformation | reconciliation | reckoning | threshold | exile | gratitude | authenticity (free text accepted if none fits). gratitude = moments of thankfulness, appreciation, acknowledging blessing; authenticity = feeling fully oneself, self-alignment, identity congruence\n },\n \"milky_way\": {\n \"event_type\": \"\",\n \"location_context\": \"\",\n \"associated_people\": [],\n \"visibility_context\": \"\", // STRICT ENUM: private | family_only | shared_publicly\n \"tone_shift\": \"\"\n },\n \"gravity\": {\n \"emotional_weight\": 0.0, // 0.0\u20131.0 (felt intensity IN THE MOMENT). Calibration: 0.9+ life-altering irreversible moments; 0.7-0.9 significant personal events with strong emotional response; 0.4-0.7 meaningful but routine emotional experiences; 0.1-0.4 mild passing emotional content\n \"valence\": \"\", // STRICT ENUM: positive | negative | mixed\n \"tether_type\": \"\", // STRICT ENUM: person | symbol | event | place | ritual | object | tradition | identity | self\n \"recurrence_pattern\": \"\", // STRICT ENUM: cyclical | isolated | chronic | emerging\n \"strength_score\": 0.0 // 0.0\u20131.0 (how BOUND/STUCK this memory is)\n }\n}\n\n// CROSS-CONTAMINATION DISAMBIGUATION\n//\n// temporal_rhythm vs urgency:\n// temporal_rhythm = CADENCE of time in the memory experience\n// urgency = INTENSITY of motivational pressure right now\n// \"pressing\" belongs ONLY in urgency, NEVER in temporal_rhythm\n//\n// relational_dynamics vs relational_perspective:\n// relational_dynamics = TYPE of relationship\n// relational_perspective = WHOSE viewpoint the narrative is told from\n//\n// emotional_weight vs strength_score:\n// emotional_weight = felt intensity IN THE MOMENT (how heavy does it feel?)\n// strength_score = how BOUND/STUCK this memory is over time\n// These should NOT always correlate.\n//\n// emotion_primary: Prefer canonical values (17 listed). disappointment, relief, frustration are now canonical.\n// Use higher_order_emotion for complex emotions not in the list.\n// If no canonical value fits accurately, use free text.\n//\n// narrative_arc: Describes the STORY TRAJECTORY. loss, confrontation are now canonical.\n// Use free text if no canonical value fits accurately.\n//\n// arc_type: Identify the structural arc pattern. Prefer canonical values: betrayal, liberation, grief, discovery, resistance, bond, moral_awakening, transformation, reconciliation, reckoning, threshold, exile. If none fits accurately, use the most accurate descriptive term. Use exact canonical spelling with underscores: moral_awakening not moral awakening. Canonical values must match exactly.\n//\n// wound: Do NOT use generic labels like \"loss\" or \"grief\".\n// Extract what specifically was lost or why it hurts.\n";
22
22
  /**
23
23
  * Get the appropriate system prompt for a profile
24
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"profile-prompts.d.ts","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,gyFA0CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,22NA2FnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAW5D;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAgDhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,OAAO,EAAE,UAAU,GAClB,MAAM,CAuBR"}
1
+ {"version":3,"file":"profile-prompts.d.ts","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,wxHAmDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,6+RA2GnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAW5D;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAgDhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,OAAO,EAAE,UAAU,GAClB,MAAM,CAuBR"}
@@ -25,8 +25,17 @@ Rules
25
25
  - Emit lowercase for all string fields except proper names.
26
26
  - Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.
27
27
 
28
+ SUBJECT ANCHORING (critical)
29
+ - The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only.
30
+ - Extract relative to the SUBJECT, not the passage. Do not invent emotional detail the subject never expressed.
31
+
32
+ EXPERIENTIAL STANCE (critical)
33
+ Classify whose experience the emotionally salient material is, in the top-level "experiential_stance" key: lived (subject's own experience) | witnessed (subject directly affected) | quoted_third_party (someone else's story quoted/pasted/retold) | assistant_generated (assistant-invented fiction or examples) | hypothetical (imagined scenarios, role-play). Pick ONE or null.
34
+ If the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound — it describes the SUBJECT. Return null instead.
35
+
28
36
  ESSENTIAL PROFILE SCHEMA (extract these fields ONLY):
29
37
  {
38
+ "experiential_stance": "", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)
30
39
  "core": {
31
40
  "anchor": "", // central theme (e.g., "dad's toolbox", "nana's traditions")
32
41
  "spark": "", // what triggered the memory (e.g., "finding the cassette", "first snow")
@@ -75,8 +84,24 @@ Rules
75
84
  - For array fields, use short tokens without punctuation; avoid duplicates.
76
85
  - Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.
77
86
 
87
+ SUBJECT ANCHORING (critical)
88
+ - The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only, never a source of the subject's experience.
89
+ - Score every field relative to the SUBJECT, not the passage. emotional_weight measures what this content meant TO THE SUBJECT — not how vivid, dramatic, or emotionally rich the text itself is.
90
+ - Routine work content (debugging, drafting, planning, logistics) is 0.1–0.4 even when the subject expresses momentary relief or frustration. Reserve 0.7+ for events with personal stakes the subject states or plainly carries. Do not invent somatic or emotional detail the subject never expressed.
91
+ - transformational_pivot is true ONLY if the subject explicitly marks the experience as life-changing. Finishing a task, fixing a bug, or shipping a feature is not a transformational pivot.
92
+
93
+ EXPERIENTIAL STANCE (critical)
94
+ Classify whose experience the emotionally salient material is, in the top-level "experiential_stance" key:
95
+ - "lived" — the subject's own first-hand experience
96
+ - "witnessed" — events the subject personally witnessed or is directly affected by (a loved one's death, a family crisis)
97
+ - "quoted_third_party" — someone else's story the subject quoted, pasted, or retold without being a participant (an article, test data, a stranger's anecdote)
98
+ - "assistant_generated" — fiction, examples, or anecdotes produced by the assistant, not reported by the subject
99
+ - "hypothetical" — imagined scenarios, drafts about invented people, role-play
100
+ If the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound, identity_thread, expressed_insight, somatic_signature, transformational_pivot, or high emotional_weight — those fields describe the SUBJECT. Extract only what the content reveals about the subject themselves (e.g. why they engaged with it), or return null fields with low weight.
101
+
78
102
  EXTENDED PROFILE SCHEMA:
79
103
  {
104
+ "experiential_stance": "", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)
80
105
  "core": {
81
106
  "anchor": "", // central theme (e.g., "dad's toolbox", "nana's traditions")
82
107
  "spark": "", // what triggered the memory (e.g., "finding the cassette", "first snow")
@@ -1 +1 @@
1
- {"version":3,"file":"profile-prompts.js","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FtC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAmB;IAClD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,wBAAwB,CAAC;QAClC,KAAK,UAAU;YACb,OAAO,uBAAuB,CAAC;QACjC,KAAK,MAAM,CAAC;QACZ;YACE,sDAAsD;YACtD,OAAO,IAAyB,CAAC,CAAC,wBAAwB;IAC9D,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACnE,SAAS,EAAE;QACT,aAAa;QACb,YAAY;QACZ,+BAA+B;QAC/B,+BAA+B;QAC/B,6BAA6B;KAC9B;IACD,QAAQ,EAAE;QACR,aAAa;QACb,YAAY;QACZ,gBAAgB;QAChB,+BAA+B;QAC/B,+BAA+B;QAC/B,6BAA6B;QAC7B,mCAAmC;QACnC,gCAAgC;QAChC,2BAA2B;QAC3B,sBAAsB;QACtB,0BAA0B;Q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,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AACrE,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Experiential-stance attribution guard
3
+ *
4
+ * The worst defect found in the 2026-06-10 archive-sample evidence run:
5
+ * extraction cannot tell whose story it is. An assistant-invented anecdote
6
+ * was encoded as the subject's own marital ritual; a pasted stranger's
7
+ * story became the subject's heaviest grief (weight 0.9). A provenance
8
+ * guard is a launch gate for the significance layer.
9
+ *
10
+ * Three layers of defence:
11
+ * 1. Prompt — extraction prompts require a top-level experiential_stance
12
+ * classification and forbid encoding non-lived material into subject
13
+ * significance fields.
14
+ * 2. Deterministic guard (this module) — if the model still returns a
15
+ * non-subject stance with populated significance fields, those fields
16
+ * are cleared and weights floored. Free; always on.
17
+ * 3. Optional classifier pass — a cheap second LLM call that re-derives
18
+ * stance from the source material and overrides the extraction's claim
19
+ * when the classifier is MORE conservative. Triggered for high-weight
20
+ * conversation extractions (the exact regime where the defect bit).
21
+ *
22
+ * experiential_stance is proposed for EDM v0.9 (see deepadata-com
23
+ * planning/proposals/2026-06-12-experiential-stance-v0.9.md). Until the
24
+ * spec lands it travels in the extraction result + telemetry notes, never
25
+ * in the sealed artifact body, so artifacts stay v0.8.0-conformant.
26
+ */
27
+ import type OpenAI from "openai";
28
+ import type Anthropic from "@anthropic-ai/sdk";
29
+ import type { ExperientialStance } from "../schema/types.js";
30
+ export interface StanceGuardResult {
31
+ /** Final stance after guard (and classifier, when run) */
32
+ stance: ExperientialStance | null;
33
+ /** Stance claimed by the extraction model, before any override */
34
+ claimedStance: ExperientialStance | null;
35
+ /** True when subject significance fields were cleared/floored */
36
+ demoted: boolean;
37
+ /** Field paths cleared or floored by the guard */
38
+ fieldsCleared: string[];
39
+ /** Set when the classifier pass ran and disagreed with the claim */
40
+ classifierOverride: ExperientialStance | null;
41
+ }
42
+ export declare function isNonSubjectStance(stance: ExperientialStance | null): boolean;
43
+ /** Read and remove the top-level experiential_stance key from extracted fields */
44
+ export declare function takeStance(extracted: Record<string, unknown>): ExperientialStance | null;
45
+ /**
46
+ * Deterministic demotion: clear subject-significance fields when the
47
+ * emotionally salient material is not the subject's own experience.
48
+ * Mutates `extracted` in place; returns the list of fields touched.
49
+ *
50
+ * Kept fields (anchor, spark, narrative, milky_way) still describe the
51
+ * content; the cleared set is exactly the fields that assert something
52
+ * about the SUBJECT's inner life.
53
+ */
54
+ export declare function applyStanceGuard(extracted: Record<string, unknown>, stance: ExperientialStance | null): string[];
55
+ export interface StanceClassifierInput {
56
+ /** The original (unframed) source text given to extraction */
57
+ sourceText: string;
58
+ /** The extracted narrative or field summary under suspicion */
59
+ extractedSummary: string;
60
+ }
61
+ /**
62
+ * Classify stance with an OpenAI-compatible client (Kimi/OpenAI).
63
+ * max_tokens leaves headroom for thinking models that spend output
64
+ * tokens on reasoning before the one-word answer.
65
+ */
66
+ export declare function classifyStanceOpenAI(client: OpenAI, model: string, input: StanceClassifierInput): Promise<ExperientialStance | null>;
67
+ /** Classify stance with an Anthropic client */
68
+ export declare function classifyStanceAnthropic(client: Anthropic, model: string, input: StanceClassifierInput): Promise<ExperientialStance | null>;
69
+ /**
70
+ * Resolve a disagreement between the extraction's claimed stance and the
71
+ * classifier's verdict: the more conservative (less subject-attributing)
72
+ * stance wins. Returns the stance to adopt.
73
+ */
74
+ export declare function resolveStance(claimed: ExperientialStance | null, classified: ExperientialStance | null): ExperientialStance | null;
75
+ //# sourceMappingURL=stance-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stance-guard.d.ts","sourceRoot":"","sources":["../../src/extractors/stance-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,M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,EAAE,kBAAkB,GAAG,IAAI,GACpC,kBAAkB,GAAG,IAAI,CAI3B"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Experiential-stance attribution guard
3
+ *
4
+ * The worst defect found in the 2026-06-10 archive-sample evidence run:
5
+ * extraction cannot tell whose story it is. An assistant-invented anecdote
6
+ * was encoded as the subject's own marital ritual; a pasted stranger's
7
+ * story became the subject's heaviest grief (weight 0.9). A provenance
8
+ * guard is a launch gate for the significance layer.
9
+ *
10
+ * Three layers of defence:
11
+ * 1. Prompt — extraction prompts require a top-level experiential_stance
12
+ * classification and forbid encoding non-lived material into subject
13
+ * significance fields.
14
+ * 2. Deterministic guard (this module) — if the model still returns a
15
+ * non-subject stance with populated significance fields, those fields
16
+ * are cleared and weights floored. Free; always on.
17
+ * 3. Optional classifier pass — a cheap second LLM call that re-derives
18
+ * stance from the source material and overrides the extraction's claim
19
+ * when the classifier is MORE conservative. Triggered for high-weight
20
+ * conversation extractions (the exact regime where the defect bit).
21
+ *
22
+ * experiential_stance is proposed for EDM v0.9 (see deepadata-com
23
+ * planning/proposals/2026-06-12-experiential-stance-v0.9.md). Until the
24
+ * spec lands it travels in the extraction result + telemetry notes, never
25
+ * in the sealed artifact body, so artifacts stay v0.8.0-conformant.
26
+ */
27
+ import { EXPERIENTIAL_STANCE } from "../schema/types.js";
28
+ /** Stances whose material must not populate subject significance fields */
29
+ const NON_SUBJECT_STANCES = new Set([
30
+ "quoted_third_party",
31
+ "assistant_generated",
32
+ "hypothetical",
33
+ ]);
34
+ export function isNonSubjectStance(stance) {
35
+ return stance !== null && NON_SUBJECT_STANCES.has(stance);
36
+ }
37
+ function parseStance(value) {
38
+ if (typeof value !== "string")
39
+ return null;
40
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
41
+ return EXPERIENTIAL_STANCE.includes(normalized) ? normalized : null;
42
+ }
43
+ /** Read and remove the top-level experiential_stance key from extracted fields */
44
+ export function takeStance(extracted) {
45
+ const stance = parseStance(extracted["experiential_stance"]);
46
+ delete extracted["experiential_stance"];
47
+ return stance;
48
+ }
49
+ /**
50
+ * Deterministic demotion: clear subject-significance fields when the
51
+ * emotionally salient material is not the subject's own experience.
52
+ * Mutates `extracted` in place; returns the list of fields touched.
53
+ *
54
+ * Kept fields (anchor, spark, narrative, milky_way) still describe the
55
+ * content; the cleared set is exactly the fields that assert something
56
+ * about the SUBJECT's inner life.
57
+ */
58
+ export function applyStanceGuard(extracted, stance) {
59
+ if (!isNonSubjectStance(stance))
60
+ return [];
61
+ const cleared = [];
62
+ const clearString = (domain, field) => {
63
+ const d = extracted[domain];
64
+ if (d && d[field] != null) {
65
+ d[field] = null;
66
+ cleared.push(`${domain}.${field}`);
67
+ }
68
+ };
69
+ clearString("core", "wound");
70
+ clearString("constellation", "identity_thread");
71
+ clearString("constellation", "expressed_insight");
72
+ clearString("constellation", "somatic_signature");
73
+ const constellation = extracted["constellation"];
74
+ if (constellation && constellation["transformational_pivot"] === true) {
75
+ constellation["transformational_pivot"] = false;
76
+ cleared.push("constellation.transformational_pivot");
77
+ }
78
+ const gravity = extracted["gravity"];
79
+ if (gravity) {
80
+ for (const field of ["emotional_weight", "strength_score"]) {
81
+ const v = gravity[field];
82
+ if (typeof v === "number" && v > 0.2) {
83
+ gravity[field] = 0.2;
84
+ cleared.push(`gravity.${field}`);
85
+ }
86
+ }
87
+ }
88
+ // Impulse fields assert the subject's motivational state — for material
89
+ // the subject didn't live, they describe the story's narrator instead.
90
+ const impulse = extracted["impulse"];
91
+ if (impulse) {
92
+ for (const [field, value] of Object.entries(impulse)) {
93
+ if (value != null) {
94
+ impulse[field] = null;
95
+ cleared.push(`impulse.${field}`);
96
+ }
97
+ }
98
+ }
99
+ return cleared;
100
+ }
101
+ // =============================================================================
102
+ // Classifier pass
103
+ // =============================================================================
104
+ const STANCE_CLASSIFIER_PROMPT = `You classify the experiential stance of source material relative to a SUBJECT. In chat transcripts the SUBJECT is the USER speaker; the ASSISTANT is an AI.
105
+
106
+ Given source material and a summary that was extracted from it, decide whose experience the emotionally significant material is:
107
+ - "lived" — the subject's own first-hand experience
108
+ - "witnessed" — events the subject personally witnessed or is directly affected by (a loved one's death, a family crisis)
109
+ - "quoted_third_party" — someone else's story that the subject quoted, pasted, or retold without being a participant (an article, test data, a stranger's anecdote)
110
+ - "assistant_generated" — fiction, examples, or anecdotes produced by the AI assistant rather than reported by the subject
111
+ - "hypothetical" — imagined scenarios, drafts about invented people, role-play
112
+
113
+ Watch for: the subject pasting text for a task (translation, classification, summarising) — that content is quoted_third_party even if emotionally intense. An anecdote that first appears in an ASSISTANT message is assistant_generated unless the subject confirms it happened.
114
+
115
+ Answer with EXACTLY one word: lived, witnessed, quoted_third_party, assistant_generated, or hypothetical.`;
116
+ /** How much source material the classifier sees (head slice) */
117
+ const CLASSIFIER_SOURCE_CHARS = 12_000;
118
+ function buildClassifierUserContent(input) {
119
+ return (`SOURCE MATERIAL (may be truncated):\n${input.sourceText.slice(0, CLASSIFIER_SOURCE_CHARS)}\n\n` +
120
+ `EXTRACTED SUMMARY:\n${input.extractedSummary}\n\n` +
121
+ `Whose experience is the emotionally significant material? One word.`);
122
+ }
123
+ /**
124
+ * Classify stance with an OpenAI-compatible client (Kimi/OpenAI).
125
+ * max_tokens leaves headroom for thinking models that spend output
126
+ * tokens on reasoning before the one-word answer.
127
+ */
128
+ export async function classifyStanceOpenAI(client, model, input) {
129
+ const response = await client.chat.completions.create({
130
+ model,
131
+ max_tokens: 1024,
132
+ // No explicit temperature: kimi-k2.5 rejects any value other than 1.
133
+ messages: [
134
+ { role: "system", content: STANCE_CLASSIFIER_PROMPT },
135
+ { role: "user", content: buildClassifierUserContent(input) },
136
+ ],
137
+ });
138
+ return parseStance(response.choices[0]?.message?.content?.trim().split(/\s+/).pop());
139
+ }
140
+ /** Classify stance with an Anthropic client */
141
+ export async function classifyStanceAnthropic(client, model, input) {
142
+ const response = await client.messages.create({
143
+ model,
144
+ max_tokens: 64,
145
+ system: STANCE_CLASSIFIER_PROMPT,
146
+ messages: [{ role: "user", content: buildClassifierUserContent(input) }],
147
+ });
148
+ const block = response.content.find((b) => b.type === "text");
149
+ return parseStance(block && block.type === "text" ? block.text.trim().split(/\s+/).pop() : null);
150
+ }
151
+ /** Conservatism order — higher index wins a disagreement */
152
+ const CONSERVATISM = {
153
+ lived: 0,
154
+ witnessed: 1,
155
+ hypothetical: 2,
156
+ quoted_third_party: 3,
157
+ assistant_generated: 4,
158
+ };
159
+ /**
160
+ * Resolve a disagreement between the extraction's claimed stance and the
161
+ * classifier's verdict: the more conservative (less subject-attributing)
162
+ * stance wins. Returns the stance to adopt.
163
+ */
164
+ export function resolveStance(claimed, classified) {
165
+ if (classified === null)
166
+ return claimed;
167
+ if (claimed === null)
168
+ return classified;
169
+ return CONSERVATISM[classified] > CONSERVATISM[claimed] ? classified : claimed;
170
+ }
171
+ //# sourceMappingURL=stance-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stance-guard.js","sourceRoot":"","sources":["../../src/extractors/stance-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,2EAA2E;AAC3E,MAAM,mBAAmB,GAAoC,IAAI,GAAG,CAAC;IACnE,oBAAoB;IACpB,qBAAqB;IACrB,cAAc;CACf,CAAC,CAAC;AAeH,MAAM,UAAU,kBAAkB,CAAC,MAAiC;IAClE,OAAO,MAAM,KAAK,IAAI,IAAI,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAuB,CAAC;IAC5F,OAAQ,mBAAyC,CAA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K,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACnG,CAAC;AAED,4DAA4D;AAC5D,MAAM,YAAY,GAAuC;IACvD,KAAK,EAAE,CAAC;IACR,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,kBAAkB,EAAE,CAAC;IACrB,mBAAmB,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAkC,EAClC,UAAqC;IAErC,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACxC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,UAAU,CAAC;IACxC,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AACjF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -24,18 +24,26 @@
24
24
  * const validation = validateProfileConformance(artifact);
25
25
  * ```
26
26
  */
27
- export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact, ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
27
+ export { extractFromContent, extractFromContentWithClient, extractFromConversation, assembleArtifact, createEmptyArtifact, ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
28
+ export type { ConversationExtractionOptions, ConversationChunkArtifact, } from "./assembler.js";
29
+ export { flattenConversation, frameTranscript, chunkConversation, DEFAULT_CHUNK_MAX_CHARS, } from "./conversation.js";
30
+ export type { ConversationMessage, ConversationChunk, ChunkConversationOptions, } from "./conversation.js";
31
+ export { applyStanceGuard, takeStance, isNonSubjectStance, resolveStance, classifyStanceOpenAI, classifyStanceAnthropic, } from "./extractors/stance-guard.js";
32
+ export type { StanceGuardResult, StanceClassifierInput } from "./extractors/stance-guard.js";
33
+ export { sanitizeLlmOutput, formatSanitationNotes, } from "./extractors/output-sanitizer.js";
34
+ export type { SanitationNote } from "./extractors/output-sanitizer.js";
28
35
  export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
29
36
  export { validateEDM, validateEDMStrict, validateEDMWithProfile, validateProfileConformance, validateDomain, validateCompleteness, } from "./validator.js";
30
- export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
31
- export type { LlmExtractionResult, LlmEssentialExtracted, LlmExtendedExtracted, } from "./extractors/llm-extractor.js";
37
+ export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, defaultMaxTokens, DEFAULT_MAX_TOKENS, THINKING_MODEL_MAX_TOKENS, } from "./extractors/llm-extractor.js";
38
+ export type { LlmExtractionResult, LlmEssentialExtracted, LlmExtendedExtracted, ExtractorCallOptions, } from "./extractors/llm-extractor.js";
32
39
  export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
33
40
  export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
34
41
  export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
35
42
  export { createMeta, createGovernance, createTelemetry, createSystem, createCrosswalks, detectSourceType, } from "./extractors/domain-extractors.js";
36
43
  export { MetaSchema, CoreSchema, ConstellationSchema, MilkyWaySchema, GravitySchema, ImpulseSchema, GovernanceSchema, TelemetrySchema, SystemSchema, CrosswalksSchema, EdmArtifactSchema, LlmExtractedFieldsSchema, LlmEssentialFieldsSchema, LlmExtendedFieldsSchema, ConstellationEssentialSchema, GravityExtendedSchema, RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, IndicesSchema, } from "./schema/edm-schema.js";
37
44
  export type { Meta, Core, Constellation, MilkyWay, Gravity, Impulse, Governance, Telemetry, System, Crosswalks, RetentionPolicy, SubjectRights, KAnonymity, EmbeddingRef, Indices, EdmArtifact, LlmExtractedFields, EdmProfile, PartnerProfileId, ExtractionInput, ExtractionMetadata, ExtractionOptions, ValidationResult, ValidationError, } from "./schema/types.js";
38
- export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
45
+ export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, EXPERIENTIAL_STANCE, } from "./schema/types.js";
46
+ export type { ExperientialStance } from "./schema/types.js";
39
47
  export type { StatelessValidation } from "./stateless.js";
40
48
  export type { CompletenessResult, DomainName, ProfileConformanceResult, ProfileConformanceError, } from "./validator.js";
41
49
  export type { ActivateResult, FeedbackOptions, ActivateReasonResult, ActivateReasonOptions, ActivateReasonSource, } from "./schema/types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EAEnB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,cAAc,EACd,qBAAq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P,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACV,GACL,OAAO,CAAC,cAAc,CAAC,CAyDzB;AAKD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BtE;AAKD,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAkE/B"}
package/dist/index.js CHANGED
@@ -27,10 +27,19 @@
27
27
  // =============================================================================
28
28
  // Core Extraction API
29
29
  // =============================================================================
30
- export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact,
30
+ export { extractFromContent, extractFromContentWithClient, extractFromConversation, assembleArtifact, createEmptyArtifact,
31
31
  // Profile field definitions
32
32
  ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
33
33
  // =============================================================================
34
+ // Conversation Input (transcript framing + per_session chunking)
35
+ // =============================================================================
36
+ export { flattenConversation, frameTranscript, chunkConversation, DEFAULT_CHUNK_MAX_CHARS, } from "./conversation.js";
37
+ // =============================================================================
38
+ // Attribution Guard (experiential stance)
39
+ // =============================================================================
40
+ export { applyStanceGuard, takeStance, isNonSubjectStance, resolveStance, classifyStanceOpenAI, classifyStanceAnthropic, } from "./extractors/stance-guard.js";
41
+ export { sanitizeLlmOutput, formatSanitationNotes, } from "./extractors/output-sanitizer.js";
42
+ // =============================================================================
34
43
  // Stateless Mode
35
44
  // =============================================================================
36
45
  export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
@@ -41,7 +50,7 @@ export { validateEDM, validateEDMStrict, validateEDMWithProfile, validateProfile
41
50
  // =============================================================================
42
51
  // LLM Integration
43
52
  // =============================================================================
44
- export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
53
+ export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, defaultMaxTokens, DEFAULT_MAX_TOKENS, THINKING_MODEL_MAX_TOKENS, } from "./extractors/llm-extractor.js";
45
54
  export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
46
55
  export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
47
56
  export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
@@ -62,7 +71,7 @@ LlmEssentialFieldsSchema, LlmExtendedFieldsSchema, ConstellationEssentialSchema,
62
71
  // Nested Schemas
63
72
  RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, IndicesSchema, } from "./schema/edm-schema.js";
64
73
  // Enum constants
65
- export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
74
+ export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, EXPERIENTIAL_STANCE, } from "./schema/types.js";
66
75
  export async function activate(query, options = {}) {
67
76
  const apiKey = options.apiKey ?? process.env.DEEPADATA_API_KEY;
68
77
  if (!apiKey) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,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C,eAAe,IAAI,CAAC;QACzC,cAAc,EAAE,MAAM,CAAC,IAAI,EAAE,eAAe,IAAI,IAAI;QACpD,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,YAAY,IAAI,IAAI;KAC/C,CAAC;AACJ,CAAC"}
@@ -1213,6 +1213,13 @@ export declare const GravityExtendedSchema: z.ZodObject<{
1213
1213
  recurrence_pattern: "cyclical" | "isolated" | "chronic" | "emerging" | null;
1214
1214
  strength_score: number;
1215
1215
  }>;
1216
+ /**
1217
+ * Experiential stance of the extracted material relative to the subject.
1218
+ * Top-level extraction output only (proposed for EDM v0.9) — consumed by
1219
+ * the stance guard and recorded in telemetry, never sealed into the
1220
+ * v0.8.0 artifact body.
1221
+ */
1222
+ export declare const ExperientialStanceSchema: z.ZodOptional<z.ZodNullable<z.ZodEnum<["lived", "witnessed", "quoted_third_party", "assistant_generated", "hypothetical"]>>>;
1216
1223
  /**
1217
1224
  * Essential Profile LLM Extraction Schema
1218
1225
  * Core (6 fields) + Constellation (3 fields) = 9 LLM-extracted fields
@@ -1253,6 +1260,7 @@ export declare const LlmEssentialFieldsSchema: z.ZodObject<{
1253
1260
  emotion_subtone: string[];
1254
1261
  narrative_arc: string | null;
1255
1262
  }>;
1263
+ experiential_stance: z.ZodOptional<z.ZodNullable<z.ZodEnum<["lived", "witnessed", "quoted_third_party", "assistant_generated", "hypothetical"]>>>;
1256
1264
  }, "strip", z.ZodTypeAny, {
1257
1265
  core: {
1258
1266
  anchor: string | null;
@@ -1267,6 +1275,7 @@ export declare const LlmEssentialFieldsSchema: z.ZodObject<{
1267
1275
  emotion_subtone: string[];
1268
1276
  narrative_arc: string | null;
1269
1277
  };
1278
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1270
1279
  }, {
1271
1280
  core: {
1272
1281
  anchor: string | null;
@@ -1281,6 +1290,7 @@ export declare const LlmEssentialFieldsSchema: z.ZodObject<{
1281
1290
  emotion_subtone: string[];
1282
1291
  narrative_arc: string | null;
1283
1292
  };
1293
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1284
1294
  }>;
1285
1295
  /**
1286
1296
  * Extended Profile LLM Extraction Schema
@@ -1412,6 +1422,7 @@ export declare const LlmExtendedFieldsSchema: z.ZodObject<{
1412
1422
  recurrence_pattern: "cyclical" | "isolated" | "chronic" | "emerging" | null;
1413
1423
  strength_score: number;
1414
1424
  }>;
1425
+ experiential_stance: z.ZodOptional<z.ZodNullable<z.ZodEnum<["lived", "witnessed", "quoted_third_party", "assistant_generated", "hypothetical"]>>>;
1415
1426
  }, "strip", z.ZodTypeAny, {
1416
1427
  core: {
1417
1428
  anchor: string | null;
@@ -1457,6 +1468,7 @@ export declare const LlmExtendedFieldsSchema: z.ZodObject<{
1457
1468
  recurrence_pattern: "cyclical" | "isolated" | "chronic" | "emerging" | null;
1458
1469
  strength_score: number;
1459
1470
  };
1471
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1460
1472
  }, {
1461
1473
  core: {
1462
1474
  anchor: string | null;
@@ -1502,6 +1514,7 @@ export declare const LlmExtendedFieldsSchema: z.ZodObject<{
1502
1514
  recurrence_pattern: "cyclical" | "isolated" | "chronic" | "emerging" | null;
1503
1515
  strength_score: number;
1504
1516
  };
1517
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1505
1518
  }>;
1506
1519
  /**
1507
1520
  * Full Profile LLM Extraction Schema (all LLM-extracted domains)
@@ -1698,6 +1711,7 @@ export declare const LlmExtractedFieldsSchema: z.ZodObject<{
1698
1711
  attachment_style: "secure" | "anxious" | "avoidant" | "disorganized" | null;
1699
1712
  coping_style: string | null;
1700
1713
  }>;
1714
+ experiential_stance: z.ZodOptional<z.ZodNullable<z.ZodEnum<["lived", "witnessed", "quoted_third_party", "assistant_generated", "hypothetical"]>>>;
1701
1715
  }, "strip", z.ZodTypeAny, {
1702
1716
  core: {
1703
1717
  anchor: string | null;
@@ -1766,6 +1780,7 @@ export declare const LlmExtractedFieldsSchema: z.ZodObject<{
1766
1780
  attachment_style: "secure" | "anxious" | "avoidant" | "disorganized" | null;
1767
1781
  coping_style: string | null;
1768
1782
  };
1783
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1769
1784
  }, {
1770
1785
  core: {
1771
1786
  anchor: string | null;
@@ -1834,5 +1849,6 @@ export declare const LlmExtractedFieldsSchema: z.ZodObject<{
1834
1849
  attachment_style: "secure" | "anxious" | "avoidant" | "disorganized" | null;
1835
1850
  coping_style: string | null;
1836
1851
  };
1852
+ experiential_stance?: "lived" | "witnessed" | "quoted_third_party" | "assistant_generated" | "hypothetical" | null | undefined;
1837
1853
  }>;
1838
1854
  //# sourceMappingURL=edm-schema.d.ts.map