Q195: a change reloads only what is not already shown, and the snapshot stops carrying records the window never reads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 09:20:45 -04:00
1 parent 2f79e4261f
commit 56eac39b1b
31 files changed
+146 -214

No files matched your search

-15
View File
@@ -24,18 +24,3 @@ export type ChatThreadBoardState = ValueOf<typeof CHAT_THREAD_BOARD_STATE>;
export type BoardInterventionMode = ValueOf<typeof BOARD_INTERVENTION_MODE>;
export type BoardInterventionAction = ValueOf<typeof BOARD_INTERVENTION_ACTION>;
export interface BoardInterventionRecord {
id: string;
orgId: string;
threadId: string;
messageId: string;
mode: BoardInterventionMode;
action: BoardInterventionAction;
details: string;
targetType: "employee" | "agent" | "board" | null;
targetId: string | null;
approvalId: string | null;
createdByType: "employee" | "agent" | "board" | "system";
createdById: string | null;
createdAt: string;
}
-23
View File
@@ -28,26 +28,3 @@ export interface ComplianceExportRecord {
completedAt: string | null;
}
export interface LegalHoldRecord {
id: string;
orgId: string;
entityType: LegalHoldEntityType;
entityId: string;
reason: string;
createdByEmployeeId: string | null;
active: boolean;
createdAt: string;
releasedAt: string | null;
}
export interface RetentionFreezeRecord {
id: string;
orgId: string;
scopeType: RetentionFreezeScopeType;
scopeId: string;
reason: string;
createdByEmployeeId: string | null;
active: boolean;
createdAt: string;
releasedAt: string | null;
}
+2 -1
View File
@@ -113,7 +113,8 @@ export interface ProviderOAuthEvent {
}
export type RendererEvent =
| { type: "snapshot-changed" }
/** `version` is the data version the change produced; a snapshot at that version or later already shows it. */
| { type: "snapshot-changed"; version: number }
| { type: "provider-response-stream"; event: ProviderStreamRendererEvent }
| ProviderOAuthEvent;
+7 -7
View File
@@ -1,14 +1,14 @@
import type { ProviderDataPolicy } from "./provider-policy-domain";
export { BOARD_INTERVENTION_ACTION, BOARD_INTERVENTION_MODE, CHAT_THREAD_BOARD_STATE, type BoardInterventionAction, type BoardInterventionMode, type BoardInterventionRecord, type ChatThreadBoardState } from "./board-domain";
export { BOARD_INTERVENTION_ACTION, BOARD_INTERVENTION_MODE, CHAT_THREAD_BOARD_STATE, type BoardInterventionAction, type BoardInterventionMode, type ChatThreadBoardState } from "./board-domain";
export type { ChatReplyStatus, ChatSpaceAnchor, ChatSpaceRecord, ChatMessageRecord, ChatMembershipRecord, ChatThreadRecord, ChatAttachmentRecord, ChatMentionRecord, ChatSlashInvocationRecord, ChatPresenceRecord, ChatReadStateRecord } from "./chat-domain";
export { COMPLIANCE_EXPORT_STATE, COMPLIANCE_EXPORT_TYPE, type ComplianceExportRecord, type ComplianceExportState, type ComplianceExportType, type ComplianceSubjectType, type LegalHoldEntityType, type LegalHoldRecord, type RetentionFreezeRecord, type RetentionFreezeScopeType } from "./compliance-domain";
export { ACCESS_DECISION, IDENTITY_SOURCE, ROLE_KEY, type AccessDecision, type AccessDecisionRecord, type EmployeeIdentityRecord, type IdentitySource, type PrincipalType, type RoleGrantRecord, type RoleKey, type ServiceIdentityRecord } from "./identity-domain";
export { ROUTE_TO_TYPE, type ApprovalAssignmentRecord, type ApprovalRoutingRuleRecord, type HiringPolicyRecord, type OrgDepartmentRecord, type RouteToType } from "./org-governance-domain";
export { FEATURE_FLAG_KEY, SLO_SIGNAL_KEY, type FeatureFlagKey, type FeatureFlagRecord, type OperationalEventRecord, type SloSignalKey, type SloTargetRecord } from "./operations-domain";
export type { ProviderAuthProfileRecord, ProviderAuthSessionRecord } from "./provider-auth-domain";
export { COMPLIANCE_EXPORT_STATE, COMPLIANCE_EXPORT_TYPE, type ComplianceExportRecord, type ComplianceExportState, type ComplianceExportType, type ComplianceSubjectType, type LegalHoldEntityType, type RetentionFreezeScopeType } from "./compliance-domain";
export { ACCESS_DECISION, IDENTITY_SOURCE, ROLE_KEY, type AccessDecision, type IdentitySource, type PrincipalType, type RoleKey } from "./identity-domain";
export { ROUTE_TO_TYPE, type HiringPolicyRecord, type RouteToType } from "./org-governance-domain";
export { FEATURE_FLAG_KEY, SLO_SIGNAL_KEY, type FeatureFlagKey, type SloSignalKey } from "./operations-domain";
export type { ProviderAuthProfileRecord } from "./provider-auth-domain";
export { PROVIDER_DATA_POLICY, PROVIDER_EXECUTION_MODE, type ProviderDataPolicy, type ProviderExecutionMode } from "./provider-policy-domain";
export { PROVIDER_REQUEST_STATE, type ProviderRequestRecord, type ProviderRequestState, type ProviderStreamRendererEvent } from "./provider-request-domain";
export type { ProviderRateLimitObservationRecord, ProviderRateLimitStateRecord } from "./provider-runtime-domain";
export type { ProviderRateLimitStateRecord } from "./provider-runtime-domain";
export { SEARCH_ENTITY_TYPES, type SearchEntityType, type SearchPage, type SearchResultRecord } from "./search-domain";
export type { BrowserActionPolicyRecord, BrowserActionRecord, BrowserSessionContainerRecord, SocialAccountGrantRecord, SocialAccountRecord, SocialApprovalRouteRecord, SocialAuditRecord } from "./social-domain";
export type { AppSnapshot, UiLanguage, UiPreferences, UiTheme } from "./snapshot-domain";
-18
View File
@@ -14,21 +14,3 @@ export type RoleKey = ValueOf<typeof ROLE_KEY>;
export type AccessDecision = ValueOf<typeof ACCESS_DECISION>;
export type PrincipalType = "employee" | "agent" | "service_identity";
export interface EmployeeIdentityRecord {
id: string; orgId: string; employeeId: string; source: IdentitySource; externalSubject: string;
email: string | null; active: boolean; createdAt: string; lastSeenAt: string | null;
}
export interface ServiceIdentityRecord {
id: string; orgId: string; agentId: string; name: string; scopeJson: string; createdAt: string;
}
export interface RoleGrantRecord {
id: string; orgId: string; principalType: PrincipalType; principalId: string; roleKey: RoleKey;
scopeType: string; scopeId: string; grantedByEmployeeId: string | null; createdAt: string;
}
export interface AccessDecisionRecord {
id: string; orgId: string; principalType: PrincipalType; principalId: string; action: string;
resourceType: string; resourceId: string; decision: AccessDecision; reason: string; createdAt: string;
}
-11
View File
@@ -16,14 +16,3 @@ export const SLO_SIGNAL_KEY = {
export type FeatureFlagKey = ValueOf<typeof FEATURE_FLAG_KEY>;
export type SloSignalKey = ValueOf<typeof SLO_SIGNAL_KEY>;
export interface FeatureFlagRecord {
id: string; orgId: string; key: FeatureFlagKey; label: string; enabled: boolean; createdAt: string; updatedAt: string;
}
export interface SloTargetRecord {
id: string; orgId: string; signalKey: SloSignalKey; label: string; targetBasisPoints: number; windowMinutes: number; createdAt: string; updatedAt: string;
}
export interface OperationalEventRecord {
id: string; orgId: string; signalKey: SloSignalKey; source: string; success: boolean; durationMs: number | null; detailJson: string; createdAt: string;
}
-14
View File
@@ -3,22 +3,8 @@ type ValueOf<T> = T[keyof T];
export const ROUTE_TO_TYPE = { EMPLOYEE: "employee", AGENT: "agent", BOARD: "board" } as const;
export type RouteToType = ValueOf<typeof ROUTE_TO_TYPE>;
export interface OrgDepartmentRecord {
id: string; orgId: string; name: string; leadAgentId: string | null;
headcountLimit: number; monthlyBudgetLimitCents: number; createdAt: string; updatedAt: string;
}
export interface HiringPolicyRecord {
id: string; orgId: string; departmentName: string; maxHeadcount: number;
monthlyBudgetLimitCents: number; requireApprovalAboveCents: number; createdAt: string; updatedAt: string;
}
export interface ApprovalRoutingRuleRecord {
id: string; orgId: string; kind: string; minimumRisk: string;
routeToType: RouteToType; routeToId: string; createdAt: string;
}
export interface ApprovalAssignmentRecord {
id: string; orgId: string; approvalId: string; assigneeType: RouteToType;
assigneeId: string; routingRuleId: string | null; createdAt: string;
}
-16
View File
@@ -16,19 +16,3 @@ export interface ProviderAuthProfileRecord {
createdAt: string;
}
export interface ProviderAuthSessionRecord {
id: string;
orgId: string;
providerId: string;
providerKey: string;
employeeId: string;
state: string;
nonce: string;
codeVerifierSha256: string;
redirectUri: string;
signInUrl: string;
partition: string;
createdAt: string;
expiresAt: string;
completedAt: string | null;
}
-9
View File
@@ -26,15 +26,6 @@ export interface ProviderObservedRateLimitState {
rawStateJson: string;
}
export interface ProviderRateLimitObservationRecord extends ProviderObservedRateLimitState {
id: string;
orgId: string;
providerId: string;
providerKey: string;
model: string | null;
observedAt: string;
}
/** The message of the typed error a run gets when its provider's monthly request allowance is used up. */
export const PROVIDER_MONTHLY_LIMIT_MESSAGE = "Provider monthly request limit has been reached.";
+6 -22
View File
@@ -1,7 +1,6 @@
import type { OnboardingDraft } from "./commands";
import type { UsageStatsRecord } from "./usage-stats";
import type { IntegrationKeyStatus } from "./commands/integration-keys";
import type { BoardInterventionRecord as BoardInterventionRecordModel } from "./board-domain";
import type {
ChatAttachmentRecord,
ChatMembershipRecord,
@@ -15,7 +14,7 @@ import type {
ChatReplyStatus,
ChatSpaceAnchor,
} from "./chat-domain";
import type { ComplianceExportRecord, LegalHoldRecord, RetentionFreezeRecord } from "./compliance-domain";
import type { ComplianceExportRecord } from "./compliance-domain";
import type {
AgentRecord,
ApprovalRecord,
@@ -44,12 +43,10 @@ import type {
TaskRunRecord,
WorkspaceRecord,
} from "./domain";
import type { AccessDecisionRecord, EmployeeIdentityRecord, RoleGrantRecord, ServiceIdentityRecord } from "./identity-domain";
import type { ApprovalAssignmentRecord, ApprovalRoutingRuleRecord, HiringPolicyRecord, OrgDepartmentRecord } from "./org-governance-domain";
import type { FeatureFlagRecord, OperationalEventRecord, SloTargetRecord } from "./operations-domain";
import type { ProviderAuthProfileRecord, ProviderAuthSessionRecord } from "./provider-auth-domain";
import type { HiringPolicyRecord } from "./org-governance-domain";
import type { ProviderAuthProfileRecord } from "./provider-auth-domain";
import type { ProviderRequestRecord } from "./provider-request-domain";
import type { ProviderRateLimitObservationRecord, ProviderRateLimitStateRecord } from "./provider-runtime-domain";
import type { ProviderRateLimitStateRecord } from "./provider-runtime-domain";
import type {
BrowserActionPolicyRecord,
BrowserActionRecord,
@@ -75,6 +72,8 @@ export interface AppSnapshot {
onboardingDraft: OnboardingDraft | null;
/** Where the operator was: page, sections, filters and selected records, by key. */
viewState: Record<string, unknown>;
/** The data version this snapshot was read at. */
dataVersion: number;
/** True while the operator has paused the autonomous run engine. */
autonomousPaused: boolean;
integrationKeys: IntegrationKeyStatus[];
@@ -96,7 +95,6 @@ export interface AppSnapshot {
chatAttachments: ChatAttachmentRecord[];
chatMentions: ChatMentionRecord[];
chatSlashInvocations: ChatSlashInvocationRecord[];
boardInterventions: BoardInterventionRecordModel[];
chatPresence: ChatPresenceRecord[];
chatReadStates: ChatReadStateRecord[];
files: FileObjectRecord[];
@@ -105,13 +103,11 @@ export interface AppSnapshot {
scheduledPosts: ScheduledPostRecord[];
providers: ProviderRecord[];
providerAuthProfiles: ProviderAuthProfileRecord[];
providerAuthSessions: ProviderAuthSessionRecord[];
providerCatalog: ProviderCatalogEntry[];
providerRequests: ProviderRequestRecord[];
providerRateLimits: ProviderRateLimitStateRecord[];
/** Period statistics per org over all records, for charts and billing. */
usageStats: UsageStatsRecord[];
providerRateLimitObservations: ProviderRateLimitObservationRecord[];
// The snapshot is the renderer's working set and rides IPC on every
// refresh. Skill internals (revisions, bindings, per-run runtime
// snapshots with compiled prompts) are main-process concerns and stay out
@@ -127,19 +123,7 @@ export interface AppSnapshot {
policyRules: PolicyRuleRecord[];
migrationReports: MigrationReportRecord[];
complianceExports: ComplianceExportRecord[];
legalHolds: LegalHoldRecord[];
retentionFreezes: RetentionFreezeRecord[];
employeeIdentities: EmployeeIdentityRecord[];
serviceIdentities: ServiceIdentityRecord[];
roleGrants: RoleGrantRecord[];
accessDecisions: AccessDecisionRecord[];
orgDepartments: OrgDepartmentRecord[];
hiringPolicies: HiringPolicyRecord[];
approvalRoutingRules: ApprovalRoutingRuleRecord[];
approvalAssignments: ApprovalAssignmentRecord[];
featureFlags: FeatureFlagRecord[];
sloTargets: SloTargetRecord[];
operationalEvents: OperationalEventRecord[];
auditEvents: AuditEventRecord[];
documents: DocumentRecord[];
knowledgeEntries: KnowledgeEntryRecord[];