@indexnetwork/protocol 4.14.1-rc.355.1 → 4.15.0-rc.357.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,13 @@ export type PoolQuestionsMode = "off" | "on";
25
25
  * "on" implies mining runs even when POOL_QUESTIONS_MINING is off.
26
26
  */
27
27
  export declare function poolQuestionsMode(): PoolQuestionsMode;
28
+ /** Push delivery mode for high-VoI pool questions (IND-421). */
29
+ export type PoolQuestionsPushMode = "off" | "on";
30
+ /**
31
+ * Current POOL_QUESTIONS_PUSH mode (default off). Callers must additionally
32
+ * require pool-question mode and negotiator availability before delivery.
33
+ */
34
+ export declare function poolQuestionsPushMode(): PoolQuestionsPushMode;
28
35
  /** Newborn-opportunity stamping mode (IND-420 P4b). */
29
36
  export type PoolQuestionsStampNewbornMode = "off" | "on";
30
37
  /**
@@ -40,6 +47,14 @@ export declare const POOL_QUESTION_MIN_EVIDENCE_RATE = 0.6;
40
47
  export declare const POOL_QUESTION_MAX_DISCRIMINATORS = 3;
41
48
  /** Unattended budget: max pending questions of ANY mode per intent. */
42
49
  export declare const POOL_QUESTION_MAX_PENDING_PER_INTENT = 3;
50
+ /** Initial internal VoI threshold for proactive push delivery. */
51
+ export declare const POOL_QUESTION_PUSH_BASE_VOI = 0.6;
52
+ /** Multiplicative VoI threshold increase per consecutive dismissal. */
53
+ export declare const POOL_QUESTION_PUSH_DISMISSAL_DECAY = 1.15;
54
+ /** Minimum pool size for proactive delivery (stricter than mining). */
55
+ export declare const POOL_QUESTION_PUSH_MIN_POOL_SIZE = 8;
56
+ /** Maximum claimed proactive pool pushes per recipient per UTC day. */
57
+ export declare const POOL_QUESTION_PUSH_DAILY_CAP = 2;
43
58
  /** Ranking mode for pool adjustments (IND-419). */
44
59
  export type PoolQuestionsRankingMode = "off" | "on";
