@indexnetwork/protocol 4.17.0-rc.360.1 → 4.17.0-rc.361.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.
- package/CHANGELOG.md +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts +10 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts.map +1 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.js +12 -4
- package/dist/opportunity/discriminator/discriminator.adjustments.js.map +1 -1
- package/dist/opportunity/discriminator/discriminator.question.d.ts +2 -0
- package/dist/opportunity/discriminator/discriminator.question.d.ts.map +1 -1
- package/dist/opportunity/discriminator/discriminator.question.js +1 -0
- package/dist/opportunity/discriminator/discriminator.question.js.map +1 -1
- package/dist/opportunity/feed/feed.graph.js +2 -2
- package/dist/opportunity/feed/feed.graph.js.map +1 -1
- package/dist/questioner/questioner.types.d.ts +2 -0
- package/dist/questioner/questioner.types.d.ts.map +1 -1
- package/dist/questioner/questioner.types.js.map +1 -1
- package/dist/shared/schemas/question.schema.d.ts +21 -0
- package/dist/shared/schemas/question.schema.d.ts.map +1 -1
- package/dist/shared/schemas/question.schema.js +6 -0
- package/dist/shared/schemas/question.schema.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,7 @@ See [STABILITY.md](./STABILITY.md) for the public-contract and tier definitions.
|
|
|
23
23
|
- QUD-typed intent clarification (`missing_constituent`, `missing_constraint`, and `open_alternative_set`) across the live intent elaboration and Questioner flows, with internal detection metadata and exact-match eval coverage (IND-425).
|
|
24
24
|
|
|
25
25
|
### Changed
|
|
26
|
+
- Added the pool-question drift lifecycle: exact recipient+intent final freshness gates, shared inclusive `0.7` Jaccard admission, system-voided stale snapshots, durable MODE cadence suppression, intent-edit invalidation, and audit-preserved stale scoped adjustments excluded from ranking (IND-422).
|
|
26
27
|
- Retargeted the HyDE evidence-v2 harness to background-only discovery: 75 saved-intent cases plus 15 independently authored user-context cases (90 cases/900 candidates), with private saved-intent -> internal `query` and user-context -> `context` graph-source provenance, production-shaped saved-intent discoverer context, source-specific non-gating diagnostics, and no direct-search cohort. The four counterbalanced paired runs, blinded independent human adjudication, hierarchical bootstrap intervals, eight fixed gates, and production agents remain unchanged; this changes eval evidence and documentation only (IND-426).
|
|
27
28
|
- Marked atomically claimed, user-balanced and privacy-thresholded frame-centroid observation plus the privacy-thresholded non-causal yield proxy as shipped by IND-430, while explicitly leaving immutable per-discovery provenance and causal drift diagnosis as future work; protocol runtime behavior is unchanged.
|
|
28
29
|
- Intent graph update mode now fails closed to update actions targeting the caller-provided intent IDs; create, expire, and wrong-target actions are discarded before persistence.
|
package/dist/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } fro
|
|
|
39
39
|
export type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';
|
|
40
40
|
export { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';
|
|
41
41
|
export { ChatContextDigestSchema, type ChatContextDigest } from "./shared/schemas/chat-context.schema.js";
|
|
42
|
-
export { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type UnderspecificationType, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionPurpose, type QuestionMode, type QuestionDetection, type QuestionPoolPush, type QuestionPoolPushRequestStatus, type QuestionPoolPushRequestReason, type QuestionActor, type QuestionAnswer } from "./shared/schemas/question.schema.js";
|
|
42
|
+
export { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionVoidedReasonSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type UnderspecificationType, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionPurpose, type QuestionMode, type QuestionDetection, type QuestionPoolPush, type QuestionVoidedReason, type QuestionPoolPushRequestStatus, type QuestionPoolPushRequestReason, type QuestionActor, type QuestionAnswer } from "./shared/schemas/question.schema.js";
|
|
43
43
|
export type { PendingQuestionSummary } from "./shared/schemas/pending-question.schema.js";
|
|
44
44
|
export type { McpAuthInput } from "./shared/schemas/mcp-auth.schema.js";
|
|
45
45
|
export { UserIdentitySchema, type UserIdentity } from "./shared/schemas/identity.schema.js";
|
|
@@ -129,7 +129,7 @@ export { scoreDiscriminator, computeNovelty, cosineSimilarity } from "./opportun
|
|
|
129
129
|
export { poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsStampNewborn, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_QUESTION_MIN_VOI, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY, POOL_QUESTION_PUSH_MIN_POOL_SIZE, POOL_QUESTION_PUSH_DAILY_CAP } from "./opportunity/discriminator/discriminator.env.js";
|
|
130
130
|
export type { PoolQuestionsMiningMode, PoolQuestionsMode, PoolQuestionsPushMode, PoolQuestionsRankingMode, PoolQuestionsStampNewbornMode } from "./opportunity/discriminator/discriminator.env.js";
|
|
131
131
|
export { poolQuestionsRanking, POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR, POOL_STALENESS_THRESHOLD, POOL_RERUN_DEBOUNCE_MS } from "./opportunity/discriminator/discriminator.env.js";
|
|
132
|
-
export { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from "./opportunity/discriminator/discriminator.adjustments.js";
|
|
132
|
+
export { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, readActivePoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from "./opportunity/discriminator/discriminator.adjustments.js";
|
|
133
133
|
export type { BuildPoolAdjustmentInput, PoolAdjustment, PoolAdjustmentPlanEntry, PoolAdjustmentProvenance, PoolAdjustmentSignal } from "./opportunity/discriminator/discriminator.adjustments.js";
|
|
134
134
|
export { synthesizePoolQuestion, selectQuestionDiscriminators, toQuestionDiscriminator, BOTH_MATTER_LABEL } from "./opportunity/discriminator/discriminator.question.js";
|
|
135
135
|
export { poolQuestionCycleKey, poolQuestionPushThreshold, escapePoolPushMarkdown, buildPoolQuestionPushMessage, POOL_QUESTION_PUSH_TITLE_MAX_CHARS } from "./opportunity/discriminator/discriminator.push.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,YAA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AE,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAKnH,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAChJ,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzG,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACnJ,YAAY,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI/E,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAI/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export { NegotiationSummarizer, buildFallbackDigest } from "./negotiation/negoti
|
|
|
25
25
|
export { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';
|
|
26
26
|
// ─── Shared schemas ───────────────────────────────────────────────────────────
|
|
27
27
|
export { ChatContextDigestSchema } from "./shared/schemas/chat-context.schema.js";
|
|
28
|
-
export { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema } from "./shared/schemas/question.schema.js";
|
|
28
|
+
export { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionVoidedReasonSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema } from "./shared/schemas/question.schema.js";
|
|
29
29
|
export { UserIdentitySchema } from "./shared/schemas/identity.schema.js";
|
|
30
30
|
export { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from "./shared/schemas/network-assignment.schema.js";
|
|
31
31
|
export { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from "./shared/assignment/network-assignment.policy.js";
|
|
@@ -81,7 +81,7 @@ export { runPoolDiscriminatorShadow } from "./opportunity/discriminator/discrimi
|
|
|
81
81
|
export { scoreDiscriminator, computeNovelty, cosineSimilarity } from "./opportunity/discriminator/discriminator.scorer.js";
|
|
82
82
|
export { poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsStampNewborn, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_QUESTION_MIN_VOI, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY, POOL_QUESTION_PUSH_MIN_POOL_SIZE, POOL_QUESTION_PUSH_DAILY_CAP } from "./opportunity/discriminator/discriminator.env.js";
|
|
83
83
|
export { poolQuestionsRanking, POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR, POOL_STALENESS_THRESHOLD, POOL_RERUN_DEBOUNCE_MS } from "./opportunity/discriminator/discriminator.env.js";
|
|
84
|
-
export { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from "./opportunity/discriminator/discriminator.adjustments.js";
|
|
84
|
+
export { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, readActivePoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from "./opportunity/discriminator/discriminator.adjustments.js";
|
|
85
85
|
export { synthesizePoolQuestion, selectQuestionDiscriminators, toQuestionDiscriminator, BOTH_MATTER_LABEL } from "./opportunity/discriminator/discriminator.question.js";
|
|
86
86
|
export { poolQuestionCycleKey, poolQuestionPushThreshold, escapePoolPushMarkdown, buildPoolQuestionPushMessage, POOL_QUESTION_PUSH_TITLE_MAX_CHARS } from "./opportunity/discriminator/discriminator.push.js";
|
|
87
87
|
export { OpportunityEvaluator } from "./opportunity/opportunity.evaluator.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,4DAA4D;AAC5D,gFAAgF;AAChF,+EAA+E;AAC/E,qDAAqD;AACrD,EAAE;AACF,yDAAyD;AACzD,2EAA2E;AAC3E,mEAAmE;AACnE,+EAA+E;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BAAuB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE1N,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAwD,MAAM,sCAAsC,CAAC;AAEnK,iFAAiF;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEpI,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAOvE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAIzG,+EAA+E;AAE/E,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAE/C,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// =============================================================================\n// @indexnetwork/protocol — public API barrel\n//\n// This file is the ONLY supported entry point. Deep imports\n// (\"@indexnetwork/protocol/src/...\") are not part of the contract and may break\n// in any release. Every symbol is re-exported explicitly (no wildcards) so the\n// surface is reviewable and changes are intentional.\n//\n// Stability tiers are defined in STABILITY.md. In short:\n// • Stable — Interfaces, Graph factories, Agents, createChatTools,\n// the tool/runtime helpers, and shared schemas.\n// • Experimental — Sections marked @experimental below (advanced graph state\n// types and internal helpers); may change in a minor release.\n// =============================================================================\n\n// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport {\n deriveAllowedNetworkIds,\n deriveDiscoveryNetworkIds,\n focusedNetworkId,\n focusedNetworkLabel,\n hasNetworkScope,\n scopeFromNetworkId,\n} from \"./shared/agent/tool.scope.js\";\nexport type { ToolScopeEnvelope, ToolScopeType, ScopeMembership, DeriveNetworkScopeInput } from \"./shared/agent/tool.scope.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setLoggerFactory } from \"./shared/observability/log.js\";\nexport type { LoggerWithSource as ProtocolLoggerWithSource } from \"./shared/observability/log.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type { McpAuthResolver } from \"./shared/interfaces/auth.interface.js\";\nexport type { Cache, CacheOptions, HydeCache, OpportunityCache } from \"./shared/interfaces/cache.interface.js\";\nexport type { ChatSessionReader, ChatSessionDetail, ChatSessionSummary } from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters, ChatQuestionsHost, ChatQuestionAnswerOutcome } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type { ContactServiceAdapter, ContactEntry, ContactImportResult, ContactInput, ContactResult, ContactSearchResult } from \"./shared/interfaces/contact.interface.js\";\nexport type {\n ChatGraphCompositeDatabase, UserDatabase, SystemDatabase, Database,\n OpportunityGraphDatabase, OpportunityControllerDatabase, HomeGraphDatabase,\n IntentGraphDatabase, IntentNetworkGraphDatabase, NetworkGraphDatabase, NetworkMembershipGraphDatabase,\n HydeGraphDatabase, EnrichmentGraphDatabase, PremiseGraphDatabase, NegotiationGraphDatabase,\n NegotiationQueries, NegotiationUserAnswer,\n Opportunity, OpportunityActor, OpportunityContext, OpportunityDetection, OpportunityInterpretation,\n OpportunityQueryOptions, OpportunitySignal, OpportunityStatus,\n ActiveIntent, CreatedIntent, CreateIntentData, UpdateIntentData, IntentRecord, SimilarIntent, SimilarIntentSearchOptions,\n IndexedIntentDetails, IndexMemberDetails, AssignmentNetworkMembership, NetworkAssignmentContext, NetworkMembership, OwnedIndex,\n CreateHydeDocumentData, HydeDocument, HydeSourceType, CreateOpportunityData,\n PremiseAnalysis, PremiseAssertion, PremiseProvenance, PremiseRecord, PremiseValidity,\n OnboardingPrivacyState, OnboardingProfileSeed, OnboardingState, PrivacyConsentDecision, PrivacyConsentSource,\n UpdateIndexSettingsData, UserRecord, UserSocial, ArchiveResult, Id,\n} from \"./shared/interfaces/database.interface.js\";\nexport type {\n Embedder, EmbeddingGenerator, EmbeddingGenerateOptions,\n VectorStore, VectorStoreOption, VectorSearchResult,\n HydeCandidate, HydeSearchOptions, LensEmbedding,\n} from \"./shared/interfaces/embedder.interface.js\";\nexport type { ProfileEnricher, EnrichmentRequest, EnrichmentResult } from \"./shared/interfaces/enrichment.interface.js\";\nexport type { IntegrationAdapter, IntegrationConnection, IntegrationSession, IntegrationSessionOptions, ToolActionResponse } from \"./shared/interfaces/integration.interface.js\";\nexport type { IntentGraphQueue } from \"./shared/interfaces/queue.interface.js\";\nexport type { Scraper, ExtractUrlContentOptions } from \"./shared/interfaces/scraper.interface.js\";\nexport type { Storage } from \"./shared/interfaces/storage.interface.js\";\nexport type { DeliveryLedger, DeliveredOpportunityRow } from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type { MintConnectLink, ConnectLinkKind } from \"./shared/interfaces/connect-link.interface.js\";\nexport type {\n DiscoveryRunStore, DiscoveryRunQueue, DiscoveryRunInput, CreateDiscoveryRunInput,\n DiscoveryRunRecord, DiscoveryRunStatus,\n} from \"./shared/interfaces/discovery-run.interface.js\";\nexport type {\n EnrichmentRunStore, EnrichmentRunQueue, EnrichmentRunInput, CreateEnrichmentRunInput,\n UpdateUserEnrichmentRunInput, PreviewUserEnrichmentRunInput,\n EnrichmentRunRecord, EnrichmentRunStatus, EnrichmentRunOperation,\n} from \"./shared/interfaces/enrichment-run.interface.js\";\nexport type { NegotiationTimeoutQueue, AskUserExpiryPayload } from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type UnderspecificationType, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionPurpose, type QuestionMode, type QuestionDetection, type QuestionPoolPush, type QuestionPoolPushRequestStatus, type QuestionPoolPushRequestReason, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { UserIdentitySchema, type UserIdentity } from \"./shared/schemas/identity.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, AssignmentScopeMembership, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Intent clarification ─────────────────────────────────────────────────────\n\nexport { IntentClarifier, type IntentClarifierOutput } from \"./intent/intent.clarifier.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport {\n ORCHESTRATOR_PERSONA,\n ORCHESTRATOR_PERSONA_ID,\n type ChatPersonaConfig,\n type ChatPersonaLoopBehaviors,\n} from \"./chat/chat.persona.js\";\nexport {\n NEGOTIATOR_PERSONA_ID,\n NEGOTIATOR_TOOL_NAMES,\n createNegotiatorPersona,\n createNegotiatorTools,\n filterNegotiatorTools,\n} from \"./chat/negotiator.persona.js\";\nexport { buildNegotiatorSystemContent, type NegotiatorPromptOptions } from \"./chat/negotiator.prompt.js\";\nexport {\n NEGOTIATOR_MEMORY_TOOL_NAMES,\n createNegotiatorMemoryTools,\n} from \"./chat/negotiator.tools.js\";\nexport type {\n NegotiatorMemoryToolsHost,\n NegotiatorMemoryRememberInput,\n NegotiatorMemoryToolView,\n NegotiatorMemoryForgetResult,\n RememberableMemoryKind,\n} from \"./shared/interfaces/negotiator-memory.interface.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport type { HydeGraphOptions, HydeLensInferrerLike, HydeGeneratorLike, HydeValidatorLike } from \"./shared/hyde/hyde.graph.js\";\nexport { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION } from \"./shared/hyde/hyde.env.js\";\nexport type { HydeGenerationMode } from \"./shared/hyde/hyde.env.js\";\nexport { sanitizeHydeSourceFrame } from \"./shared/hyde/hyde.frame.js\";\nexport type { HydeSourceFrame, HydeFrameRole, HydeFrameHardConstraint, HydeFrameNamedEntity, HydeFrameVocabulary, HydeHardConstraintType, HydeNamedEntityType } from \"./shared/hyde/hyde.frame.js\";\nexport { HydeValidator } from \"./shared/hyde/hyde.validator.js\";\nexport type { HydeValidationInput, HydeValidationDocument, HydeValidationOutput, HydeValidationVerdict } from \"./shared/hyde/hyde.validator.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { SemanticVerifier } from \"./intent/intent.verifier.js\";\nexport type { SemanticVerifierOutput } from \"./intent/intent.verifier.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport type { StampNewbornOpportunitiesFn, StampNewbornOpportunitiesInput } from \"./opportunity/opportunity.graph.js\";\nexport { EnrichmentGraphFactory } from \"./enrichment/enrichment.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport type { HydeGenerateInput, HydeGeneratorOutput } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport type { Lens, LensInferenceInput, LensInferenceOutput, HydeTargetCorpus } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport { NegotiationScreener, configuredScreenMode, ScreenDecisionSchema, NEGOTIATION_SCREEN_MODES } from \"./negotiation/negotiation.screen.js\";\nexport type { ScreenDecision, ScreenDecisionRecord, NegotiationScreenMode, NegotiationScreenerInput } from \"./negotiation/negotiation.screen.js\";\nexport { NegotiationReflector, DistilledMemorySchema, ReflectionResultSchema, MAX_DISTILLED_MEMORIES, NEGOTIATOR_MEMORY_KINDS } from \"./negotiation/negotiation.reflect.js\";\nexport type { DistilledMemory, DistilledMemoryKind, ReflectionResult, ReflectionTranscriptEntry, NegotiationReflectionInput, ChatReflectionInput, NegotiationReflectJobData, ReflectEnqueueFn } from \"./negotiation/negotiation.reflect.js\";\nexport { renderNegotiatorMemorySection, renderNegotiatorChatMemorySection } from \"./negotiation/negotiation.memory.js\";\nexport type { NegotiatorMemoryEntry, NegotiatorMemoryQuery, NegotiatorMemoryScope, NegotiatorMemoryRetrieveFn } from \"./negotiation/negotiation.memory.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, UptakeQuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext, PostStallNegotiationContext, UptakeNegotiationContext, NegotiationInflightContext, ChatContext, PoolDiscoveryContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport { QUD_UNDERSPECIFICATION_RULES } from \"./questioner/questioner.qud.js\";\nexport { isQuestionerEnabled, isDiscoveryQuestionsEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, discoveryQuestionsInputMode, discoveryQuestionsTimeoutMs, chatQuestionWaitTimeoutMs } from \"./questioner/questioner.env.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { PoolDiscriminatorMiner } from \"./opportunity/discriminator/discriminator.miner.js\";\nexport type { PoolDiscriminatorMinerConfig } from \"./opportunity/discriminator/discriminator.miner.js\";\nexport { PoolDiscriminatorAssigner, buildAssignmentPrompt, verifyAssignedAxis } from \"./opportunity/discriminator/discriminator.assigner.js\";\nexport type { PoolDiscriminatorAssignerConfig, PoolDiscriminatorAssignmentAxis, PoolDiscriminatorAssignmentInput, PoolDiscriminatorAssignedAxis, PoolDiscriminatorCandidateAssignment } from \"./opportunity/discriminator/discriminator.assigner.js\";\nexport { runPoolDiscriminatorShadow } from \"./opportunity/discriminator/discriminator.shadow.js\";\nexport type { DiscriminatorShadowInput } from \"./opportunity/discriminator/discriminator.shadow.js\";\nexport { scoreDiscriminator, computeNovelty, cosineSimilarity } from \"./opportunity/discriminator/discriminator.scorer.js\";\nexport { poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsStampNewborn, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_QUESTION_MIN_VOI, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY, POOL_QUESTION_PUSH_MIN_POOL_SIZE, POOL_QUESTION_PUSH_DAILY_CAP } from \"./opportunity/discriminator/discriminator.env.js\";\nexport type { PoolQuestionsMiningMode, PoolQuestionsMode, PoolQuestionsPushMode, PoolQuestionsRankingMode, PoolQuestionsStampNewbornMode } from \"./opportunity/discriminator/discriminator.env.js\";\nexport { poolQuestionsRanking, POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR, POOL_STALENESS_THRESHOLD, POOL_RERUN_DEBOUNCE_MS } from \"./opportunity/discriminator/discriminator.env.js\";\nexport { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from \"./opportunity/discriminator/discriminator.adjustments.js\";\nexport type { BuildPoolAdjustmentInput, PoolAdjustment, PoolAdjustmentPlanEntry, PoolAdjustmentProvenance, PoolAdjustmentSignal } from \"./opportunity/discriminator/discriminator.adjustments.js\";\nexport { synthesizePoolQuestion, selectQuestionDiscriminators, toQuestionDiscriminator, BOTH_MATTER_LABEL } from \"./opportunity/discriminator/discriminator.question.js\";\nexport { poolQuestionCycleKey, poolQuestionPushThreshold, escapePoolPushMarkdown, buildPoolQuestionPushMessage, POOL_QUESTION_PUSH_TITLE_MAX_CHARS } from \"./opportunity/discriminator/discriminator.push.js\";\nexport type { SynthesizePoolQuestionInput, SynthesizedPoolQuestion } from \"./opportunity/discriminator/discriminator.question.js\";\nexport type { QuestionPoolAssignment, QuestionPoolDiscriminator, QuestionPoolSnapshot } from \"./shared/schemas/question.schema.js\";\nexport type { PoolCandidate, DiscriminatorMiningInput, MinedDiscriminator, ScoredDiscriminator, VerifiedAssignment, DiscriminatorShadowResult } from \"./opportunity/discriminator/discriminator.types.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createEnrichmentTools } from \"./enrichment/enrichment.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions, truncateAtBoundary } from \"./opportunity/opportunity.presentation.js\";\nexport { hasUnsupportedOpportunityClaim, stripUnsupportedOpportunityClaims } from \"./opportunity/opportunity.claim-safety.js\";\nexport { safeFallbackSummary, getSafePresentationOrSkip, SAFE_FALLBACK_MAX_CHARS, DEFAULT_FALLBACK_HEADLINE, DEFAULT_FALLBACK_ACTION, DEFAULT_EMPTY_FALLBACK_TEXT } from \"./opportunity/opportunity.safe-presentation.js\";\nexport type { SafeFallbackOptions, SafePresentation, SafePresentationOptions, SafePresentationSource } from \"./opportunity/opportunity.safe-presentation.js\";\nexport { buildApiChatCardPresentationCacheKey } from \"./opportunity/opportunity.presentation-cache.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentAllowedNetworkIds, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n// @experimental — internal graph-state shapes; may change in a minor release.\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport { NEGOTIATION_ACTIONS, AskUserPayloadSchema } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationAction, NegotiationSeat, NegotiationProtocolVersion, AskUserPayload } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Negotiation seat rules (v2 client-advocate protocol) ───────────────────\n\nexport {\n InitiatorTurnSchema,\n CounterpartyTurnSchema,\n FinalInitiatorTurnSchema,\n FinalCounterpartyTurnSchema,\n InitiatorAskUserTurnSchema,\n CounterpartyAskUserTurnSchema,\n allowedActionsFor,\n turnSchemaFor,\n isTerminalAction,\n isRejectLikeAction,\n fallbackActionFor,\n rejectActionFor,\n readProtocolVersion,\n configuredProtocolVersion,\n configuredAskUserEnabled,\n askUserAnswerWindowMs,\n DEFAULT_ASK_USER_WINDOW_MS,\n ASK_USER_LOCK_SLACK_MS,\n resolveSeat,\n seatViolationMessage,\n} from \"./negotiation/negotiation.protocol.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,4DAA4D;AAC5D,gFAAgF;AAChF,+EAA+E;AAC/E,qDAAqD;AACrD,EAAE;AACF,yDAAyD;AACzD,2EAA2E;AAC3E,mEAAmE;AACnE,+EAA+E;AAC/E,iFAAiF;AACjF,gFAAgF;AAEhF,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAI9D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAcrI,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAyCrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,iFAAiF;AAEjF,OAAO,EAAE,uBAAuB,EAA0B,MAAM,yCAAyC,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,0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eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAE/C,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// =============================================================================\n// @indexnetwork/protocol — public API barrel\n//\n// This file is the ONLY supported entry point. Deep imports\n// (\"@indexnetwork/protocol/src/...\") are not part of the contract and may break\n// in any release. Every symbol is re-exported explicitly (no wildcards) so the\n// surface is reviewable and changes are intentional.\n//\n// Stability tiers are defined in STABILITY.md. In short:\n// • Stable — Interfaces, Graph factories, Agents, createChatTools,\n// the tool/runtime helpers, and shared schemas.\n// • Experimental — Sections marked @experimental below (advanced graph state\n// types and internal helpers); may change in a minor release.\n// =============================================================================\n\n// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport {\n deriveAllowedNetworkIds,\n deriveDiscoveryNetworkIds,\n focusedNetworkId,\n focusedNetworkLabel,\n hasNetworkScope,\n scopeFromNetworkId,\n} from \"./shared/agent/tool.scope.js\";\nexport type { ToolScopeEnvelope, ToolScopeType, ScopeMembership, DeriveNetworkScopeInput } from \"./shared/agent/tool.scope.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setLoggerFactory } from \"./shared/observability/log.js\";\nexport type { LoggerWithSource as ProtocolLoggerWithSource } from \"./shared/observability/log.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type { McpAuthResolver } from \"./shared/interfaces/auth.interface.js\";\nexport type { Cache, CacheOptions, HydeCache, OpportunityCache } from \"./shared/interfaces/cache.interface.js\";\nexport type { ChatSessionReader, ChatSessionDetail, ChatSessionSummary } from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters, ChatQuestionsHost, ChatQuestionAnswerOutcome } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type { ContactServiceAdapter, ContactEntry, ContactImportResult, ContactInput, ContactResult, ContactSearchResult } from \"./shared/interfaces/contact.interface.js\";\nexport type {\n ChatGraphCompositeDatabase, UserDatabase, SystemDatabase, Database,\n OpportunityGraphDatabase, OpportunityControllerDatabase, HomeGraphDatabase,\n IntentGraphDatabase, IntentNetworkGraphDatabase, NetworkGraphDatabase, NetworkMembershipGraphDatabase,\n HydeGraphDatabase, EnrichmentGraphDatabase, PremiseGraphDatabase, NegotiationGraphDatabase,\n NegotiationQueries, NegotiationUserAnswer,\n Opportunity, OpportunityActor, OpportunityContext, OpportunityDetection, OpportunityInterpretation,\n OpportunityQueryOptions, OpportunitySignal, OpportunityStatus,\n ActiveIntent, CreatedIntent, CreateIntentData, UpdateIntentData, IntentRecord, SimilarIntent, SimilarIntentSearchOptions,\n IndexedIntentDetails, IndexMemberDetails, AssignmentNetworkMembership, NetworkAssignmentContext, NetworkMembership, OwnedIndex,\n CreateHydeDocumentData, HydeDocument, HydeSourceType, CreateOpportunityData,\n PremiseAnalysis, PremiseAssertion, PremiseProvenance, PremiseRecord, PremiseValidity,\n OnboardingPrivacyState, OnboardingProfileSeed, OnboardingState, PrivacyConsentDecision, PrivacyConsentSource,\n UpdateIndexSettingsData, UserRecord, UserSocial, ArchiveResult, Id,\n} from \"./shared/interfaces/database.interface.js\";\nexport type {\n Embedder, EmbeddingGenerator, EmbeddingGenerateOptions,\n VectorStore, VectorStoreOption, VectorSearchResult,\n HydeCandidate, HydeSearchOptions, LensEmbedding,\n} from \"./shared/interfaces/embedder.interface.js\";\nexport type { ProfileEnricher, EnrichmentRequest, EnrichmentResult } from \"./shared/interfaces/enrichment.interface.js\";\nexport type { IntegrationAdapter, IntegrationConnection, IntegrationSession, IntegrationSessionOptions, ToolActionResponse } from \"./shared/interfaces/integration.interface.js\";\nexport type { IntentGraphQueue } from \"./shared/interfaces/queue.interface.js\";\nexport type { Scraper, ExtractUrlContentOptions } from \"./shared/interfaces/scraper.interface.js\";\nexport type { Storage } from \"./shared/interfaces/storage.interface.js\";\nexport type { DeliveryLedger, DeliveredOpportunityRow } from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type { MintConnectLink, ConnectLinkKind } from \"./shared/interfaces/connect-link.interface.js\";\nexport type {\n DiscoveryRunStore, DiscoveryRunQueue, DiscoveryRunInput, CreateDiscoveryRunInput,\n DiscoveryRunRecord, DiscoveryRunStatus,\n} from \"./shared/interfaces/discovery-run.interface.js\";\nexport type {\n EnrichmentRunStore, EnrichmentRunQueue, EnrichmentRunInput, CreateEnrichmentRunInput,\n UpdateUserEnrichmentRunInput, PreviewUserEnrichmentRunInput,\n EnrichmentRunRecord, EnrichmentRunStatus, EnrichmentRunOperation,\n} from \"./shared/interfaces/enrichment-run.interface.js\";\nexport type { NegotiationTimeoutQueue, AskUserExpiryPayload } from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, UnderspecificationTypeSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionPurposeSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionPoolPushSchema, QuestionVoidedReasonSchema, QuestionPoolPushRequestStatusSchema, QuestionPoolPushRequestReasonSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type UnderspecificationType, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionPurpose, type QuestionMode, type QuestionDetection, type QuestionPoolPush, type QuestionVoidedReason, type QuestionPoolPushRequestStatus, type QuestionPoolPushRequestReason, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { UserIdentitySchema, type UserIdentity } from \"./shared/schemas/identity.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, AssignmentScopeMembership, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Intent clarification ─────────────────────────────────────────────────────\n\nexport { IntentClarifier, type IntentClarifierOutput } from \"./intent/intent.clarifier.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport {\n ORCHESTRATOR_PERSONA,\n ORCHESTRATOR_PERSONA_ID,\n type ChatPersonaConfig,\n type ChatPersonaLoopBehaviors,\n} from \"./chat/chat.persona.js\";\nexport {\n NEGOTIATOR_PERSONA_ID,\n NEGOTIATOR_TOOL_NAMES,\n createNegotiatorPersona,\n createNegotiatorTools,\n filterNegotiatorTools,\n} from \"./chat/negotiator.persona.js\";\nexport { buildNegotiatorSystemContent, type NegotiatorPromptOptions } from \"./chat/negotiator.prompt.js\";\nexport {\n NEGOTIATOR_MEMORY_TOOL_NAMES,\n createNegotiatorMemoryTools,\n} from \"./chat/negotiator.tools.js\";\nexport type {\n NegotiatorMemoryToolsHost,\n NegotiatorMemoryRememberInput,\n NegotiatorMemoryToolView,\n NegotiatorMemoryForgetResult,\n RememberableMemoryKind,\n} from \"./shared/interfaces/negotiator-memory.interface.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport type { HydeGraphOptions, HydeLensInferrerLike, HydeGeneratorLike, HydeValidatorLike } from \"./shared/hyde/hyde.graph.js\";\nexport { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION } from \"./shared/hyde/hyde.env.js\";\nexport type { HydeGenerationMode } from \"./shared/hyde/hyde.env.js\";\nexport { sanitizeHydeSourceFrame } from \"./shared/hyde/hyde.frame.js\";\nexport type { HydeSourceFrame, HydeFrameRole, HydeFrameHardConstraint, HydeFrameNamedEntity, HydeFrameVocabulary, HydeHardConstraintType, HydeNamedEntityType } from \"./shared/hyde/hyde.frame.js\";\nexport { HydeValidator } from \"./shared/hyde/hyde.validator.js\";\nexport type { HydeValidationInput, HydeValidationDocument, HydeValidationOutput, HydeValidationVerdict } from \"./shared/hyde/hyde.validator.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { SemanticVerifier } from \"./intent/intent.verifier.js\";\nexport type { SemanticVerifierOutput } from \"./intent/intent.verifier.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport type { StampNewbornOpportunitiesFn, StampNewbornOpportunitiesInput } from \"./opportunity/opportunity.graph.js\";\nexport { EnrichmentGraphFactory } from \"./enrichment/enrichment.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport type { HydeGenerateInput, HydeGeneratorOutput } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport type { Lens, LensInferenceInput, LensInferenceOutput, HydeTargetCorpus } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport { NegotiationScreener, configuredScreenMode, ScreenDecisionSchema, NEGOTIATION_SCREEN_MODES } from \"./negotiation/negotiation.screen.js\";\nexport type { ScreenDecision, ScreenDecisionRecord, NegotiationScreenMode, NegotiationScreenerInput } from \"./negotiation/negotiation.screen.js\";\nexport { NegotiationReflector, DistilledMemorySchema, ReflectionResultSchema, MAX_DISTILLED_MEMORIES, NEGOTIATOR_MEMORY_KINDS } from \"./negotiation/negotiation.reflect.js\";\nexport type { DistilledMemory, DistilledMemoryKind, ReflectionResult, ReflectionTranscriptEntry, NegotiationReflectionInput, ChatReflectionInput, NegotiationReflectJobData, ReflectEnqueueFn } from \"./negotiation/negotiation.reflect.js\";\nexport { renderNegotiatorMemorySection, renderNegotiatorChatMemorySection } from \"./negotiation/negotiation.memory.js\";\nexport type { NegotiatorMemoryEntry, NegotiatorMemoryQuery, NegotiatorMemoryScope, NegotiatorMemoryRetrieveFn } from \"./negotiation/negotiation.memory.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, UptakeQuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext, PostStallNegotiationContext, UptakeNegotiationContext, NegotiationInflightContext, ChatContext, PoolDiscoveryContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport { QUD_UNDERSPECIFICATION_RULES } from \"./questioner/questioner.qud.js\";\nexport { isQuestionerEnabled, isDiscoveryQuestionsEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, discoveryQuestionsInputMode, discoveryQuestionsTimeoutMs, chatQuestionWaitTimeoutMs } from \"./questioner/questioner.env.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { PoolDiscriminatorMiner } from \"./opportunity/discriminator/discriminator.miner.js\";\nexport type { PoolDiscriminatorMinerConfig } from \"./opportunity/discriminator/discriminator.miner.js\";\nexport { PoolDiscriminatorAssigner, buildAssignmentPrompt, verifyAssignedAxis } from \"./opportunity/discriminator/discriminator.assigner.js\";\nexport type { PoolDiscriminatorAssignerConfig, PoolDiscriminatorAssignmentAxis, PoolDiscriminatorAssignmentInput, PoolDiscriminatorAssignedAxis, PoolDiscriminatorCandidateAssignment } from \"./opportunity/discriminator/discriminator.assigner.js\";\nexport { runPoolDiscriminatorShadow } from \"./opportunity/discriminator/discriminator.shadow.js\";\nexport type { DiscriminatorShadowInput } from \"./opportunity/discriminator/discriminator.shadow.js\";\nexport { scoreDiscriminator, computeNovelty, cosineSimilarity } from \"./opportunity/discriminator/discriminator.scorer.js\";\nexport { poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsStampNewborn, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_QUESTION_MIN_VOI, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_PUSH_BASE_VOI, POOL_QUESTION_PUSH_DISMISSAL_DECAY, POOL_QUESTION_PUSH_MIN_POOL_SIZE, POOL_QUESTION_PUSH_DAILY_CAP } from \"./opportunity/discriminator/discriminator.env.js\";\nexport type { PoolQuestionsMiningMode, PoolQuestionsMode, PoolQuestionsPushMode, PoolQuestionsRankingMode, PoolQuestionsStampNewbornMode } from \"./opportunity/discriminator/discriminator.env.js\";\nexport { poolQuestionsRanking, POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR, POOL_STALENESS_THRESHOLD, POOL_RERUN_DEBOUNCE_MS } from \"./opportunity/discriminator/discriminator.env.js\";\nexport { buildPoolAdjustment, planPoolAdjustments, mergePoolAdjustment, removePoolAdjustment, readPoolAdjustments, readActivePoolAdjustments, poolAdjustmentMultiplier, adjustedConfidence, latestPoolDemotionDetail } from \"./opportunity/discriminator/discriminator.adjustments.js\";\nexport type { BuildPoolAdjustmentInput, PoolAdjustment, PoolAdjustmentPlanEntry, PoolAdjustmentProvenance, PoolAdjustmentSignal } from \"./opportunity/discriminator/discriminator.adjustments.js\";\nexport { synthesizePoolQuestion, selectQuestionDiscriminators, toQuestionDiscriminator, BOTH_MATTER_LABEL } from \"./opportunity/discriminator/discriminator.question.js\";\nexport { poolQuestionCycleKey, poolQuestionPushThreshold, escapePoolPushMarkdown, buildPoolQuestionPushMessage, POOL_QUESTION_PUSH_TITLE_MAX_CHARS } from \"./opportunity/discriminator/discriminator.push.js\";\nexport type { SynthesizePoolQuestionInput, SynthesizedPoolQuestion } from \"./opportunity/discriminator/discriminator.question.js\";\nexport type { QuestionPoolAssignment, QuestionPoolDiscriminator, QuestionPoolSnapshot } from \"./shared/schemas/question.schema.js\";\nexport type { PoolCandidate, DiscriminatorMiningInput, MinedDiscriminator, ScoredDiscriminator, VerifiedAssignment, DiscriminatorShadowResult } from \"./opportunity/discriminator/discriminator.types.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createEnrichmentTools } from \"./enrichment/enrichment.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions, truncateAtBoundary } from \"./opportunity/opportunity.presentation.js\";\nexport { hasUnsupportedOpportunityClaim, stripUnsupportedOpportunityClaims } from \"./opportunity/opportunity.claim-safety.js\";\nexport { safeFallbackSummary, getSafePresentationOrSkip, SAFE_FALLBACK_MAX_CHARS, DEFAULT_FALLBACK_HEADLINE, DEFAULT_FALLBACK_ACTION, DEFAULT_EMPTY_FALLBACK_TEXT } from \"./opportunity/opportunity.safe-presentation.js\";\nexport type { SafeFallbackOptions, SafePresentation, SafePresentationOptions, SafePresentationSource } from \"./opportunity/opportunity.safe-presentation.js\";\nexport { buildApiChatCardPresentationCacheKey } from \"./opportunity/opportunity.presentation-cache.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentAllowedNetworkIds, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n// @experimental — internal graph-state shapes; may change in a minor release.\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport { NEGOTIATION_ACTIONS, AskUserPayloadSchema } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationAction, NegotiationSeat, NegotiationProtocolVersion, AskUserPayload } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Negotiation seat rules (v2 client-advocate protocol) ───────────────────\n\nexport {\n InitiatorTurnSchema,\n CounterpartyTurnSchema,\n FinalInitiatorTurnSchema,\n FinalCounterpartyTurnSchema,\n InitiatorAskUserTurnSchema,\n CounterpartyAskUserTurnSchema,\n allowedActionsFor,\n turnSchemaFor,\n isTerminalAction,\n isRejectLikeAction,\n fallbackActionFor,\n rejectActionFor,\n readProtocolVersion,\n configuredProtocolVersion,\n configuredAskUserEnabled,\n askUserAnswerWindowMs,\n DEFAULT_ASK_USER_WINDOW_MS,\n ASK_USER_LOCK_SLACK_MS,\n resolveSeat,\n seatViolationMessage,\n} from \"./negotiation/negotiation.protocol.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
|
|
@@ -18,9 +18,15 @@ export interface PoolAdjustment extends PoolAdjustmentProvenance {
|
|
|
18
18
|
detail?: string;
|
|
19
19
|
/** ISO-8601 apply timestamp. */
|
|
20
20
|
appliedAt: string;
|
|
21
|
+
/** Full intent fingerprint authoritative when this adjustment was created. */
|
|
22
|
+
intentFingerprint?: string;
|
|
23
|
+
/** Audit-only marker: stale adjustments remain stored but have no ranking effect. */
|
|
24
|
+
stale?: true;
|
|
21
25
|
}
|
|
22
26
|
/** Reads valid adjustments, optionally narrowed to one recipient + intent. */
|
|
23
27
|
export declare function readPoolAdjustments(metadata: Record<string, unknown> | null | undefined, provenance?: PoolAdjustmentProvenance): PoolAdjustment[];
|
|
28
|
+
/** Reads valid, non-stale adjustments for ranking and presentation behavior. */
|
|
29
|
+
export declare function readActivePoolAdjustments(metadata: Record<string, unknown> | null | undefined, provenance?: PoolAdjustmentProvenance): PoolAdjustment[];
|
|
24
30
|
/**
|
|
25
31
|
* Cumulative adjustment multiplier for an opportunity, floored at
|
|
26
32
|
* {@link POOL_ADJUSTMENT_FLOOR}. 1 when no scoped adjustments exist.
|
|
@@ -43,6 +49,8 @@ export interface BuildPoolAdjustmentInput extends PoolAdjustmentProvenance {
|
|
|
43
49
|
assignedSide: string | null;
|
|
44
50
|
chosenSide: string;
|
|
45
51
|
appliedAt: string;
|
|
52
|
+
/** Full intent fingerprint authoritative when this adjustment was created. */
|
|
53
|
+
intentFingerprint?: string;
|
|
46
54
|
}
|
|
47
55
|
/**
|
|
48
56
|
* Build one P3-compatible adjustment and signal. This is the only place that
|
|
@@ -69,8 +77,9 @@ export interface PoolAdjustmentPlanEntry {
|
|
|
69
77
|
* @param recipientUserId User whose answer produced the preference.
|
|
70
78
|
* @param intentId Intent whose candidate pool was ranked.
|
|
71
79
|
* @param now ISO-8601 timestamp.
|
|
80
|
+
* @param intentFingerprint Full intent fingerprint authoritative at apply time.
|
|
72
81
|
*/
|
|
73
|
-
export declare function planPoolAdjustments(discriminator: QuestionPoolDiscriminator, chosenSide: string, questionId: string, recipientUserId: string, intentId: string, now: string): PoolAdjustmentPlanEntry[];
|
|
82
|
+
export declare function planPoolAdjustments(discriminator: QuestionPoolDiscriminator, chosenSide: string, questionId: string, recipientUserId: string, intentId: string, now: string, intentFingerprint?: string): PoolAdjustmentPlanEntry[];
|
|
74
83
|
/**
|
|
75
84
|
* Merges one adjustment into an opportunity's existing metadata, replacing
|
|
76
85
|
* only the entry for the same question + recipient + intent provenance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminator.adjustments.d.ts","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.adjustments.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEzF,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC9D,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"discriminator.adjustments.d.ts","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.adjustments.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEzF,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC9D,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qFAAqF;IACrF,KAAK,CAAC,EAAE,IAAI,CAAC;CACd;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,CAAC,EAAE,wBAAwB,GACpC,cAAc,EAAE,CAiBlB;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,CAAC,EAAE,wBAAwB,GACpC,cAAc,EAAE,CAElB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAA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MAAM,EACX,iBAAiB,CAAC,EAAE,MAAM,GACzB,uBAAuB,EAAE,CAwB3B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,EAAE,cAAc,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,EAAE,wBAAwB,GACnC,MAAM,GAAG,SAAS,CAKpB;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,wBAAwB,GACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB"}
|
|
@@ -26,18 +26,23 @@ export function readPoolAdjustments(metadata, provenance) {
|
|
|
26
26
|
typeof a.questionId !== "string" ||
|
|
27
27
|
typeof a.recipientUserId !== "string" ||
|
|
28
28
|
typeof a.intentId !== "string" ||
|
|
29
|
-
typeof a.factor !== "number"
|
|
29
|
+
typeof a.factor !== "number" ||
|
|
30
|
+
(a.stale !== undefined && a.stale !== true))
|
|
30
31
|
return false;
|
|
31
32
|
return provenance === undefined || (a.recipientUserId === provenance.recipientUserId &&
|
|
32
33
|
a.intentId === provenance.intentId);
|
|
33
34
|
});
|
|
34
35
|
}
|
|
36
|
+
/** Reads valid, non-stale adjustments for ranking and presentation behavior. */
|
|
37
|
+
export function readActivePoolAdjustments(metadata, provenance) {
|
|
38
|
+
return readPoolAdjustments(metadata, provenance).filter((adjustment) => adjustment.stale !== true);
|
|
39
|
+
}
|
|
35
40
|
/**
|
|
36
41
|
* Cumulative adjustment multiplier for an opportunity, floored at
|
|
37
42
|
* {@link POOL_ADJUSTMENT_FLOOR}. 1 when no scoped adjustments exist.
|
|
38
43
|
*/
|
|
39
44
|
export function poolAdjustmentMultiplier(metadata, provenance) {
|
|
40
|
-
const adjustments =
|
|
45
|
+
const adjustments = readActivePoolAdjustments(metadata, provenance);
|
|
41
46
|
if (adjustments.length === 0)
|
|
42
47
|
return 1;
|
|
43
48
|
const product = adjustments.reduce((acc, a) => acc * (Number.isFinite(a.factor) && a.factor > 0 ? a.factor : 1), 1);
|
|
@@ -67,6 +72,7 @@ export function buildPoolAdjustment(input) {
|
|
|
67
72
|
factor,
|
|
68
73
|
...(!isChosen && !isUnknown ? { detail: `${input.label}: you chose ${input.chosenSide}` } : {}),
|
|
69
74
|
appliedAt: input.appliedAt,
|
|
75
|
+
...(input.intentFingerprint !== undefined ? { intentFingerprint: input.intentFingerprint } : {}),
|
|
70
76
|
},
|
|
71
77
|
signal: {
|
|
72
78
|
type: "pool_discriminator",
|
|
@@ -89,8 +95,9 @@ export function buildPoolAdjustment(input) {
|
|
|
89
95
|
* @param recipientUserId User whose answer produced the preference.
|
|
90
96
|
* @param intentId Intent whose candidate pool was ranked.
|
|
91
97
|
* @param now ISO-8601 timestamp.
|
|
98
|
+
* @param intentFingerprint Full intent fingerprint authoritative at apply time.
|
|
92
99
|
*/
|
|
93
|
-
export function planPoolAdjustments(discriminator, chosenSide, questionId, recipientUserId, intentId, now) {
|
|
100
|
+
export function planPoolAdjustments(discriminator, chosenSide, questionId, recipientUserId, intentId, now, intentFingerprint) {
|
|
94
101
|
// Chip labels are word-capped side labels; match on the capped prefix too.
|
|
95
102
|
const matchesSide = (side) => side === chosenSide || side.startsWith(chosenSide) || chosenSide.startsWith(side);
|
|
96
103
|
const chosen = discriminator.sides.find(matchesSide);
|
|
@@ -108,6 +115,7 @@ export function planPoolAdjustments(discriminator, chosenSide, questionId, recip
|
|
|
108
115
|
assignedSide: a.side,
|
|
109
116
|
chosenSide: chosen,
|
|
110
117
|
appliedAt: now,
|
|
118
|
+
...(intentFingerprint !== undefined ? { intentFingerprint } : {}),
|
|
111
119
|
}),
|
|
112
120
|
});
|
|
113
121
|
}
|
|
@@ -126,7 +134,7 @@ export function mergePoolAdjustment(metadata, adjustment) {
|
|
|
126
134
|
}
|
|
127
135
|
/** Latest scoped user-explainable demotion detail for card presentation. */
|
|
128
136
|
export function latestPoolDemotionDetail(metadata, provenance) {
|
|
129
|
-
return [...
|
|
137
|
+
return [...readActivePoolAdjustments(metadata, provenance)]
|
|
130
138
|
.reverse()
|
|
131
139
|
.find((adjustment) => adjustment.factor < 1 && typeof adjustment.detail === 'string' && adjustment.detail.length > 0)
|
|
132
140
|
?.detail;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminator.adjustments.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.adjustments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAyB7H,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CACjC,QAAoD,EACpD,UAAqC;IAErC,MAAM,GAAG,GAAG,QAAQ,EAAE,eAAe,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAuB,EAAE;QAC3C,IACE,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;YACnC,OAAQ,CAAoB,CAAC,UAAU,KAAK,QAAQ;YACpD,OAAQ,CAAoB,CAAC,eAAe,KAAK,QAAQ;YACzD,OAAQ,CAAoB,CAAC,QAAQ,KAAK,QAAQ;YAClD,OAAQ,CAAoB,CAAC,MAAM,KAAK,QAAQ;YAChD,OAAO,KAAK,CAAC;QACf,OAAO,UAAU,KAAK,SAAS,IAAI,CAChC,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,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACrH,EAAE,MAAM,CAAC;AACb,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAClC,QAAoD,EACpD,UAAkB,EAClB,UAAoC;IAEpC,MAAM,SAAS,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAC7D,CAAC,CAAC,UAAU,KAAK,UAAU;QAC3B,CAAC,CAAC,eAAe,KAAK,UAAU,CAAC,eAAe;QAChD,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,QAAQ,CACnC,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * Pool-adjustment domain logic (IND-419) — pure functions, no I/O.\n *\n * When a user answers a pool_discovery question, every candidate the mining\n * pass assigned to a side gets a multiplicative adjustment written to\n * `opportunities.metadata.poolAdjustments`. The home feed (flag-gated) orders\n * by `confidence × Π factor`, floored so demoted candidates stay visible.\n *\n * Invariants:\n * - Deterministic and O(pool): no LLM at answer time — the applyPlan was\n * computed (and evidence-verified) at mining time.\n * - Reversible: entries are keyed by questionId; re-answering replaces them,\n * dismissal-driven reversal removes them.\n * - `detail` carries the template chip text built from the user's OWN answer\n * (\"Hands-on builders vs advisors: you chose Advisor\") — never LLM\n * reasoning (opportunity-presentation-safety).\n */\nimport { POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR } from \"./discriminator.env.js\";\nimport type { QuestionPoolDiscriminator } from \"../../shared/schemas/question.schema.js\";\n\n/** Recipient and intent provenance that scopes one pool preference. */\nexport interface PoolAdjustmentProvenance {\n recipientUserId: string;\n intentId: string;\n}\n\n/** One applied adjustment on an opportunity (stored in metadata.poolAdjustments). */\nexport interface PoolAdjustment extends PoolAdjustmentProvenance {\n /** The answered question that produced this adjustment (reversal key). */\n questionId: string;\n /** Discriminator label, e.g. \"Hands-on builders vs advisors\". */\n label: string;\n /** Side this candidate was assigned to (or \"unknown\"). */\n side: string;\n /** Multiplicative factor: chosen 1.0, other 0.6, unknown 0.9. */\n factor: number;\n /** Template chip text from the user's own answer. Set on demotions only. */\n detail?: string;\n /** ISO-8601 apply timestamp. */\n appliedAt: string;\n}\n\n/** Reads valid adjustments, optionally narrowed to one recipient + intent. */\nexport function readPoolAdjustments(\n metadata: Record<string, unknown> | null | undefined,\n provenance?: PoolAdjustmentProvenance,\n): PoolAdjustment[] {\n const raw = metadata?.poolAdjustments;\n if (!Array.isArray(raw)) return [];\n return raw.filter((a): a is PoolAdjustment => {\n if (\n typeof a !== \"object\" || a === null ||\n typeof (a as PoolAdjustment).questionId !== \"string\" ||\n typeof (a as PoolAdjustment).recipientUserId !== \"string\" ||\n typeof (a as PoolAdjustment).intentId !== \"string\" ||\n typeof (a as PoolAdjustment).factor !== \"number\"\n ) return false;\n return provenance === undefined || (\n (a as PoolAdjustment).recipientUserId === provenance.recipientUserId &&\n (a as PoolAdjustment).intentId === provenance.intentId\n );\n });\n}\n\n/**\n * Cumulative adjustment multiplier for an opportunity, floored at\n * {@link POOL_ADJUSTMENT_FLOOR}. 1 when no scoped adjustments exist.\n */\nexport function poolAdjustmentMultiplier(\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): number {\n const adjustments = readPoolAdjustments(metadata, provenance);\n if (adjustments.length === 0) return 1;\n const product = adjustments.reduce((acc, a) => acc * (Number.isFinite(a.factor) && a.factor > 0 ? a.factor : 1), 1);\n return Math.max(POOL_ADJUSTMENT_FLOOR, product);\n}\n\n/** Adjusted confidence: `confidence × Π factor`, floored. */\nexport function adjustedConfidence(\n confidence: number,\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): number {\n return confidence * poolAdjustmentMultiplier(metadata, provenance);\n}\n\n/** Deterministic provenance signal stored alongside one adjustment. */\nexport interface PoolAdjustmentSignal extends PoolAdjustmentProvenance {\n type: \"pool_discriminator\";\n weight: 1 | -1 | 0;\n detail: string;\n questionId: string;\n}\n\n/** Pure helper input shared by Tier-0 answers and newborn stamping. */\nexport interface BuildPoolAdjustmentInput extends PoolAdjustmentProvenance {\n questionId: string;\n label: string;\n /** Verified side assignment, or null when the candidate is unassigned. */\n assignedSide: string | null;\n chosenSide: string;\n appliedAt: string;\n}\n\n/**\n * Build one P3-compatible adjustment and signal. This is the only place that\n * defines chosen/other/unknown factors, weights, and safe template details.\n */\nexport function buildPoolAdjustment(input: BuildPoolAdjustmentInput): {\n adjustment: PoolAdjustment;\n signal: PoolAdjustmentSignal;\n} {\n const isUnknown = input.assignedSide === null;\n const isChosen = !isUnknown && input.assignedSide === input.chosenSide;\n const factor = isUnknown ? POOL_ADJUSTMENT_FACTOR_UNKNOWN : isChosen ? 1 : POOL_ADJUSTMENT_FACTOR_OTHER;\n const weight = isUnknown ? 0 : isChosen ? 1 : -1;\n const side = input.assignedSide ?? \"unknown\";\n return {\n adjustment: {\n questionId: input.questionId,\n recipientUserId: input.recipientUserId,\n intentId: input.intentId,\n label: input.label,\n side,\n factor,\n ...(!isChosen && !isUnknown ? { detail: `${input.label}: you chose ${input.chosenSide}` } : {}),\n appliedAt: input.appliedAt,\n },\n signal: {\n type: \"pool_discriminator\",\n weight,\n recipientUserId: input.recipientUserId,\n intentId: input.intentId,\n detail: isUnknown ? `${input.label}: unassigned` : `${input.label}: ${input.chosenSide}`,\n questionId: input.questionId,\n },\n };\n}\n\n/** Plan entry: what to write on one opportunity for one answer. */\nexport interface PoolAdjustmentPlanEntry {\n opportunityId: string;\n adjustment: PoolAdjustment;\n signal: PoolAdjustmentSignal;\n}\n\n/**\n * Computes the write plan for one answered discriminator. Pure: the caller\n * loads/patches rows. \"Both matter\" (or any label not in `sides`) yields an\n * empty plan — no preference, no adjustments.\n *\n * @param discriminator The asked discriminator (from detection.pool).\n * @param chosenSide The selected option label (chip label = side label).\n * @param questionId Reversal key.\n * @param recipientUserId User whose answer produced the preference.\n * @param intentId Intent whose candidate pool was ranked.\n * @param now ISO-8601 timestamp.\n */\nexport function planPoolAdjustments(\n discriminator: QuestionPoolDiscriminator,\n chosenSide: string,\n questionId: string,\n recipientUserId: string,\n intentId: string,\n now: string,\n): PoolAdjustmentPlanEntry[] {\n // Chip labels are word-capped side labels; match on the capped prefix too.\n const matchesSide = (side: string): boolean =>\n side === chosenSide || side.startsWith(chosenSide) || chosenSide.startsWith(side);\n const chosen = discriminator.sides.find(matchesSide);\n if (!chosen) return []; // \"Both matter\" or unrecognized option → no adjustments.\n\n const plan: PoolAdjustmentPlanEntry[] = [];\n for (const a of discriminator.assignments) {\n plan.push({\n opportunityId: a.opportunityId,\n ...buildPoolAdjustment({\n questionId,\n recipientUserId,\n intentId,\n label: discriminator.label,\n assignedSide: a.side,\n chosenSide: chosen,\n appliedAt: now,\n }),\n });\n }\n return plan;\n}\n\n/**\n * Merges one adjustment into an opportunity's existing metadata, replacing\n * only the entry for the same question + recipient + intent provenance.\n * Returns the NEW metadata object (caller persists it wholesale).\n */\nexport function mergePoolAdjustment(\n metadata: Record<string, unknown> | null | undefined,\n adjustment: PoolAdjustment,\n): Record<string, unknown> {\n const existing = readPoolAdjustments(metadata).filter((a) => !(\n a.questionId === adjustment.questionId &&\n a.recipientUserId === adjustment.recipientUserId &&\n a.intentId === adjustment.intentId\n ));\n return { ...(metadata ?? {}), poolAdjustments: [...existing, adjustment] };\n}\n\n/** Latest scoped user-explainable demotion detail for card presentation. */\nexport function latestPoolDemotionDetail(\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): string | undefined {\n return [...readPoolAdjustments(metadata, provenance)]\n .reverse()\n .find((adjustment) => adjustment.factor < 1 && typeof adjustment.detail === 'string' && adjustment.detail.length > 0)\n ?.detail;\n}\n\n/** Removes one question adjustment for exact recipient + intent provenance. */\nexport function removePoolAdjustment(\n metadata: Record<string, unknown> | null | undefined,\n questionId: string,\n provenance: PoolAdjustmentProvenance,\n): Record<string, unknown> {\n const remaining = readPoolAdjustments(metadata).filter((a) => !(\n a.questionId === questionId &&\n a.recipientUserId === provenance.recipientUserId &&\n a.intentId === provenance.intentId\n ));\n return { ...(metadata ?? {}), poolAdjustments: remaining };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discriminator.adjustments.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.adjustments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AA6B7H,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CACjC,QAAoD,EACpD,UAAqC;IAErC,MAAM,GAAG,GAAG,QAAQ,EAAE,eAAe,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAuB,EAAE;QAC3C,IACE,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;YACnC,OAAQ,CAAoB,CAAC,UAAU,KAAK,QAAQ;YACpD,OAAQ,CAAoB,CAAC,eAAe,KAAK,QAAQ;YACzD,OAAQ,CAAoB,CAAC,QAAQ,KAAK,QAAQ;YAClD,OAAQ,CAAoB,CAAC,MAAM,KAAK,QAAQ;YAChD,CAAE,CAAoB,CAAC,KAAK,KAAK,SAAS,IAAK,CAAoB,CAAC,KAAK,KAAK,IAAI,CAAC;YACnF,OAAO,KAAK,CAAC;QACf,OAAO,UAAU,KAAK,SAAS,IAAI,CACh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EAAE,EAAE,CAAC,CAAC,CAC5D,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,UAAU;QACtC,CAAC,CAAC,eAAe,KAAK,UAAU,CAAC,eAAe;QAChD,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,QAAQ,CACnC,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,GAAG,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC;AAC7E,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,wBAAwB,CACtC,QAAoD,EACpD,UAAoC;IAEpC,OAAO,CAAC,GAAG,yBAAyB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SACxD,OAAO,EAAE;SACT,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACrH,EAAE,MAAM,CAAC;AACb,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAClC,QAAoD,EACpD,UAAkB,EAClB,UAAoC;IAEpC,MAAM,SAAS,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAC7D,CAAC,CAAC,UAAU,KAAK,UAAU;QAC3B,CAAC,CAAC,eAAe,KAAK,UAAU,CAAC,eAAe;QAChD,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,QAAQ,CACnC,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * Pool-adjustment domain logic (IND-419) — pure functions, no I/O.\n *\n * When a user answers a pool_discovery question, every candidate the mining\n * pass assigned to a side gets a multiplicative adjustment written to\n * `opportunities.metadata.poolAdjustments`. The home feed (flag-gated) orders\n * by `confidence × Π factor`, floored so demoted candidates stay visible.\n *\n * Invariants:\n * - Deterministic and O(pool): no LLM at answer time — the applyPlan was\n * computed (and evidence-verified) at mining time.\n * - Reversible: entries are keyed by questionId; re-answering replaces them,\n * dismissal-driven reversal removes them.\n * - `detail` carries the template chip text built from the user's OWN answer\n * (\"Hands-on builders vs advisors: you chose Advisor\") — never LLM\n * reasoning (opportunity-presentation-safety).\n */\nimport { POOL_ADJUSTMENT_FACTOR_OTHER, POOL_ADJUSTMENT_FACTOR_UNKNOWN, POOL_ADJUSTMENT_FLOOR } from \"./discriminator.env.js\";\nimport type { QuestionPoolDiscriminator } from \"../../shared/schemas/question.schema.js\";\n\n/** Recipient and intent provenance that scopes one pool preference. */\nexport interface PoolAdjustmentProvenance {\n recipientUserId: string;\n intentId: string;\n}\n\n/** One applied adjustment on an opportunity (stored in metadata.poolAdjustments). */\nexport interface PoolAdjustment extends PoolAdjustmentProvenance {\n /** The answered question that produced this adjustment (reversal key). */\n questionId: string;\n /** Discriminator label, e.g. \"Hands-on builders vs advisors\". */\n label: string;\n /** Side this candidate was assigned to (or \"unknown\"). */\n side: string;\n /** Multiplicative factor: chosen 1.0, other 0.6, unknown 0.9. */\n factor: number;\n /** Template chip text from the user's own answer. Set on demotions only. */\n detail?: string;\n /** ISO-8601 apply timestamp. */\n appliedAt: string;\n /** Full intent fingerprint authoritative when this adjustment was created. */\n intentFingerprint?: string;\n /** Audit-only marker: stale adjustments remain stored but have no ranking effect. */\n stale?: true;\n}\n\n/** Reads valid adjustments, optionally narrowed to one recipient + intent. */\nexport function readPoolAdjustments(\n metadata: Record<string, unknown> | null | undefined,\n provenance?: PoolAdjustmentProvenance,\n): PoolAdjustment[] {\n const raw = metadata?.poolAdjustments;\n if (!Array.isArray(raw)) return [];\n return raw.filter((a): a is PoolAdjustment => {\n if (\n typeof a !== \"object\" || a === null ||\n typeof (a as PoolAdjustment).questionId !== \"string\" ||\n typeof (a as PoolAdjustment).recipientUserId !== \"string\" ||\n typeof (a as PoolAdjustment).intentId !== \"string\" ||\n typeof (a as PoolAdjustment).factor !== \"number\" ||\n ((a as PoolAdjustment).stale !== undefined && (a as PoolAdjustment).stale !== true)\n ) return false;\n return provenance === undefined || (\n (a as PoolAdjustment).recipientUserId === provenance.recipientUserId &&\n (a as PoolAdjustment).intentId === provenance.intentId\n );\n });\n}\n\n/** Reads valid, non-stale adjustments for ranking and presentation behavior. */\nexport function readActivePoolAdjustments(\n metadata: Record<string, unknown> | null | undefined,\n provenance?: PoolAdjustmentProvenance,\n): PoolAdjustment[] {\n return readPoolAdjustments(metadata, provenance).filter((adjustment) => adjustment.stale !== true);\n}\n\n/**\n * Cumulative adjustment multiplier for an opportunity, floored at\n * {@link POOL_ADJUSTMENT_FLOOR}. 1 when no scoped adjustments exist.\n */\nexport function poolAdjustmentMultiplier(\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): number {\n const adjustments = readActivePoolAdjustments(metadata, provenance);\n if (adjustments.length === 0) return 1;\n const product = adjustments.reduce((acc, a) => acc * (Number.isFinite(a.factor) && a.factor > 0 ? a.factor : 1), 1);\n return Math.max(POOL_ADJUSTMENT_FLOOR, product);\n}\n\n/** Adjusted confidence: `confidence × Π factor`, floored. */\nexport function adjustedConfidence(\n confidence: number,\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): number {\n return confidence * poolAdjustmentMultiplier(metadata, provenance);\n}\n\n/** Deterministic provenance signal stored alongside one adjustment. */\nexport interface PoolAdjustmentSignal extends PoolAdjustmentProvenance {\n type: \"pool_discriminator\";\n weight: 1 | -1 | 0;\n detail: string;\n questionId: string;\n}\n\n/** Pure helper input shared by Tier-0 answers and newborn stamping. */\nexport interface BuildPoolAdjustmentInput extends PoolAdjustmentProvenance {\n questionId: string;\n label: string;\n /** Verified side assignment, or null when the candidate is unassigned. */\n assignedSide: string | null;\n chosenSide: string;\n appliedAt: string;\n /** Full intent fingerprint authoritative when this adjustment was created. */\n intentFingerprint?: string;\n}\n\n/**\n * Build one P3-compatible adjustment and signal. This is the only place that\n * defines chosen/other/unknown factors, weights, and safe template details.\n */\nexport function buildPoolAdjustment(input: BuildPoolAdjustmentInput): {\n adjustment: PoolAdjustment;\n signal: PoolAdjustmentSignal;\n} {\n const isUnknown = input.assignedSide === null;\n const isChosen = !isUnknown && input.assignedSide === input.chosenSide;\n const factor = isUnknown ? POOL_ADJUSTMENT_FACTOR_UNKNOWN : isChosen ? 1 : POOL_ADJUSTMENT_FACTOR_OTHER;\n const weight = isUnknown ? 0 : isChosen ? 1 : -1;\n const side = input.assignedSide ?? \"unknown\";\n return {\n adjustment: {\n questionId: input.questionId,\n recipientUserId: input.recipientUserId,\n intentId: input.intentId,\n label: input.label,\n side,\n factor,\n ...(!isChosen && !isUnknown ? { detail: `${input.label}: you chose ${input.chosenSide}` } : {}),\n appliedAt: input.appliedAt,\n ...(input.intentFingerprint !== undefined ? { intentFingerprint: input.intentFingerprint } : {}),\n },\n signal: {\n type: \"pool_discriminator\",\n weight,\n recipientUserId: input.recipientUserId,\n intentId: input.intentId,\n detail: isUnknown ? `${input.label}: unassigned` : `${input.label}: ${input.chosenSide}`,\n questionId: input.questionId,\n },\n };\n}\n\n/** Plan entry: what to write on one opportunity for one answer. */\nexport interface PoolAdjustmentPlanEntry {\n opportunityId: string;\n adjustment: PoolAdjustment;\n signal: PoolAdjustmentSignal;\n}\n\n/**\n * Computes the write plan for one answered discriminator. Pure: the caller\n * loads/patches rows. \"Both matter\" (or any label not in `sides`) yields an\n * empty plan — no preference, no adjustments.\n *\n * @param discriminator The asked discriminator (from detection.pool).\n * @param chosenSide The selected option label (chip label = side label).\n * @param questionId Reversal key.\n * @param recipientUserId User whose answer produced the preference.\n * @param intentId Intent whose candidate pool was ranked.\n * @param now ISO-8601 timestamp.\n * @param intentFingerprint Full intent fingerprint authoritative at apply time.\n */\nexport function planPoolAdjustments(\n discriminator: QuestionPoolDiscriminator,\n chosenSide: string,\n questionId: string,\n recipientUserId: string,\n intentId: string,\n now: string,\n intentFingerprint?: string,\n): PoolAdjustmentPlanEntry[] {\n // Chip labels are word-capped side labels; match on the capped prefix too.\n const matchesSide = (side: string): boolean =>\n side === chosenSide || side.startsWith(chosenSide) || chosenSide.startsWith(side);\n const chosen = discriminator.sides.find(matchesSide);\n if (!chosen) return []; // \"Both matter\" or unrecognized option → no adjustments.\n\n const plan: PoolAdjustmentPlanEntry[] = [];\n for (const a of discriminator.assignments) {\n plan.push({\n opportunityId: a.opportunityId,\n ...buildPoolAdjustment({\n questionId,\n recipientUserId,\n intentId,\n label: discriminator.label,\n assignedSide: a.side,\n chosenSide: chosen,\n appliedAt: now,\n ...(intentFingerprint !== undefined ? { intentFingerprint } : {}),\n }),\n });\n }\n return plan;\n}\n\n/**\n * Merges one adjustment into an opportunity's existing metadata, replacing\n * only the entry for the same question + recipient + intent provenance.\n * Returns the NEW metadata object (caller persists it wholesale).\n */\nexport function mergePoolAdjustment(\n metadata: Record<string, unknown> | null | undefined,\n adjustment: PoolAdjustment,\n): Record<string, unknown> {\n const existing = readPoolAdjustments(metadata).filter((a) => !(\n a.questionId === adjustment.questionId &&\n a.recipientUserId === adjustment.recipientUserId &&\n a.intentId === adjustment.intentId\n ));\n return { ...(metadata ?? {}), poolAdjustments: [...existing, adjustment] };\n}\n\n/** Latest scoped user-explainable demotion detail for card presentation. */\nexport function latestPoolDemotionDetail(\n metadata: Record<string, unknown> | null | undefined,\n provenance: PoolAdjustmentProvenance,\n): string | undefined {\n return [...readActivePoolAdjustments(metadata, provenance)]\n .reverse()\n .find((adjustment) => adjustment.factor < 1 && typeof adjustment.detail === 'string' && adjustment.detail.length > 0)\n ?.detail;\n}\n\n/** Removes one question adjustment for exact recipient + intent provenance. */\nexport function removePoolAdjustment(\n metadata: Record<string, unknown> | null | undefined,\n questionId: string,\n provenance: PoolAdjustmentProvenance,\n): Record<string, unknown> {\n const remaining = readPoolAdjustments(metadata).filter((a) => !(\n a.questionId === questionId &&\n a.recipientUserId === provenance.recipientUserId &&\n a.intentId === provenance.intentId\n ));\n return { ...(metadata ?? {}), poolAdjustments: remaining };\n}\n"]}
|
|
@@ -31,6 +31,8 @@ export interface SynthesizePoolQuestionInput {
|
|
|
31
31
|
/** Remaining ranked eligible discriminators (interview-mode chain stash). */
|
|
32
32
|
alternates: QuestionPoolDiscriminator[];
|
|
33
33
|
poolSize: number;
|
|
34
|
+
/** Exact bounded candidate opportunity IDs supplied to this synthesis pass. */
|
|
35
|
+
opportunityIds: string[];
|
|
34
36
|
/** ISO-8601 timestamp of the mining pass. */
|
|
35
37
|
minedAt: string;
|
|
36
38
|
/** Discovery run id, when known. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminator.question.d.ts","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.question.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAkB,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAEzI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAQ/C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,mBAAmB,GAAG,yBAAyB,CAqBzF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,cAAc,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAIzG;AAkED,wCAAwC;AACxC,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,aAAa,EAAE,yBAAyB,CAAC;IACzC,6EAA6E;IAC7E,UAAU,EAAE,yBAAyB,EAAE,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,uBAAuB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"discriminator.question.d.ts","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.question.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAkB,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAEzI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAQ/C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,mBAAmB,GAAG,yBAAyB,CAqBzF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,cAAc,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAIzG;AAkED,wCAAwC;AACxC,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,aAAa,EAAE,yBAAyB,CAAC;IACzC,6EAA6E;IAC7E,UAAU,EAAE,yBAAyB,EAAE,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,uBAAuB,GAAG,IAAI,CA2CzG"}
|
|
@@ -143,6 +143,7 @@ export function synthesizePoolQuestion(input) {
|
|
|
143
143
|
},
|
|
144
144
|
pool: {
|
|
145
145
|
poolSize,
|
|
146
|
+
opportunityIds: [...input.opportunityIds],
|
|
146
147
|
minedAt: input.minedAt,
|
|
147
148
|
...(input.runId ? { runId: input.runId } : {}),
|
|
148
149
|
...(snippet.length > 0 ? { intentText: snippet.slice(0, 160) } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminator.question.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.question.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGpK,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE/C,mFAAmF;AACnF,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,sDAAsD;AACtD,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,CAAsB;IAC5D,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,KAAK;QAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,WAAW,GAAmD,EAAE,CAAC;IACvE,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI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C,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClF,aAAa,EAAE,CAAC;YAChB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Deterministic pool_discovery question synthesis (IND-418).\n *\n * A mined discriminator already carries everything a question needs: a label,\n * a question seed, 2–3 sides, and verified per-candidate assignments. This\n * module turns the top discriminator into a `Question` payload + server-side\n * pool snapshot with ZERO generation-time LLM calls — the phrasing was\n * produced (and evidence-verified) at mining time, so synthesis is pure,\n * auditable, and cheap to re-run for interview-mode chaining.\n */\nimport type { Question, QuestionOption, QuestionPoolDiscriminator, QuestionPoolSnapshot } from \"../../shared/schemas/question.schema.js\";\nimport { POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MIN_VOI } from \"./discriminator.env.js\";\nimport type { ScoredDiscriminator } from \"./discriminator.types.js\";\n\n/** Fixed option appended to every pool question — the no-preference escape. */\nexport const BOTH_MATTER_LABEL = \"Both matter\";\n\n/** Max words in a chip-style option label (prototype voice: terse, glanceable). */\nconst MAX_LABEL_WORDS = 5;\n\n/** Question title (≤12 chars, per QuestionSchema). */\nconst POOL_QUESTION_TITLE = \"Matches\";\n\n/**\n * Converts a scored discriminator into the compact snapshot form stored on\n * the question row (verified assignments only; unknowns dropped).\n */\nexport function toQuestionDiscriminator(d: ScoredDiscriminator): QuestionPoolDiscriminator {\n const sideCounts: Record<string, number> = {};\n for (const side of d.sides) sideCounts[side] = 0;\n const assignments: Array<{ opportunityId: string; side: string }> = [];\n for (const a of d.assignments) {\n if (a.side === null || !a.verified) continue;\n if (!(a.side in sideCounts)) continue;\n sideCounts[a.side] += 1;\n assignments.push({ opportunityId: a.id, side: a.side });\n }\n return {\n label: d.label,\n questionSeed: d.questionSeed,\n sides: d.sides,\n sideCounts,\n voi: d.voi,\n evidenceRate: d.evidenceRate,\n ...(d.embedding ? { embedding: d.embedding } : {}),\n ...(d.embeddingModel ? { embeddingModel: d.embeddingModel } : {}),\n assignments,\n };\n}\n\n/**\n * Filters a mining pass down to question-eligible discriminators:\n * VoI ≥ {@link POOL_QUESTION_MIN_VOI}, evidenceRate ≥\n * {@link POOL_QUESTION_MIN_EVIDENCE_RATE}, capped at\n * {@link POOL_QUESTION_MAX_DISCRIMINATORS}. Input is already VoI-sorted.\n */\nexport function selectQuestionDiscriminators(discriminators: ScoredDiscriminator[]): ScoredDiscriminator[] {\n return discriminators\n .filter((d) => d.voi >= POOL_QUESTION_MIN_VOI && d.evidenceRate >= POOL_QUESTION_MIN_EVIDENCE_RATE)\n .slice(0, POOL_QUESTION_MAX_DISCRIMINATORS);\n}\n\n/** Truncates a side label to the chip word budget. */\nfunction chipLabel(side: string): string {\n const words = side.trim().split(/\\s+/);\n return words.slice(0, MAX_LABEL_WORDS).join(\" \");\n}\n\n/**\n * Miner seeds are sometimes written from the intent owner's POV (\"Do I\n * prefer…\"). The question is asked TO the owner, so normalize to second\n * person. Conservative verb-pair map + bare pronoun/possessive swaps.\n */\nfunction toSecondPerson(seed: string): string {\n return seed\n .replace(/\\b(do|should|would|could|can|will) I\\b/gi, (_, verb: string) => `${verb.toLowerCase()} you`)\n .replace(/\\bam I\\b/gi, \"are you\")\n .replace(/\\bI\\b/g, \"you\")\n .replace(/\\bmy\\b/gi, \"your\")\n // Third-person seeds (\"Is the user primarily involved…\") — the question is\n // asked TO the owner, never ABOUT them.\n .replace(/\\b(is|was) (?:the|this) (user|owner|discoverer|client)\\b/gi, \"are you\")\n .replace(/\\bdoes (?:the|this) (user|owner|discoverer|client)\\b/gi, \"do you\")\n .replace(/\\b(?:the|this) (user|owner|discoverer|client)'s\\b/gi, \"your\")\n .replace(/\\b(?:the|this) (user|owner|discoverer|client)\\b/gi, \"you\");\n}\n\n/**\n * Catch-all: after normalization the prompt must be second-person. Any\n * residual third-person reference to the owner means an unanticipated seed\n * shape slipped through — the deterministic two-sided template (always\n * second-person) is the safe fallback.\n */\nfunction isStillThirdPerson(prompt: string): boolean {\n return /\\b(?:the|this|a) (?:user|owner|discoverer|client)\\b/i.test(prompt);\n}\n\n/**\n * A good discriminator prompt names BOTH sides so the chips read as a real\n * choice. When the seed mentions fewer than two sides (e.g. \"Do you prefer\n * hands-on prototyping?\"), fall back to a deterministic two-sided template.\n */\nfunction mentionsSide(seed: string, side: string): boolean {\n const lowerSeed = seed.toLowerCase();\n return side\n .toLowerCase()\n .split(/[^a-z0-9-]+/)\n .filter((w) => w.length > 3)\n .some((w) => lowerSeed.includes(w));\n}\n\n/** Ensures the prompt reads as one second-person, two-sided question. */\nfunction toPrompt(questionSeed: string, sides: string[]): string {\n let p = toSecondPerson(questionSeed.trim().replace(/\\s+/g, \" \"));\n const sidesMentioned = sides.filter((s) => mentionsSide(p, s)).length;\n if (sidesMentioned < 2 || isStillThirdPerson(p)) {\n const last = sides[sides.length - 1];\n const head = sides.slice(0, -1).join(\", \");\n p = `Which matters more here: ${head} or ${last}`;\n }\n // Sentence-case the first character (template + normalization can lowercase it).\n p = p.charAt(0).toUpperCase() + p.slice(1);\n if (!/[?]$/.test(p)) p = p.replace(/[.!]+$/, \"\") + \"?\";\n return p.slice(0, 400);\n}\n\n/** Input for one question synthesis. */\nexport interface SynthesizePoolQuestionInput {\n /** The discriminator to ask about (already eligibility-filtered). */\n discriminator: QuestionPoolDiscriminator;\n /** Remaining ranked eligible discriminators (interview-mode chain stash). */\n alternates: QuestionPoolDiscriminator[];\n poolSize: number;\n /** ISO-8601 timestamp of the mining pass. */\n minedAt: string;\n /** Discovery run id, when known. */\n runId?: string;\n /**\n * Intent payload snippet — folded into the evidence chip so the question\n * self-identifies on any surface (\"based on 16 people matching ‘…’\").\n */\n intentText?: string;\n /** Stable hash of the full normalized intent payload + summary. */\n intentFingerprint?: string;\n}\n\n/** Synthesized question: client payload + server-side snapshot. */\nexport interface SynthesizedPoolQuestion {\n payload: Question;\n pool: QuestionPoolSnapshot;\n}\n\n/**\n * Builds the pool_discovery question. Returns null when the pool is below\n * the k-anonymity floor or the discriminator shape is unusable (guards are\n * duplicated here so no caller can bypass them).\n */\nexport function synthesizePoolQuestion(input: SynthesizePoolQuestionInput): SynthesizedPoolQuestion | null {\n const { discriminator: d, poolSize } = input;\n if (poolSize < POOL_DISCRIMINATOR_MIN_POOL_SIZE) return null;\n if (d.sides.length < 2 || d.sides.length > 3) return null;\n\n // Evidence chip: aggregate count + the intent it belongs to, so the card is\n // self-identifying on every surface (QuestionSchema caps evidence at 160).\n const snippet = input.intentText?.trim().replace(/\\s+/g, \" \") ?? \"\";\n const evidence = snippet.length > 0\n ? `based on ${poolSize} people matching “${snippet.slice(0, 110)}${snippet.length > 110 ? \"…\" : \"\"}”`\n : `based on ${poolSize} people matching this intent`;\n\n const sideOptions: QuestionOption[] = d.sides.map((side) => ({\n label: chipLabel(side),\n description: `${d.sideCounts[side] ?? 0} of your ${poolSize} current matches lean this way`,\n }));\n const options: QuestionOption[] = [\n ...sideOptions,\n {\n label: BOTH_MATTER_LABEL,\n description: \"No preference — keep the current ranking\",\n },\n ];\n\n return {\n payload: {\n title: POOL_QUESTION_TITLE,\n prompt: toPrompt(d.questionSeed, d.sides),\n options,\n multiSelect: false,\n evidence,\n },\n pool: {\n poolSize,\n minedAt: input.minedAt,\n ...(input.runId ? { runId: input.runId } : {}),\n ...(snippet.length > 0 ? { intentText: snippet.slice(0, 160) } : {}),\n ...(input.intentFingerprint ? { intentFingerprint: input.intentFingerprint } : {}),\n discriminator: d,\n alternates: input.alternates,\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discriminator.question.js","sourceRoot":"/","sources":["opportunity/discriminator/discriminator.question.ts"],"names":[],"mappings":"AA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MAAM,OAAO,GAAqB;QAChC,GAAG,WAAW;QACd;YACE,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,0CAA0C;SACxD;KACF,CAAC;IAEF,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC;YACzC,OAAO;YACP,WAAW,EAAE,KAAK;YAClB,QAAQ;SACT;QACD,IAAI,EAAE;YACJ,QAAQ;YACR,cAAc,EAAE,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;YACzC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClF,aAAa,EAAE,CAAC;YAChB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Deterministic pool_discovery question synthesis (IND-418).\n *\n * A mined discriminator already carries everything a question needs: a label,\n * a question seed, 2–3 sides, and verified per-candidate assignments. This\n * module turns the top discriminator into a `Question` payload + server-side\n * pool snapshot with ZERO generation-time LLM calls — the phrasing was\n * produced (and evidence-verified) at mining time, so synthesis is pure,\n * auditable, and cheap to re-run for interview-mode chaining.\n */\nimport type { Question, QuestionOption, QuestionPoolDiscriminator, QuestionPoolSnapshot } from \"../../shared/schemas/question.schema.js\";\nimport { POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_QUESTION_MAX_DISCRIMINATORS, POOL_QUESTION_MIN_EVIDENCE_RATE, POOL_QUESTION_MIN_VOI } from \"./discriminator.env.js\";\nimport type { ScoredDiscriminator } from \"./discriminator.types.js\";\n\n/** Fixed option appended to every pool question — the no-preference escape. */\nexport const BOTH_MATTER_LABEL = \"Both matter\";\n\n/** Max words in a chip-style option label (prototype voice: terse, glanceable). */\nconst MAX_LABEL_WORDS = 5;\n\n/** Question title (≤12 chars, per QuestionSchema). */\nconst POOL_QUESTION_TITLE = \"Matches\";\n\n/**\n * Converts a scored discriminator into the compact snapshot form stored on\n * the question row (verified assignments only; unknowns dropped).\n */\nexport function toQuestionDiscriminator(d: ScoredDiscriminator): QuestionPoolDiscriminator {\n const sideCounts: Record<string, number> = {};\n for (const side of d.sides) sideCounts[side] = 0;\n const assignments: Array<{ opportunityId: string; side: string }> = [];\n for (const a of d.assignments) {\n if (a.side === null || !a.verified) continue;\n if (!(a.side in sideCounts)) continue;\n sideCounts[a.side] += 1;\n assignments.push({ opportunityId: a.id, side: a.side });\n }\n return {\n label: d.label,\n questionSeed: d.questionSeed,\n sides: d.sides,\n sideCounts,\n voi: d.voi,\n evidenceRate: d.evidenceRate,\n ...(d.embedding ? { embedding: d.embedding } : {}),\n ...(d.embeddingModel ? { embeddingModel: d.embeddingModel } : {}),\n assignments,\n };\n}\n\n/**\n * Filters a mining pass down to question-eligible discriminators:\n * VoI ≥ {@link POOL_QUESTION_MIN_VOI}, evidenceRate ≥\n * {@link POOL_QUESTION_MIN_EVIDENCE_RATE}, capped at\n * {@link POOL_QUESTION_MAX_DISCRIMINATORS}. Input is already VoI-sorted.\n */\nexport function selectQuestionDiscriminators(discriminators: ScoredDiscriminator[]): ScoredDiscriminator[] {\n return discriminators\n .filter((d) => d.voi >= POOL_QUESTION_MIN_VOI && d.evidenceRate >= POOL_QUESTION_MIN_EVIDENCE_RATE)\n .slice(0, POOL_QUESTION_MAX_DISCRIMINATORS);\n}\n\n/** Truncates a side label to the chip word budget. */\nfunction chipLabel(side: string): string {\n const words = side.trim().split(/\\s+/);\n return words.slice(0, MAX_LABEL_WORDS).join(\" \");\n}\n\n/**\n * Miner seeds are sometimes written from the intent owner's POV (\"Do I\n * prefer…\"). The question is asked TO the owner, so normalize to second\n * person. Conservative verb-pair map + bare pronoun/possessive swaps.\n */\nfunction toSecondPerson(seed: string): string {\n return seed\n .replace(/\\b(do|should|would|could|can|will) I\\b/gi, (_, verb: string) => `${verb.toLowerCase()} you`)\n .replace(/\\bam I\\b/gi, \"are you\")\n .replace(/\\bI\\b/g, \"you\")\n .replace(/\\bmy\\b/gi, \"your\")\n // Third-person seeds (\"Is the user primarily involved…\") — the question is\n // asked TO the owner, never ABOUT them.\n .replace(/\\b(is|was) (?:the|this) (user|owner|discoverer|client)\\b/gi, \"are you\")\n .replace(/\\bdoes (?:the|this) (user|owner|discoverer|client)\\b/gi, \"do you\")\n .replace(/\\b(?:the|this) (user|owner|discoverer|client)'s\\b/gi, \"your\")\n .replace(/\\b(?:the|this) (user|owner|discoverer|client)\\b/gi, \"you\");\n}\n\n/**\n * Catch-all: after normalization the prompt must be second-person. Any\n * residual third-person reference to the owner means an unanticipated seed\n * shape slipped through — the deterministic two-sided template (always\n * second-person) is the safe fallback.\n */\nfunction isStillThirdPerson(prompt: string): boolean {\n return /\\b(?:the|this|a) (?:user|owner|discoverer|client)\\b/i.test(prompt);\n}\n\n/**\n * A good discriminator prompt names BOTH sides so the chips read as a real\n * choice. When the seed mentions fewer than two sides (e.g. \"Do you prefer\n * hands-on prototyping?\"), fall back to a deterministic two-sided template.\n */\nfunction mentionsSide(seed: string, side: string): boolean {\n const lowerSeed = seed.toLowerCase();\n return side\n .toLowerCase()\n .split(/[^a-z0-9-]+/)\n .filter((w) => w.length > 3)\n .some((w) => lowerSeed.includes(w));\n}\n\n/** Ensures the prompt reads as one second-person, two-sided question. */\nfunction toPrompt(questionSeed: string, sides: string[]): string {\n let p = toSecondPerson(questionSeed.trim().replace(/\\s+/g, \" \"));\n const sidesMentioned = sides.filter((s) => mentionsSide(p, s)).length;\n if (sidesMentioned < 2 || isStillThirdPerson(p)) {\n const last = sides[sides.length - 1];\n const head = sides.slice(0, -1).join(\", \");\n p = `Which matters more here: ${head} or ${last}`;\n }\n // Sentence-case the first character (template + normalization can lowercase it).\n p = p.charAt(0).toUpperCase() + p.slice(1);\n if (!/[?]$/.test(p)) p = p.replace(/[.!]+$/, \"\") + \"?\";\n return p.slice(0, 400);\n}\n\n/** Input for one question synthesis. */\nexport interface SynthesizePoolQuestionInput {\n /** The discriminator to ask about (already eligibility-filtered). */\n discriminator: QuestionPoolDiscriminator;\n /** Remaining ranked eligible discriminators (interview-mode chain stash). */\n alternates: QuestionPoolDiscriminator[];\n poolSize: number;\n /** Exact bounded candidate opportunity IDs supplied to this synthesis pass. */\n opportunityIds: string[];\n /** ISO-8601 timestamp of the mining pass. */\n minedAt: string;\n /** Discovery run id, when known. */\n runId?: string;\n /**\n * Intent payload snippet — folded into the evidence chip so the question\n * self-identifies on any surface (\"based on 16 people matching ‘…’\").\n */\n intentText?: string;\n /** Stable hash of the full normalized intent payload + summary. */\n intentFingerprint?: string;\n}\n\n/** Synthesized question: client payload + server-side snapshot. */\nexport interface SynthesizedPoolQuestion {\n payload: Question;\n pool: QuestionPoolSnapshot;\n}\n\n/**\n * Builds the pool_discovery question. Returns null when the pool is below\n * the k-anonymity floor or the discriminator shape is unusable (guards are\n * duplicated here so no caller can bypass them).\n */\nexport function synthesizePoolQuestion(input: SynthesizePoolQuestionInput): SynthesizedPoolQuestion | null {\n const { discriminator: d, poolSize } = input;\n if (poolSize < POOL_DISCRIMINATOR_MIN_POOL_SIZE) return null;\n if (d.sides.length < 2 || d.sides.length > 3) return null;\n\n // Evidence chip: aggregate count + the intent it belongs to, so the card is\n // self-identifying on every surface (QuestionSchema caps evidence at 160).\n const snippet = input.intentText?.trim().replace(/\\s+/g, \" \") ?? \"\";\n const evidence = snippet.length > 0\n ? `based on ${poolSize} people matching “${snippet.slice(0, 110)}${snippet.length > 110 ? \"…\" : \"\"}”`\n : `based on ${poolSize} people matching this intent`;\n\n const sideOptions: QuestionOption[] = d.sides.map((side) => ({\n label: chipLabel(side),\n description: `${d.sideCounts[side] ?? 0} of your ${poolSize} current matches lean this way`,\n }));\n const options: QuestionOption[] = [\n ...sideOptions,\n {\n label: BOTH_MATTER_LABEL,\n description: \"No preference — keep the current ranking\",\n },\n ];\n\n return {\n payload: {\n title: POOL_QUESTION_TITLE,\n prompt: toPrompt(d.questionSeed, d.sides),\n options,\n multiSelect: false,\n evidence,\n },\n pool: {\n poolSize,\n opportunityIds: [...input.opportunityIds],\n minedAt: input.minedAt,\n ...(input.runId ? { runId: input.runId } : {}),\n ...(snippet.length > 0 ? { intentText: snippet.slice(0, 160) } : {}),\n ...(input.intentFingerprint ? { intentFingerprint: input.intentFingerprint } : {}),\n discriminator: d,\n alternates: input.alternates,\n },\n };\n}\n"]}
|