import { z } from 'zod'; export declare const EntityKindSchema: z.ZodEnum<{ event: "event"; tool: "tool"; actor: "actor"; team: "team"; org: "org"; project: "project"; product: "product"; workitem: "workitem"; decision: "decision"; tech: "tech"; concept: "concept"; other: "other"; }>; export type EntityKind = z.infer; export declare const AtomEntitySchema: z.ZodObject<{ name: z.ZodString; kind: z.ZodEnum<{ event: "event"; tool: "tool"; actor: "actor"; team: "team"; org: "org"; project: "project"; product: "product"; workitem: "workitem"; decision: "decision"; tech: "tech"; concept: "concept"; other: "other"; }>; subtype: z.ZodOptional>; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>; export type AtomEntity = z.infer; export declare const RELATION_PREDICATES: readonly ["uses", "depends_on", "replaces", "supersedes", "mentions", "relates_to", "part_of", "owned_by", "assigned_to", "created_by"]; export type RelationPredicate = (typeof RELATION_PREDICATES)[number] | 'other'; export declare const AtomRelationSchema: z.ZodObject<{ subject: z.ZodString; predicate: z.ZodEnum<{ other: "other"; uses: "uses"; depends_on: "depends_on"; replaces: "replaces"; supersedes: "supersedes"; mentions: "mentions"; relates_to: "relates_to"; part_of: "part_of"; owned_by: "owned_by"; assigned_to: "assigned_to"; created_by: "created_by"; }>; object: z.ZodString; evidence: z.ZodOptional; confidence: z.ZodOptional; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>; export type AtomRelation = z.infer; export declare const AtomSchema: z.ZodObject<{ type: z.ZodEnum<{ event: "event"; decision: "decision"; fact: "fact"; lesson: "lesson"; command: "command"; todo: "todo"; note: "note"; }>; text: z.ZodString; importance: z.ZodNumber; confidence: z.ZodNumber; evidence: z.ZodOptional; entities: z.ZodOptional; subtype: z.ZodOptional>; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>>>; relations: z.ZodOptional; object: z.ZodString; evidence: z.ZodOptional; confidence: z.ZodOptional; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>>>; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>; /** * INVARIANT: this schema (and everything AtomSchema nests) must stay * `z.toJSONSchema()`-representable — 05-extract.ts converts it at MODULE * LOAD into the structured-output `jsonSchema` sent to providers (the * qwen3.5 duplicate-key-collapse fix, 2026-07-16). Adding a `.refine()` / * `.transform()` / `.catch()` here throws at import time and takes down the * whole distill pipeline with it. Enforced by a build-failing test * (tests/distill/05-extract.test.ts "ExtractionSchema stays * toJSONSchema-representable"), not just this comment. */ export declare const ExtractionSchema: z.ZodObject<{ atoms: z.ZodArray; text: z.ZodString; importance: z.ZodNumber; confidence: z.ZodNumber; evidence: z.ZodOptional; entities: z.ZodOptional; subtype: z.ZodOptional>; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>>>; relations: z.ZodOptional; object: z.ZodString; evidence: z.ZodOptional; confidence: z.ZodOptional; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>>>; valid_at: z.ZodOptional; invalid_at: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type Atom = z.infer; export type Extraction = z.infer; /** * FEAT-551: which extraction pass produced an atom. Assigned * PROGRAMMATICALLY by the pipeline (src/distill/pipeline.ts, right where * pass B's atoms are read back from `extractSpecifics`) — NEVER part of * `AtomSchema`/`ExtractionSchema`, so it never appears in the structured- * output JSON schema sent to a provider and is never something the model * itself emits or could hallucinate. */ export type AtomExtractionSource = 'passA' | 'passB'; /** * `Atom` widened with the FEAT-551 pass tag. `Atom` is structurally * assignable to `SourcedAtom` (the extra field is optional), so every * existing single-pass caller that still deals in plain `Atom[]` keeps * working unchanged — the tag is simply absent (`undefined`), which * `checkEvidenceGate` (src/distill/evidence-gate.ts) treats as "not passB, * bypass" (AC-2). `ReducedAtom` (06-reduce.ts) and `NormalizedMemory` * (07-memory-normalize.ts) both extend this chain, and both stages spread * (`{ ...atom, ... }`) rather than reconstruct their inputs, so the tag * rides through reduce/memory-normalize to stage 8 for free. */ export interface SourcedAtom extends Atom { extractionSource?: AtomExtractionSource; } export declare const EXTRACTION_SYSTEM_PROMPT = "You extract durable knowledge from AI coding agent transcripts.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"<5-500 chars, canonical phrasing>\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }]\n }\n ]\n}\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. command: a shell/CLI incantation worth reusing\n2. todo: pending work explicitly raised\n3. event: something that happened at a point in time (deployment, incident, meeting)\n4. decision: a choice was made between alternatives (pick this over \"fact\" whenever\n two or more options were weighed, even if only one is mentioned by name)\n5. lesson: a failure, error, or surprise \u2014 extract it EVEN IF unresolved; do not\n require a fix or root cause to exist yet\n6. fact: a verifiable, current property of the code/system (a value, a config\n default, a version, a status)\n7. note: opinions, preferences, or style remarks that don't fit above\n\nEntities: list every specific named thing the atom is ABOUT (not every word\nmentioned) \u2014 a person, agent, team, technology, product, or piece of work.\nNever extract a bare number or unqualified issue/PR reference (e.g. \"#110\",\n\"123\") as a standalone entity \u2014 without a name, repo, or subject attached it\nis not a durable, identifiable thing; omit it rather than inventing one.\nkind is one of:\n- actor: a named human OR AI agent (e.g. \"Sergey\", \"Claude Code\", \"the reviewer bot\") \u2014\n set subtype to \"human\" or \"ai\" when you can tell which; omit subtype when unsure\n- team: a named team or squad within an organization\n- org: a company or organization (e.g. \"Anthropic\", \"Astragenie\")\n- project: a named codebase/repo/workspace the work belongs to (e.g. \"astramem-local\",\n \"memory\") \u2014 NOT the same as the product it ships; use this for \"which repo\"\n- product: a named product or app the project builds or depends on as a product\n (e.g. \"AstraMemory\", \"GitHub Copilot\", \"Claude Code\" the app rather than the agent)\n- workitem: a FEAT/PR/issue/ticket id, always WITH the context that identifies\n it (e.g. \"FEAT-402\", \"the #145 PR for the auth refactor\") \u2014 never a bare,\n unqualified number or hash-number like \"#145\" or \"110\" alone; skip it if you\n cannot name what repo/feature it belongs to\n- decision: a DEC/ADR reference (e.g. \"DEC-048\", \"ADR-001\")\n- tech: a language/framework/library/protocol the stack depends on (e.g. \"Postgres\",\n \"TypeScript\", \"sqlite-vec\")\n- tool: a CLI/dev tool used to do the work (e.g. \"vitest\", \"Docker\")\n- concept: a named pattern, architecture, or idea \u2014 only RECURRING technical concepts\n worth remembering across sessions (e.g. \"bitemporal model\", \"CRDT\"), not one-off phrasing\n- event: a named happening at a point in time (e.g. \"the 2026-07-08 incident\")\n- other: doesn't fit any kind above but is still a specific named thing\nOmit \"entities\" entirely (or leave it empty) when the atom names nothing specific.\nvalid_at/invalid_at: omit both for a given entity unless the source text explicitly states\na start and/or end date for THAT entity's specific relationship to the atom (e.g. \"Alice was\nthe approver from January to March\") \u2014 never infer or default one from context.\n\nSkip noise: greetings, repeated thinking, false starts, generic AI fluff.\nSkip secrets: tokens, API keys, passwords.\nConfidence reflects evidence strength: clear conclusion = 0.9; speculation = 0.3.\nImportance reflects long-term value: architecture decision = 0.9; one-off command = 0.4.\n\nRecall: enumerate EVERY distinct durable item, not just the first one you notice.\nA typical real-work chunk yields 2-6 atoms across different types \u2014 a debugging\nchunk alone often has a lesson AND a decision AND an event. Keep scanning to the\nend of the chunk before stopping. If a decision is reversed later in the same\nchunk, output only the FINAL value as the decision (optionally add a lesson for\nwhy the first value was wrong) \u2014 never emit the stale, reverted value.\nException: if the chunk truly contains nothing durable (small talk, a plain\nacknowledgment, no claims/choices/errors/commands), output \"atoms\": [] \u2014 do not\ninvent an atom just to have output.\n\nExamples (illustrative only, not exhaustive):\n\n1. Input: \"Should we use Postgres or SQLite? Let's go with SQLite, it's simpler for a single-node local daemon.\" \"Also fyi we're already on Node 20.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Use SQLite instead of Postgres for the local daemon \u2014 simpler for a single-node deployment.\",\"importance\":0.8,\"confidence\":0.9},\n {\"type\":\"fact\",\"text\":\"The project runs on Node 20.\",\"importance\":0.4,\"confidence\":0.9}\n]}\n\n2. Input: \"The reinstall step threw Access is denied. I haven't figured out why yet.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"reinstall fails with 'Access is denied' \u2014 cause not yet identified.\",\"importance\":0.6,\"confidence\":0.7}\n]}\n\n3. Input: \"Users get logged out after 15 min. Found it \u2014 maxAge was set in seconds but the library expects ms. Fixed by adding a named constant. Also, switching topics, let's split CI lint/test into parallel jobs to cut wall-clock time.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"Refresh-token maxAge was set in seconds while the cookie library expected milliseconds, causing premature logout.\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Fix the cookie expiry bug via an explicit named ms constant.\",\"importance\":0.6,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Split the CI 'build' job into parallel 'lint' and 'test' jobs to reduce wall-clock time.\",\"importance\":0.6,\"confidence\":0.8}\n]}\n\n4. Input: \"hey\" / \"Hey! What can I help with?\" / \"just checking you're there\" / \"cool thanks that's all\" ->\n{\"atoms\":[]}\n\n5. Input: \"Set epsilon to 0.3.\" ... \"Actually wait, 0.3 is too aggressive, use 0.1 instead, matching the ADR-010 default.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Set epsilon to 0.1, matching the ADR-010 default (not the initially proposed 0.3, which was reverted).\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"lesson\",\"text\":\"epsilon=0.3 was too aggressive \u2014 reverted in favor of 0.1.\",\"importance\":0.5,\"confidence\":0.8}\n]}"; export declare const EXTRACTION_STRICT_PROMPT = "You extract durable knowledge from AI coding agent transcripts.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"<5-500 chars, canonical phrasing>\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }]\n }\n ]\n}\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. command: a shell/CLI incantation worth reusing\n2. todo: pending work explicitly raised\n3. event: something that happened at a point in time (deployment, incident, meeting)\n4. decision: a choice was made between alternatives (pick this over \"fact\" whenever\n two or more options were weighed, even if only one is mentioned by name)\n5. lesson: a failure, error, or surprise \u2014 extract it EVEN IF unresolved; do not\n require a fix or root cause to exist yet\n6. fact: a verifiable, current property of the code/system (a value, a config\n default, a version, a status)\n7. note: opinions, preferences, or style remarks that don't fit above\n\nEntities: list every specific named thing the atom is ABOUT (not every word\nmentioned) \u2014 a person, agent, team, technology, product, or piece of work.\nNever extract a bare number or unqualified issue/PR reference (e.g. \"#110\",\n\"123\") as a standalone entity \u2014 without a name, repo, or subject attached it\nis not a durable, identifiable thing; omit it rather than inventing one.\nkind is one of:\n- actor: a named human OR AI agent (e.g. \"Sergey\", \"Claude Code\", \"the reviewer bot\") \u2014\n set subtype to \"human\" or \"ai\" when you can tell which; omit subtype when unsure\n- team: a named team or squad within an organization\n- org: a company or organization (e.g. \"Anthropic\", \"Astragenie\")\n- project: a named codebase/repo/workspace the work belongs to (e.g. \"astramem-local\",\n \"memory\") \u2014 NOT the same as the product it ships; use this for \"which repo\"\n- product: a named product or app the project builds or depends on as a product\n (e.g. \"AstraMemory\", \"GitHub Copilot\", \"Claude Code\" the app rather than the agent)\n- workitem: a FEAT/PR/issue/ticket id, always WITH the context that identifies\n it (e.g. \"FEAT-402\", \"the #145 PR for the auth refactor\") \u2014 never a bare,\n unqualified number or hash-number like \"#145\" or \"110\" alone; skip it if you\n cannot name what repo/feature it belongs to\n- decision: a DEC/ADR reference (e.g. \"DEC-048\", \"ADR-001\")\n- tech: a language/framework/library/protocol the stack depends on (e.g. \"Postgres\",\n \"TypeScript\", \"sqlite-vec\")\n- tool: a CLI/dev tool used to do the work (e.g. \"vitest\", \"Docker\")\n- concept: a named pattern, architecture, or idea \u2014 only RECURRING technical concepts\n worth remembering across sessions (e.g. \"bitemporal model\", \"CRDT\"), not one-off phrasing\n- event: a named happening at a point in time (e.g. \"the 2026-07-08 incident\")\n- other: doesn't fit any kind above but is still a specific named thing\nOmit \"entities\" entirely (or leave it empty) when the atom names nothing specific.\nvalid_at/invalid_at: omit both for a given entity unless the source text explicitly states\na start and/or end date for THAT entity's specific relationship to the atom (e.g. \"Alice was\nthe approver from January to March\") \u2014 never infer or default one from context.\n\nSkip noise: greetings, repeated thinking, false starts, generic AI fluff.\nSkip secrets: tokens, API keys, passwords.\nConfidence reflects evidence strength: clear conclusion = 0.9; speculation = 0.3.\nImportance reflects long-term value: architecture decision = 0.9; one-off command = 0.4.\n\nRecall: enumerate EVERY distinct durable item, not just the first one you notice.\nA typical real-work chunk yields 2-6 atoms across different types \u2014 a debugging\nchunk alone often has a lesson AND a decision AND an event. Keep scanning to the\nend of the chunk before stopping. If a decision is reversed later in the same\nchunk, output only the FINAL value as the decision (optionally add a lesson for\nwhy the first value was wrong) \u2014 never emit the stale, reverted value.\nException: if the chunk truly contains nothing durable (small talk, a plain\nacknowledgment, no claims/choices/errors/commands), output \"atoms\": [] \u2014 do not\ninvent an atom just to have output.\n\nExamples (illustrative only, not exhaustive):\n\n1. Input: \"Should we use Postgres or SQLite? Let's go with SQLite, it's simpler for a single-node local daemon.\" \"Also fyi we're already on Node 20.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Use SQLite instead of Postgres for the local daemon \u2014 simpler for a single-node deployment.\",\"importance\":0.8,\"confidence\":0.9},\n {\"type\":\"fact\",\"text\":\"The project runs on Node 20.\",\"importance\":0.4,\"confidence\":0.9}\n]}\n\n2. Input: \"The reinstall step threw Access is denied. I haven't figured out why yet.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"reinstall fails with 'Access is denied' \u2014 cause not yet identified.\",\"importance\":0.6,\"confidence\":0.7}\n]}\n\n3. Input: \"Users get logged out after 15 min. Found it \u2014 maxAge was set in seconds but the library expects ms. Fixed by adding a named constant. Also, switching topics, let's split CI lint/test into parallel jobs to cut wall-clock time.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"Refresh-token maxAge was set in seconds while the cookie library expected milliseconds, causing premature logout.\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Fix the cookie expiry bug via an explicit named ms constant.\",\"importance\":0.6,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Split the CI 'build' job into parallel 'lint' and 'test' jobs to reduce wall-clock time.\",\"importance\":0.6,\"confidence\":0.8}\n]}\n\n4. Input: \"hey\" / \"Hey! What can I help with?\" / \"just checking you're there\" / \"cool thanks that's all\" ->\n{\"atoms\":[]}\n\n5. Input: \"Set epsilon to 0.3.\" ... \"Actually wait, 0.3 is too aggressive, use 0.1 instead, matching the ADR-010 default.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Set epsilon to 0.1, matching the ADR-010 default (not the initially proposed 0.3, which was reverted).\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"lesson\",\"text\":\"epsilon=0.3 was too aggressive \u2014 reverted in favor of 0.1.\",\"importance\":0.5,\"confidence\":0.8}\n]}\n\nCRITICAL: Output ONLY valid JSON. No markdown, no prose, no code fences. The response must start with { and end with }."; /** Which prompt family stage 5 (05-extract.ts) resolves per-run. See * `Config['distill']['extractProfile']` (src/config/config.ts) for the * config surface and `PipelineContext.extractProfile` (src/distill/ * pipeline.ts) for the per-transcript envelope override. */ export type ExtractProfile = 'engineering' | 'conversational'; /** * FEAT-479 (D3 S3.2) AC-9/AC-10 (SLICE-434) - the mem0/Graphiti-pattern * liberal-extraction profile for conversational (non-engineering) transcripts. * Memories here are self-contained explanations, not contextless trivia - * mem0-pattern liberal extraction (15-80 word standalone sentences, pronouns * resolved, proper nouns preserved, relative dates grounded to an in- * transcript observation date when one exists) plus Graphiti-pattern * possessor qualification (attribute every fact to its owner by name) and an * explicit banned-abstractions negative list (no vague summaries, no * meta-commentary, no sentiment padding). Unlike the engineering v3 prompt's * type-conditioned richness rule (300-800 chars for lesson/decision), EVERY * atom here stays atomic/short (~15-80 words) regardless of type - personal * facts are frequently superseded as life moves on, so a single clean, * independently-replaceable sentence beats a rich paragraph. The 7-type * taxonomy and AtomEntitySchema/EntityKindSchema contract are unchanged - * only the entity-kind description text below is trimmed to the kinds that * actually recur in personal conversation (actor/org/product/event/other); * the full 12-kind enum still validates whatever the model emits. * * UPDATE (temporal-grounding fix, 2026-07-13): captured_at IS now threaded * into this call. 05-extract.ts's extractChunk takes an optional * `sessionDateIso` param (an ISO calendar date, formatted from * PipelineContext.capturedAtMs by pipeline.ts's stage-5 call site) and * callExtract prepends it as a literal "Observation date: " line * ahead of the transcript chunk in the user message. The date-grounding * rule below now points at that injected line FIRST, falling back to the * old conditional wording ("if the transcript states or implies...") only * when no sessionDateIso was available (legacy v0.0 envelopes, direct * /remember calls) — those callers see byte-identical behavior to before * this fix. * * UPDATE (LoCoMo WS3, 2026-07-13): narrowed the "sentiment padding" * banned-abstraction. It used to exclude ANY standalone reaction, which * meant the model was correctly following instructions when it dropped * things like "Melanie thinks Caroline will be an awesome mom" — a real, * durable fact about the two people's relationship, not conversational * filler. Root-caused via a direct root-cause trace on questions from * `docs/research/20260713-locomo-retrieval-diagnosis.md`'s not-in-db * bucket: real production extraction, run twice (once pre-fix, once * post-fix) on the same source session, showed the fix adds exactly the * missing atom and nothing else (see PR discussion for the before/after). * DO NOT widen this back to "any reaction with a named cause survives" — * an early draft of this fix used exactly that wording and a reviewer * caught that it would let "the user was frustrated with the build" back * in (a named cause, but still the user's own mood, still padding). The * test that actually holds, verbatim, so a future "cleanup" doesn't * re-break it: the dividing line is WHOSE LIFE the reaction is about, not * whether a cause is named — a reaction to your own circumstances is * banned even with a named cause; a reaction to another specifically * named person's specific event is a keeper. * Known limitation, not yet fixed: when a session has BOTH people * reacting to each other repeatedly, extraction still shows a lopsided * capture rate — it tends to keep the reactions belonging to whichever * person's event is the subject and drop the other person's commentary, * even after this fix (measured ~77% capture on one dense two-way session, * both losses on the same side). Same shape as the pre-existing * Caroline/Melanie 58/42 extraction asymmetry flagged in the WS2 * root-cause research's "A secondary, correlated signal: speaker * asymmetry" section (as of this writing that doc is an uncommitted * local research artifact, not yet merged to origin/main — anchor on the * section title, not a file:line, until it lands; see ADR-015's citation * policy) — likely one mechanism, not confirmed. A dedicated * reactions-extraction pass (giving reactions their own call instead of * competing with headline facts for one call's attention) is the * candidate fix if this turns out not to be good enough on its own; not * built yet, gated on measuring whether the prompt fix alone is sufficient * at full-sample scale. */ export declare const EXTRACTION_SYSTEM_PROMPT_CONVERSATIONAL = "You extract durable PERSONAL knowledge from conversational transcripts \u2014 chats, journals, voice-note transcripts, casual check-ins between a person and an assistant \u2014 not engineering or coding sessions.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }],\n \"relations\": [{ \"subject\": \"\", \"predicate\": \"uses\" | \"depends_on\" | \"replaces\" | \"supersedes\" | \"mentions\" | \"relates_to\" | \"part_of\" | \"owned_by\" | \"assigned_to\" | \"created_by\" | \"other\", \"object\": \"\", \"confidence\": 0.0-1.0 }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\nLiberal extraction (mem0 pattern) \u2014 a DIFFERENT posture from engineering transcripts: capture EVERY durable personal fact, preference, relationship, plan, or event mentioned, not only the highest-value few. A stated preference, a named relationship, or a planned date is cheap to keep and expensive to lose \u2014 bias toward extracting whenever a candidate is genuinely durable, rather than filtering it out because it seems minor.\n\nEXHAUSTIVENESS CHECKLIST \u2014 run this before you emit. These are checks, not encouragement:\n1. COUNT CHECK. A chunk of 10+ conversational turns normally yields 5-15 atoms. If you are about to emit FEWER THAN 3 from a chunk that size, you have almost certainly missed things \u2014 go back and re-read the transcript from the top before answering.\n2. NO FIRST-TOPIC DOMINANCE. Do not spend all your attention on whatever the conversation opened with. A conversation that starts with a job change and later mentions a sister's wedding, a new apartment, and a dog's name must yield atoms for ALL FOUR \u2014 not four atoms about the job. Walk the transcript end to end and ask what is durable at EACH turn, not just the ones that felt important.\n3. BOTH SPEAKERS. Extract facts stated by EITHER participant about EITHER participant. A fact one person states about the other is still a durable fact.\n4. SWEEP THE CATEGORIES. Before finishing, ask explicitly: did anyone mention a NAMED PERSON, a PLACE, a DATE or timeframe, a JOB or school, a possession or pet, a plan, a preference, or a health/life event? Each \"yes\" that is not already in your output is a fact you dropped.\n\nQuantity over timidity: a marginal-but-durable fact you keep costs almost nothing. A real fact you drop is gone forever \u2014 nothing downstream can recover it. When genuinely torn, EXTRACT.\n\nSelf-containment \u2014 every atom must read as ONE complete, standalone sentence of roughly 15-80 words, true on its own without the rest of the conversation:\n- Resolve every pronoun to the actual named person before writing the atom. Never emit \"she started her new job\", \"his sister called him\", or \"they're moving in June\" \u2014 write the real names: \"Priya started her new job\", \"Marcus's sister called him\", \"the Nguyen family is moving in June\".\n- Preserve proper nouns EXACTLY as given \u2014 people's names, place names, employer and school names, product and brand names. Never substitute a generic noun (\"her employer\", \"the city\") for a name you were actually told.\n- Possessor qualification (Graphiti pattern): whenever a fact belongs to a specific person, name that owner inside the sentence itself. Write \"Sergey's daughter Alice starts kindergarten in September, moving up from the preschool she has attended the past two years\", never a bare \"daughter starts kindergarten in September\" or \"starts school in the fall\" \u2014 a reader must never have to guess whose fact this is.\n\nDate grounding: if a line reading \"Observation date: \" appears immediately before the transcript chunk below, treat that as the authoritative anchor and resolve every relative date expression (\"yesterday\", \"last week\", \"next month\", \"three years ago\") against it \u2014 write the resolved absolute date in natural-language form (e.g. \"14 May 2023\", NOT \"2023-05-14\") directly into the atom's text in place of the relative phrase, not alongside it. Use natural-language dates in \"text\" specifically \u2014 this is prose a person or another model reads later, not a machine-parsed field; \"valid_at\"/\"invalid_at\" below are the separate ISO-8601 fields for that. Otherwise, if the transcript states or implies an explicit observation/capture date (a timestamp, a line like \"today is 2026-07-13\", a dated header), resolve relative dates against that anchor instead, still in natural-language form. If no anchor exists at all \u2014 no Observation date line and no in-transcript date \u2014 keep the original relative phrasing rather than inventing an absolute date you were not given \u2014 a guessed date is worse than an honest relative one.\n\nBanned abstractions \u2014 NEVER emit these shapes, even when a summary version is technically accurate:\n- Vague summaries: \"discussed plans for the weekend\", \"talked about work stuff\", \"had a conversation about the move\" \u2014 these describe the CONVERSATION itself, not a fact about the person's life; extract the actual plan, fact, or decision underneath instead, or emit nothing if there genuinely isn't one.\n- Meta-commentary: \"the user shared an update\", \"mentioned something about the family\" \u2014 never describe that a topic came up; state plainly what was actually said.\n- Sentiment padding: \"seemed happy about it\", \"expressed some excitement\" \u2014 the test is NOT \"does this mood have a named cause.\" A person's reaction to their OWN circumstances is banned even with a specific named cause: \"the user was frustrated with the build\", \"the user was thrilled after the workout\", \"the user was annoyed about the delayed flight\" are all sentiment padding \u2014 skip them, cause or no cause. What is NOT banned, and must be kept as its own atom: one person's stated reaction or opinion about ANOTHER specifically named person's specific event, decision, or plan. That reaction is a fact about their relationship, not a mood \u2014 e.g. \"Melanie told Caroline she thinks Caroline is doing something amazing by pursuing adoption and will be an awesome mom\" is a keeper: it names who is reacting, who the reaction is about, and the specific thing that prompted it. The dividing line is whose life the reaction is about, not whether a cause is named \u2014 a reaction to your own life is still banned; a reaction to someone else's specific, named event is a keeper.\n\nType-conditioned shape: conversational content maps mostly onto fact, note, event, and decision (a settled plan or choice); command and todo apply only when the source is literally a task, chore, or reminder, and lesson only when the person explicitly names something they personally learned. Regardless of type, every atom here stays atomic, single-valued, and roughly 15-80 words \u2014 do NOT apply the engineering profile's 300-800-character rich-shape rule (claim + rationale + consequence + provenance). Personal facts \u2014 a job, a relationship status, an address, a due date \u2014 are frequently corrected or superseded as life moves on, so keep each one a single clean, independently replaceable statement rather than a multi-clause paragraph.\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. event: something that happened, or is scheduled to happen, at a specific point in time (a birth, a move, a wedding, a diagnosis, a graduation, a trip)\n2. decision: a stated choice settled between real alternatives (a school picked, a job offer accepted, a name chosen)\n3. todo: an explicit pending personal task, errand, or reminder (\"pick up the dry cleaning Thursday\")\n4. command: a literal recipe, routine, or set of steps the person follows step by step (rare in personal conversation \u2014 most personal content is NOT this)\n5. fact: a current, stable property of a person's life (job, employer, address, relationship status, age, a health condition, a pet's name)\n6. note: a stated preference, opinion, aversion, or recurring habit (a favorite food, a dislike of crowds, always running on Sunday mornings)\n7. lesson: something the person explicitly names as a takeaway they personally learned from an experience\n\nEntities: list every specific named person, place, organization, or thing the atom is about. kind is one of:\n- actor: a named person \u2014 set subtype to \"human\" unless the transcript makes clear it is an AI/assistant\n- org: a named company, school, or organization\n- product: a named brand, app, or product\n- event: a named happening (e.g. \"Alice's graduation\")\n- other: a specific named thing that doesn't fit above (a place, a pet's name, a named condition)\nOmit \"entities\" entirely when the atom names nothing specific.\nvalid_at/invalid_at: omit both unless the source explicitly states a start and/or end date for that entity's relationship to the atom.\n\nRelations (retrieval-overhaul Phase 6): for each atom, optionally list entity-to-entity relation\ntriples this atom's own text asserts \u2014 this is what powers multi-hop retrieval later (e.g.\nanswering \"who is Alice's mother?\" by walking a relation edge instead of re-reading every atom).\nsubject and object MUST each be a name that ALSO appears in this SAME atom's own \"entities\" list\nabove \u2014 never name an entity here that isn't also listed there, and never invent a new entity\njust to complete a triple. predicate MUST be exactly one of these 11 lowercase values \u2014 personal\nconversation maps mostly onto relates_to/mentions/other, with owned_by/created_by for literal\npossession/authorship:\n- relates_to: a personal relationship or general association that doesn't fit a more specific\n predicate below (e.g. \"Priya\" relates_to \"Caroline\" for sisters, friends, coworkers, a couple)\n- owned_by: the subject (a pet, a house, a possession) belongs to the object (e.g. \"Tilly the dog\" owned_by \"Joanna\")\n- created_by: the subject (a book, a project, an idea) was made by the object (e.g. \"the mural\" created_by \"Marcus\")\n- part_of: the subject is a member/component of the object (e.g. \"Alice\" part_of \"the school choir\")\n- mentions: the subject references the object without a stronger relationship applying\n- assigned_to: a task/errand subject is assigned to the object (e.g. \"pick up the dry cleaning\" assigned_to \"Sergey\")\n- uses / depends_on / replaces / supersedes: rare in personal conversation, kept for consistency with the closed vocabulary \u2014 use only when a literal fit exists\n- other: a real, meaningful relation that genuinely doesn't fit any predicate above\nPossessor qualification (Graphiti pattern): resolve pronouns and possessives to the actual named\nentity before writing subject/object \u2014 write \"Alice\" and \"Sergey\", never \"her\" and \"him\" or \"her\ndad\" as a single unresolved phrase.\nPrefer omission over guessing: emit a relation ONLY when the source text states or clearly implies\nit directly (a stated family/friend relationship, an explicit ownership, an explicit assignment).\nWhen in doubt whether a relation genuinely holds, or whether it fits one of the 11 predicates,\nleave \"relations\" empty (or omit it) for that atom rather than emitting a low-confidence guess.\nOmit \"relations\" entirely (or leave it empty) when the atom asserts no clear relation between two\nof its own named entities.\n\nAtom-level validity (issue #205): the top-level valid_at/invalid_at fields bound THIS ATOM'S\nOWN fact in time \u2014 set either ONLY when the source explicitly states when the fact itself\nstarted and/or stopped being true (e.g. \"I lived in Denver until last year, then moved to\nAustin\", \"we broke up back in March\"). Omit both by default \u2014 a still-true fact (a current job,\nan ongoing relationship) MUST leave invalid_at unset. Never guess a bound from silence: a\nhallucinated invalid_at is worse than none, since it would silently mark a still-true personal\nfact as no longer valid. When a person's life genuinely changed (moved, changed jobs, a\nrelationship ended) AND the source states a date for the change, prefer emitting the OLD fact\nwith invalid_at set to when it changed, plus a separate NEW fact for the current state, rather\nthan only keeping the new one.\n\nDateless full-stop pattern (\"used to X, no longer Y\"): a conversation very often states that\nsomething ended WITHOUT giving any date at all \u2014 \"John used to play the drums, hasn't in a\nwhile\", \"Deborah used to play video games, it's been a while\", \"Joanna had a dog Tilly but\nbecame allergic and gave her up.\" These are genuine, unambiguous cessations \u2014 the person is\ntelling you the state changed \u2014 but because no literal date anchors WHEN it changed, do NOT set\ninvalid_at for them. The fact stopped being true at some unknown point in the past, and the\natom's own capture/observation time is NOT that point: do NOT set invalid_at to the\nobservation/capture date \"as if it just became false\" \u2014 an unresolvable past point is not the\nsame as today, and that shortcut would misrepresent an unknown past change as \"just became false\nright now,\" which is its own kind of hallucination, just a subtler one. Instead, write the\ncessation directly into the atom's \"text\" itself so the fact reads correctly on its own without\nneeding a bound at all: \"John used to play the drums but has not played in a while.\" / \"Joanna\nused to have a dog named Tilly, but gave her up after discovering she was allergic.\" Leave\nvalid_at/invalid_at both unset for these atoms \u2014 retrieval reads \"text\", not the bitemporal\nfields, so the cessation still surfaces correctly. Contrast with PARTIAL continuation, which is\nNOT a full stop: write it with no cessation language and no bound at all \u2014 \"I used to hike a\nlot, but it's more challenging now that I'm older\" describes an ongoing activity that simply\nbecame harder (the person still hikes), so preserve that ongoing framing in the text (e.g.\n\"still hikes, though it's more challenging now\") rather than writing it as though the activity\nstopped.\n\nSkip noise: greetings, small talk with no durable content, filler acknowledgments (\"cool\", \"got it\", \"haha\", \"yeah totally\").\nSkip secrets: passwords, tokens, financial account numbers, government ID numbers.\nConfidence reflects how clearly and directly the fact was stated: an explicit, unambiguous statement = 0.9; a hedge or maybe = 0.4.\nImportance reflects how durable and personally significant the fact is: a life event, relationship, or major decision = 0.8; a minor passing preference = 0.4.\n\nRecall: enumerate every distinct durable personal item in the chunk, not just the first one \u2014 a single real conversation often yields a life event, a couple of facts, and a preference or two across different topics.\nEmpty is valid: if the chunk truly contains nothing durable (small talk, filler, no stated fact/plan/preference), output \"atoms\": [] \u2014 do not invent an atom just to have output.\n\nExamples (illustrative only, not exhaustive \u2014 the shape of these IS the spec: one self-contained sentence per atom, names resolved, possessor stated):\n\n1. Input: \"My daughter Alice is starting kindergarten in September, I honestly can't believe it \u2014 she's moving up from the same preschool she's been at for two years.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Sergey's daughter Alice is starting kindergarten in September, moving up from the same preschool she has attended for the past two years.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}],\"relations\":[{\"subject\":\"Alice\",\"predicate\":\"relates_to\",\"object\":\"Sergey\",\"confidence\":0.9}]}\n]}\n(The relation captures the stated parent/child relationship \u2014 \"relates_to\" is the closest fit in the closed predicate vocabulary for a family relationship; do not invent a \"child_of\" predicate that isn't in the list.)\n\n2. Input: \"I moved to Austin last month for a new job at Anthropic. Honestly loving the move so far, way better weather than where I was before.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last month to start a new job at Anthropic, relocating from where he had been living before.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"},{\"name\":\"Anthropic\",\"kind\":\"org\"}]},\n {\"type\":\"note\",\"text\":\"Sergey has been enjoying his recent move to Austin so far, and prefers the weather there over where he lived previously.\",\"importance\":0.4,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\n\n3. Input: \"We ended up going with the Montessori school down the street for Alice instead of the public one, mostly because of the smaller class sizes.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Sergey and his wife chose the Montessori school down the street for their daughter Alice instead of the local public school, mainly because of its smaller class sizes.\",\"importance\":0.7,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n4. Input: \"Yeah we just talked about the weekend and stuff, nothing major, haha.\" ->\n{\"atoms\":[]}\n\n5. NEGATIVE EXAMPLE \u2014 what NOT to produce. Input: \"We talked about my new job for a bit and how my sister Priya's been dealing with a lot lately with her divorce.\" ->\nWRONG (vague summary + unresolved possessor + meta-commentary about the conversation itself \u2014 this is exactly the failure mode the banned-abstractions and possessor-qualification rules above exist to prevent):\n{\"type\":\"note\",\"text\":\"Discussed work stuff and some family things, sister going through something hard.\",\"importance\":0.5,\"confidence\":0.5}\nRIGHT (self-contained, possessor-qualified, states the actual fact instead of describing the conversation):\n{\"type\":\"fact\",\"text\":\"Sergey's sister Priya is currently going through a divorce, and has been having a difficult time with it lately.\",\"importance\":0.7,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n\n6. Input: \"Priya: I finally handed in my notice at the old job! -- Sergey: That's amazing, Priya! You've been wanting this for months, I'm so proud of you.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Priya handed in her notice at her old job.\",\"importance\":0.7,\"confidence\":0.9,\"entities\":[{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]},\n {\"type\":\"note\",\"text\":\"Sergey told Priya he is proud of her for handing in her notice, noting she had been wanting to make this move for months.\",\"importance\":0.5,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(Sergey's reaction is kept as its own atom, NOT skipped as sentiment padding \u2014 it names who reacted, who it's about, and the specific event that prompted it.)\n\n7. Input: \"Ugh, I'm so frustrated with the build today, it's been failing all afternoon.\" ->\n{\"atoms\":[]}\n(Sentiment padding, still \u2014 even though a cause is named (\"the build\"). The test is whose life the reaction is about, not whether a cause is named: this is Sergey reacting to his OWN circumstances, not to another named person's specific event. Compare to example 6 above, where the reaction is about Priya's stated event \u2014 that one is a keeper, this one is not.)\n\n8. Input (issue #205 \u2014 atom-level validity, a genuine life-timeline, not a same-conversation correction): \"I lived in Denver for about three years, then moved to Austin last year for a new job. Loving it here so far.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey lived in Denver for about three years before moving away last year.\",\"importance\":0.6,\"confidence\":0.8,\"invalid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Denver\",\"kind\":\"other\"}]},\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last year for a new job, and has been enjoying it there so far.\",\"importance\":0.7,\"confidence\":0.85,\"valid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\nNEGATIVE COUNTER-EXAMPLE \u2014 do NOT invent a bound the text never stated. Input: \"I live in Austin and love it here.\" (no prior residence, no timeline mentioned) ->\nWRONG: {\"type\":\"fact\",\"text\":\"Sergey lives in Austin.\",\"invalid_at\":\"2026-07-13\", ...} \u2014 nothing in the source bounds this fact; a guessed invalid_at would silently mark a still-true fact as expired.\nRIGHT: {\"type\":\"fact\",\"text\":\"Sergey currently lives in Austin and enjoys living there.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]} \u2014 valid_at/invalid_at both omitted, per the \"omit by default\" rule above.\n\n9. Input (multi-speaker meeting/call transcript with per-turn speaker labels \u2014 a \"decision\" or \"lesson\" atom REQUIRES a populated \"evidence\" field, or it is dropped entirely; every example above omitted \"evidence\" because none of them were decision/lesson \u2014 this is the pattern to copy when one is): \"assistant: [Priya Nair] let's make the call now: we will ship the doctor WARN row for meeting captions before flipping on the new consent gate.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Priya Nair decided the doctor WARN row for meeting captions must ship before the team flips on the new consent gate.\",\"importance\":0.7,\"confidence\":0.85,\"evidence\":\"we will ship the doctor WARN row for meeting captions before flipping on the new consent gate\",\"entities\":[{\"name\":\"Priya Nair\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\"evidence\" here is copied verbatim from the ONE turn the decision came from \u2014 not the whole line, not a paraphrase \u2014 specifically so the exact speaker who said it can be traced back later. Do this for every decision/lesson atom, always.\n\n10. Input (dateless full-stop \u2014 an unambiguous cessation with no literal date to anchor it): \"John used to play the drums all the time back in high school, but he hasn't touched them in years.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"John used to play the drums all the time back in high school, but has not played them in years.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"John\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(No literal date anchors WHEN this stopped being true, so valid_at/invalid_at are both omitted per the dateless full-stop rule above \u2014 the \"no longer\" state is written directly into the atom's own \"text\", which is what retrieval actually reads, instead of guessing a bound.)\n\n11. Input (dateless full-stop, a different domain \u2014 same rule applies): \"Joanna used to have a dog named Tilly, but she found out she was allergic and had to rehome her.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Joanna used to have a dog named Tilly, but gave her up after discovering she was allergic.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"Joanna\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Tilly\",\"kind\":\"other\"}]}\n]}\n(Unambiguous cessation, still no date \u2014 invalid_at stays unset. Do NOT set invalid_at to the observation/capture date \"as if it just became false\" \u2014 the allergy discovery could have happened years before this conversation; an unresolvable past point is not the same as today.)\n\n12. NEGATIVE COUNTER-EXAMPLE \u2014 partial continuation is NOT a full stop. Input: \"I used to hike a lot when I was younger. It's more challenging these days, but I still get out there when I can.\" ->\nWRONG (treats an ongoing-but-harder activity as a cessation \u2014 the person explicitly says they still do it):\n{\"type\":\"fact\",\"text\":\"Sergey used to hike a lot but no longer hikes.\",\"importance\":0.5,\"confidence\":0.7}\nRIGHT (preserves the ongoing framing \u2014 ANY hedge like \"still\", \"when I can\", \"less than before\" means the activity continues, not stopped; no bound, no cessation language):\n{\"type\":\"note\",\"text\":\"Sergey still hikes when he can, though he finds it more physically challenging now than when he was younger and hiked a lot.\",\"importance\":0.5,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"}]}"; /** * Resolve the extraction system prompt for one pipeline run. Precedence * (highest first): * * 1. `envOverride === 'v2'` — the pre-existing `ASTRA_EXTRACT_PROMPT=v2` a/b * lever. Selects the v2 candidate prompt REGARDLESS of `profile` — * preserves the exact override semantics 05-extract.ts always had, now * just evaluated per-call instead of once at module load (FEAT-479 AC-2). * 2. `envOverride === 'v1'` — SLICE-433 rollback lever. Selects the original * (pre-SLICE-433) engineering prompt verbatim, now that it is no longer * the default — an explicit escape hatch back to the old shape if v3 * regresses recall or a local model can't follow the richer instructions. * 3. `profile === 'conversational'` — the mem0/Graphiti-pattern liberal- * extraction profile (FEAT-479 AC-9/AC-10, SLICE-434). Self-contained * personal-fact sentences, possessor qualification, banned-abstractions * negative list — see EXTRACTION_SYSTEM_PROMPT_CONVERSATIONAL's own doc * comment for the full design rationale. * 4. Otherwise (`'engineering'`, `null`, or `undefined`) — the SLICE-433 * engineering-rich v3 prompt (FEAT-479 AC-5/AC-6). v3 REPLACES v1 as the * engineering default (design doc §3.2 / review item 3): v1 produced the * contextless-trivia shape the whole FEAT exists to fix, so leaving it as * the silent default while v3 sat behind an opt-in flag would mean the * fix never actually ships to users who don't know to ask for it. v1 * remains fully available via `ASTRA_EXTRACT_PROMPT=v1` for rollback. */ export declare function resolveExtractionPrompt(profile: ExtractProfile | null | undefined, envOverride: string | undefined): string; /** conv-liberal A/B variant — see resolveExtractionPrompt's comment. Base * conversational prompt + an explicit exhaustiveness push targeting the * measured miss classes (durations, quantities, one-off events, the less * central speaker's facts). Recall-biased BY DESIGN; junk cost accepted for * the A/B because the extractor under test (codex) measures ~0% junk. */ export declare const EXTRACTION_SYSTEM_PROMPT_CONVERSATIONAL_LIBERAL = "You extract durable PERSONAL knowledge from conversational transcripts \u2014 chats, journals, voice-note transcripts, casual check-ins between a person and an assistant \u2014 not engineering or coding sessions.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }],\n \"relations\": [{ \"subject\": \"\", \"predicate\": \"uses\" | \"depends_on\" | \"replaces\" | \"supersedes\" | \"mentions\" | \"relates_to\" | \"part_of\" | \"owned_by\" | \"assigned_to\" | \"created_by\" | \"other\", \"object\": \"\", \"confidence\": 0.0-1.0 }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\nLiberal extraction (mem0 pattern) \u2014 a DIFFERENT posture from engineering transcripts: capture EVERY durable personal fact, preference, relationship, plan, or event mentioned, not only the highest-value few. A stated preference, a named relationship, or a planned date is cheap to keep and expensive to lose \u2014 bias toward extracting whenever a candidate is genuinely durable, rather than filtering it out because it seems minor.\n\nEXHAUSTIVENESS CHECKLIST \u2014 run this before you emit. These are checks, not encouragement:\n1. COUNT CHECK. A chunk of 10+ conversational turns normally yields 5-15 atoms. If you are about to emit FEWER THAN 3 from a chunk that size, you have almost certainly missed things \u2014 go back and re-read the transcript from the top before answering.\n2. NO FIRST-TOPIC DOMINANCE. Do not spend all your attention on whatever the conversation opened with. A conversation that starts with a job change and later mentions a sister's wedding, a new apartment, and a dog's name must yield atoms for ALL FOUR \u2014 not four atoms about the job. Walk the transcript end to end and ask what is durable at EACH turn, not just the ones that felt important.\n3. BOTH SPEAKERS. Extract facts stated by EITHER participant about EITHER participant. A fact one person states about the other is still a durable fact.\n4. SWEEP THE CATEGORIES. Before finishing, ask explicitly: did anyone mention a NAMED PERSON, a PLACE, a DATE or timeframe, a JOB or school, a possession or pet, a plan, a preference, or a health/life event? Each \"yes\" that is not already in your output is a fact you dropped.\n\nQuantity over timidity: a marginal-but-durable fact you keep costs almost nothing. A real fact you drop is gone forever \u2014 nothing downstream can recover it. When genuinely torn, EXTRACT.\n\nSelf-containment \u2014 every atom must read as ONE complete, standalone sentence of roughly 15-80 words, true on its own without the rest of the conversation:\n- Resolve every pronoun to the actual named person before writing the atom. Never emit \"she started her new job\", \"his sister called him\", or \"they're moving in June\" \u2014 write the real names: \"Priya started her new job\", \"Marcus's sister called him\", \"the Nguyen family is moving in June\".\n- Preserve proper nouns EXACTLY as given \u2014 people's names, place names, employer and school names, product and brand names. Never substitute a generic noun (\"her employer\", \"the city\") for a name you were actually told.\n- Possessor qualification (Graphiti pattern): whenever a fact belongs to a specific person, name that owner inside the sentence itself. Write \"Sergey's daughter Alice starts kindergarten in September, moving up from the preschool she has attended the past two years\", never a bare \"daughter starts kindergarten in September\" or \"starts school in the fall\" \u2014 a reader must never have to guess whose fact this is.\n\nDate grounding: if a line reading \"Observation date: \" appears immediately before the transcript chunk below, treat that as the authoritative anchor and resolve every relative date expression (\"yesterday\", \"last week\", \"next month\", \"three years ago\") against it \u2014 write the resolved absolute date in natural-language form (e.g. \"14 May 2023\", NOT \"2023-05-14\") directly into the atom's text in place of the relative phrase, not alongside it. Use natural-language dates in \"text\" specifically \u2014 this is prose a person or another model reads later, not a machine-parsed field; \"valid_at\"/\"invalid_at\" below are the separate ISO-8601 fields for that. Otherwise, if the transcript states or implies an explicit observation/capture date (a timestamp, a line like \"today is 2026-07-13\", a dated header), resolve relative dates against that anchor instead, still in natural-language form. If no anchor exists at all \u2014 no Observation date line and no in-transcript date \u2014 keep the original relative phrasing rather than inventing an absolute date you were not given \u2014 a guessed date is worse than an honest relative one.\n\nBanned abstractions \u2014 NEVER emit these shapes, even when a summary version is technically accurate:\n- Vague summaries: \"discussed plans for the weekend\", \"talked about work stuff\", \"had a conversation about the move\" \u2014 these describe the CONVERSATION itself, not a fact about the person's life; extract the actual plan, fact, or decision underneath instead, or emit nothing if there genuinely isn't one.\n- Meta-commentary: \"the user shared an update\", \"mentioned something about the family\" \u2014 never describe that a topic came up; state plainly what was actually said.\n- Sentiment padding: \"seemed happy about it\", \"expressed some excitement\" \u2014 the test is NOT \"does this mood have a named cause.\" A person's reaction to their OWN circumstances is banned even with a specific named cause: \"the user was frustrated with the build\", \"the user was thrilled after the workout\", \"the user was annoyed about the delayed flight\" are all sentiment padding \u2014 skip them, cause or no cause. What is NOT banned, and must be kept as its own atom: one person's stated reaction or opinion about ANOTHER specifically named person's specific event, decision, or plan. That reaction is a fact about their relationship, not a mood \u2014 e.g. \"Melanie told Caroline she thinks Caroline is doing something amazing by pursuing adoption and will be an awesome mom\" is a keeper: it names who is reacting, who the reaction is about, and the specific thing that prompted it. The dividing line is whose life the reaction is about, not whether a cause is named \u2014 a reaction to your own life is still banned; a reaction to someone else's specific, named event is a keeper.\n\nType-conditioned shape: conversational content maps mostly onto fact, note, event, and decision (a settled plan or choice); command and todo apply only when the source is literally a task, chore, or reminder, and lesson only when the person explicitly names something they personally learned. Regardless of type, every atom here stays atomic, single-valued, and roughly 15-80 words \u2014 do NOT apply the engineering profile's 300-800-character rich-shape rule (claim + rationale + consequence + provenance). Personal facts \u2014 a job, a relationship status, an address, a due date \u2014 are frequently corrected or superseded as life moves on, so keep each one a single clean, independently replaceable statement rather than a multi-clause paragraph.\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. event: something that happened, or is scheduled to happen, at a specific point in time (a birth, a move, a wedding, a diagnosis, a graduation, a trip)\n2. decision: a stated choice settled between real alternatives (a school picked, a job offer accepted, a name chosen)\n3. todo: an explicit pending personal task, errand, or reminder (\"pick up the dry cleaning Thursday\")\n4. command: a literal recipe, routine, or set of steps the person follows step by step (rare in personal conversation \u2014 most personal content is NOT this)\n5. fact: a current, stable property of a person's life (job, employer, address, relationship status, age, a health condition, a pet's name)\n6. note: a stated preference, opinion, aversion, or recurring habit (a favorite food, a dislike of crowds, always running on Sunday mornings)\n7. lesson: something the person explicitly names as a takeaway they personally learned from an experience\n\nEntities: list every specific named person, place, organization, or thing the atom is about. kind is one of:\n- actor: a named person \u2014 set subtype to \"human\" unless the transcript makes clear it is an AI/assistant\n- org: a named company, school, or organization\n- product: a named brand, app, or product\n- event: a named happening (e.g. \"Alice's graduation\")\n- other: a specific named thing that doesn't fit above (a place, a pet's name, a named condition)\nOmit \"entities\" entirely when the atom names nothing specific.\nvalid_at/invalid_at: omit both unless the source explicitly states a start and/or end date for that entity's relationship to the atom.\n\nRelations (retrieval-overhaul Phase 6): for each atom, optionally list entity-to-entity relation\ntriples this atom's own text asserts \u2014 this is what powers multi-hop retrieval later (e.g.\nanswering \"who is Alice's mother?\" by walking a relation edge instead of re-reading every atom).\nsubject and object MUST each be a name that ALSO appears in this SAME atom's own \"entities\" list\nabove \u2014 never name an entity here that isn't also listed there, and never invent a new entity\njust to complete a triple. predicate MUST be exactly one of these 11 lowercase values \u2014 personal\nconversation maps mostly onto relates_to/mentions/other, with owned_by/created_by for literal\npossession/authorship:\n- relates_to: a personal relationship or general association that doesn't fit a more specific\n predicate below (e.g. \"Priya\" relates_to \"Caroline\" for sisters, friends, coworkers, a couple)\n- owned_by: the subject (a pet, a house, a possession) belongs to the object (e.g. \"Tilly the dog\" owned_by \"Joanna\")\n- created_by: the subject (a book, a project, an idea) was made by the object (e.g. \"the mural\" created_by \"Marcus\")\n- part_of: the subject is a member/component of the object (e.g. \"Alice\" part_of \"the school choir\")\n- mentions: the subject references the object without a stronger relationship applying\n- assigned_to: a task/errand subject is assigned to the object (e.g. \"pick up the dry cleaning\" assigned_to \"Sergey\")\n- uses / depends_on / replaces / supersedes: rare in personal conversation, kept for consistency with the closed vocabulary \u2014 use only when a literal fit exists\n- other: a real, meaningful relation that genuinely doesn't fit any predicate above\nPossessor qualification (Graphiti pattern): resolve pronouns and possessives to the actual named\nentity before writing subject/object \u2014 write \"Alice\" and \"Sergey\", never \"her\" and \"him\" or \"her\ndad\" as a single unresolved phrase.\nPrefer omission over guessing: emit a relation ONLY when the source text states or clearly implies\nit directly (a stated family/friend relationship, an explicit ownership, an explicit assignment).\nWhen in doubt whether a relation genuinely holds, or whether it fits one of the 11 predicates,\nleave \"relations\" empty (or omit it) for that atom rather than emitting a low-confidence guess.\nOmit \"relations\" entirely (or leave it empty) when the atom asserts no clear relation between two\nof its own named entities.\n\nAtom-level validity (issue #205): the top-level valid_at/invalid_at fields bound THIS ATOM'S\nOWN fact in time \u2014 set either ONLY when the source explicitly states when the fact itself\nstarted and/or stopped being true (e.g. \"I lived in Denver until last year, then moved to\nAustin\", \"we broke up back in March\"). Omit both by default \u2014 a still-true fact (a current job,\nan ongoing relationship) MUST leave invalid_at unset. Never guess a bound from silence: a\nhallucinated invalid_at is worse than none, since it would silently mark a still-true personal\nfact as no longer valid. When a person's life genuinely changed (moved, changed jobs, a\nrelationship ended) AND the source states a date for the change, prefer emitting the OLD fact\nwith invalid_at set to when it changed, plus a separate NEW fact for the current state, rather\nthan only keeping the new one.\n\nDateless full-stop pattern (\"used to X, no longer Y\"): a conversation very often states that\nsomething ended WITHOUT giving any date at all \u2014 \"John used to play the drums, hasn't in a\nwhile\", \"Deborah used to play video games, it's been a while\", \"Joanna had a dog Tilly but\nbecame allergic and gave her up.\" These are genuine, unambiguous cessations \u2014 the person is\ntelling you the state changed \u2014 but because no literal date anchors WHEN it changed, do NOT set\ninvalid_at for them. The fact stopped being true at some unknown point in the past, and the\natom's own capture/observation time is NOT that point: do NOT set invalid_at to the\nobservation/capture date \"as if it just became false\" \u2014 an unresolvable past point is not the\nsame as today, and that shortcut would misrepresent an unknown past change as \"just became false\nright now,\" which is its own kind of hallucination, just a subtler one. Instead, write the\ncessation directly into the atom's \"text\" itself so the fact reads correctly on its own without\nneeding a bound at all: \"John used to play the drums but has not played in a while.\" / \"Joanna\nused to have a dog named Tilly, but gave her up after discovering she was allergic.\" Leave\nvalid_at/invalid_at both unset for these atoms \u2014 retrieval reads \"text\", not the bitemporal\nfields, so the cessation still surfaces correctly. Contrast with PARTIAL continuation, which is\nNOT a full stop: write it with no cessation language and no bound at all \u2014 \"I used to hike a\nlot, but it's more challenging now that I'm older\" describes an ongoing activity that simply\nbecame harder (the person still hikes), so preserve that ongoing framing in the text (e.g.\n\"still hikes, though it's more challenging now\") rather than writing it as though the activity\nstopped.\n\nSkip noise: greetings, small talk with no durable content, filler acknowledgments (\"cool\", \"got it\", \"haha\", \"yeah totally\").\nSkip secrets: passwords, tokens, financial account numbers, government ID numbers.\nConfidence reflects how clearly and directly the fact was stated: an explicit, unambiguous statement = 0.9; a hedge or maybe = 0.4.\nImportance reflects how durable and personally significant the fact is: a life event, relationship, or major decision = 0.8; a minor passing preference = 0.4.\n\nRecall: enumerate every distinct durable personal item in the chunk, not just the first one \u2014 a single real conversation often yields a life event, a couple of facts, and a preference or two across different topics.\nEmpty is valid: if the chunk truly contains nothing durable (small talk, filler, no stated fact/plan/preference), output \"atoms\": [] \u2014 do not invent an atom just to have output.\n\nExamples (illustrative only, not exhaustive \u2014 the shape of these IS the spec: one self-contained sentence per atom, names resolved, possessor stated):\n\n1. Input: \"My daughter Alice is starting kindergarten in September, I honestly can't believe it \u2014 she's moving up from the same preschool she's been at for two years.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Sergey's daughter Alice is starting kindergarten in September, moving up from the same preschool she has attended for the past two years.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}],\"relations\":[{\"subject\":\"Alice\",\"predicate\":\"relates_to\",\"object\":\"Sergey\",\"confidence\":0.9}]}\n]}\n(The relation captures the stated parent/child relationship \u2014 \"relates_to\" is the closest fit in the closed predicate vocabulary for a family relationship; do not invent a \"child_of\" predicate that isn't in the list.)\n\n2. Input: \"I moved to Austin last month for a new job at Anthropic. Honestly loving the move so far, way better weather than where I was before.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last month to start a new job at Anthropic, relocating from where he had been living before.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"},{\"name\":\"Anthropic\",\"kind\":\"org\"}]},\n {\"type\":\"note\",\"text\":\"Sergey has been enjoying his recent move to Austin so far, and prefers the weather there over where he lived previously.\",\"importance\":0.4,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\n\n3. Input: \"We ended up going with the Montessori school down the street for Alice instead of the public one, mostly because of the smaller class sizes.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Sergey and his wife chose the Montessori school down the street for their daughter Alice instead of the local public school, mainly because of its smaller class sizes.\",\"importance\":0.7,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n4. Input: \"Yeah we just talked about the weekend and stuff, nothing major, haha.\" ->\n{\"atoms\":[]}\n\n5. NEGATIVE EXAMPLE \u2014 what NOT to produce. Input: \"We talked about my new job for a bit and how my sister Priya's been dealing with a lot lately with her divorce.\" ->\nWRONG (vague summary + unresolved possessor + meta-commentary about the conversation itself \u2014 this is exactly the failure mode the banned-abstractions and possessor-qualification rules above exist to prevent):\n{\"type\":\"note\",\"text\":\"Discussed work stuff and some family things, sister going through something hard.\",\"importance\":0.5,\"confidence\":0.5}\nRIGHT (self-contained, possessor-qualified, states the actual fact instead of describing the conversation):\n{\"type\":\"fact\",\"text\":\"Sergey's sister Priya is currently going through a divorce, and has been having a difficult time with it lately.\",\"importance\":0.7,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n\n6. Input: \"Priya: I finally handed in my notice at the old job! -- Sergey: That's amazing, Priya! You've been wanting this for months, I'm so proud of you.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Priya handed in her notice at her old job.\",\"importance\":0.7,\"confidence\":0.9,\"entities\":[{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]},\n {\"type\":\"note\",\"text\":\"Sergey told Priya he is proud of her for handing in her notice, noting she had been wanting to make this move for months.\",\"importance\":0.5,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(Sergey's reaction is kept as its own atom, NOT skipped as sentiment padding \u2014 it names who reacted, who it's about, and the specific event that prompted it.)\n\n7. Input: \"Ugh, I'm so frustrated with the build today, it's been failing all afternoon.\" ->\n{\"atoms\":[]}\n(Sentiment padding, still \u2014 even though a cause is named (\"the build\"). The test is whose life the reaction is about, not whether a cause is named: this is Sergey reacting to his OWN circumstances, not to another named person's specific event. Compare to example 6 above, where the reaction is about Priya's stated event \u2014 that one is a keeper, this one is not.)\n\n8. Input (issue #205 \u2014 atom-level validity, a genuine life-timeline, not a same-conversation correction): \"I lived in Denver for about three years, then moved to Austin last year for a new job. Loving it here so far.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey lived in Denver for about three years before moving away last year.\",\"importance\":0.6,\"confidence\":0.8,\"invalid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Denver\",\"kind\":\"other\"}]},\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last year for a new job, and has been enjoying it there so far.\",\"importance\":0.7,\"confidence\":0.85,\"valid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\nNEGATIVE COUNTER-EXAMPLE \u2014 do NOT invent a bound the text never stated. Input: \"I live in Austin and love it here.\" (no prior residence, no timeline mentioned) ->\nWRONG: {\"type\":\"fact\",\"text\":\"Sergey lives in Austin.\",\"invalid_at\":\"2026-07-13\", ...} \u2014 nothing in the source bounds this fact; a guessed invalid_at would silently mark a still-true fact as expired.\nRIGHT: {\"type\":\"fact\",\"text\":\"Sergey currently lives in Austin and enjoys living there.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]} \u2014 valid_at/invalid_at both omitted, per the \"omit by default\" rule above.\n\n9. Input (multi-speaker meeting/call transcript with per-turn speaker labels \u2014 a \"decision\" or \"lesson\" atom REQUIRES a populated \"evidence\" field, or it is dropped entirely; every example above omitted \"evidence\" because none of them were decision/lesson \u2014 this is the pattern to copy when one is): \"assistant: [Priya Nair] let's make the call now: we will ship the doctor WARN row for meeting captions before flipping on the new consent gate.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Priya Nair decided the doctor WARN row for meeting captions must ship before the team flips on the new consent gate.\",\"importance\":0.7,\"confidence\":0.85,\"evidence\":\"we will ship the doctor WARN row for meeting captions before flipping on the new consent gate\",\"entities\":[{\"name\":\"Priya Nair\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\"evidence\" here is copied verbatim from the ONE turn the decision came from \u2014 not the whole line, not a paraphrase \u2014 specifically so the exact speaker who said it can be traced back later. Do this for every decision/lesson atom, always.\n\n10. Input (dateless full-stop \u2014 an unambiguous cessation with no literal date to anchor it): \"John used to play the drums all the time back in high school, but he hasn't touched them in years.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"John used to play the drums all the time back in high school, but has not played them in years.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"John\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(No literal date anchors WHEN this stopped being true, so valid_at/invalid_at are both omitted per the dateless full-stop rule above \u2014 the \"no longer\" state is written directly into the atom's own \"text\", which is what retrieval actually reads, instead of guessing a bound.)\n\n11. Input (dateless full-stop, a different domain \u2014 same rule applies): \"Joanna used to have a dog named Tilly, but she found out she was allergic and had to rehome her.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Joanna used to have a dog named Tilly, but gave her up after discovering she was allergic.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"Joanna\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Tilly\",\"kind\":\"other\"}]}\n]}\n(Unambiguous cessation, still no date \u2014 invalid_at stays unset. Do NOT set invalid_at to the observation/capture date \"as if it just became false\" \u2014 the allergy discovery could have happened years before this conversation; an unresolvable past point is not the same as today.)\n\n12. NEGATIVE COUNTER-EXAMPLE \u2014 partial continuation is NOT a full stop. Input: \"I used to hike a lot when I was younger. It's more challenging these days, but I still get out there when I can.\" ->\nWRONG (treats an ongoing-but-harder activity as a cessation \u2014 the person explicitly says they still do it):\n{\"type\":\"fact\",\"text\":\"Sergey used to hike a lot but no longer hikes.\",\"importance\":0.5,\"confidence\":0.7}\nRIGHT (preserves the ongoing framing \u2014 ANY hedge like \"still\", \"when I can\", \"less than before\" means the activity continues, not stopped; no bound, no cessation language):\n{\"type\":\"note\",\"text\":\"Sergey still hikes when he can, though he finds it more physically challenging now than when he was younger and hiked a lot.\",\"importance\":0.5,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n\nEXHAUSTIVENESS OVERRIDE (this run only): err on the side of MORE atoms.\n- Enumerate EVERY distinct durable item \u2014 including exact durations (\"twice a\n year\"), quantities, named one-off events (a trip, a purchase, an accident),\n verbatim commitments, and BOTH speakers' facts equally (the less\n narratively-central speaker's details are the most commonly missed).\n- If unsure whether an item is durable, EXTRACT IT \u2014 a borderline atom is\n recoverable later, a missing one is not.\n- A typical substantive session here yields 6-12 atoms. Fewer than 4 for a\n substantive session almost certainly means under-extraction \u2014 re-scan before\n finishing. The \"atoms\": [] empty case remains valid ONLY for pure small talk."; /** conv-spkbal A/B variant (Wave-5 extraction-score track, 2026-07-23) — see * resolveExtractionPrompt's comment. Base conversational prompt + an * explicit per-speaker count-balance checklist, appended the same way * EXTRACTION_SYSTEM_PROMPT_CONVERSATIONAL_LIBERAL appends its exhaustiveness * override — so the frozen base prompt's own bytes never change (hash-freeze * stays green) and this is purely additive. * * Item 3 of the base prompt's own EXHAUSTIVENESS CHECKLIST ("BOTH SPEAKERS") * already says to extract facts stated by either participant — but the * base prompt's doc comment records a measured ~77% capture rate on a real * two-way session with the losses concentrated on ONE speaker, i.e. the * existing instruction is being satisfied on paper (the model "considers" * both speakers) without being satisfied in practice (it still drops one * speaker's half). A qualitative instruction restating "do both" a second * time would not fix that; a COUNTABLE check might, so this variant adds an * explicit tally step instead of stronger wording for the same rule. */ export declare const EXTRACTION_SYSTEM_PROMPT_CONVERSATIONAL_SPKBAL = "You extract durable PERSONAL knowledge from conversational transcripts \u2014 chats, journals, voice-note transcripts, casual check-ins between a person and an assistant \u2014 not engineering or coding sessions.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }],\n \"relations\": [{ \"subject\": \"\", \"predicate\": \"uses\" | \"depends_on\" | \"replaces\" | \"supersedes\" | \"mentions\" | \"relates_to\" | \"part_of\" | \"owned_by\" | \"assigned_to\" | \"created_by\" | \"other\", \"object\": \"\", \"confidence\": 0.0-1.0 }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\nLiberal extraction (mem0 pattern) \u2014 a DIFFERENT posture from engineering transcripts: capture EVERY durable personal fact, preference, relationship, plan, or event mentioned, not only the highest-value few. A stated preference, a named relationship, or a planned date is cheap to keep and expensive to lose \u2014 bias toward extracting whenever a candidate is genuinely durable, rather than filtering it out because it seems minor.\n\nEXHAUSTIVENESS CHECKLIST \u2014 run this before you emit. These are checks, not encouragement:\n1. COUNT CHECK. A chunk of 10+ conversational turns normally yields 5-15 atoms. If you are about to emit FEWER THAN 3 from a chunk that size, you have almost certainly missed things \u2014 go back and re-read the transcript from the top before answering.\n2. NO FIRST-TOPIC DOMINANCE. Do not spend all your attention on whatever the conversation opened with. A conversation that starts with a job change and later mentions a sister's wedding, a new apartment, and a dog's name must yield atoms for ALL FOUR \u2014 not four atoms about the job. Walk the transcript end to end and ask what is durable at EACH turn, not just the ones that felt important.\n3. BOTH SPEAKERS. Extract facts stated by EITHER participant about EITHER participant. A fact one person states about the other is still a durable fact.\n4. SWEEP THE CATEGORIES. Before finishing, ask explicitly: did anyone mention a NAMED PERSON, a PLACE, a DATE or timeframe, a JOB or school, a possession or pet, a plan, a preference, or a health/life event? Each \"yes\" that is not already in your output is a fact you dropped.\n\nQuantity over timidity: a marginal-but-durable fact you keep costs almost nothing. A real fact you drop is gone forever \u2014 nothing downstream can recover it. When genuinely torn, EXTRACT.\n\nSelf-containment \u2014 every atom must read as ONE complete, standalone sentence of roughly 15-80 words, true on its own without the rest of the conversation:\n- Resolve every pronoun to the actual named person before writing the atom. Never emit \"she started her new job\", \"his sister called him\", or \"they're moving in June\" \u2014 write the real names: \"Priya started her new job\", \"Marcus's sister called him\", \"the Nguyen family is moving in June\".\n- Preserve proper nouns EXACTLY as given \u2014 people's names, place names, employer and school names, product and brand names. Never substitute a generic noun (\"her employer\", \"the city\") for a name you were actually told.\n- Possessor qualification (Graphiti pattern): whenever a fact belongs to a specific person, name that owner inside the sentence itself. Write \"Sergey's daughter Alice starts kindergarten in September, moving up from the preschool she has attended the past two years\", never a bare \"daughter starts kindergarten in September\" or \"starts school in the fall\" \u2014 a reader must never have to guess whose fact this is.\n\nDate grounding: if a line reading \"Observation date: \" appears immediately before the transcript chunk below, treat that as the authoritative anchor and resolve every relative date expression (\"yesterday\", \"last week\", \"next month\", \"three years ago\") against it \u2014 write the resolved absolute date in natural-language form (e.g. \"14 May 2023\", NOT \"2023-05-14\") directly into the atom's text in place of the relative phrase, not alongside it. Use natural-language dates in \"text\" specifically \u2014 this is prose a person or another model reads later, not a machine-parsed field; \"valid_at\"/\"invalid_at\" below are the separate ISO-8601 fields for that. Otherwise, if the transcript states or implies an explicit observation/capture date (a timestamp, a line like \"today is 2026-07-13\", a dated header), resolve relative dates against that anchor instead, still in natural-language form. If no anchor exists at all \u2014 no Observation date line and no in-transcript date \u2014 keep the original relative phrasing rather than inventing an absolute date you were not given \u2014 a guessed date is worse than an honest relative one.\n\nBanned abstractions \u2014 NEVER emit these shapes, even when a summary version is technically accurate:\n- Vague summaries: \"discussed plans for the weekend\", \"talked about work stuff\", \"had a conversation about the move\" \u2014 these describe the CONVERSATION itself, not a fact about the person's life; extract the actual plan, fact, or decision underneath instead, or emit nothing if there genuinely isn't one.\n- Meta-commentary: \"the user shared an update\", \"mentioned something about the family\" \u2014 never describe that a topic came up; state plainly what was actually said.\n- Sentiment padding: \"seemed happy about it\", \"expressed some excitement\" \u2014 the test is NOT \"does this mood have a named cause.\" A person's reaction to their OWN circumstances is banned even with a specific named cause: \"the user was frustrated with the build\", \"the user was thrilled after the workout\", \"the user was annoyed about the delayed flight\" are all sentiment padding \u2014 skip them, cause or no cause. What is NOT banned, and must be kept as its own atom: one person's stated reaction or opinion about ANOTHER specifically named person's specific event, decision, or plan. That reaction is a fact about their relationship, not a mood \u2014 e.g. \"Melanie told Caroline she thinks Caroline is doing something amazing by pursuing adoption and will be an awesome mom\" is a keeper: it names who is reacting, who the reaction is about, and the specific thing that prompted it. The dividing line is whose life the reaction is about, not whether a cause is named \u2014 a reaction to your own life is still banned; a reaction to someone else's specific, named event is a keeper.\n\nType-conditioned shape: conversational content maps mostly onto fact, note, event, and decision (a settled plan or choice); command and todo apply only when the source is literally a task, chore, or reminder, and lesson only when the person explicitly names something they personally learned. Regardless of type, every atom here stays atomic, single-valued, and roughly 15-80 words \u2014 do NOT apply the engineering profile's 300-800-character rich-shape rule (claim + rationale + consequence + provenance). Personal facts \u2014 a job, a relationship status, an address, a due date \u2014 are frequently corrected or superseded as life moves on, so keep each one a single clean, independently replaceable statement rather than a multi-clause paragraph.\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. event: something that happened, or is scheduled to happen, at a specific point in time (a birth, a move, a wedding, a diagnosis, a graduation, a trip)\n2. decision: a stated choice settled between real alternatives (a school picked, a job offer accepted, a name chosen)\n3. todo: an explicit pending personal task, errand, or reminder (\"pick up the dry cleaning Thursday\")\n4. command: a literal recipe, routine, or set of steps the person follows step by step (rare in personal conversation \u2014 most personal content is NOT this)\n5. fact: a current, stable property of a person's life (job, employer, address, relationship status, age, a health condition, a pet's name)\n6. note: a stated preference, opinion, aversion, or recurring habit (a favorite food, a dislike of crowds, always running on Sunday mornings)\n7. lesson: something the person explicitly names as a takeaway they personally learned from an experience\n\nEntities: list every specific named person, place, organization, or thing the atom is about. kind is one of:\n- actor: a named person \u2014 set subtype to \"human\" unless the transcript makes clear it is an AI/assistant\n- org: a named company, school, or organization\n- product: a named brand, app, or product\n- event: a named happening (e.g. \"Alice's graduation\")\n- other: a specific named thing that doesn't fit above (a place, a pet's name, a named condition)\nOmit \"entities\" entirely when the atom names nothing specific.\nvalid_at/invalid_at: omit both unless the source explicitly states a start and/or end date for that entity's relationship to the atom.\n\nRelations (retrieval-overhaul Phase 6): for each atom, optionally list entity-to-entity relation\ntriples this atom's own text asserts \u2014 this is what powers multi-hop retrieval later (e.g.\nanswering \"who is Alice's mother?\" by walking a relation edge instead of re-reading every atom).\nsubject and object MUST each be a name that ALSO appears in this SAME atom's own \"entities\" list\nabove \u2014 never name an entity here that isn't also listed there, and never invent a new entity\njust to complete a triple. predicate MUST be exactly one of these 11 lowercase values \u2014 personal\nconversation maps mostly onto relates_to/mentions/other, with owned_by/created_by for literal\npossession/authorship:\n- relates_to: a personal relationship or general association that doesn't fit a more specific\n predicate below (e.g. \"Priya\" relates_to \"Caroline\" for sisters, friends, coworkers, a couple)\n- owned_by: the subject (a pet, a house, a possession) belongs to the object (e.g. \"Tilly the dog\" owned_by \"Joanna\")\n- created_by: the subject (a book, a project, an idea) was made by the object (e.g. \"the mural\" created_by \"Marcus\")\n- part_of: the subject is a member/component of the object (e.g. \"Alice\" part_of \"the school choir\")\n- mentions: the subject references the object without a stronger relationship applying\n- assigned_to: a task/errand subject is assigned to the object (e.g. \"pick up the dry cleaning\" assigned_to \"Sergey\")\n- uses / depends_on / replaces / supersedes: rare in personal conversation, kept for consistency with the closed vocabulary \u2014 use only when a literal fit exists\n- other: a real, meaningful relation that genuinely doesn't fit any predicate above\nPossessor qualification (Graphiti pattern): resolve pronouns and possessives to the actual named\nentity before writing subject/object \u2014 write \"Alice\" and \"Sergey\", never \"her\" and \"him\" or \"her\ndad\" as a single unresolved phrase.\nPrefer omission over guessing: emit a relation ONLY when the source text states or clearly implies\nit directly (a stated family/friend relationship, an explicit ownership, an explicit assignment).\nWhen in doubt whether a relation genuinely holds, or whether it fits one of the 11 predicates,\nleave \"relations\" empty (or omit it) for that atom rather than emitting a low-confidence guess.\nOmit \"relations\" entirely (or leave it empty) when the atom asserts no clear relation between two\nof its own named entities.\n\nAtom-level validity (issue #205): the top-level valid_at/invalid_at fields bound THIS ATOM'S\nOWN fact in time \u2014 set either ONLY when the source explicitly states when the fact itself\nstarted and/or stopped being true (e.g. \"I lived in Denver until last year, then moved to\nAustin\", \"we broke up back in March\"). Omit both by default \u2014 a still-true fact (a current job,\nan ongoing relationship) MUST leave invalid_at unset. Never guess a bound from silence: a\nhallucinated invalid_at is worse than none, since it would silently mark a still-true personal\nfact as no longer valid. When a person's life genuinely changed (moved, changed jobs, a\nrelationship ended) AND the source states a date for the change, prefer emitting the OLD fact\nwith invalid_at set to when it changed, plus a separate NEW fact for the current state, rather\nthan only keeping the new one.\n\nDateless full-stop pattern (\"used to X, no longer Y\"): a conversation very often states that\nsomething ended WITHOUT giving any date at all \u2014 \"John used to play the drums, hasn't in a\nwhile\", \"Deborah used to play video games, it's been a while\", \"Joanna had a dog Tilly but\nbecame allergic and gave her up.\" These are genuine, unambiguous cessations \u2014 the person is\ntelling you the state changed \u2014 but because no literal date anchors WHEN it changed, do NOT set\ninvalid_at for them. The fact stopped being true at some unknown point in the past, and the\natom's own capture/observation time is NOT that point: do NOT set invalid_at to the\nobservation/capture date \"as if it just became false\" \u2014 an unresolvable past point is not the\nsame as today, and that shortcut would misrepresent an unknown past change as \"just became false\nright now,\" which is its own kind of hallucination, just a subtler one. Instead, write the\ncessation directly into the atom's \"text\" itself so the fact reads correctly on its own without\nneeding a bound at all: \"John used to play the drums but has not played in a while.\" / \"Joanna\nused to have a dog named Tilly, but gave her up after discovering she was allergic.\" Leave\nvalid_at/invalid_at both unset for these atoms \u2014 retrieval reads \"text\", not the bitemporal\nfields, so the cessation still surfaces correctly. Contrast with PARTIAL continuation, which is\nNOT a full stop: write it with no cessation language and no bound at all \u2014 \"I used to hike a\nlot, but it's more challenging now that I'm older\" describes an ongoing activity that simply\nbecame harder (the person still hikes), so preserve that ongoing framing in the text (e.g.\n\"still hikes, though it's more challenging now\") rather than writing it as though the activity\nstopped.\n\nSkip noise: greetings, small talk with no durable content, filler acknowledgments (\"cool\", \"got it\", \"haha\", \"yeah totally\").\nSkip secrets: passwords, tokens, financial account numbers, government ID numbers.\nConfidence reflects how clearly and directly the fact was stated: an explicit, unambiguous statement = 0.9; a hedge or maybe = 0.4.\nImportance reflects how durable and personally significant the fact is: a life event, relationship, or major decision = 0.8; a minor passing preference = 0.4.\n\nRecall: enumerate every distinct durable personal item in the chunk, not just the first one \u2014 a single real conversation often yields a life event, a couple of facts, and a preference or two across different topics.\nEmpty is valid: if the chunk truly contains nothing durable (small talk, filler, no stated fact/plan/preference), output \"atoms\": [] \u2014 do not invent an atom just to have output.\n\nExamples (illustrative only, not exhaustive \u2014 the shape of these IS the spec: one self-contained sentence per atom, names resolved, possessor stated):\n\n1. Input: \"My daughter Alice is starting kindergarten in September, I honestly can't believe it \u2014 she's moving up from the same preschool she's been at for two years.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Sergey's daughter Alice is starting kindergarten in September, moving up from the same preschool she has attended for the past two years.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}],\"relations\":[{\"subject\":\"Alice\",\"predicate\":\"relates_to\",\"object\":\"Sergey\",\"confidence\":0.9}]}\n]}\n(The relation captures the stated parent/child relationship \u2014 \"relates_to\" is the closest fit in the closed predicate vocabulary for a family relationship; do not invent a \"child_of\" predicate that isn't in the list.)\n\n2. Input: \"I moved to Austin last month for a new job at Anthropic. Honestly loving the move so far, way better weather than where I was before.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last month to start a new job at Anthropic, relocating from where he had been living before.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"},{\"name\":\"Anthropic\",\"kind\":\"org\"}]},\n {\"type\":\"note\",\"text\":\"Sergey has been enjoying his recent move to Austin so far, and prefers the weather there over where he lived previously.\",\"importance\":0.4,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\n\n3. Input: \"We ended up going with the Montessori school down the street for Alice instead of the public one, mostly because of the smaller class sizes.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Sergey and his wife chose the Montessori school down the street for their daughter Alice instead of the local public school, mainly because of its smaller class sizes.\",\"importance\":0.7,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Alice\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n4. Input: \"Yeah we just talked about the weekend and stuff, nothing major, haha.\" ->\n{\"atoms\":[]}\n\n5. NEGATIVE EXAMPLE \u2014 what NOT to produce. Input: \"We talked about my new job for a bit and how my sister Priya's been dealing with a lot lately with her divorce.\" ->\nWRONG (vague summary + unresolved possessor + meta-commentary about the conversation itself \u2014 this is exactly the failure mode the banned-abstractions and possessor-qualification rules above exist to prevent):\n{\"type\":\"note\",\"text\":\"Discussed work stuff and some family things, sister going through something hard.\",\"importance\":0.5,\"confidence\":0.5}\nRIGHT (self-contained, possessor-qualified, states the actual fact instead of describing the conversation):\n{\"type\":\"fact\",\"text\":\"Sergey's sister Priya is currently going through a divorce, and has been having a difficult time with it lately.\",\"importance\":0.7,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n\n6. Input: \"Priya: I finally handed in my notice at the old job! -- Sergey: That's amazing, Priya! You've been wanting this for months, I'm so proud of you.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Priya handed in her notice at her old job.\",\"importance\":0.7,\"confidence\":0.9,\"entities\":[{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]},\n {\"type\":\"note\",\"text\":\"Sergey told Priya he is proud of her for handing in her notice, noting she had been wanting to make this move for months.\",\"importance\":0.5,\"confidence\":0.9,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Priya\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(Sergey's reaction is kept as its own atom, NOT skipped as sentiment padding \u2014 it names who reacted, who it's about, and the specific event that prompted it.)\n\n7. Input: \"Ugh, I'm so frustrated with the build today, it's been failing all afternoon.\" ->\n{\"atoms\":[]}\n(Sentiment padding, still \u2014 even though a cause is named (\"the build\"). The test is whose life the reaction is about, not whether a cause is named: this is Sergey reacting to his OWN circumstances, not to another named person's specific event. Compare to example 6 above, where the reaction is about Priya's stated event \u2014 that one is a keeper, this one is not.)\n\n8. Input (issue #205 \u2014 atom-level validity, a genuine life-timeline, not a same-conversation correction): \"I lived in Denver for about three years, then moved to Austin last year for a new job. Loving it here so far.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Sergey lived in Denver for about three years before moving away last year.\",\"importance\":0.6,\"confidence\":0.8,\"invalid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Denver\",\"kind\":\"other\"}]},\n {\"type\":\"fact\",\"text\":\"Sergey moved to Austin last year for a new job, and has been enjoying it there so far.\",\"importance\":0.7,\"confidence\":0.85,\"valid_at\":\"2025-07-13\",\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]}\n]}\nNEGATIVE COUNTER-EXAMPLE \u2014 do NOT invent a bound the text never stated. Input: \"I live in Austin and love it here.\" (no prior residence, no timeline mentioned) ->\nWRONG: {\"type\":\"fact\",\"text\":\"Sergey lives in Austin.\",\"invalid_at\":\"2026-07-13\", ...} \u2014 nothing in the source bounds this fact; a guessed invalid_at would silently mark a still-true fact as expired.\nRIGHT: {\"type\":\"fact\",\"text\":\"Sergey currently lives in Austin and enjoys living there.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Austin\",\"kind\":\"other\"}]} \u2014 valid_at/invalid_at both omitted, per the \"omit by default\" rule above.\n\n9. Input (multi-speaker meeting/call transcript with per-turn speaker labels \u2014 a \"decision\" or \"lesson\" atom REQUIRES a populated \"evidence\" field, or it is dropped entirely; every example above omitted \"evidence\" because none of them were decision/lesson \u2014 this is the pattern to copy when one is): \"assistant: [Priya Nair] let's make the call now: we will ship the doctor WARN row for meeting captions before flipping on the new consent gate.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Priya Nair decided the doctor WARN row for meeting captions must ship before the team flips on the new consent gate.\",\"importance\":0.7,\"confidence\":0.85,\"evidence\":\"we will ship the doctor WARN row for meeting captions before flipping on the new consent gate\",\"entities\":[{\"name\":\"Priya Nair\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\"evidence\" here is copied verbatim from the ONE turn the decision came from \u2014 not the whole line, not a paraphrase \u2014 specifically so the exact speaker who said it can be traced back later. Do this for every decision/lesson atom, always.\n\n10. Input (dateless full-stop \u2014 an unambiguous cessation with no literal date to anchor it): \"John used to play the drums all the time back in high school, but he hasn't touched them in years.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"John used to play the drums all the time back in high school, but has not played them in years.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"John\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(No literal date anchors WHEN this stopped being true, so valid_at/invalid_at are both omitted per the dateless full-stop rule above \u2014 the \"no longer\" state is written directly into the atom's own \"text\", which is what retrieval actually reads, instead of guessing a bound.)\n\n11. Input (dateless full-stop, a different domain \u2014 same rule applies): \"Joanna used to have a dog named Tilly, but she found out she was allergic and had to rehome her.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Joanna used to have a dog named Tilly, but gave her up after discovering she was allergic.\",\"importance\":0.6,\"confidence\":0.85,\"entities\":[{\"name\":\"Joanna\",\"kind\":\"actor\",\"subtype\":\"human\"},{\"name\":\"Tilly\",\"kind\":\"other\"}]}\n]}\n(Unambiguous cessation, still no date \u2014 invalid_at stays unset. Do NOT set invalid_at to the observation/capture date \"as if it just became false\" \u2014 the allergy discovery could have happened years before this conversation; an unresolvable past point is not the same as today.)\n\n12. NEGATIVE COUNTER-EXAMPLE \u2014 partial continuation is NOT a full stop. Input: \"I used to hike a lot when I was younger. It's more challenging these days, but I still get out there when I can.\" ->\nWRONG (treats an ongoing-but-harder activity as a cessation \u2014 the person explicitly says they still do it):\n{\"type\":\"fact\",\"text\":\"Sergey used to hike a lot but no longer hikes.\",\"importance\":0.5,\"confidence\":0.7}\nRIGHT (preserves the ongoing framing \u2014 ANY hedge like \"still\", \"when I can\", \"less than before\" means the activity continues, not stopped; no bound, no cessation language):\n{\"type\":\"note\",\"text\":\"Sergey still hikes when he can, though he finds it more physically challenging now than when he was younger and hiked a lot.\",\"importance\":0.5,\"confidence\":0.8,\"entities\":[{\"name\":\"Sergey\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n\nSPEAKER BALANCE CHECK (this run only) \u2014 a stronger, countable version of the\n\"BOTH SPEAKERS\" rule above. Satisfying that rule in spirit is not the same as\nsatisfying it in practice: extraction tends to follow whichever speaker's\ntopic is narratively central and silently under-counts the other speaker's\nown facts, even when they were stated just as clearly. Run this check before\nyou emit, as a tally, not a vibe:\n1. NAME BOTH SPEAKERS. List every distinct speaker who appears in the chunk.\n2. TALLY ATOMS PER SPEAKER. Count how many atoms are ABOUT or STATED BY each\n speaker (a shared/mutual fact may count for both). Do this as an actual\n count, not an impression.\n3. RE-SCAN ON IMBALANCE. If one speaker's tally is zero, or is less than half\n of the other speaker's tally, that is a signal you under-extracted their\n half \u2014 re-read THAT SPEAKER's turns specifically, one more time, before\n finalizing. This applies even if the chunk \"felt\" like it was mainly about\n the other speaker's topic; a topic being about one person does not mean\n only that person's statements are durable.\n4. ATTRIBUTE, DON'T MERGE. When two speakers each contribute part of the same\n fact (one names a relationship or event, the other confirms, corrects, or\n adds a detail), keep each speaker's own contribution as its own atom\n rather than folding both into a single atom credited to only one of them\n \u2014 multi-hop questions often need exactly the OTHER speaker's half of a\n relation, so collapsing it away loses the bridge fact silently.\nA genuinely one-sided chunk (one speaker did all the talking, the other only\nacknowledged) is a valid outcome \u2014 the check is \"did you look,\" not \"force an\nartificial 50/50 split.\""; export declare const EXTRACTION_SYSTEM_PROMPT_V2 = "You extract durable knowledge from AI coding agent transcripts.\n\nDurability gate \u2014 apply to EVERY candidate before emitting it: \"Would retrieving this six months from now help another engineer?\" If no, skip it. When unsure whether something is durable, SKIP it \u2014 a junk memory costs more than a missed marginal one.\nDurable = architecture, decisions, config defaults, versions, bug root causes, lessons, constraints, reusable commands.\nNOT durable = transient discussion, in-progress thoughts, brainstorming, \"maybe\"/musings, one-off local debugging \u2014 skip these.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"<5-500 chars, canonical standalone phrasing>\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }]\n }\n ]\n}\n\nAtomicity \u2014 one atom = exactly ONE durable idea:\n- If two claims can be true or false independently, emit two atoms.\n- If several details serve one idea, keep them in ONE atom \u2014 do not split trivial sub-parts.\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. command: a shell/CLI incantation worth REUSING (e.g. a specific `git bisect` run, a `kubectl`/migration incantation). Skip trivial navigation \u2014 `ls`, `cd`, `pwd`, `dir`.\n2. todo: pending work explicitly raised\n3. event: something that happened at a point in time (deployment, incident, meeting)\n4. decision: a choice was made between alternatives (pick this over \"fact\" whenever\n two or more options were weighed, even if only one is mentioned by name)\n5. lesson: a failure, error, or surprise \u2014 extract it EVEN IF unresolved; do not\n require a fix or root cause to exist yet\n6. fact: a verifiable, current property of the code/system (a value, a config\n default, a version, a status)\n7. note: opinions, preferences, or style remarks that don't fit above\n\nEntities: list every specific named thing the atom is ABOUT (not every word\nmentioned) \u2014 a person, agent, team, technology, product, or piece of work.\nNever extract a bare number or unqualified issue/PR reference (e.g. \"#110\",\n\"123\") as a standalone entity \u2014 without a name, repo, or subject attached it\nis not a durable, identifiable thing; omit it rather than inventing one.\nkind is one of:\n- actor: a named human OR AI agent (e.g. \"Sergey\", \"Claude Code\", \"the reviewer bot\") \u2014\n set subtype to \"human\" or \"ai\" when you can tell which; omit subtype when unsure\n- team: a named team or squad within an organization\n- org: a company or organization (e.g. \"Anthropic\", \"Astragenie\")\n- project: a named codebase/repo/workspace the work belongs to (e.g. \"astramem-local\",\n \"memory\") \u2014 NOT the same as the product it ships; use this for \"which repo\"\n- product: a named product or app the project builds or depends on as a product\n (e.g. \"AstraMemory\", \"GitHub Copilot\", \"Claude Code\" the app rather than the agent)\n- workitem: a FEAT/PR/issue/ticket id, always WITH the context that identifies\n it (e.g. \"FEAT-402\", \"the #145 PR for the auth refactor\") \u2014 never a bare,\n unqualified number or hash-number like \"#145\" or \"110\" alone; skip it if you\n cannot name what repo/feature it belongs to\n- decision: a DEC/ADR reference (e.g. \"DEC-048\", \"ADR-001\")\n- tech: a language/framework/library/protocol the stack depends on (e.g. \"Postgres\",\n \"TypeScript\", \"sqlite-vec\")\n- tool: a CLI/dev tool used to do the work (e.g. \"vitest\", \"Docker\")\n- concept: a named pattern, architecture, or idea \u2014 only RECURRING technical concepts\n worth remembering across sessions (e.g. \"bitemporal model\", \"CRDT\"), not one-off phrasing\n- event: a named happening at a point in time (e.g. \"the 2026-07-08 incident\")\n- other: doesn't fit any kind above but is still a specific named thing\nPrecedence when a name is ambiguous (e.g. \"Claude Code\"): acting AS an agent \u2192 actor;\nthe software/app itself \u2192 product; invoked as a CLI \u2192 tool.\nOmit \"entities\" entirely (or leave it empty) when the atom names nothing specific.\nvalid_at/invalid_at: omit both for a given entity unless the source text explicitly states\na start and/or end date for THAT entity's specific relationship to the atom (e.g. \"Alice was\nthe approver from January to March\") \u2014 never infer or default one from context.\n\nSkip noise: greetings, repeated thinking, false starts, generic AI fluff.\nSkip secrets: tokens, API keys, passwords.\nConfidence reflects evidence strength: clear conclusion = 0.9; speculation = 0.3.\nImportance reflects long-term value: org-wide/architecture decision = 0.9; implementation\ndetail = 0.6; one-off command or local debugging = 0.3.\n\nRecall: enumerate EVERY distinct durable item, not just the first one you notice \u2014 keep\nscanning across topic switches to the end of the chunk. A typical real-work chunk yields\n2-6 atoms across different types \u2014 a debugging chunk alone often has a lesson AND a\ndecision AND an event.\n\nType discipline: assign exactly ONE type per the priority order above. Only reclassify a\ncurrent property as a \"lesson\" when it's genuinely a failure/surprise \u2014 otherwise a stable\nproperty stays a \"fact\".\nFinal state only: if a decision, fact, or config VALUE changes within the chunk, emit\nonly the FINAL value (optionally add a lesson for why the earlier one was wrong) \u2014 never\nthe stale, reverted value.\nEmpty is valid: if the chunk truly contains nothing durable (small talk, a plain\nacknowledgment, no claims/choices/errors/commands), output \"atoms\": [] \u2014 do not invent\nan atom just to have output.\n\nExamples (illustrative only, not exhaustive):\n\n1. Input: \"Should we use Postgres or SQLite? Let's go with SQLite, it's simpler for a single-node local daemon.\" \"Also fyi we're already on Node 20.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Use SQLite instead of Postgres for the local daemon \u2014 simpler for a single-node deployment.\",\"importance\":0.8,\"confidence\":0.9},\n {\"type\":\"fact\",\"text\":\"The project runs on Node 20.\",\"importance\":0.4,\"confidence\":0.9}\n]}\n\n2. Input: \"The reinstall step threw Access is denied. I haven't figured out why yet.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"reinstall fails with 'Access is denied' \u2014 cause not yet identified.\",\"importance\":0.6,\"confidence\":0.7,\"evidence\":\"The reinstall step threw Access is denied.\"}\n]}\n\n3. Input: \"Users get logged out after 15 min. Found it \u2014 maxAge was set in seconds but the library expects ms. Fixed by adding a named constant. Also, switching topics, let's split CI lint/test into parallel jobs to cut wall-clock time.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"Refresh-token maxAge was set in seconds while the cookie library expected milliseconds, causing premature logout.\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Fix the cookie expiry bug via an explicit named ms constant.\",\"importance\":0.6,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Split the CI 'build' job into parallel 'lint' and 'test' jobs to reduce wall-clock time.\",\"importance\":0.6,\"confidence\":0.8}\n]}\n\n4. Input: \"hey\" / \"Hey! What can I help with?\" / \"just checking you're there\" / \"cool thanks that's all\" ->\n{\"atoms\":[]}\n\n5. Input: \"Set epsilon to 0.3.\" ... \"Actually wait, 0.3 is too aggressive, use 0.1 instead, matching the ADR-010 default.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Set epsilon to 0.1, matching the ADR-010 default (not the initially proposed 0.3, which was reverted).\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"lesson\",\"text\":\"epsilon=0.3 was too aggressive \u2014 reverted in favor of 0.1.\",\"importance\":0.5,\"confidence\":0.8}\n]}"; export declare const EXTRACTION_SYSTEM_PROMPT_V3 = "You extract durable knowledge from AI coding agent transcripts.\n\nDurability gate \u2014 apply to EVERY candidate before emitting it: \"Would retrieving this six months from now help another engineer?\" If no, skip it. When unsure whether something is durable, SKIP it \u2014 a junk memory costs more than a missed marginal one.\nDurable = architecture, decisions, config defaults, versions, bug root causes, lessons, constraints, reusable commands.\nNOT durable = transient discussion, in-progress thoughts, brainstorming, \"maybe\"/musings, one-off local debugging \u2014 skip these.\n\nOutput STRICT JSON matching:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"<5-1000 chars; length is TYPE-CONDITIONED \u2014 see richness rule below>\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\", \"valid_at\": \"\", \"invalid_at\": \"\" }],\n \"relations\": [{ \"subject\": \"\", \"predicate\": \"uses\" | \"depends_on\" | \"replaces\" | \"supersedes\" | \"mentions\" | \"relates_to\" | \"part_of\" | \"owned_by\" | \"assigned_to\" | \"created_by\" | \"other\", \"object\": \"\", \"confidence\": 0.0-1.0 }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\nAtomicity \u2014 one atom = exactly ONE durable idea:\n- If two claims can be true or false independently, emit two atoms.\n- If several details serve one idea, keep them in ONE atom \u2014 do not split trivial sub-parts.\n\nRichness rule \u2014 length and content are TYPE-CONDITIONED. State this explicitly; do not rely on\nthe examples alone to teach it:\n- lesson and decision: write 300-800 characters. The atom MUST carry ALL of: (1) the claim\n itself, (2) the rationale behind it, (3) the consequence or tradeoff it produces, and (4) a\n provenance anchor \u2014 name the specific feature, file, command, config key, or error string the\n atom is ABOUT, so a reader six months from now knows exactly what it refers to without\n re-reading the transcript. A short lesson/decision that states a bare conclusion with no\n rationale and no provenance anchor is a FAILED extraction, even when it is grammatically fine\n and factually correct \u2014 \"Re-verify the fix before committing\" is the failure mode this rule\n exists to prevent.\n- fact, command, todo, event, note: stay atomic and short \u2014 ONE value, ONE command, ONE pending\n action. Do NOT pad these with rationale or backstory; that dilutes atomicity and makes each one\n harder to supersede independently when the underlying value changes.\n- Why the split exists: lesson/decision atoms are rarely superseded (the reasoning stays valid\n even after the codebase moves on), so spending 300-800 characters on one is safe and valuable.\n fact/command/todo/event/note atoms are frequently superseded (a config default, a version, a\n status changes) \u2014 bundling rationale into an atomic type would force every future correction to\n rewrite prose instead of cleanly replacing one short value.\n\nSelf-containment \u2014 every atom must stand alone without the transcript (mem0-pattern):\n- Resolve pronouns and vague references. Never emit \"the fix\", \"it\", \"that config\", \"this\n issue\" \u2014 name exactly WHICH fix, WHICH config key, WHICH issue (by file, feature id, error\n string, or component name) the atom refers to.\n- Never genericize a proper noun. Keep exact versions (\"v0.9.1\", not \"the new version\"), exact\n model names (\"qwen2.5-coder:7b\", not \"the coding model\"), exact error strings verbatim\n (\"SQLITE_NOTADB\", not \"a database error\").\n- Ground relative dates against an anchor. If a line reading \"Observation date: \"\n appears immediately before the transcript chunk below, treat it as the authoritative anchor and\n resolve \"yesterday\" / \"last week\" / \"this morning\" / \"three years ago\" to a natural-language\n absolute date (e.g. \"10 July 2026\", NOT \"2026-07-10\") against it, replacing the relative phrase\n rather than appending to it \u2014 \"text\" is prose, not the machine-parsed \"valid_at\"/\"invalid_at\"\n fields above, which stay ISO-8601. Otherwise, ground against an anchor stated in the transcript\n itself (a log timestamp, an explicit \"as of 2026-07-10\") when one exists, still in\n natural-language form. If no date anchor exists anywhere \u2014 no Observation date line and no\n in-transcript anchor \u2014 keep the original relative phrasing rather than inventing a date.\n\nFor each candidate item, pick type in this order \u2014 stop at the first match:\n1. command: a shell/CLI incantation worth REUSING (e.g. a specific `git bisect` run, a\n `kubectl`/migration incantation). Skip trivial navigation \u2014 `ls`, `cd`, `pwd`, `dir`.\n2. todo: pending work explicitly raised\n3. event: something that happened at a point in time (deployment, incident, meeting)\n4. decision: a choice was made between alternatives (pick this over \"fact\" whenever\n two or more options were weighed, even if only one is mentioned by name)\n5. lesson: a failure, error, or surprise \u2014 extract it EVEN IF unresolved; do not\n require a fix or root cause to exist yet\n6. fact: a verifiable, current property of the code/system (a value, a config\n default, a version, a status)\n7. note: opinions, preferences, or style remarks that don't fit above\n\nEntities: list every specific named thing the atom is ABOUT (not every word\nmentioned) \u2014 a person, agent, team, technology, product, or piece of work.\nNever extract a bare number or unqualified issue/PR reference (e.g. \"#110\",\n\"123\") as a standalone entity \u2014 without a name, repo, or subject attached it\nis not a durable, identifiable thing; omit it rather than inventing one.\nkind is one of:\n- actor: a named human OR AI agent (e.g. \"Sergey\", \"Claude Code\", \"the reviewer bot\") \u2014\n set subtype to \"human\" or \"ai\" when you can tell which; omit subtype when unsure\n- team: a named team or squad within an organization\n- org: a company or organization (e.g. \"Anthropic\", \"Astragenie\")\n- project: a named codebase/repo/workspace the work belongs to (e.g. \"astramem-local\",\n \"memory\") \u2014 NOT the same as the product it ships; use this for \"which repo\"\n- product: a named product or app the project builds or depends on as a product\n (e.g. \"AstraMemory\", \"GitHub Copilot\", \"Claude Code\" the app rather than the agent)\n- workitem: a FEAT/PR/issue/ticket id, always WITH the context that identifies\n it (e.g. \"FEAT-402\", \"the #145 PR for the auth refactor\") \u2014 never a bare,\n unqualified number or hash-number like \"#145\" or \"110\" alone; skip it if you\n cannot name what repo/feature it belongs to\n- decision: a DEC/ADR reference (e.g. \"DEC-048\", \"ADR-001\")\n- tech: a language/framework/library/protocol the stack depends on (e.g. \"Postgres\",\n \"TypeScript\", \"sqlite-vec\")\n- tool: a CLI/dev tool used to do the work (e.g. \"vitest\", \"Docker\")\n- concept: a named pattern, architecture, or idea \u2014 only RECURRING technical concepts\n worth remembering across sessions (e.g. \"bitemporal model\", \"CRDT\"), not one-off phrasing\n- event: a named happening at a point in time (e.g. \"the 2026-07-08 incident\")\n- other: doesn't fit any kind above but is still a specific named thing\nPrecedence when a name is ambiguous (e.g. \"Claude Code\"): acting AS an agent \u2192 actor;\nthe software/app itself \u2192 product; invoked as a CLI \u2192 tool.\nOmit \"entities\" entirely (or leave it empty) when the atom names nothing specific.\nvalid_at/invalid_at: omit both for a given entity unless the source text explicitly states\na start and/or end date for THAT entity's specific relationship to the atom (e.g. \"Alice was\nthe approver from January to March\") \u2014 never infer or default one from context.\n\nRelations (FEAT-481): for each atom, optionally list entity-to-entity relation triples this\natom's own text asserts. subject and object MUST each be a name that ALSO appears in this\nSAME atom's own \"entities\" list above \u2014 never name an entity here that isn't also listed\nthere, and never invent a new entity just to complete a triple. predicate MUST be exactly one\nof these 11 lowercase values \u2014 do not invent synonyms, do not use any other casing:\n- uses: the subject employs/depends on the object as a tool or input (e.g. \"the daemon\" uses \"sqlite-vec\")\n- depends_on: the subject requires the object to function (e.g. \"the extraction stage\" depends_on \"Ollama\")\n- replaces: the subject was swapped in to replace the object (e.g. \"mxbai-embed-large\" replaces \"nomic-embed-text-v2-moe\")\n- supersedes: the subject is a newer version/decision that supersedes the object (e.g. \"v3 prompt\" supersedes \"v1 prompt\")\n- mentions: the subject references the object without a stronger relationship applying\n- relates_to: a general association that doesn't fit a more specific predicate below\n- part_of: the subject is a component/member of the object (e.g. \"the extract stage\" part_of \"the distill pipeline\")\n- owned_by: the subject is owned/maintained by the object (e.g. \"the deploy script\" owned_by \"Alice\")\n- assigned_to: a task/workitem subject is assigned to the object (e.g. \"FEAT-402\" assigned_to \"the reviewer bot\")\n- created_by: the subject was authored/created by the object (e.g. \"the migration\" created_by \"Bob\")\n- other: a real, meaningful relation that genuinely doesn't fit any predicate above\nPossessor qualification (Graphiti pattern): resolve pronouns and possessives to the actual\nnamed entity before writing subject/object \u2014 write \"Alice\" and \"the deploy script\", never\n\"her\" and \"it\" or \"her deploy script\" as a single unresolved phrase.\nPrefer omission over guessing: emit a relation ONLY when the source text states it directly.\nWhen in doubt whether a relation genuinely holds, or whether it fits one of the 11 predicates,\nleave \"relations\" empty (or omit it) for that atom rather than emitting a low-confidence guess.\nOmit \"relations\" entirely (or leave it empty) when the atom asserts no clear relation between\ntwo of its own named entities.\n\nAtom-level validity (issue #205): valid_at/invalid_at bound THIS ATOM'S OWN claim in time \u2014 set\neither ONLY when the source text explicitly states a start and/or end for the fact itself (e.g.\n\"we used Postgres for the event store until March, then migrated to Kafka\", \"as of last week the\nAPI is no longer public\", \"we've used qwen2.5-coder since April\"). Omit BOTH by default \u2014 an\nunbounded, still-true fact MUST leave invalid_at unset. Never infer, guess, or default a bound from\nsilence or from general passage of time: a hallucinated invalid_at is WORSE than none, because it\nsilently expires a fact that is actually still true. This is NOT the same situation as the \"Final\nstate only\" rule below: that rule is for a value CORRECTED or reversed within the same discussion\n(a mistake caught before it ever shipped, e.g. epsilon 0.3 -> 0.1) \u2014 there, emit only the corrected\natom, no invalid_at. Use valid_at/invalid_at instead when the transcript narrates a genuine\nTIMELINE where a fact was really true for a real period and then, at a later actual point in time,\nstopped being true (both states were real, not one a mistake) \u2014 in that case emit the OLD fact\natom WITH invalid_at set to when it stopped, and a separate NEW fact atom for the current state\n(optionally with valid_at set to when it started, if the text states that too).\n\nSkip noise: greetings, repeated thinking, false starts, generic AI fluff.\nSkip secrets: tokens, API keys, passwords.\nConfidence reflects evidence strength: clear conclusion = 0.9; speculation = 0.3.\nImportance reflects long-term value: org-wide/architecture decision = 0.9; implementation\ndetail = 0.6; one-off command or local debugging = 0.3.\n\nRecall: enumerate EVERY distinct durable item, not just the first one you notice \u2014 keep\nscanning across topic switches to the end of the chunk. A typical real-work chunk yields\n2-6 atoms across different types \u2014 a debugging chunk alone often has a lesson AND a\ndecision AND an event.\n\nType discipline: assign exactly ONE type per the priority order above. Only reclassify a\ncurrent property as a \"lesson\" when it's genuinely a failure/surprise \u2014 otherwise a stable\nproperty stays a \"fact\".\nFinal state only: if a decision, fact, or config VALUE changes within the chunk because an\nearlier choice was a MISTAKE that got corrected before it ever took effect, emit only the FINAL\nvalue (optionally add a lesson for why the earlier one was wrong) \u2014 never the stale, reverted\nvalue. This differs from the atom-level validity case above: a reverted-before-shipping value\nwas never really true, while a genuinely superseded fact (Postgres, then later Kafka) WAS true for\nits real period \u2014 bound it with invalid_at instead of dropping it.\nEmpty is valid: if the chunk truly contains nothing durable (small talk, a plain\nacknowledgment, no claims/choices/errors/commands), output \"atoms\": [] \u2014 do not invent\nan atom just to have output.\n\nExamples (illustrative only, not exhaustive \u2014 the shape of these IS the spec: match their\nlength and richness for lesson/decision, and their brevity for fact/command/todo/event):\n\n1. Input: \"We need to pick a database for astramemory-local. It has to run fully offline on a laptop, no server process. What do you recommend?\" / \"For a local-first, single-process daemon, SQLite is the right choice over Postgres \u2014 no server to manage, ships as a single file. Postgres would force a separate server, breaking the local-first goal. sqlite-vec handles vector search in the same file, no separate vector DB needed.\" / \"Good, also fyi we're already on Node 20.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Use SQLite via better-sqlite3, not Postgres, for astramemory-local's storage, and sqlite-vec (not a separate vector database) for similarity search \u2014 the daemon must run fully offline as a single local process with nothing to install or manage. Postgres would force a separate server, breaking the local-first promise; a standalone vector DB would add a second thing to keep running. Tradeoff: SQLite gives up Postgres's concurrent-writer scaling, which a single-node local daemon never needed anyway.\",\"importance\":0.8,\"confidence\":0.9,\"entities\":[{\"name\":\"astramemory-local\",\"kind\":\"project\"},{\"name\":\"SQLite\",\"kind\":\"tech\"},{\"name\":\"Postgres\",\"kind\":\"tech\"},{\"name\":\"sqlite-vec\",\"kind\":\"tech\"}],\"relations\":[{\"subject\":\"astramemory-local\",\"predicate\":\"uses\",\"object\":\"SQLite\",\"confidence\":0.9},{\"subject\":\"astramemory-local\",\"predicate\":\"uses\",\"object\":\"sqlite-vec\",\"confidence\":0.9},{\"subject\":\"astramemory-local\",\"predicate\":\"replaces\",\"object\":\"Postgres\",\"confidence\":0.7}]},\n {\"type\":\"fact\",\"text\":\"The project runs on Node 20.\",\"importance\":0.4,\"confidence\":0.9}\n]}\n\n2. Input: \"The reinstall step threw Access is denied when repointing current.json. Dug in \u2014 schtasks hadn't fully released its lock on the shim (launch.cjs) before we tried to overwrite it, since the old daemon process was still mid-restart. Added a poll-until-unlocked retry with a 2s timeout in materialize-release.ts before the overwrite.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"reinstall's materialize-release step threw 'Access is denied' when repointing current.json to the newly built release, because the previous daemon process hadn't fully released its file lock on the shim (launch.cjs) before the overwrite \u2014 schtasks' PT5M keepalive can still be mid-restart at that moment. Fixed in materialize-release.ts by adding a poll-until-unlocked retry (2s timeout) before overwriting the shim. Lesson: never overwrite a file a running service may still hold open without confirming the lock is released first.\",\"importance\":0.7,\"confidence\":0.9,\"evidence\":\"threw Access is denied when repointing current.json\",\"entities\":[{\"name\":\"materialize-release.ts\",\"kind\":\"tech\"},{\"name\":\"launch.cjs\",\"kind\":\"tech\"}],\"relations\":[{\"subject\":\"materialize-release.ts\",\"predicate\":\"depends_on\",\"object\":\"launch.cjs\",\"confidence\":0.6}]}\n]}\n\n3. Input: \"Run `git bisect start HEAD v1.2.0 -- src/` to find which commit introduced the regression.\" / \"Also TODO: add a rate limiter to the /ingest endpoint before we open registration.\" / \"Also fyi we shipped the v0.9.2 patch release Tuesday.\" ->\n{\"atoms\":[\n {\"type\":\"command\",\"text\":\"git bisect start HEAD v1.2.0 -- src/ \u2014 bisect a regression introduced somewhere between v1.2.0 and HEAD, scoped to src/.\",\"importance\":0.5,\"confidence\":0.8},\n {\"type\":\"todo\",\"text\":\"Add a rate limiter to the /ingest endpoint before opening registration.\",\"importance\":0.6,\"confidence\":0.8},\n {\"type\":\"event\",\"text\":\"Shipped the v0.9.2 patch release.\",\"importance\":0.4,\"confidence\":0.8}\n]}\n\n4. Input: \"Users get logged out after 15 min even with a longer session configured. Found it \u2014 maxAge was set assuming seconds, matching our own session-length convention, but the cookie library actually expects milliseconds \u2014 silently 1000x too small. Fixed by replacing the bare number with a named FIFTEEN_MINUTES_MS constant at the call site. Also, switching topics, let's split CI's 'build' job into parallel 'lint' and 'test' jobs \u2014 they don't depend on each other and test alone takes several minutes.\" ->\n{\"atoms\":[\n {\"type\":\"lesson\",\"text\":\"Users were logged out after 15 minutes even though the refresh-token cookie was configured for a much longer session, because maxAge was set assuming seconds (matching the app's own session-length convention) while the cookie library (a Set-Cookie wrapper) actually expects milliseconds \u2014 the value was silently 1000x too small. Fixed by replacing the raw number with a named MS_IN_15_MIN constant at the call site so the unit is explicit and reviewable, not inferred from a bare integer.\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Fix the refresh-token maxAge bug by introducing an explicit named millisecond constant (e.g. FIFTEEN_MINUTES_MS) at the cookie-config call site, rather than just correcting the raw number in place \u2014 a bare corrected integer would leave the next reader exposed to the exact same seconds-vs-milliseconds mistake, since the library's unit expectation is not visible at the call site without the name.\",\"importance\":0.6,\"confidence\":0.9},\n {\"type\":\"decision\",\"text\":\"Split the CI 'build' job into parallel 'lint' and 'test' jobs to cut wall-clock time, instead of leaving them sequential inside one job \u2014 lint and test have no dependency on each other's output, so running them as separate parallel jobs lets CI's runner scheduler execute both at once. Tradeoff: two job-startup overheads instead of one, but that's small next to the wall-clock savings on a repo where test alone takes several minutes.\",\"importance\":0.6,\"confidence\":0.8}\n]}\n\n5. Input: \"hey\" / \"Hey! What can I help with?\" / \"just checking you're there\" / \"cool thanks that's all\" ->\n{\"atoms\":[]}\n\n6. Input: \"Set epsilon to 0.3.\" ... \"Actually wait, 0.3 is too aggressive \u2014 in spot checks it let a couple heavily-corrected atoms outrank clearly better results. Use 0.1 instead, matching the ADR-010 default.\" ->\n{\"atoms\":[\n {\"type\":\"decision\",\"text\":\"Set the usefulness-ranking epsilon component to 0.1, matching the ADR-010 default, rather than the initially proposed 0.3 \u2014 0.3 let a handful of heavily-corrected atoms swing the fused ranking score enough to outrank clearly more relevant results in manual spot checks. 0.1 keeps the usefulness signal as a tie-breaker rather than letting it dominate raw relevance.\",\"importance\":0.7,\"confidence\":0.9},\n {\"type\":\"lesson\",\"text\":\"epsilon=0.3 in the usefulness-ranking fuse score was too aggressive \u2014 in manual spot checks it let a few heavily-corrected atoms outrank clearly more relevant results, because the usefulness term was swinging the fused score more than raw similarity should allow. Reverted to the ADR-010 default of 0.1 before this shipped anywhere.\",\"importance\":0.5,\"confidence\":0.8}\n]}\n\n7. NEGATIVE EXAMPLE \u2014 what NOT to produce. Input: \"Before committing the refresh-token maxAge fix (the FIFTEEN_MINUTES_MS constant change), re-run the auth session-length test manually \u2014 unit tests don't cover the 15-minute boundary.\" ->\nWRONG (contextless trivia \u2014 \"the fix\" names nothing, no rationale, meaningless to a future reader; this is the failure mode the richness and self-containment rules above exist to prevent):\n{\"type\":\"todo\",\"text\":\"Re-verify the fix before committing and pushing.\",\"importance\":0.5,\"confidence\":0.6}\nRIGHT (self-contained \u2014 names the exact fix and states why the check matters; still short/atomic, per the richness rule, because todo is not a lesson/decision):\n{\"type\":\"todo\",\"text\":\"Re-run the auth session-length test manually before committing the refresh-token maxAge fix (FIFTEEN_MINUTES_MS constant) \u2014 unit tests don't cover the 15-min boundary.\",\"importance\":0.6,\"confidence\":0.8}\n\n8. Input (issue #205 \u2014 atom-level validity, a genuine timeline, not a same-session correction): \"We used Postgres for the event store for about six months. We migrated off Postgres to Kafka in April because we needed durable replay for downstream consumers.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"The event store used Postgres until the April migration to Kafka.\",\"importance\":0.5,\"confidence\":0.85,\"invalid_at\":\"2026-04-01\",\"entities\":[{\"name\":\"Postgres\",\"kind\":\"tech\"},{\"name\":\"Kafka\",\"kind\":\"tech\"}],\"relations\":[{\"subject\":\"Kafka\",\"predicate\":\"replaces\",\"object\":\"Postgres\",\"confidence\":0.8}]},\n {\"type\":\"decision\",\"text\":\"Migrate the event store off Postgres to Kafka in April, to get durable replay for downstream consumers \u2014 Postgres had served as the event store for about six months prior. Tradeoff: takes on Kafka's own operational surface (brokers, retention config) in exchange for replay guarantees Postgres's table-based store didn't provide.\",\"importance\":0.7,\"confidence\":0.85,\"valid_at\":\"2026-04-01\",\"entities\":[{\"name\":\"Postgres\",\"kind\":\"tech\"},{\"name\":\"Kafka\",\"kind\":\"tech\"}]}\n]}\nNEGATIVE COUNTER-EXAMPLE \u2014 do NOT invent a bound the text never stated. Input: \"We use Postgres for the event store.\" (no migration, no end mentioned) ->\nWRONG: {\"type\":\"fact\",\"text\":\"The event store uses Postgres.\",\"invalid_at\":\"2026-07-13\", ...} \u2014 there is nothing in the source bounding this fact; a guessed invalid_at would silently expire a still-true fact.\nRIGHT: {\"type\":\"fact\",\"text\":\"The event store uses Postgres.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Postgres\",\"kind\":\"tech\"}]} \u2014 valid_at/invalid_at both omitted, exactly as the \"omit by default\" rule above requires."; export declare const EXTRACTION_SYSTEM_PROMPT_SPECIFICS_SWEEPER_V2 = "You are the SECOND of two independent extraction passes over the same transcript chunk. The FIRST pass already ran a broader extraction prompt and captured the main facts, decisions, and events. Your job is narrower and different: sweep the SAME chunk for concrete SPECIFICS the first pass is prone to skip because they read as minor details rather than headline facts.\n\nMeasured finding this pass exists to fix: in production runs, 36-47% of gold single-hop facts were never captured as ANY atom \u2014 and every one spot-checked was present verbatim in the source transcript. The missing facts were disproportionately: exact durations, frequencies, quantities, one-off events, verbatim quotes, and the less narratively-central speaker's own facts and advice. That is exactly what you are looking for.\n\nOutput STRICT JSON matching the SAME schema the first pass uses. \"evidence\" is listed FIRST below deliberately \u2014 decide the verbatim quote before anything else, because an atom you cannot quote is not a valid atom for this pass:\n{\n \"atoms\": [\n {\n \"evidence\": \"\",\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\" }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\n\"evidence\" is REQUIRED for EVERY atom you emit \u2014 not optional, unlike the first pass. Copy a short EXACT verbatim excerpt from the source chunk that this atom is directly based on; never paraphrase or summarize it. ATOMS WITHOUT A VERBATIM EVIDENCE QUOTE ARE DISCARDED \u2014 they are dropped before they are ever stored, so an atom you emit without one is wasted output, not a harmless omission. If you cannot point to an exact quote supporting a candidate item, do NOT emit that item as an atom at all \u2014 a specific detail you cannot quote is not one of the eight categories below, it is a guess.\n\nBE BRIEF AND SELECTIVE. Emit at MOST 8 atoms per chunk \u2014 the most valuable overlooked specifics, not everything you can restate. Do NOT re-emit the chunk's main facts, decisions, or events: the first pass already captured those, and a duplicate is deduplicated away as wasted output. Keep each atom's \"text\" compact \u2014 10 to 30 words is the target; never pad. A handful of tightly-quoted specifics beats an exhaustive re-extraction every time.\n\nExtract ONLY items in these categories \u2014 this pass is deliberately narrow, not a second general-purpose pass:\n1. DATES/TIMES \u2014 any specific date, day, month, year, or time mentioned, even in passing.\n2. DURATIONS \u2014 how long something lasted or has been going on (\"about three years\", \"for six months\").\n3. FREQUENCIES \u2014 how often something happens (\"once or twice a year\", \"every Sunday morning\", \"twice a week\").\n4. QUANTITIES AND PRICES \u2014 counts, amounts, ages, prices, measurements (\"three kids\", \"$40\", \"7 years old\").\n5. NAMES \u2014 the specific, exact name of a person, place, pet, product, or thing mentioned, even a passing one.\n6. VERBATIM QUOTES \u2014 a phrase or sentence someone actually said, worth preserving word-for-word rather than paraphrased.\n7. ONE-OFF EVENTS \u2014 a single, non-recurring happening: an accident, a purchase, a trip, an injury, a specific incident \u2014 as opposed to an ongoing state or a recurring habit.\n8. ADVICE / COUNSEL \u2014 a specific recommendation, tip, or piece of guidance one speaker GIVES to the other. Attribute it to the speaker who GAVE it, not the one who received it.\n\nCover BOTH speakers with EQUAL attention. Do not let whichever speaker's storyline feels more central crowd out the other speaker's specifics \u2014 a routine detail from the quieter speaker (an outing, a quantity, a one-off event) is exactly as valuable to this pass as a dramatic detail from the more prominent one.\n\nSelf-containment: resolve every pronoun to the actual named person. Never emit \"she went twice a year\" \u2014 write \"Melanie goes horseback riding once or twice a year\". Preserve proper nouns exactly as given.\n\nGround relative dates against an anchor. If a line reading \"Observation date: \"\nappears immediately before the transcript chunk below, treat it as the authoritative anchor and\nresolve \"yesterday\" / \"last week\" / \"this morning\" / \"three years ago\" to a natural-language\nabsolute date (e.g. \"10 July 2026\", NOT \"2026-07-10\") against it, replacing the relative phrase\nrather than appending to it \u2014 \"text\" is prose, not the machine-parsed \"valid_at\"/\"invalid_at\"\nfields above, which stay ISO-8601. Otherwise, ground against an anchor stated in the transcript\nitself (a log timestamp, an explicit \"as of 2026-07-10\") when one exists, still in\nnatural-language form. If no date anchor exists anywhere \u2014 no Observation date line and no\nin-transcript anchor \u2014 keep the original relative phrasing rather than inventing a date. This\nmatters especially for you: DATES/TIMES is category 1 above and the category most likely to fire,\nso a bare/unresolved date here is not a corner case \u2014 it is the common path.\n\nDuplicating something the first pass likely already caught is FINE and expected \u2014 a separate merge step deduplicates the two passes' output afterward, so do not spend effort trying to guess what the first pass kept or skipped. Your only job is to sweep for the eight specific categories above, exhaustively, from BOTH speakers.\n\nSkip noise: greetings, small talk with no durable specific, filler acknowledgments.\nSkip secrets: passwords, tokens, financial account numbers, government ID numbers.\nConfidence reflects how clearly and directly the specific was stated: an explicit, unambiguous statement = 0.9; a hedge or approximation = 0.5.\nImportance reflects how durable and specific the detail is: a precise duration/frequency/quantity/quote/one-off event/piece of advice = 0.6-0.8; nothing here should score below 0.4, since if it doesn't fit one of the eight categories above it should not be extracted at all.\n\nEmpty is valid: if the chunk truly contains none of the eight categories above, output \"atoms\": [] \u2014 do not invent one to have output.\n\nExamples (illustrative only, not exhaustive):\n\n1. Input: \"Caroline: We don't go often, usually only once or twice a year. Melanie: Makes sense, it's a long drive.\" ->\n{\"atoms\":[\n {\"evidence\":\"usually only once or twice a year\",\"type\":\"fact\",\"text\":\"Caroline said they don't go often \u2014 usually only once or twice a year.\",\"importance\":0.6,\"confidence\":0.85}\n]}\n\n2. Input: \"Observation date: 2026-07-10\n\nMelanie: My son got into an accident last week, but he's okay, thank god.\" ->\n{\"atoms\":[\n {\"evidence\":\"My son got into an accident last week\",\"type\":\"event\",\"text\":\"Melanie's son got into an accident on 3 July 2026 and is okay.\",\"importance\":0.7,\"confidence\":0.9,\"entities\":[{\"name\":\"Melanie\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(The Observation date anchor resolves \"last week\" to a natural-language absolute date IN \"text\" \u2014\nnever a bare ISO date like \"2026-07-03\", and never left as the unresolved relative phrase. \"evidence\"\nstays the untouched verbatim source quote \u2014 the relative phrase, not the resolved date \u2014 since it\nmust be copyable from the transcript exactly as written.)\n\n3. Input: \"Caroline: I saw a sign that said 'Trans Lives Matter' at the rally and took a photo of it.\" ->\n{\"atoms\":[\n {\"evidence\":\"a sign that said 'Trans Lives Matter'\",\"type\":\"fact\",\"text\":\"Caroline saw and photographed a sign reading \\\"Trans Lives Matter\\\" at a rally she attended.\",\"importance\":0.6,\"confidence\":0.9}\n]}\n\n4. Input: \"Melanie: Honestly, if you're thinking about adopting, my advice is to start the home study early \u2014 it took us almost 7 months just for that part.\" ->\n{\"atoms\":[\n {\"evidence\":\"my advice is to start the home study early\",\"type\":\"note\",\"text\":\"Melanie advised starting the adoption home study early, noting it took her family almost 7 months to complete that part alone.\",\"importance\":0.7,\"confidence\":0.85,\"entities\":[{\"name\":\"Melanie\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n5. Input: \"Caroline: I used to go horseback riding with my dad when I was a kid.\" ->\n{\"atoms\":[\n {\"evidence\":\"I used to go horseback riding with my dad when I was a kid\",\"type\":\"fact\",\"text\":\"Caroline used to go horseback riding with her dad when she was a kid.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Caroline\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n6. Input: \"Caroline: hey how's it going? Melanie: good, just tired, work's been busy.\" ->\n{\"atoms\":[]}\n(No date, duration, frequency, quantity, name, quote, one-off event, or advice \u2014 plain small talk, nothing in this pass's eight categories. No evidence quote to point to either way -- empty output, not a guess.)"; /** PRE-552A sweeper prompt, resurrected 2026-07-19 for the champion-gap * forensics: the 0.6002 champion (run started 07-17 21:29) used THESE bytes * for pass B; every run after 91189291 (07-18 02:22) used the V2 restructure * (evidence-first ordering + "ATOMS WITHOUT A VERBATIM EVIDENCE QUOTE ARE * DISCARDED"), including the 0.5346 "exact" replication — which was * therefore NOT byte-exact on the sweeper. The 55fx proof chain measured the * V2 restructure at −96 atoms / −7 recall on qwen self-sweep (validation * artifact 20260718T2100Z); ASTRA_SWEEPER_PROMPT=v1 is the A/B lever that * prices the same mechanism on codex. */ export declare const EXTRACTION_SYSTEM_PROMPT_SPECIFICS_SWEEPER_V1 = "You are the SECOND of two independent extraction passes over the same transcript chunk. The FIRST pass already ran a broader extraction prompt and captured the main facts, decisions, and events. Your job is narrower and different: sweep the SAME chunk for concrete SPECIFICS the first pass is prone to skip because they read as minor details rather than headline facts.\n\nMeasured finding this pass exists to fix: in production runs, 36-47% of gold single-hop facts were never captured as ANY atom \u2014 and every one spot-checked was present verbatim in the source transcript. The missing facts were disproportionately: exact durations, frequencies, quantities, one-off events, verbatim quotes, and the less narratively-central speaker's own facts and advice. That is exactly what you are looking for.\n\nOutput STRICT JSON matching the SAME schema the first pass uses:\n{\n \"atoms\": [\n {\n \"type\": \"decision\" | \"fact\" | \"lesson\" | \"command\" | \"todo\" | \"note\" | \"event\",\n \"text\": \"\",\n \"importance\": 0.0-1.0,\n \"confidence\": 0.0-1.0,\n \"evidence\": \"\",\n \"entities\": [{ \"name\": \"\", \"kind\": \"actor\" | \"team\" | \"org\" | \"project\" | \"product\" | \"workitem\" | \"decision\" | \"tech\" | \"tool\" | \"concept\" | \"event\" | \"other\", \"subtype\": \"human\" | \"ai\" }],\n \"valid_at\": \"\",\n \"invalid_at\": \"\"\n }\n ]\n}\n\n\"evidence\" is REQUIRED for EVERY atom you emit \u2014 not optional, unlike the first pass. Copy a short EXACT verbatim excerpt from the source chunk that this atom is directly based on; never paraphrase or summarize it. If you cannot point to an exact quote supporting a candidate item, do NOT emit that item as an atom at all \u2014 a specific detail you cannot quote is not one of the eight categories below, it is a guess.\n\nExtract ONLY items in these categories \u2014 this pass is deliberately narrow, not a second general-purpose pass:\n1. DATES/TIMES \u2014 any specific date, day, month, year, or time mentioned, even in passing.\n2. DURATIONS \u2014 how long something lasted or has been going on (\"about three years\", \"for six months\").\n3. FREQUENCIES \u2014 how often something happens (\"once or twice a year\", \"every Sunday morning\", \"twice a week\").\n4. QUANTITIES AND PRICES \u2014 counts, amounts, ages, prices, measurements (\"three kids\", \"$40\", \"7 years old\").\n5. NAMES \u2014 the specific, exact name of a person, place, pet, product, or thing mentioned, even a passing one.\n6. VERBATIM QUOTES \u2014 a phrase or sentence someone actually said, worth preserving word-for-word rather than paraphrased.\n7. ONE-OFF EVENTS \u2014 a single, non-recurring happening: an accident, a purchase, a trip, an injury, a specific incident \u2014 as opposed to an ongoing state or a recurring habit.\n8. ADVICE / COUNSEL \u2014 a specific recommendation, tip, or piece of guidance one speaker GIVES to the other. Attribute it to the speaker who GAVE it, not the one who received it.\n\nCover BOTH speakers with EQUAL attention. Do not let whichever speaker's storyline feels more central crowd out the other speaker's specifics \u2014 a routine detail from the quieter speaker (an outing, a quantity, a one-off event) is exactly as valuable to this pass as a dramatic detail from the more prominent one.\n\nSelf-containment: resolve every pronoun to the actual named person. Never emit \"she went twice a year\" \u2014 write \"Melanie goes horseback riding once or twice a year\". Preserve proper nouns exactly as given.\n\nGround relative dates against an anchor. If a line reading \"Observation date: \"\nappears immediately before the transcript chunk below, treat it as the authoritative anchor and\nresolve \"yesterday\" / \"last week\" / \"this morning\" / \"three years ago\" to a natural-language\nabsolute date (e.g. \"10 July 2026\", NOT \"2026-07-10\") against it, replacing the relative phrase\nrather than appending to it \u2014 \"text\" is prose, not the machine-parsed \"valid_at\"/\"invalid_at\"\nfields above, which stay ISO-8601. Otherwise, ground against an anchor stated in the transcript\nitself (a log timestamp, an explicit \"as of 2026-07-10\") when one exists, still in\nnatural-language form. If no date anchor exists anywhere \u2014 no Observation date line and no\nin-transcript anchor \u2014 keep the original relative phrasing rather than inventing a date. This\nmatters especially for you: DATES/TIMES is category 1 above and the category most likely to fire,\nso a bare/unresolved date here is not a corner case \u2014 it is the common path.\n\nDuplicating something the first pass likely already caught is FINE and expected \u2014 a separate merge step deduplicates the two passes' output afterward, so do not spend effort trying to guess what the first pass kept or skipped. Your only job is to sweep for the eight specific categories above, exhaustively, from BOTH speakers.\n\nSkip noise: greetings, small talk with no durable specific, filler acknowledgments.\nSkip secrets: passwords, tokens, financial account numbers, government ID numbers.\nConfidence reflects how clearly and directly the specific was stated: an explicit, unambiguous statement = 0.9; a hedge or approximation = 0.5.\nImportance reflects how durable and specific the detail is: a precise duration/frequency/quantity/quote/one-off event/piece of advice = 0.6-0.8; nothing here should score below 0.4, since if it doesn't fit one of the eight categories above it should not be extracted at all.\n\nEmpty is valid: if the chunk truly contains none of the eight categories above, output \"atoms\": [] \u2014 do not invent one to have output.\n\nExamples (illustrative only, not exhaustive):\n\n1. Input: \"Caroline: We don't go often, usually only once or twice a year. Melanie: Makes sense, it's a long drive.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Caroline said they don't go often \u2014 usually only once or twice a year.\",\"importance\":0.6,\"confidence\":0.85,\"evidence\":\"usually only once or twice a year\"}\n]}\n\n2. Input: \"Observation date: 2026-07-10\n\nMelanie: My son got into an accident last week, but he's okay, thank god.\" ->\n{\"atoms\":[\n {\"type\":\"event\",\"text\":\"Melanie's son got into an accident on 3 July 2026 and is okay.\",\"importance\":0.7,\"confidence\":0.9,\"entities\":[{\"name\":\"Melanie\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n(The Observation date anchor resolves \"last week\" to a natural-language absolute date IN \"text\" \u2014\nnever a bare ISO date like \"2026-07-03\", and never left as the unresolved relative phrase.)\n\n3. Input: \"Caroline: I saw a sign that said 'Trans Lives Matter' at the rally and took a photo of it.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Caroline saw and photographed a sign reading \\\"Trans Lives Matter\\\" at a rally she attended.\",\"importance\":0.6,\"confidence\":0.9,\"evidence\":\"a sign that said 'Trans Lives Matter'\"}\n]}\n\n4. Input: \"Melanie: Honestly, if you're thinking about adopting, my advice is to start the home study early \u2014 it took us almost 7 months just for that part.\" ->\n{\"atoms\":[\n {\"type\":\"note\",\"text\":\"Melanie advised starting the adoption home study early, noting it took her family almost 7 months to complete that part alone.\",\"importance\":0.7,\"confidence\":0.85,\"entities\":[{\"name\":\"Melanie\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n5. Input: \"Caroline: I used to go horseback riding with my dad when I was a kid.\" ->\n{\"atoms\":[\n {\"type\":\"fact\",\"text\":\"Caroline used to go horseback riding with her dad when she was a kid.\",\"importance\":0.5,\"confidence\":0.85,\"entities\":[{\"name\":\"Caroline\",\"kind\":\"actor\",\"subtype\":\"human\"}]}\n]}\n\n6. Input: \"Caroline: hey how's it going? Melanie: good, just tired, work's been busy.\" ->\n{\"atoms\":[]}\n(No date, duration, frequency, quantity, name, quote, one-off event, or advice \u2014 plain small talk, nothing in this pass's eight categories.)"; /** Sweeper prompt resolution (2026-07-19): V2 (the 552-A restructure) is the * default; ASTRA_SWEEPER_PROMPT=v1 restores the pre-552A / champion-era * bytes as a rollback + A/B lever, mirroring resolveExtractionPrompt's * env-override shape. Recorded per run via runConstants.promptHashes + * promptVersions; frozen by tests/distill/prompt-hash-freeze.test.ts. */ export declare const EXTRACTION_SYSTEM_PROMPT_SPECIFICS_SWEEPER: string; /** Human-readable prompt version registry (2026-07-19 operator directive: * prompts carry explicit versions from now on). Bump the version WITH the * bytes — the freeze test pins the hash, this map names it for manifests. */ export declare const EXTRACTION_PROMPT_VERSIONS: { readonly v3: "eng-v3.0 (FEAT-479, 2026-07-13)"; readonly conversational: "conv-v1.1 (FEAT-485; relations[] added, retrieval-overhaul Phase 6, 2026-07-20)"; readonly convLiberal: "conv-liberal-v1.0 (2026-07-18 champion prompt)"; readonly convSpkbal: "conv-spkbal-v1.0 (Wave-5 extraction-score track, 2026-07-23 — A/B candidate, unmeasured)"; readonly specificsSweeper: "sweeper-v1.0 (pre-552A, champion-era — env-selected)" | "sweeper-v2.0 (552-A evidence-first restructure, 2026-07-18)"; };