45
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"discriminator.env.d.ts","sourceRoot":"/","sources":["opportunity/discri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4BAA4B,MAAM,CAAC;AAEhD,6EAA6E;AAC7E,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAElD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,6DAA6D;AAC7D,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD,qEAAqE;AACrE,eAAO,MAAM,2CAA2C,MAAM,CAAC"}
@@ -25,6 +25,13 @@ export function poolQuestionsMiningMode() {
25
25
  export function poolQuestionsMode() {
26
26
  return process.env.POOL_QUESTIONS_MODE?.trim() === "on" ? "on" : "off";
27
27
  }
28
+ /**
29
+ * Current POOL_QUESTIONS_PUSH mode (default off). Callers must additionally
30
+ * require pool-question mode and negotiator availability before delivery.
31
+ */
32
+ export function poolQuestionsPushMode() {
33
+ return process.env.POOL_QUESTIONS_PUSH?.trim() === "on" ? "on" : "off";
34
+ }
28
35
  /**
29
36
  * Current POOL_QUESTIONS_STAMP_NEWBORN mode (default off). Effective callers
30
37
  * additionally require {@link poolQuestionsMode} to be on.
@@ -40,6 +47,14 @@ export const POOL_QUESTION_MIN_EVIDENCE_RATE = 0.6;
40
47
  export const POOL_QUESTION_MAX_DISCRIMINATORS = 3;
41
48
  /** Unattended budget: max pending questions of ANY mode per intent. */
42
49
  export const POOL_QUESTION_MAX_PENDING_PER_INTENT = 3;
50
+ /** Initial internal VoI threshold for proactive push delivery. */
51
+ export const POOL_QUESTION_PUSH_BASE_VOI = 0.6;
52
+ /** Multiplicative VoI threshold increase per consecutive dismissal. */
53
+ export const POOL_QUESTION_PUSH_DISMISSAL_DECAY = 1.15;
54
+ /** Minimum pool size for proactive delivery (stricter than mining). */
55
+ export const POOL_QUESTION_PUSH_MIN_POOL_SIZE = 8;
56
+ /** Maximum claimed proactive pool pushes per recipient per UTC day. */
57
+ export const POOL_QUESTION_PUSH_DAILY_CAP = 2;
43
58
  /**
44
59
  * Current POOL_QUESTIONS_RANKING (default off). When "on", the home feed
45
60
  * orders by adjusted confidence (confidence × Π poolAdjustments.factor,
@@ -1 +1 @@
1
- {"version":3,"file":"discriminator.env.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wDAAwD;AACxD,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AACnF,CAAC;AAKD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC;AAKD;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAClF,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,mFAAmF;AACnF,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD,gFAAgF;AAChF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,uEAAuE;AACvE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAKtD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5E,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAElD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAM,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEpD,qEAAqE;AACrE,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAG,CAAC","sourcesContent":["/**\n * Centralized accessors for pool-question environment variables (IND-416).\n *\n * POOL_QUESTIONS_MINING off | shadow — P1 shadow axis mining on\n * discovery-run completion. `shadow` mines and\n * scores axes and logs them; no questions are\n * generated and no user-facing behavior changes.\n * Any value other than \"shadow\" (including unset)\n * means off.\n *\n * All reads go through this module — do not read these variables via\n * `process.env` elsewhere. Values are read on every call (no caching) so\n * tests and long-lived processes observe changes.\n */\n\n/** Mining mode for pool discriminator axes. */\nexport type PoolQuestionsMiningMode = \"off\" | \"shadow\";\n\n/** Current POOL_QUESTIONS_MINING mode (default off). */\nexport function poolQuestionsMiningMode(): PoolQuestionsMiningMode {\n return process.env.POOL_QUESTIONS_MINING?.trim() === \"shadow\" ? \"shadow\" : \"off\";\n}\n\n/** Question mode for pool discriminators (IND-418). */\nexport type PoolQuestionsMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_MODE (default off). When \"on\", the mining hook also\n * enqueues a pool_discovery question for the top eligible discriminator\n * (still subject to the QUESTIONER_ENABLED master gate and per-intent budget).\n * \"on\" implies mining runs even when POOL_QUESTIONS_MINING is off.\n */\nexport function poolQuestionsMode(): PoolQuestionsMode {\n return process.env.POOL_QUESTIONS_MODE?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Newborn-opportunity stamping mode (IND-420 P4b). */\nexport type PoolQuestionsStampNewbornMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_STAMP_NEWBORN mode (default off). Effective callers\n * additionally require {@link poolQuestionsMode} to be on.\n */\nexport function poolQuestionsStampNewborn(): PoolQuestionsStampNewbornMode {\n return process.env.POOL_QUESTIONS_STAMP_NEWBORN?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Minimum VoI for a discriminator to become (or chain) a question. */\nexport const POOL_QUESTION_MIN_VOI = 0.2;\n\n/** Minimum evidence-verification rate for a discriminator to become a question. */\nexport const POOL_QUESTION_MIN_EVIDENCE_RATE = 0.6;\n\n/** Max eligible discriminators carried per mining pass (asked + alternates). */\nexport const POOL_QUESTION_MAX_DISCRIMINATORS = 3;\n\n/** Unattended budget: max pending questions of ANY mode per intent. */\nexport const POOL_QUESTION_MAX_PENDING_PER_INTENT = 3;\n\n/** Ranking mode for pool adjustments (IND-419). */\nexport type PoolQuestionsRankingMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_RANKING (default off). When \"on\", the home feed\n * orders by adjusted confidence (confidence × Π poolAdjustments.factor,\n * floor {@link POOL_ADJUSTMENT_FLOOR}). Adjustments are WRITTEN regardless of\n * this flag — it only gates whether ordering reads them, so the apply path\n * can ship first.\n */\nexport function poolQuestionsRanking(): PoolQuestionsRankingMode {\n return process.env.POOL_QUESTIONS_RANKING?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Adjustment factor for candidates on the side the user did NOT choose. */\nexport const POOL_ADJUSTMENT_FACTOR_OTHER = 0.6;\n\n/** Adjustment factor for candidates the miner could not assign (unknown). */\nexport const POOL_ADJUSTMENT_FACTOR_UNKNOWN = 0.9;\n\n/** Floor for the cumulative adjustment multiplier — demoted, never hidden. */\nexport const POOL_ADJUSTMENT_FLOOR = 0.3;\n\n/**\n * Staleness guard (IND-419): when more than this fraction of a question's\n * stored assignments point at opportunities that left the pool (expired /\n * rejected / accepted / archived), skip the re-rank — the snapshot no longer\n * describes the live pool.\n */\nexport const POOL_STALENESS_THRESHOLD = 0.3;\n\n/** Debounce window for answer-triggered re-discovery (Tier 1), per intent. */\nexport const POOL_RERUN_DEBOUNCE_MS = 60_000;\n\n/**\n * k-anonymity floor: axes are only mined when the pool has at least this many\n * candidates, so no axis (or later, question option) can be traced back to a\n * specific individual.\n */\nexport const POOL_DISCRIMINATOR_MIN_POOL_SIZE = 5;\n\n/** Max candidates sent to the miner LLM (top-N by score). */\nexport const POOL_DISCRIMINATOR_MAX_CANDIDATES = 24;\n\n/** Max chars of public context per candidate in the miner prompt. */\nexport const POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS = 400;\n"]}
1
+ {"version":3,"file":"discriminator.env.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wDAAwD;AACxD,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AACnF,CAAC;AAKD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC;AAKD;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CA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sBAAsB,GAAG,KAAM,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEpD,qEAAqE;AACrE,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAG,CAAC","sourcesContent":["/**\n * Centralized accessors for pool-question environment variables (IND-416).\n *\n * POOL_QUESTIONS_MINING off | shadow — P1 shadow axis mining on\n * discovery-run completion. `shadow` mines and\n * scores axes and logs them; no questions are\n * generated and no user-facing behavior changes.\n * Any value other than \"shadow\" (including unset)\n * means off.\n *\n * All reads go through this module — do not read these variables via\n * `process.env` elsewhere. Values are read on every call (no caching) so\n * tests and long-lived processes observe changes.\n */\n\n/** Mining mode for pool discriminator axes. */\nexport type PoolQuestionsMiningMode = \"off\" | \"shadow\";\n\n/** Current POOL_QUESTIONS_MINING mode (default off). */\nexport function poolQuestionsMiningMode(): PoolQuestionsMiningMode {\n return process.env.POOL_QUESTIONS_MINING?.trim() === \"shadow\" ? \"shadow\" : \"off\";\n}\n\n/** Question mode for pool discriminators (IND-418). */\nexport type PoolQuestionsMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_MODE (default off). When \"on\", the mining hook also\n * enqueues a pool_discovery question for the top eligible discriminator\n * (still subject to the QUESTIONER_ENABLED master gate and per-intent budget).\n * \"on\" implies mining runs even when POOL_QUESTIONS_MINING is off.\n */\nexport function poolQuestionsMode(): PoolQuestionsMode {\n return process.env.POOL_QUESTIONS_MODE?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Push delivery mode for high-VoI pool questions (IND-421). */\nexport type PoolQuestionsPushMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_PUSH mode (default off). Callers must additionally\n * require pool-question mode and negotiator availability before delivery.\n */\nexport function poolQuestionsPushMode(): PoolQuestionsPushMode {\n return process.env.POOL_QUESTIONS_PUSH?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Newborn-opportunity stamping mode (IND-420 P4b). */\nexport type PoolQuestionsStampNewbornMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_STAMP_NEWBORN mode (default off). Effective callers\n * additionally require {@link poolQuestionsMode} to be on.\n */\nexport function poolQuestionsStampNewborn(): PoolQuestionsStampNewbornMode {\n return process.env.POOL_QUESTIONS_STAMP_NEWBORN?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Minimum VoI for a discriminator to become (or chain) a question. */\nexport const POOL_QUESTION_MIN_VOI = 0.2;\n\n/** Minimum evidence-verification rate for a discriminator to become a question. */\nexport const POOL_QUESTION_MIN_EVIDENCE_RATE = 0.6;\n\n/** Max eligible discriminators carried per mining pass (asked + alternates). */\nexport const POOL_QUESTION_MAX_DISCRIMINATORS = 3;\n\n/** Unattended budget: max pending questions of ANY mode per intent. */\nexport const POOL_QUESTION_MAX_PENDING_PER_INTENT = 3;\n\n/** Initial internal VoI threshold for proactive push delivery. */\nexport const POOL_QUESTION_PUSH_BASE_VOI = 0.6;\n\n/** Multiplicative VoI threshold increase per consecutive dismissal. */\nexport const POOL_QUESTION_PUSH_DISMISSAL_DECAY = 1.15;\n\n/** Minimum pool size for proactive delivery (stricter than mining). */\nexport const POOL_QUESTION_PUSH_MIN_POOL_SIZE = 8;\n\n/** Maximum claimed proactive pool pushes per recipient per UTC day. */\nexport const POOL_QUESTION_PUSH_DAILY_CAP = 2;\n\n/** Ranking mode for pool adjustments (IND-419). */\nexport type PoolQuestionsRankingMode = \"off\" | \"on\";\n\n/**\n * Current POOL_QUESTIONS_RANKING (default off). When \"on\", the home feed\n * orders by adjusted confidence (confidence × Π poolAdjustments.factor,\n * floor {@link POOL_ADJUSTMENT_FLOOR}). Adjustments are WRITTEN regardless of\n * this flag — it only gates whether ordering reads them, so the apply path\n * can ship first.\n */\nexport function poolQuestionsRanking(): PoolQuestionsRankingMode {\n return process.env.POOL_QUESTIONS_RANKING?.trim() === \"on\" ? \"on\" : \"off\";\n}\n\n/** Adjustment factor for candidates on the side the user did NOT choose. */\nexport const POOL_ADJUSTMENT_FACTOR_OTHER = 0.6;\n\n/** Adjustment factor for candidates the miner could not assign (unknown). */\nexport const POOL_ADJUSTMENT_FACTOR_UNKNOWN = 0.9;\n\n/** Floor for the cumulative adjustment multiplier — demoted, never hidden. */\nexport const POOL_ADJUSTMENT_FLOOR = 0.3;\n\n/**\n * Staleness guard (IND-419): when more than this fraction of a question's\n * stored assignments point at opportunities that left the pool (expired /\n * rejected / accepted / archived), skip the re-rank — the snapshot no longer\n * describes the live pool.\n */\nexport const POOL_STALENESS_THRESHOLD = 0.3;\n\n/** Debounce window for answer-triggered re-discovery (Tier 1), per intent. */\nexport const POOL_RERUN_DEBOUNCE_MS = 60_000;\n\n/**\n * k-anonymity floor: axes are only mined when the pool has at least this many\n * candidates, so no axis (or later, question option) can be traced back to a\n * specific individual.\n */\nexport const POOL_DISCRIMINATOR_MIN_POOL_SIZE = 5;\n\n/** Max candidates sent to the miner LLM (top-N by score). */\nexport const POOL_DISCRIMINATOR_MAX_CANDIDATES = 24;\n\n/** Max chars of public context per candidate in the miner prompt. */\nexport const POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS = 400;\n"]}
@@ -0,0 +1,16 @@
1
+ import type { QuestionPoolSnapshot } from "../../shared/schemas/question.schema.js";
2
+ /** Maximum raw intent-title characters included in a proactive DM line. */
3
+ export declare const POOL_QUESTION_PUSH_TITLE_MAX_CHARS = 80;
4
+ /** Stable identity for one pool refresh cycle. Chained alternates retain it. */
5
+ export declare function poolQuestionCycleKey(pool: Pick<QuestionPoolSnapshot, "runId" | "minedAt">): string;
6
+ /** Strict VoI threshold after the recipient's consecutive dismissal streak. */
7
+ export declare function poolQuestionPushThreshold(consecutiveDismissals: number): number;
8
+ /** Escape plain text so it cannot alter the deterministic Markdown template. */
9
+ export declare function escapePoolPushMarkdown(text: string): string;
10
+ /** Build the sole proactive user-facing DM line for a pushed pool question. */
11
+ export declare function buildPoolQuestionPushMessage(input: {
12
+ intentId: string;
13
+ intentTitle: string;
14
+ questionPrompt: string;
15
+ }): string;
16
+ //# sourceMappingURL=discriminator.push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminator.push.d.ts","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAIpF,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAErD,gFAAgF;AAChF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC,GACpD,MAAM,CAGR;AAED,+EAA+E;AAC/E,wBAAgB,yBAAyB,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,CAG/E;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAMT"}
@@ -0,0 +1,26 @@
1
+ import { POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY } from "./discriminator.env.js";
2
+ /** Maximum raw intent-title characters included in a proactive DM line. */
3
+ export const POOL_QUESTION_PUSH_TITLE_MAX_CHARS = 80;
4
+ /** Stable identity for one pool refresh cycle. Chained alternates retain it. */
5
+ export function poolQuestionCycleKey(pool) {
6
+ const runId = pool.runId?.trim();
7
+ return runId ? `run:${runId}` : `mined:${pool.minedAt}`;
8
+ }
9
+ /** Strict VoI threshold after the recipient's consecutive dismissal streak. */
10
+ export function poolQuestionPushThreshold(consecutiveDismissals) {
11
+ const streak = Math.max(0, Math.floor(consecutiveDismissals));
12
+ return POOL_QUESTION_PUSH_BASE_VOI * POOL_QUESTION_PUSH_DISMISSAL_DECAY ** streak;
13
+ }
14
+ /** Escape plain text so it cannot alter the deterministic Markdown template. */
15
+ export function escapePoolPushMarkdown(text) {
16
+ return text.replace(/([\\`*_[\]{}()<>#+\-.!|])/g, "\\$1");
17
+ }
18
+ /** Build the sole proactive user-facing DM line for a pushed pool question. */
19
+ export function buildPoolQuestionPushMessage(input) {
20
+ const normalizedTitle = input.intentTitle.replace(/\s+/g, " ").trim() || "your intent";
21
+ const boundedTitle = normalizedTitle.length > POOL_QUESTION_PUSH_TITLE_MAX_CHARS
22
+ ? `${normalizedTitle.slice(0, POOL_QUESTION_PUSH_TITLE_MAX_CHARS - 1)}…`
23
+ : normalizedTitle;
24
+ return `Quick one about [${escapePoolPushMarkdown(boundedTitle)}](/i/${input.intentId}): ${escapePoolPushMarkdown(input.questionPrompt)}`;
25
+ }
26
+ //# sourceMappingURL=discriminator.push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminator.push.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.push.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAEzG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAC;AAErD,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAClC,IAAqD;IAErD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;IACjC,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;AAC1D,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,yBAAyB,CAAC,qBAA6B;IACrE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC9D,OAAO,2BAA2B,GAAG,kCAAkC,IAAI,MAAM,CAAC;AACpF,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,4BAA4B,CAAC,KAI5C;IACC,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,aAAa,CAAC;IACvF,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,GAAG,kCAAkC;QAC9E,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,kCAAkC,GAAG,CAAC,CAAC,GAAG;QACxE,CAAC,CAAC,eAAe,CAAC;IACpB,OAAO,oBAAoB,sBAAsB,CAAC,YAAY,CAAC,QAAQ,KAAK,CAAC,QAAQ,MAAM,sBAAsB,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;AAC5I,CAAC","sourcesContent":["import type { QuestionPoolSnapshot } from \"../../shared/schemas/question.schema.js\";\n\nimport { POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY } from \"./discriminator.env.js\";\n\n/** Maximum raw intent-title characters included in a proactive DM line. */\nexport const POOL_QUESTION_PUSH_TITLE_MAX_CHARS = 80;\n\n/** Stable identity for one pool refresh cycle. Chained alternates retain it. */\nexport function poolQuestionCycleKey(\n pool: Pick<QuestionPoolSnapshot, \"runId\" | \"minedAt\">,\n): string {\n const runId = pool.runId?.trim();\n return runId ? `run:${runId}` : `mined:${pool.minedAt}`;\n}\n\n/** Strict VoI threshold after the recipient's consecutive dismissal streak. */\nexport function poolQuestionPushThreshold(consecutiveDismissals: number): number {\n const streak = Math.max(0, Math.floor(consecutiveDismissals));\n return POOL_QUESTION_PUSH_BASE_VOI * POOL_QUESTION_PUSH_DISMISSAL_DECAY ** streak;\n}\n\n/** Escape plain text so it cannot alter the deterministic Markdown template. */\nexport function escapePoolPushMarkdown(text: string): string {\n return text.replace(/([\\\\`*_[\\]{}()<>#+\\-.!|])/g, \"\\\\$1\");\n}\n\n/** Build the sole proactive user-facing DM line for a pushed pool question. */\nexport function buildPoolQuestionPushMessage(input: {\n intentId: string;\n intentTitle: string;\n questionPrompt: string;\n}): string {\n const normalizedTitle = input.intentTitle.replace(/\\s+/g, \" \").trim() || \"your intent\";\n const boundedTitle = normalizedTitle.length > POOL_QUESTION_PUSH_TITLE_MAX_CHARS\n ? `${normalizedTitle.slice(0, POOL_QUESTION_PUSH_TITLE_MAX_CHARS - 1)}…`\n : normalizedTitle;\n return `Quick one about [${escapePoolPushMarkdown(boundedTitle)}](/i/${input.intentId}): ${escapePoolPushMarkdown(input.questionPrompt)}`;\n}\n"]}
@@ -471,7 +471,55 @@ export declare const QuestionPoolSnapshotSchema: z.ZodObject<{
471
471
  intentText?: string | undefined;
472
472
  intentFingerprint?: string | undefined;
473
473
  }>;
474
- export declare const QuestionDetectionSchema: z.ZodObject<{
474
+ /** Internal delivery ledger for proactive pool-question pushes (IND-421). */
475
+ export declare const QuestionPoolPushSchema: z.ZodObject<{
476
+ version: z.ZodLiteral<1>;
477
+ source: z.ZodLiteral<"pool_discovery">;
478
+ recipientId: z.ZodString;
479
+ intentId: z.ZodString;
480
+ cycleKey: z.ZodString;
481
+ messageId: z.ZodString;
482
+ surfaces: z.ZodTuple<[z.ZodLiteral<"personal_agent_badge">, z.ZodLiteral<"negotiator_dm">], null>;
483
+ claimedAt: z.ZodString;
484
+ deliveryStatus: z.ZodEnum<["claimed", "delivered", "suppressed", "failed"]>;
485
+ conversationId: z.ZodOptional<z.ZodString>;
486
+ deliveredAt: z.ZodOptional<z.ZodString>;
487
+ suppressedAt: z.ZodOptional<z.ZodString>;
488
+ failure: z.ZodOptional<z.ZodString>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ source: "pool_discovery";
491
+ version: 1;
492
+ recipientId: string;
493
+ intentId: string;
494
+ cycleKey: string;
495
+ messageId: string;
496
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
497
+ claimedAt: string;
498
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
499
+ conversationId?: string | undefined;
500
+ deliveredAt?: string | undefined;
501
+ suppressedAt?: string | undefined;
502
+ failure?: string | undefined;
503
+ }, {
504
+ source: "pool_discovery";
505
+ version: 1;
506
+ recipientId: string;
507
+ intentId: string;
508
+ cycleKey: string;
509
+ messageId: string;
510
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
511
+ claimedAt: string;
512
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
513
+ conversationId?: string | undefined;
514
+ deliveredAt?: string | undefined;
515
+ suppressedAt?: string | undefined;
516
+ failure?: string | undefined;
517
+ }>;
518
+ /** Durable request state for proactive pool-question delivery. */
519
+ export declare const QuestionPoolPushRequestStatusSchema: z.ZodEnum<["requested", "suppressed"]>;
520
+ /** Permanent reasons that terminalize an unclaimed proactive push request. */
521
+ export declare const QuestionPoolPushRequestReasonSchema: z.ZodEnum<["question_lifecycle", "intent_lifecycle", "malformed_source", "malformed_actor", "malformed_pool", "malformed_cycle", "visited", "pool_size", "voi", "cycle_budget"]>;
522
+ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
475
523
  /** Which preset mode generated this question. */
476
524
  mode: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat", "pool_discovery"]>;
477
525
  /** Internal reason for generation; independent of mode and QUD repair metadata. */
@@ -675,16 +723,87 @@ export declare const QuestionDetectionSchema: z.ZodObject<{
675
723
  intentText?: string | undefined;
676
724
  intentFingerprint?: string | undefined;
677
725
  }>>;
726
+ /** Durable request marker written before enqueueing proactive delivery. Internal only. */
727
+ pushRequestedAt: z.ZodOptional<z.ZodString>;
728
+ /** Last bounded recovery sweep that selected this request. Internal only. */
729
+ pushRecoveryAttemptedAt: z.ZodOptional<z.ZodString>;
730
+ /** Durable request outcome. Internal only. */
731
+ pushRequestStatus: z.ZodOptional<z.ZodEnum<["requested", "suppressed"]>>;
732
+ /** Permanent suppression reason for an unclaimed request. Internal only. */
733
+ pushRequestReason: z.ZodOptional<z.ZodEnum<["question_lifecycle", "intent_lifecycle", "malformed_source", "malformed_actor", "malformed_pool", "malformed_cycle", "visited", "pool_size", "voi", "cycle_budget"]>>;
734
+ /** ISO-8601 timestamp at which an unclaimed request was suppressed. Internal only. */
735
+ pushRequestSuppressedAt: z.ZodOptional<z.ZodString>;
736
+ /** Internal proactive delivery state. Never serialize to public clients. */
737
+ push: z.ZodOptional<z.ZodObject<{
738
+ version: z.ZodLiteral<1>;
739
+ source: z.ZodLiteral<"pool_discovery">;
740
+ recipientId: z.ZodString;
741
+ intentId: z.ZodString;
742
+ cycleKey: z.ZodString;
743
+ messageId: z.ZodString;
744
+ surfaces: z.ZodTuple<[z.ZodLiteral<"personal_agent_badge">, z.ZodLiteral<"negotiator_dm">], null>;
745
+ claimedAt: z.ZodString;
746
+ deliveryStatus: z.ZodEnum<["claimed", "delivered", "suppressed", "failed"]>;
747
+ conversationId: z.ZodOptional<z.ZodString>;
748
+ deliveredAt: z.ZodOptional<z.ZodString>;
749
+ suppressedAt: z.ZodOptional<z.ZodString>;
750
+ failure: z.ZodOptional<z.ZodString>;
751
+ }, "strip", z.ZodTypeAny, {
752
+ source: "pool_discovery";
753
+ version: 1;
754
+ recipientId: string;
755
+ intentId: string;
756
+ cycleKey: string;
757
+ messageId: string;
758
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
759
+ claimedAt: string;
760
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
761
+ conversationId?: string | undefined;
762
+ deliveredAt?: string | undefined;
763
+ suppressedAt?: string | undefined;
764
+ failure?: string | undefined;
765
+ }, {
766
+ source: "pool_discovery";
767
+ version: 1;
768
+ recipientId: string;
769
+ intentId: string;
770
+ cycleKey: string;
771
+ messageId: string;
772
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
773
+ claimedAt: string;
774
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
775
+ conversationId?: string | undefined;
776
+ deliveredAt?: string | undefined;
777
+ suppressedAt?: string | undefined;
778
+ failure?: string | undefined;
779
+ }>>;
780
+ /** Authoritative successful-delivery ledger timestamp. Internal only. */
781
+ pushedAt: z.ZodOptional<z.ZodString>;
678
782
  }, "strip", z.ZodTypeAny, {
679
783
  mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
680
784
  sourceType: string;
681
785
  sourceId: string;
682
786
  timestamp: string;
787
+ push?: {
788
+ source: "pool_discovery";
789
+ version: 1;
790
+ recipientId: string;
791
+ intentId: string;
792
+ cycleKey: string;
793
+ messageId: string;
794
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
795
+ claimedAt: string;
796
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
797
+ conversationId?: string | undefined;
798
+ deliveredAt?: string | undefined;
799
+ suppressedAt?: string | undefined;
800
+ failure?: string | undefined;
801
+ } | undefined;
683
802
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
684
803
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
804
+ messageId?: string | undefined;
685
805
  purpose?: "uptake" | undefined;
686
806
  triggeredBy?: string | undefined;
687
- messageId?: string | undefined;
688
807
  pool?: {
689
808
  poolSize: number;
690
809
  minedAt: string;
@@ -720,16 +839,169 @@ export declare const QuestionDetectionSchema: z.ZodObject<{
720
839
  intentText?: string | undefined;
721
840
  intentFingerprint?: string | undefined;
722
841
  } | undefined;
842
+ pushRequestedAt?: string | undefined;
843
+ pushRecoveryAttemptedAt?: string | undefined;
844
+ pushRequestStatus?: "suppressed" | "requested" | undefined;
845
+ pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
846
+ pushRequestSuppressedAt?: string | undefined;
847
+ pushedAt?: string | undefined;
723
848
  }, {
724
849
  mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
725
850
  sourceType: string;
726
851
  sourceId: string;
727
852
  timestamp: string;
853
+ push?: {
854
+ source: "pool_discovery";
855
+ version: 1;
856
+ recipientId: string;
857
+ intentId: string;
858
+ cycleKey: string;
859
+ messageId: string;
860
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
861
+ claimedAt: string;
862
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
863
+ conversationId?: string | undefined;
864
+ deliveredAt?: string | undefined;
865
+ suppressedAt?: string | undefined;
866
+ failure?: string | undefined;
867
+ } | undefined;
728
868
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
729
869
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
870
+ messageId?: string | undefined;
730
871
  purpose?: "uptake" | undefined;
731
872
  triggeredBy?: string | undefined;
873
+ pool?: {
874
+ poolSize: number;
875
+ minedAt: string;
876
+ discriminator: {
877
+ label: string;
878
+ questionSeed: string;
879
+ sides: string[];
880
+ sideCounts: Record<string, number>;
881
+ voi: number;
882
+ evidenceRate: number;
883
+ assignments: {
884
+ opportunityId: string;
885
+ side: string;
886
+ }[];
887
+ embedding?: number[] | undefined;
888
+ embeddingModel?: string | undefined;
889
+ };
890
+ alternates: {
891
+ label: string;
892
+ questionSeed: string;
893
+ sides: string[];
894
+ sideCounts: Record<string, number>;
895
+ voi: number;
896
+ evidenceRate: number;
897
+ assignments: {
898
+ opportunityId: string;
899
+ side: string;
900
+ }[];
901
+ embedding?: number[] | undefined;
902
+ embeddingModel?: string | undefined;
903
+ }[];
904
+ runId?: string | undefined;
905
+ intentText?: string | undefined;
906
+ intentFingerprint?: string | undefined;
907
+ } | undefined;
908
+ pushRequestedAt?: string | undefined;
909
+ pushRecoveryAttemptedAt?: string | undefined;
910
+ pushRequestStatus?: "suppressed" | "requested" | undefined;
911
+ pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
912
+ pushRequestSuppressedAt?: string | undefined;
913
+ pushedAt?: string | undefined;
914
+ }>, {
915
+ mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
916
+ sourceType: string;
917
+ sourceId: string;
918
+ timestamp: string;
919
+ push?: {
920
+ source: "pool_discovery";
921
+ version: 1;
922
+ recipientId: string;
923
+ intentId: string;
924
+ cycleKey: string;
925
+ messageId: string;
926
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
927
+ claimedAt: string;
928
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
929
+ conversationId?: string | undefined;
930
+ deliveredAt?: string | undefined;
931
+ suppressedAt?: string | undefined;
932
+ failure?: string | undefined;
933
+ } | undefined;
934
+ strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
935
+ underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
936
+ messageId?: string | undefined;
937
+ purpose?: "uptake" | undefined;
938
+ triggeredBy?: string | undefined;
939
+ pool?: {
940
+ poolSize: number;
941
+ minedAt: string;
942
+ discriminator: {
943
+ label: string;
944
+ questionSeed: string;
945
+ sides: string[];
946
+ sideCounts: Record<string, number>;
947
+ voi: number;
948
+ evidenceRate: number;
949
+ assignments: {
950
+ opportunityId: string;
951
+ side: string;
952
+ }[];
953
+ embedding?: number[] | undefined;
954
+ embeddingModel?: string | undefined;
955
+ };
956
+ alternates: {
957
+ label: string;
958
+ questionSeed: string;
959
+ sides: string[];
960
+ sideCounts: Record<string, number>;
961
+ voi: number;
962
+ evidenceRate: number;
963
+ assignments: {
964
+ opportunityId: string;
965
+ side: string;
966
+ }[];
967
+ embedding?: number[] | undefined;
968
+ embeddingModel?: string | undefined;
969
+ }[];
970
+ runId?: string | undefined;
971
+ intentText?: string | undefined;
972
+ intentFingerprint?: string | undefined;
973
+ } | undefined;
974
+ pushRequestedAt?: string | undefined;
975
+ pushRecoveryAttemptedAt?: string | undefined;
976
+ pushRequestStatus?: "suppressed" | "requested" | undefined;
977
+ pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
978
+ pushRequestSuppressedAt?: string | undefined;
979
+ pushedAt?: string | undefined;
980
+ }, {
981
+ mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
982
+ sourceType: string;
983
+ sourceId: string;
984
+ timestamp: string;
985
+ push?: {
986
+ source: "pool_discovery";
987
+ version: 1;
988
+ recipientId: string;
989
+ intentId: string;
990
+ cycleKey: string;
991
+ messageId: string;
992
+ surfaces: ["personal_agent_badge", "negotiator_dm"];
993
+ claimedAt: string;
994
+ deliveryStatus: "failed" | "claimed" | "delivered" | "suppressed";
995
+ conversationId?: string | undefined;
996
+ deliveredAt?: string | undefined;
997
+ suppressedAt?: string | undefined;
998
+ failure?: string | undefined;
999
+ } | undefined;
1000
+ strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
1001
+ underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
732
1002
  messageId?: string | undefined;
1003
+ purpose?: "uptake" | undefined;
1004
+ triggeredBy?: string | undefined;
733
1005
  pool?: {
734
1006
  poolSize: number;
735
1007
  minedAt: string;
@@ -765,6 +1037,12 @@ export declare const QuestionDetectionSchema: z.ZodObject<{
765
1037
  intentText?: string | undefined;
766
1038
  intentFingerprint?: string | undefined;
767
1039
  } | undefined;
1040
+ pushRequestedAt?: string | undefined;
1041
+ pushRecoveryAttemptedAt?: string | undefined;
1042
+ pushRequestStatus?: "suppressed" | "requested" | undefined;
1043
+ pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
1044
+ pushRequestSuppressedAt?: string | undefined;
1045
+ pushedAt?: string | undefined;
768
1046
  }>;
769
1047
  export declare const QuestionActorSchema: z.ZodObject<{
770
1048
  /** The user this question is for. */
@@ -810,4 +1088,7 @@ export type QuestionAnswer = z.infer<typeof QuestionAnswerSchema>;
810
1088
  export type QuestionPoolAssignment = z.infer<typeof QuestionPoolAssignmentSchema>;
811
1089
  export type QuestionPoolDiscriminator = z.infer<typeof QuestionPoolDiscriminatorSchema>;
812
1090
  export type QuestionPoolSnapshot = z.infer<typeof QuestionPoolSnapshotSchema>;
1091
+ export type QuestionPoolPush = z.infer<typeof QuestionPoolPushSchema>;
1092
+ export type QuestionPoolPushRequestStatus = z.infer<typeof QuestionPoolPushRequestStatusSchema>;
1093
+ export type QuestionPoolPushRequestReason = z.infer<typeof QuestionPoolPushRequestReasonSchema>;
813
1094
  //# sourceMappingURL=question.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/question.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;IAC/B,+EAA+E;;IAE/E,iFAAiF;;;;;;;;EAEjF,CAAC;AAEH,eAAO,MAAM,cAAc;IACzB,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/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K,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
@@ -111,6 +111,40 @@ export const QuestionPoolSnapshotSchema = z.object({
111
111
  /** Remaining ranked discriminators for interview-mode chaining. */
112
112
  alternates: z.array(QuestionPoolDiscriminatorSchema),
113
113
  });
114
+ /** Internal delivery ledger for proactive pool-question pushes (IND-421). */
115
+ export const QuestionPoolPushSchema = z.object({
116
+ version: z.literal(1),
117
+ source: z.literal("pool_discovery"),
118
+ recipientId: z.string().min(1),
119
+ intentId: z.string().min(1),
120
+ cycleKey: z.string().min(1),
121
+ messageId: z.string().min(1),
122
+ surfaces: z.tuple([
123
+ z.literal("personal_agent_badge"),
124
+ z.literal("negotiator_dm"),
125
+ ]),
126
+ claimedAt: z.string().min(1),
127
+ deliveryStatus: z.enum(["claimed", "delivered", "suppressed", "failed"]),
128
+ conversationId: z.string().min(1).optional(),
129
+ deliveredAt: z.string().min(1).optional(),
130
+ suppressedAt: z.string().min(1).optional(),
131
+ failure: z.string().min(1).max(500).optional(),
132
+ });
133
+ /** Durable request state for proactive pool-question delivery. */
134
+ export const QuestionPoolPushRequestStatusSchema = z.enum(["requested", "suppressed"]);
135
+ /** Permanent reasons that terminalize an unclaimed proactive push request. */
136
+ export const QuestionPoolPushRequestReasonSchema = z.enum([
137
+ "question_lifecycle",
138
+ "intent_lifecycle",
139
+ "malformed_source",
140
+ "malformed_actor",
141
+ "malformed_pool",
142
+ "malformed_cycle",
143
+ "visited",
144
+ "pool_size",
145
+ "voi",
146
+ "cycle_budget",
147
+ ]);
114
148
  export const QuestionDetectionSchema = z.object({
115
149
  /** Which preset mode generated this question. */
116
150
  mode: QuestionModeSchema,
@@ -135,6 +169,59 @@ export const QuestionDetectionSchema = z.object({
135
169
  * INTERNAL — stripped from every client-facing read (web + MCP).
136
170
  */
137
171
  pool: QuestionPoolSnapshotSchema.optional(),
172
+ /** Durable request marker written before enqueueing proactive delivery. Internal only. */
173
+ pushRequestedAt: z.string().min(1).optional(),
174
+ /** Last bounded recovery sweep that selected this request. Internal only. */
175
+ pushRecoveryAttemptedAt: z.string().min(1).optional(),
176
+ /** Durable request outcome. Internal only. */
177
+ pushRequestStatus: QuestionPoolPushRequestStatusSchema.optional(),
178
+ /** Permanent suppression reason for an unclaimed request. Internal only. */
179
+ pushRequestReason: QuestionPoolPushRequestReasonSchema.optional(),
180
+ /** ISO-8601 timestamp at which an unclaimed request was suppressed. Internal only. */
181
+ pushRequestSuppressedAt: z.string().min(1).optional(),
182
+ /** Internal proactive delivery state. Never serialize to public clients. */
183
+ push: QuestionPoolPushSchema.optional(),
184
+ /** Authoritative successful-delivery ledger timestamp. Internal only. */
185
+ pushedAt: z.string().min(1).optional(),
186
+ }).superRefine((detection, ctx) => {
187
+ if (detection.mode === "pool_discovery"
188
+ && (!detection.triggeredBy?.trim() || detection.triggeredBy !== detection.sourceId)) {
189
+ ctx.addIssue({
190
+ code: z.ZodIssueCode.custom,
191
+ path: ["triggeredBy"],
192
+ message: "pool_discovery triggeredBy must be non-empty and equal sourceId",
193
+ });
194
+ }
195
+ if (detection.pushRequestStatus && !detection.pushRequestedAt) {
196
+ ctx.addIssue({
197
+ code: z.ZodIssueCode.custom,
198
+ path: ["pushRequestedAt"],
199
+ message: "push request state requires a request timestamp",
200
+ });
201
+ }
202
+ if (detection.pushRecoveryAttemptedAt && !detection.pushRequestedAt) {
203
+ ctx.addIssue({
204
+ code: z.ZodIssueCode.custom,
205
+ path: ["pushRequestedAt"],
206
+ message: "push recovery attempts require a request timestamp",
207
+ });
208
+ }
209
+ if (detection.pushRequestStatus === "suppressed") {
210
+ if (!detection.pushRequestReason) {
211
+ ctx.addIssue({
212
+ code: z.ZodIssueCode.custom,
213
+ path: ["pushRequestReason"],
214
+ message: "suppressed push requests require a reason",
215
+ });
216
+ }
217
+ if (!detection.pushRequestSuppressedAt) {
218
+ ctx.addIssue({
219
+ code: z.ZodIssueCode.custom,
220
+ path: ["pushRequestSuppressedAt"],
221
+ message: "suppressed push requests require a timestamp",
222
+ });
223
+ }
224
+ }
138
225
  });
139
226
  export const QuestionActorSchema = z.object({
140
227
  /** The user this question is for. */