Documentation
¶
Index ¶
- func AnalystScopedColumns(allowlist []string) bool
- func ApplyScopedReaderGrants(ctx context.Context, databaseURL string, params ScopedReaderGrantSQLParams) (string, error)
- func BuildScopedReaderGrantSQL(params ScopedReaderGrantSQLParams) (string, error)
- func BusinessPilotScopedColumns(allowlist []string) bool
- func DefaultReadOnlyFunctionSignatures() []string
- func FunctionSignaturesForTools(allowlist []string) []string
- func GovernanceFunctionSignatures() []string
- func RedactedAllReadonlyScopedColumns(allowlist []string) bool
- func ServingSchemaAuditTables() []string
- func URLFromEnv(getenv func(string) string) string
- func ValidateServingSchemaAudit(snapshot ServingSchemaSnapshot, skippedTables []string) error
- type CacheDiagnostics
- type ColumnSelectGrant
- func BusinessPilotColumnSelectGrants() []ColumnSelectGrant
- func DefaultReadOnlyColumnSelectGrants() []ColumnSelectGrant
- func RedactedAllReadonlyColumnSelectGrants() []ColumnSelectGrant
- func ScopedReaderColumnSelectGrants() []ColumnSelectGrant
- func ScopedReaderColumnSelectGrantsForAllowlist(allowlist []string) []ColumnSelectGrant
- type GovernancePolicyState
- type ReadModelStatus
- type ReadOnlyOptions
- type RefreshServingDBOptions
- type ScopedReaderGrantSQLParams
- type ServingColumnDecision
- type ServingColumnPolicy
- type ServingDBRefreshMarker
- type ServingDBRefreshResult
- type ServingSchemaSnapshot
- type Store
- func Open(ctx context.Context, databaseURL string) (*Store, error)
- func OpenProfileInventory(ctx context.Context, databaseURL string) (*Store, error)
- func OpenReadOnly(ctx context.Context, databaseURL string) (*Store, error)
- func OpenReadOnlyWithOptions(ctx context.Context, databaseURL string, options ReadOnlyOptions) (*Store, error)
- func OpenStatus(ctx context.Context, databaseURL string) (*Store, error)
- func (s *Store) ActivateProfile(ctx context.Context, ref string) (*sqlite.ProfileImportResult, error)
- func (s *Store) ActiveBusinessProfile(ctx context.Context) (*sqlite.BusinessProfile, error)
- func (s *Store) ActiveProfileDocument(ctx context.Context) (*profilepkg.Profile, error)
- func (s *Store) AnalyzeLateStageSignals(ctx context.Context, params sqlite.LateStageSignalParams) (*sqlite.LateStageSignalsReport, error)
- func (s *Store) BuildAndSaveGovernancePolicy(ctx context.Context, configSHA256 string, cfg *governance.Config) (*governance.Audit, *GovernancePolicyState, error)
- func (s *Store) CRMFieldPopulationMatrix(ctx context.Context, params sqlite.CRMFieldPopulationMatrixParams) (*sqlite.CRMFieldPopulationMatrix, error)
- func (s *Store) CacheDiagnostics(ctx context.Context) (*CacheDiagnostics, error)
- func (s *Store) CacheInventory(ctx context.Context) (*sqlite.CacheInventory, error)
- func (s *Store) CallDrilldownEvidence(ctx context.Context, params sqlite.CallDrilldownEvidenceParams) ([]sqlite.CallDrilldownEvidenceRow, error)
- func (s *Store) CallFactsCoverage(ctx context.Context) (*sqlite.CallFactsCoverage, error)
- func (s *Store) CallFactsCoverageWithSource(ctx context.Context, sourceArg string) (*sqlite.CallFactsCoverage, []sqlite.CallFactsSummaryRow, ...)
- func (s *Store) CallRawJSON(ctx context.Context, callID string) (json.RawMessage, error)
- func (s *Store) ClearGovernanceIngestSkippedCall(ctx context.Context, callID string) error
- func (s *Store) Close() error
- func (s *Store) CompareLifecycleCRMFields(ctx context.Context, params sqlite.LifecycleCRMFieldComparisonParams) (*sqlite.LifecycleCRMFieldComparison, error)
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteGovernanceIngestCachedCall(ctx context.Context, callID string) error
- func (s *Store) FindCallsMissingTranscripts(ctx context.Context, limit int) ([]sqlite.MissingTranscriptCall, error)
- func (s *Store) FindCallsMissingTranscriptsByFilters(ctx context.Context, params sqlite.MissingTranscriptSearchParams) ([]sqlite.MissingTranscriptCall, error)
- func (s *Store) FinishSyncRun(ctx context.Context, runID int64, params sqlite.FinishSyncRunParams) error
- func (s *Store) GetCallDetail(ctx context.Context, callID string) (*sqlite.CallDetail, error)
- func (s *Store) GetScorecardDetail(ctx context.Context, scorecardID string) (*sqlite.ScorecardDetail, error)
- func (s *Store) GovernanceDataFingerprint(ctx context.Context) (string, error)
- func (s *Store) GovernanceNameCandidates(ctx context.Context) ([]governance.Candidate, error)
- func (s *Store) ImportProfile(ctx context.Context, params sqlite.ProfileImportParams) (*sqlite.ProfileImportResult, error)
- func (s *Store) LatestServingRefreshMarker(ctx context.Context) (*ServingDBRefreshMarker, error)
- func (s *Store) ListAIHighlights(ctx context.Context, params sqlite.AIHighlightListParams) ([]sqlite.AIHighlightRow, error)
- func (s *Store) ListBusinessConcepts(ctx context.Context) ([]sqlite.BusinessConcept, error)
- func (s *Store) ListCRMFields(ctx context.Context, objectType string, limit int) ([]sqlite.CRMFieldSummary, error)
- func (s *Store) ListCRMIntegrations(ctx context.Context) ([]sqlite.CRMIntegrationRecord, error)
- func (s *Store) ListCRMObjectTypes(ctx context.Context) ([]sqlite.CRMObjectTypeSummary, error)
- func (s *Store) ListCRMSchemaFields(ctx context.Context, params sqlite.CRMSchemaFieldListParams) ([]sqlite.CRMSchemaFieldRecord, error)
- func (s *Store) ListCRMSchemaObjects(ctx context.Context, integrationID string) ([]sqlite.CRMSchemaObjectRecord, error)
- func (s *Store) ListGongSettings(ctx context.Context, params sqlite.GongSettingListParams) ([]sqlite.GongSettingRecord, error)
- func (s *Store) ListLifecycleBucketDefinitions(ctx context.Context) ([]sqlite.LifecycleBucketDefinition, error)
- func (s *Store) ListLifecycleBucketDefinitionsWithSource(ctx context.Context, requested string) ([]sqlite.LifecycleBucketDefinition, *sqlite.ProfileQueryInfo, error)
- func (s *Store) ListOpportunitiesMissingTranscripts(ctx context.Context, params sqlite.OpportunityMissingTranscriptParams) ([]sqlite.OpportunityMissingTranscriptSummary, error)
- func (s *Store) ListProfiles(ctx context.Context) ([]sqlite.ProfileHistoryEntry, error)
- func (s *Store) ListScorecards(ctx context.Context, params sqlite.ScorecardListParams) ([]sqlite.ScorecardSummary, error)
- func (s *Store) ListUnmappedCRMFields(ctx context.Context, params sqlite.UnmappedCRMFieldParams) ([]sqlite.UnmappedCRMField, error)
- func (s *Store) LoadGovernancePolicy(ctx context.Context, configSHA256 string) (*GovernancePolicyState, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) PlanCachePurgeBefore(ctx context.Context, startedBefore string) (*sqlite.CachePurgePlan, error)
- func (s *Store) PrioritizeTranscriptsByLifecycle(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, error)
- func (s *Store) PrioritizeTranscriptsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, *sqlite.ProfileQueryInfo, error)
- func (s *Store) ProfileDocument(ctx context.Context, ref string) (*sqlite.StoredProfileDocument, error)
- func (s *Store) ProfileInventory(ctx context.Context) (*profilepkg.Inventory, error)
- func (s *Store) PurgeCacheBefore(ctx context.Context, startedBefore string) (*sqlite.CachePurgePlan, error)
- func (s *Store) ReadModelStatus(ctx context.Context) (*ReadModelStatus, error)
- func (s *Store) RebuildReadModel(ctx context.Context) (*ReadModelStatus, error)
- func (s *Store) RecordGovernanceIngestSkippedCall(ctx context.Context, params sqlite.GovernanceIngestSkippedCallParams) error
- func (s *Store) RecordGovernanceIngestSkippedCallAndDeleteCachedCall(ctx context.Context, params sqlite.GovernanceIngestSkippedCallParams) error
- func (s *Store) RecordServingRefreshMarker(ctx context.Context, result *ServingDBRefreshResult) (*ServingDBRefreshMarker, error)
- func (s *Store) RefreshActiveProfileReadModel(ctx context.Context) error
- func (s *Store) ResolveCallIDByRef(ctx context.Context, ref string) (string, error)
- func (s *Store) ResolveLifecycleSource(ctx context.Context, requested string) (string, *sqlite.BusinessProfile, error)
- func (s *Store) ScorecardActivityOverview(ctx context.Context, limit int) (*sqlite.ScorecardActivityOverview, error)
- func (s *Store) SearchBusinessAnalysisCalls(ctx context.Context, params sqlite.BusinessAnalysisCallSearchParams) (*sqlite.BusinessAnalysisCallSearchResult, error)
- func (s *Store) SearchBusinessAnalysisEvidence(ctx context.Context, params sqlite.BusinessAnalysisEvidenceSearchParams) ([]sqlite.BusinessAnalysisEvidenceRow, error)
- func (s *Store) SearchCRMFieldValues(ctx context.Context, params sqlite.CRMFieldValueSearchParams) ([]sqlite.CRMFieldValueMatch, error)
- func (s *Store) SearchCallsByLifecycle(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, error)
- func (s *Store) SearchCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, *sqlite.ProfileQueryInfo, error)
- func (s *Store) SearchCallsRaw(ctx context.Context, params sqlite.CallSearchParams) ([]json.RawMessage, error)
- func (s *Store) SearchTranscriptQuotesWithAttribution(ctx context.Context, params sqlite.TranscriptAttributionSearchParams) ([]sqlite.TranscriptAttributionSearchResult, error)
- func (s *Store) SearchTranscriptSegments(ctx context.Context, query string, limit int) ([]sqlite.TranscriptSearchResult, error)
- func (s *Store) SearchTranscriptSegmentsByCRMContext(ctx context.Context, params sqlite.TranscriptCRMSearchParams) ([]sqlite.TranscriptCRMSearchResult, error)
- func (s *Store) SearchTranscriptSegmentsByCallFacts(ctx context.Context, params sqlite.TranscriptCallFactsSearchParams) ([]sqlite.TranscriptCallFactsSearchResult, error)
- func (s *Store) StartSyncRun(ctx context.Context, params sqlite.StartSyncRunParams) (*sqlite.SyncRun, error)
- func (s *Store) SummarizeBusinessAnalysisDimension(ctx context.Context, params sqlite.BusinessAnalysisDimensionSummaryParams) ([]sqlite.BusinessAnalysisDimensionRow, error)
- func (s *Store) SummarizeCallFacts(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, error)
- func (s *Store) SummarizeCallFactsWithSource(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, *sqlite.ProfileQueryInfo, error)
- func (s *Store) SummarizeCallsByLifecycle(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, error)
- func (s *Store) SummarizeCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, *sqlite.ProfileQueryInfo, error)
- func (s *Store) SummarizeOpportunityCalls(ctx context.Context, params sqlite.OpportunityCallSummaryParams) ([]sqlite.OpportunityCallSummary, error)
- func (s *Store) SummarizeScorecardActivity(ctx context.Context, params sqlite.ScorecardActivitySummaryParams) ([]sqlite.ScorecardActivitySummaryRow, error)
- func (s *Store) SyncStatusSummary(ctx context.Context) (*sqlite.SyncStatusSummary, error)
- func (s *Store) UpsertCRMIntegration(ctx context.Context, raw json.RawMessage) (*sqlite.CRMIntegrationRecord, error)
- func (s *Store) UpsertCRMSchema(ctx context.Context, integrationID string, objectType string, ...) (int64, error)
- func (s *Store) UpsertCall(ctx context.Context, raw json.RawMessage) (*sqlite.CallRecord, error)
- func (s *Store) UpsertGongSetting(ctx context.Context, kind string, raw json.RawMessage) (*sqlite.GongSettingRecord, error)
- func (s *Store) UpsertScorecardActivity(ctx context.Context, raw json.RawMessage) (*sqlite.ScorecardActivityRecord, error)
- func (s *Store) UpsertTranscript(ctx context.Context, raw json.RawMessage) (*sqlite.TranscriptRecord, error)
- func (s *Store) UpsertUser(ctx context.Context, raw json.RawMessage) (*sqlite.UserRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalystScopedColumns ¶
func ApplyScopedReaderGrants ¶
func BuildScopedReaderGrantSQL ¶
func BuildScopedReaderGrantSQL(params ScopedReaderGrantSQLParams) (string, error)
func DefaultReadOnlyFunctionSignatures ¶
func DefaultReadOnlyFunctionSignatures() []string
func GovernanceFunctionSignatures ¶
func GovernanceFunctionSignatures() []string
func RedactedAllReadonlyScopedColumns ¶ added in v0.4.0
func ServingSchemaAuditTables ¶ added in v0.4.0
func ServingSchemaAuditTables() []string
ServingSchemaAuditTables enumerates every table referenced by ServingSchemaAudit; useful for quick set-membership tests.
func URLFromEnv ¶
func ValidateServingSchemaAudit ¶ added in v0.4.0
func ValidateServingSchemaAudit(snapshot ServingSchemaSnapshot, skippedTables []string) error
ValidateServingSchemaAudit fails when a column or table observed in the supplied snapshot is not categorized in ServingSchemaAudit. Foundation D-1 requires that newly introduced text/JSON/ID columns force an explicit allow/redact decision before they can be copied to the serving DB.
Tables in skippedTables (operator-only or governance bookkeeping) are allowed to exist on the source without an audit row because they are intentionally not copied; the snapshot simply confirms they are not referenced from the audit either.
Types ¶
type CacheDiagnostics ¶
type CacheDiagnostics struct {
Backend string `json:"backend"`
SchemaVersion int `json:"schema_version"`
SupportedSchemaVersion int `json:"supported_schema_version"`
ReadModelReady bool `json:"read_model_ready"`
ReadModelStatus string `json:"read_model_status"`
ReadModelStaleReason string `json:"read_model_stale_reason,omitempty"`
ProfileCacheStatus string `json:"profile_cache_status"`
ReaderPrivilegeStatus string `json:"reader_privilege_status"`
}
type ColumnSelectGrant ¶
func BusinessPilotColumnSelectGrants ¶
func BusinessPilotColumnSelectGrants() []ColumnSelectGrant
func DefaultReadOnlyColumnSelectGrants ¶
func DefaultReadOnlyColumnSelectGrants() []ColumnSelectGrant
func RedactedAllReadonlyColumnSelectGrants ¶ added in v0.4.0
func RedactedAllReadonlyColumnSelectGrants() []ColumnSelectGrant
func ScopedReaderColumnSelectGrants ¶
func ScopedReaderColumnSelectGrants() []ColumnSelectGrant
func ScopedReaderColumnSelectGrantsForAllowlist ¶ added in v0.4.0
func ScopedReaderColumnSelectGrantsForAllowlist(allowlist []string) []ColumnSelectGrant
type GovernancePolicyState ¶
type GovernancePolicyState struct {
ConfigSHA256 string `json:"config_sha256"`
DataFingerprint string `json:"data_fingerprint"`
ConfigEntries int `json:"config_entries"`
ConfigAliases int `json:"config_aliases"`
MatchedEntries int `json:"matched_entries"`
UnmatchedEntries int `json:"unmatched_entries"`
SuppressedCallCount int `json:"suppressed_call_count"`
SuppressedCallIDs []string `json:"suppressed_call_ids,omitempty"`
UpdatedAt string `json:"updated_at"`
}
type ReadModelStatus ¶
type ReadModelStatus struct {
ModelName string `json:"model_name"`
ModelVersion int `json:"model_version"`
CurrentVersion int `json:"current_version"`
Ready bool `json:"ready"`
RebuiltAt string `json:"rebuilt_at"`
CallCount int64 `json:"call_count"`
FactCount int64 `json:"fact_count"`
MissingFactCallCount int64 `json:"missing_fact_call_count"`
OrphanFactCount int64 `json:"orphan_fact_count"`
StaleReason string `json:"stale_reason,omitempty"`
DiagnosticsCallCount int64 `json:"diagnostics_call_count"`
LimitExceededCallCount int64 `json:"limit_exceeded_call_count"`
UpdatedAt string `json:"updated_at"`
}
type ReadOnlyOptions ¶
type ReadOnlyOptions struct {
RequiredFunctionSignatures []string
AllowedFunctionSignatures []string
EnforceAllowedFunctionBoundary bool
RequiredColumnSelectGrants []ColumnSelectGrant
AllowedColumnSelectGrants []ColumnSelectGrant
EnforceAllowedColumnBoundary bool
AllowAccountQuery bool
AllowBusinessAnalysisRawIDs bool
}
func ReadOnlyOptionsForToolAllowlist ¶
func ReadOnlyOptionsForToolAllowlist(allowlist []string) ReadOnlyOptions
type RefreshServingDBOptions ¶ added in v0.4.0
type RefreshServingDBOptions struct {
SourceURL string
TargetURL string
Config *governance.Config
NoGovernanceExclusions bool
}
RefreshServingDBOptions describes a Phase 13e4 redacted MCP serving database refresh. Source is the operator cache; target is the physically redacted MCP serving cache. Config carries the private governance YAML used to determine which call IDs must not appear on the target.
type ServingColumnDecision ¶ added in v0.4.0
type ServingColumnDecision string
ServingColumnDecision categorizes a column copied from the operator cache into the redacted MCP serving database. Foundation D-1 requires that every column carrying customer identity or text/JSON has an explicit policy.
const ( // ServingColumnAllowed means the column copies its source value verbatim // because the column does not carry customer identity (e.g. counts, dates, // integration IDs, profile aliases that have already been redacted). ServingColumnAllowed ServingColumnDecision = "allowed" // ServingColumnRedacted means the column copies a redacted/derived value; // the source value never reaches the serving DB unchanged. (Reserved for // future slices that introduce sanitization-during-copy.) ServingColumnRedacted ServingColumnDecision = "redacted" // ServingColumnNotCopied means the column exists in the source schema but // is intentionally absent from the serving DB; it must not be copied by // any future code path without an audit decision. ServingColumnNotCopied ServingColumnDecision = "not_copied" )
type ServingColumnPolicy ¶ added in v0.4.0
type ServingColumnPolicy struct {
Table string
Column string
Decision ServingColumnDecision
Reason string
CarriesPII bool
}
ServingColumnPolicy is one row of the schema/redaction audit. Each row names the table+column and the audit decision plus a one-line justification that explains why the decision is safe.
func ServingSchemaAudit ¶ added in v0.4.0
func ServingSchemaAudit() []ServingColumnPolicy
ServingSchemaAudit catalogs the operator-cache schema columns that the serving-DB refresh slice currently knows about. Foundation D-1 requires every column carrying customer identity, text, or JSON to be categorized; the linter test ValidateServingSchemaAudit rejects synthetic columns or tables that lack a decision.
This is the source of truth for the audit, so adding a new copy in serving.go must be paired with a new entry here.
type ServingDBRefreshMarker ¶ added in v0.5.0
type ServingDBRefreshMarker struct {
ID int64 `json:"id"`
RefreshedAt string `json:"refreshed_at"`
SourceDataFingerprint string `json:"source_data_fingerprint"`
TargetDataFingerprint string `json:"target_data_fingerprint"`
PolicyConfigSHA256 string `json:"policy_config_sha256"`
SourceCalls int64 `json:"source_calls"`
TargetCalls int64 `json:"target_calls"`
RemovedCalls int64 `json:"removed_calls"`
SuppressedCallCount int64 `json:"suppressed_call_count"`
RowCountsJSON json.RawMessage `json:"row_counts_json"`
}
ServingDBRefreshMarker is the persisted, sanitized proof that a target Postgres database was rebuilt through governance refresh. It intentionally contains fingerprints and counts only: no URLs, customer names, call IDs, call titles, governance terms, or transcript text.
type ServingDBRefreshResult ¶ added in v0.4.0
type ServingDBRefreshResult struct {
ServingRefreshID int64 `json:"serving_refresh_id,omitempty"`
RefreshedAt string `json:"refreshed_at,omitempty"`
Backend string `json:"backend"`
SourceCalls int64 `json:"source_calls"`
SourceUsers int64 `json:"source_users"`
SourceTranscripts int64 `json:"source_transcripts"`
SourceTranscriptSegments int64 `json:"source_transcript_segments"`
SourceContextObjects int64 `json:"source_context_objects"`
SourceContextFields int64 `json:"source_context_fields"`
SourceGongSettings int64 `json:"source_gong_settings"`
SourceScorecards int64 `json:"source_scorecards"`
SourceScorecardActivity int64 `json:"source_scorecard_activity"`
SourceAIHighlights int64 `json:"source_ai_highlights"`
TargetCalls int64 `json:"target_calls"`
TargetUsers int64 `json:"target_users"`
TargetTranscripts int64 `json:"target_transcripts"`
TargetTranscriptSegments int64 `json:"target_transcript_segments"`
TargetContextObjects int64 `json:"target_context_objects"`
TargetContextFields int64 `json:"target_context_fields"`
TargetGongSettings int64 `json:"target_gong_settings"`
TargetScorecards int64 `json:"target_scorecards"`
TargetScorecardActivity int64 `json:"target_scorecard_activity"`
TargetAIHighlights int64 `json:"target_ai_highlights"`
RemovedCalls int64 `json:"removed_calls"`
RemovedScorecardActivity int64 `json:"removed_scorecard_activity"`
RemovedAIHighlights int64 `json:"removed_ai_highlights"`
SuppressedCallCount int `json:"suppressed_call_count"`
NoGovernanceExclusions bool `json:"no_governance_exclusions,omitempty"`
PolicyConfigSHA256 string `json:"policy_config_sha256"`
SourceDataFingerprint string `json:"source_data_fingerprint"`
TargetDataFingerprint string `json:"target_data_fingerprint"`
TargetSuppressedRows int64 `json:"target_suppressed_rows"`
SkippedTables []string `json:"skipped_tables,omitempty"`
}
ServingDBRefreshResult is the sanitized output of a serving-DB refresh.
It intentionally does NOT include database URLs, customer names/aliases, blocklist values, call IDs, or call titles so the structure can be logged and shared with reviewers without leaking governance content or operator secrets.
func RefreshServingDB ¶ added in v0.4.0
func RefreshServingDB(ctx context.Context, opts RefreshServingDBOptions) (*ServingDBRefreshResult, error)
RefreshServingDB rebuilds the redacted MCP serving database (target) from the operator cache (source) using the supplied governance config.
Behavior summary:
- Validates that source/target URLs are present and refer to different databases (different scheme/host/port/path tuple).
- Determines the suppressed call ID set by running the existing governance audit logic against the source.
- Truncates the call-scoped tables on the target that this slice rebuilds and copies allowed rows (call_id NOT IN suppressed) from source to target with raw payloads preserved.
- Re-runs the Postgres read model rebuild and re-applies the governance policy on the target so MCP can serve sanitized outputs immediately.
The serving refresh intentionally does not copy several operator/global metadata tables; see servingSkippedTables for the full list. Skipped tables are surfaced in the sanitized output so reviewers can confirm the boundary.
type ServingSchemaSnapshot ¶ added in v0.4.0
ServingSchemaSnapshot describes the columns observed in some live source schema. Tests use it to feed a synthetic snapshot into the validator.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func OpenProfileInventory ¶
func OpenReadOnlyWithOptions ¶
func (*Store) ActivateProfile ¶
func (*Store) ActiveBusinessProfile ¶
func (*Store) ActiveProfileDocument ¶
func (*Store) AnalyzeLateStageSignals ¶
func (s *Store) AnalyzeLateStageSignals(ctx context.Context, params sqlite.LateStageSignalParams) (*sqlite.LateStageSignalsReport, error)
func (*Store) BuildAndSaveGovernancePolicy ¶
func (s *Store) BuildAndSaveGovernancePolicy(ctx context.Context, configSHA256 string, cfg *governance.Config) (*governance.Audit, *GovernancePolicyState, error)
func (*Store) CRMFieldPopulationMatrix ¶
func (s *Store) CRMFieldPopulationMatrix(ctx context.Context, params sqlite.CRMFieldPopulationMatrixParams) (*sqlite.CRMFieldPopulationMatrix, error)
func (*Store) CacheDiagnostics ¶
func (s *Store) CacheDiagnostics(ctx context.Context) (*CacheDiagnostics, error)
func (*Store) CacheInventory ¶
func (*Store) CallDrilldownEvidence ¶ added in v0.4.0
func (s *Store) CallDrilldownEvidence(ctx context.Context, params sqlite.CallDrilldownEvidenceParams) ([]sqlite.CallDrilldownEvidenceRow, error)
CallDrilldownEvidence returns bounded transcript excerpts scoped to a single call. The Postgres path uses a dedicated SECURITY DEFINER function so scoped MCP roles can drill into one call without being granted broad transcript_segments search rights.
func (*Store) CallFactsCoverage ¶
func (*Store) CallFactsCoverageWithSource ¶
func (s *Store) CallFactsCoverageWithSource(ctx context.Context, sourceArg string) (*sqlite.CallFactsCoverage, []sqlite.CallFactsSummaryRow, *sqlite.ProfileQueryInfo, error)
func (*Store) CallRawJSON ¶ added in v0.4.0
func (*Store) ClearGovernanceIngestSkippedCall ¶ added in v0.4.0
func (*Store) CompareLifecycleCRMFields ¶
func (s *Store) CompareLifecycleCRMFields(ctx context.Context, params sqlite.LifecycleCRMFieldComparisonParams) (*sqlite.LifecycleCRMFieldComparison, error)
func (*Store) DeleteGovernanceIngestCachedCall ¶ added in v0.4.0
func (*Store) FindCallsMissingTranscripts ¶
func (*Store) FindCallsMissingTranscriptsByFilters ¶
func (s *Store) FindCallsMissingTranscriptsByFilters(ctx context.Context, params sqlite.MissingTranscriptSearchParams) ([]sqlite.MissingTranscriptCall, error)
func (*Store) FinishSyncRun ¶
func (*Store) GetCallDetail ¶
func (*Store) GetScorecardDetail ¶
func (*Store) GovernanceDataFingerprint ¶
func (*Store) GovernanceNameCandidates ¶
func (*Store) ImportProfile ¶
func (s *Store) ImportProfile(ctx context.Context, params sqlite.ProfileImportParams) (*sqlite.ProfileImportResult, error)
func (*Store) LatestServingRefreshMarker ¶ added in v0.5.0
func (s *Store) LatestServingRefreshMarker(ctx context.Context) (*ServingDBRefreshMarker, error)
LatestServingRefreshMarker returns the most recent successful serving refresh marker for diagnostics. sql.ErrNoRows means the database has no durable proof that it was built by governance refresh.
func (*Store) ListAIHighlights ¶ added in v0.4.0
func (s *Store) ListAIHighlights(ctx context.Context, params sqlite.AIHighlightListParams) ([]sqlite.AIHighlightRow, error)
ListAIHighlights returns bounded, typed Gong AI highlight rows from the Postgres call_ai_highlights read model. The serving DB never contains rows for governance-restricted calls, so they remain absent without any additional filtering here. Raw highlight JSON is intentionally not exposed; only the typed text/type/index columns are returned.
func (*Store) ListBusinessConcepts ¶
func (*Store) ListCRMFields ¶
func (*Store) ListCRMIntegrations ¶
func (*Store) ListCRMObjectTypes ¶
func (*Store) ListCRMSchemaFields ¶
func (s *Store) ListCRMSchemaFields(ctx context.Context, params sqlite.CRMSchemaFieldListParams) ([]sqlite.CRMSchemaFieldRecord, error)
func (*Store) ListCRMSchemaObjects ¶
func (*Store) ListGongSettings ¶
func (s *Store) ListGongSettings(ctx context.Context, params sqlite.GongSettingListParams) ([]sqlite.GongSettingRecord, error)
func (*Store) ListLifecycleBucketDefinitions ¶
func (*Store) ListLifecycleBucketDefinitionsWithSource ¶
func (s *Store) ListLifecycleBucketDefinitionsWithSource(ctx context.Context, requested string) ([]sqlite.LifecycleBucketDefinition, *sqlite.ProfileQueryInfo, error)
func (*Store) ListOpportunitiesMissingTranscripts ¶
func (s *Store) ListOpportunitiesMissingTranscripts(ctx context.Context, params sqlite.OpportunityMissingTranscriptParams) ([]sqlite.OpportunityMissingTranscriptSummary, error)
func (*Store) ListProfiles ¶
func (*Store) ListScorecards ¶
func (s *Store) ListScorecards(ctx context.Context, params sqlite.ScorecardListParams) ([]sqlite.ScorecardSummary, error)
func (*Store) ListUnmappedCRMFields ¶
func (s *Store) ListUnmappedCRMFields(ctx context.Context, params sqlite.UnmappedCRMFieldParams) ([]sqlite.UnmappedCRMField, error)
func (*Store) LoadGovernancePolicy ¶
func (*Store) PlanCachePurgeBefore ¶
func (*Store) PrioritizeTranscriptsByLifecycle ¶
func (s *Store) PrioritizeTranscriptsByLifecycle(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, error)
func (*Store) PrioritizeTranscriptsByLifecycleWithSource ¶
func (s *Store) PrioritizeTranscriptsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, *sqlite.ProfileQueryInfo, error)
func (*Store) ProfileDocument ¶
func (*Store) ProfileInventory ¶
func (*Store) PurgeCacheBefore ¶
func (*Store) ReadModelStatus ¶
func (s *Store) ReadModelStatus(ctx context.Context) (*ReadModelStatus, error)
func (*Store) RebuildReadModel ¶
func (s *Store) RebuildReadModel(ctx context.Context) (*ReadModelStatus, error)
func (*Store) RecordGovernanceIngestSkippedCall ¶ added in v0.4.0
func (*Store) RecordGovernanceIngestSkippedCallAndDeleteCachedCall ¶ added in v0.4.0
func (*Store) RecordServingRefreshMarker ¶ added in v0.5.0
func (s *Store) RecordServingRefreshMarker(ctx context.Context, result *ServingDBRefreshResult) (*ServingDBRefreshMarker, error)
RecordServingRefreshMarker stores a sanitized proof record for a successful serving refresh. Call it only after copy, read-model rebuild, governance policy application, and validation have succeeded.
func (*Store) RefreshActiveProfileReadModel ¶
func (*Store) ResolveCallIDByRef ¶ added in v0.4.0
func (*Store) ResolveLifecycleSource ¶
func (*Store) ScorecardActivityOverview ¶
func (*Store) SearchBusinessAnalysisCalls ¶
func (s *Store) SearchBusinessAnalysisCalls(ctx context.Context, params sqlite.BusinessAnalysisCallSearchParams) (*sqlite.BusinessAnalysisCallSearchResult, error)
func (*Store) SearchBusinessAnalysisEvidence ¶
func (s *Store) SearchBusinessAnalysisEvidence(ctx context.Context, params sqlite.BusinessAnalysisEvidenceSearchParams) ([]sqlite.BusinessAnalysisEvidenceRow, error)
func (*Store) SearchCRMFieldValues ¶
func (s *Store) SearchCRMFieldValues(ctx context.Context, params sqlite.CRMFieldValueSearchParams) ([]sqlite.CRMFieldValueMatch, error)
func (*Store) SearchCallsByLifecycle ¶
func (s *Store) SearchCallsByLifecycle(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, error)
func (*Store) SearchCallsByLifecycleWithSource ¶
func (s *Store) SearchCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, *sqlite.ProfileQueryInfo, error)
func (*Store) SearchCallsRaw ¶
func (s *Store) SearchCallsRaw(ctx context.Context, params sqlite.CallSearchParams) ([]json.RawMessage, error)
func (*Store) SearchTranscriptQuotesWithAttribution ¶
func (s *Store) SearchTranscriptQuotesWithAttribution(ctx context.Context, params sqlite.TranscriptAttributionSearchParams) ([]sqlite.TranscriptAttributionSearchResult, error)
func (*Store) SearchTranscriptSegments ¶
func (*Store) SearchTranscriptSegmentsByCRMContext ¶
func (s *Store) SearchTranscriptSegmentsByCRMContext(ctx context.Context, params sqlite.TranscriptCRMSearchParams) ([]sqlite.TranscriptCRMSearchResult, error)
func (*Store) SearchTranscriptSegmentsByCallFacts ¶
func (s *Store) SearchTranscriptSegmentsByCallFacts(ctx context.Context, params sqlite.TranscriptCallFactsSearchParams) ([]sqlite.TranscriptCallFactsSearchResult, error)
func (*Store) StartSyncRun ¶
func (*Store) SummarizeBusinessAnalysisDimension ¶
func (s *Store) SummarizeBusinessAnalysisDimension(ctx context.Context, params sqlite.BusinessAnalysisDimensionSummaryParams) ([]sqlite.BusinessAnalysisDimensionRow, error)
func (*Store) SummarizeCallFacts ¶
func (s *Store) SummarizeCallFacts(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, error)
func (*Store) SummarizeCallFactsWithSource ¶
func (s *Store) SummarizeCallFactsWithSource(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, *sqlite.ProfileQueryInfo, error)
func (*Store) SummarizeCallsByLifecycle ¶
func (s *Store) SummarizeCallsByLifecycle(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, error)
func (*Store) SummarizeCallsByLifecycleWithSource ¶
func (s *Store) SummarizeCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, *sqlite.ProfileQueryInfo, error)
func (*Store) SummarizeOpportunityCalls ¶
func (s *Store) SummarizeOpportunityCalls(ctx context.Context, params sqlite.OpportunityCallSummaryParams) ([]sqlite.OpportunityCallSummary, error)
func (*Store) SummarizeScorecardActivity ¶
func (s *Store) SummarizeScorecardActivity(ctx context.Context, params sqlite.ScorecardActivitySummaryParams) ([]sqlite.ScorecardActivitySummaryRow, error)
func (*Store) SyncStatusSummary ¶
func (*Store) UpsertCRMIntegration ¶
func (s *Store) UpsertCRMIntegration(ctx context.Context, raw json.RawMessage) (*sqlite.CRMIntegrationRecord, error)
func (*Store) UpsertCRMSchema ¶
func (*Store) UpsertCall ¶
func (s *Store) UpsertCall(ctx context.Context, raw json.RawMessage) (*sqlite.CallRecord, error)
func (*Store) UpsertGongSetting ¶
func (s *Store) UpsertGongSetting(ctx context.Context, kind string, raw json.RawMessage) (*sqlite.GongSettingRecord, error)
func (*Store) UpsertScorecardActivity ¶
func (s *Store) UpsertScorecardActivity(ctx context.Context, raw json.RawMessage) (*sqlite.ScorecardActivityRecord, error)
func (*Store) UpsertTranscript ¶
func (s *Store) UpsertTranscript(ctx context.Context, raw json.RawMessage) (*sqlite.TranscriptRecord, error)
func (*Store) UpsertUser ¶
func (s *Store) UpsertUser(ctx context.Context, raw json.RawMessage) (*sqlite.UserRecord, error)