@ttt-productions/ttt-core 0.78.22 → 0.78.24

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.
Files changed (128) hide show
  1. package/dist/constants/business-user.d.ts +1 -1
  2. package/dist/constants/business-user.js +1 -1
  3. package/dist/constants/business-user.js.map +1 -1
  4. package/dist/constants/release-flags.d.ts +2 -2
  5. package/dist/constants/release-flags.d.ts.map +1 -1
  6. package/dist/constants/release-flags.js +2 -2
  7. package/dist/constants/release-flags.js.map +1 -1
  8. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  9. package/dist/doc-schemas/chat-sync.js +3 -2
  10. package/dist/doc-schemas/chat-sync.js.map +1 -1
  11. package/dist/doc-schemas/commissions.d.ts +14 -11
  12. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  13. package/dist/doc-schemas/commissions.js +14 -4
  14. package/dist/doc-schemas/commissions.js.map +1 -1
  15. package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
  16. package/dist/doc-schemas/media-activation-jobs.js +4 -3
  17. package/dist/doc-schemas/media-activation-jobs.js.map +1 -1
  18. package/dist/doc-schemas/media-assets.d.ts +2 -2
  19. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  20. package/dist/doc-schemas/media-assets.js +5 -4
  21. package/dist/doc-schemas/media-assets.js.map +1 -1
  22. package/dist/doc-schemas/messaging.d.ts.map +1 -1
  23. package/dist/doc-schemas/messaging.js +3 -2
  24. package/dist/doc-schemas/messaging.js.map +1 -1
  25. package/dist/doc-schemas/ncii/allegations.js +3 -3
  26. package/dist/doc-schemas/ncii/allegations.js.map +1 -1
  27. package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
  28. package/dist/doc-schemas/ncii/cases.js +4 -3
  29. package/dist/doc-schemas/ncii/cases.js.map +1 -1
  30. package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
  31. package/dist/doc-schemas/ncii/config.js +4 -3
  32. package/dist/doc-schemas/ncii/config.js.map +1 -1
  33. package/dist/doc-schemas/ncii/holds.js +3 -3
  34. package/dist/doc-schemas/ncii/holds.js.map +1 -1
  35. package/dist/doc-schemas/ncii/removal.js +3 -3
  36. package/dist/doc-schemas/ncii/removal.js.map +1 -1
  37. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
  38. package/dist/doc-schemas/ncii/requests.js +4 -3
  39. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  40. package/dist/doc-schemas/notification-ledger.d.ts.map +1 -1
  41. package/dist/doc-schemas/notification-ledger.js +3 -1
  42. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  43. package/dist/doc-schemas/payments.d.ts.map +1 -1
  44. package/dist/doc-schemas/payments.js +2 -1
  45. package/dist/doc-schemas/payments.js.map +1 -1
  46. package/dist/doc-schemas/registry.d.ts +108 -35
  47. package/dist/doc-schemas/registry.d.ts.map +1 -1
  48. package/dist/doc-schemas/registry.js +4 -0
  49. package/dist/doc-schemas/registry.js.map +1 -1
  50. package/dist/doc-schemas/safety/age.d.ts.map +1 -1
  51. package/dist/doc-schemas/safety/age.js +4 -3
  52. package/dist/doc-schemas/safety/age.js.map +1 -1
  53. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -1
  54. package/dist/doc-schemas/safety/case-aliases.js +5 -4
  55. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  56. package/dist/doc-schemas/safety/case.d.ts.map +1 -1
  57. package/dist/doc-schemas/safety/case.js +4 -3
  58. package/dist/doc-schemas/safety/case.js.map +1 -1
  59. package/dist/doc-schemas/safety/evidence.js +3 -3
  60. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  61. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
  62. package/dist/doc-schemas/safety/foundation.js +5 -3
  63. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  64. package/dist/doc-schemas/safety/holds.d.ts.map +1 -1
  65. package/dist/doc-schemas/safety/holds.js +4 -3
  66. package/dist/doc-schemas/safety/holds.js.map +1 -1
  67. package/dist/doc-schemas/safety/monitors.d.ts.map +1 -1
  68. package/dist/doc-schemas/safety/monitors.js +5 -3
  69. package/dist/doc-schemas/safety/monitors.js.map +1 -1
  70. package/dist/doc-schemas/safety/provenance.js +3 -3
  71. package/dist/doc-schemas/safety/provenance.js.map +1 -1
  72. package/dist/doc-schemas/safety/report.d.ts.map +1 -1
  73. package/dist/doc-schemas/safety/report.js +4 -3
  74. package/dist/doc-schemas/safety/report.js.map +1 -1
  75. package/dist/doc-schemas/safety/sagas.js +3 -3
  76. package/dist/doc-schemas/safety/sagas.js.map +1 -1
  77. package/dist/doc-schemas/social.d.ts +130 -0
  78. package/dist/doc-schemas/social.d.ts.map +1 -1
  79. package/dist/doc-schemas/social.js +91 -2
  80. package/dist/doc-schemas/social.js.map +1 -1
  81. package/dist/doc-schemas/square-announcement-jobs.d.ts +306 -14
  82. package/dist/doc-schemas/square-announcement-jobs.d.ts.map +1 -1
  83. package/dist/doc-schemas/square-announcement-jobs.js +15 -2
  84. package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
  85. package/dist/doc-schemas/user.js +3 -3
  86. package/dist/doc-schemas/user.js.map +1 -1
  87. package/dist/doc-schemas/work-project.js +2 -2
  88. package/dist/doc-schemas/work-project.js.map +1 -1
  89. package/dist/ids/chat-ids.d.ts +3 -2
  90. package/dist/ids/chat-ids.d.ts.map +1 -1
  91. package/dist/ids/chat-ids.js +3 -2
  92. package/dist/ids/chat-ids.js.map +1 -1
  93. package/dist/media/domain-events-admin.d.ts +0 -7
  94. package/dist/media/domain-events-admin.d.ts.map +1 -1
  95. package/dist/media/domain-events-admin.js +0 -11
  96. package/dist/media/domain-events-admin.js.map +1 -1
  97. package/dist/media/domain-events.d.ts +0 -6
  98. package/dist/media/domain-events.d.ts.map +1 -1
  99. package/dist/media/domain-events.js +1 -2
  100. package/dist/media/domain-events.js.map +1 -1
  101. package/dist/media/hall-library-target-fields.js +1 -1
  102. package/dist/media/hall-library-target-fields.js.map +1 -1
  103. package/dist/media/pending-media.d.ts +0 -54
  104. package/dist/media/pending-media.d.ts.map +1 -1
  105. package/dist/media/photodna-coverage.d.ts.map +1 -1
  106. package/dist/media/photodna-coverage.js +5 -3
  107. package/dist/media/photodna-coverage.js.map +1 -1
  108. package/dist/paths/related-ids.js +1 -1
  109. package/dist/paths/related-ids.js.map +1 -1
  110. package/dist/safety/ncii-intake-derivations.d.ts.map +1 -1
  111. package/dist/safety/ncii-intake-derivations.js +4 -2
  112. package/dist/safety/ncii-intake-derivations.js.map +1 -1
  113. package/dist/safety/resource-keys.d.ts +8 -0
  114. package/dist/safety/resource-keys.d.ts.map +1 -1
  115. package/dist/safety/resource-keys.js +12 -1
  116. package/dist/safety/resource-keys.js.map +1 -1
  117. package/dist/schemas/chat.js +3 -3
  118. package/dist/schemas/chat.js.map +1 -1
  119. package/dist/schemas/ncii.js +1 -1
  120. package/dist/schemas/ncii.js.map +1 -1
  121. package/dist/schemas/notification.d.ts +8 -8
  122. package/dist/schemas/notification.d.ts.map +1 -1
  123. package/dist/schemas/notification.js +17 -11
  124. package/dist/schemas/notification.js.map +1 -1
  125. package/dist/types/social.d.ts +1 -45
  126. package/dist/types/social.d.ts.map +1 -1
  127. package/dist/types/social.js.map +1 -1
  128. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,0FAA0F;AAC1F,oFAAoF;AACpF,yFAAyF;AACzF,mFAAmF;AACnF,EAAE;AACF,0FAA0F;AAC1F,4EAA4E;AAG5E,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,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AoF;IACpF,uCAAuC,EAAE,KAAK;IAC9C,uCAAuC,EAAE,KAAK;IAC9C,4CAA4C,EAAE,KAAK;IACnD,0CAA0C,EAAE,IAAI;IAChD,2CAA2C,EAAE,IAAI;IACjD,2CAA2C,EAAE,qBAAqB;IAClE,4DAA4D,EAAE,qBAAqB;IACnF,uCAAuC,EAAE,IAAI;IAC7C,4BAA4B,EAAE,KAAK;CACiC,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,oFAAoF;IACpF,oEAAoE;IACpE,eAAe;CACP,CAAC","sourcesContent":["// Firestore collection registry — the single, authoritative binding from each Firestore\n// collection/subcollection path template to its document Zod schema. This is the input to\n// the schema-doc generator and the drift-check, and its completeness is CI-enforced\n// (registry.test.ts) against the COLLECTIONS / *_SUBCOLLECTIONS name constants, so a new\n// collection cannot be added without either a schema or an explicit PENDING entry.\n//\n// Path templates reuse the segment names from ../paths/collections.ts (and the shapes the\n// path-builders produce). `{placeholder}` segments are document/parent IDs.\n\nimport type { z } from 'zod';\nimport {\n FullUserSchema,\n UserPrivateDataSchema,\n CraftSkillSchema,\n CraftSkillReferenceSchema,\n} from './user.js';\nimport { PublicUserSchema } from './publicUser.js';\nimport { AccountDeletionRequestV1Schema } from './account-deletion.js';\nimport {\n FullWorkProjectSchema,\n PublicWorkProjectSchema,\n WorkFileFolderSchema,\n WorkFileSchema,\n WorkRealmSchema,\n GuildmateUserSchema,\n PublicGuildmateUserSchema,\n} from './work-project.js';\nimport {\n FullTaleSchema,\n FullChapterSchema,\n FullTuneSchema,\n FullTuneTrackSchema,\n FullTelevisionSchema,\n FullTelevisionEpisodeSchema,\n ThresholdItemSchema,\n PublishedHallItemSchema,\n PublishedChapterSchema,\n PublishedTuneTrackSchema,\n PublishedTelevisionEpisodeSchema,\n HallContentChangeRequestSchema,\n FuturePlansDocumentSchema,\n RulesAndAgreementsSchema,\n LegalPageDocumentSchema,\n TakeItDownPageCopySchema,\n HallLibraryPreferencesSchema,\n} from './content.js';\nimport {\n SquareStreetzPostSchema,\n MentionHistoryDocumentSchema,\n FollowEdgeSchema,\n FollowCounterSchema,\n SquareStreetzLikeSchema,\n TrendingPostsSchema,\n} from './social.js';\nimport {\n PledgePaymentSchema,\n PledgePaymentProviderRefSchema,\n ProcessedStripeEventSchema,\n PledgePaymentLedgerEventSchema,\n PaymentWebhookQuarantineSchema,\n PledgePaymentTotalsDocSchema,\n PledgeRefundRequestSchema,\n} from './payments.js';\nimport {\n FullCommissionListingSchema,\n CommissionProposalSchema,\n AuditionSchema,\n AuditionEntrySchema,\n UserAuditionVoteSchema,\n} from './commissions.js';\nimport {\n GuildChatChannelSchema,\n GuildInviteConversationSchema,\n AdminDispatchSchema,\n ChatMessageV1Schema,\n} from './messaging.js';\nimport { AppConfigSchema, AdminListSchema, ProfanityListSchema, ReservedUsernamesSchema, BlockedFranchiseNamesSchema, AppModeMarkerSchema } from './system.js';\nimport {\n ContentViolationSchema,\n ModerationCascadeManifestSchema,\n ModerationCascadeChangedDocSchema,\n} from './moderation.js';\nimport {\n AdminTaskDocSchema,\n} from './report-docs.js';\nimport { TTTAuditEventSchema } from './audit.js';\nimport {\n NotificationDocSchema,\n NotificationHistoryDocSchema,\n PendingNotificationSchema,\n} from './notifications.js';\nimport {\n NotificationDeliverySchema,\n NotificationFanoutJobSchema,\n} from './notification-ledger.js';\nimport {\n ChatChannelAuthProjectionSchema,\n ChatScopeDegradedSchema,\n ChatScopeDegradedCauseSchema,\n ChatSyncEventSchema,\n ChatSyncFanoutJobSchema,\n ChatMessageOutboxSchema,\n ChatAdminActionCommandSchema,\n ChatHistoryAnonymizationJobSchema,\n ChatHistoryAnonymizationAffectedChunkSchema,\n} from './chat-sync.js';\nimport { SquareAnnouncementJobSchema } from './square-announcement-jobs.js';\nimport { PendingMediaSchema, ArchivedPendingMediaSchema } from '../media/pending-media.js';\nimport { MediaAssetSchema } from './media-assets.js';\nimport { MediaActivationJobSchema } from './media-activation-jobs.js';\nimport {\n ReservedDisplayNameSchema,\n ReservedRealmNameSchema,\n StakeShareAuditEventSchema,\n ShortLinkSchema,\n FeedbackAliasSchema,\n UserSuggestionSchema,\n StatusReconcileQueueEntrySchema,\n} from './operational.js';\n// ===== Trust & Safety — report spine (§A1) =====\nimport {\n ProtectedReportRootV1Schema,\n ReportPublicProjectionV1Schema,\n ReportGroupV1Schema,\n ReportTargetSnapshotV1Schema,\n NarrativeRecordV1Schema,\n} from './safety/report.js';\nimport { SafetyCaseAlertV1Schema } from './safety/case-alert.js';\n// ===== Trust & Safety — child-safety case spine (§A1b, §A2) =====\nimport {\n ChildSafetyCaseListV1Schema,\n ChildSafetyCaseV1Schema,\n ChildSafetySourceSignalV1Schema,\n ChildSafetyDecisionV1Schema,\n ChildSafetyDecisionViewV1Schema,\n ChildSafetyCaseAccountV1Schema,\n ChildSafetyCaseAccountHistoryV1Schema,\n ChildSafetyNcmecSubmissionV1Schema,\n ChildSafetyNcmecSubmissionFileV1Schema,\n ChildSafetyLegalProcessEventV1Schema,\n} from './safety/case.js';\nimport {\n ChildSafetyOwningAliasV1Schema,\n} from './safety/case-aliases.js';\nimport {\n SafetyHoldRefV1Schema,\n SafetyHoldResourceV1Schema,\n SafetyResourceCommandV1Schema,\n SafetyResourceCommandAuthorizedRequestV1Schema,\n SafetyResourceCommandBypassRefV1Schema,\n} from './safety/holds.js';\nimport {\n SafetyEvidenceManifestV1Schema,\n SafetyEvidenceJobV1Schema,\n SafetyEvidenceJobItemV1Schema,\n SafetyEvidenceDispositionV1Schema,\n} from './safety/evidence.js';\nimport { EventProvenanceV1Schema } from './safety/provenance.js';\nimport {\n QuarantineSagaJobV1Schema,\n QuarantineSagaRelatedAssetV1Schema,\n NcmecSubmissionJobV1Schema,\n AccountActionCommandV1Schema,\n} from './safety/sagas.js';\nimport {\n SafetySlaMonitorV1Schema,\n SafetyMonitorHeartbeatV1Schema,\n} from './safety/monitors.js';\nimport { AgeAttestationNonceV1Schema, AgePolicyConfigV1Schema } from './safety/age.js';\nimport {\n PrivilegedReviewerPasskeyProfileV1Schema,\n PrivilegedReviewerCapabilityGrantV1Schema,\n} from './safety/reviewer-security.js';\n// ===== Trust & Safety — NCII / TAKE IT DOWN (§A11) =====\nimport { NciiAllegationV1Schema } from './ncii/allegations.js';\nimport {\n TakeItDownRequestRootV1Schema,\n TakeItDownRequesterPrivateV1Schema,\n TakeItDownSubmissionV1Schema,\n TakeItDownValidityDecisionV1Schema,\n TakeItDownRequestActionV1Schema,\n TakeItDownEvidenceV1Schema,\n NciiRetainedEvidenceInventoryV1Schema,\n} from './ncii/requests.js';\nimport {\n NciiCaseV1Schema,\n NciiCaseAllegationLinkV1Schema,\n NciiCaseRequestLinkV1Schema,\n NciiCaseRemovalActionV1Schema,\n NciiBlockedHashV1Schema,\n} from './ncii/cases.js';\nimport { NciiTemporaryHoldV1Schema } from './ncii/holds.js';\nimport {\n NciiRemovalJobV1Schema,\n NciiRemovalTargetV1Schema,\n} from './ncii/removal.js';\nimport {\n NciiPolicyConfigV1Schema,\n PrivilegedReviewerSecurityProfileV1Schema,\n} from './ncii/config.js';\n\nexport const COLLECTION_SCHEMAS = {\n // ===== Users =====\n 'userProfiles/{userId}': FullUserSchema,\n 'userProfiles/{userId}/privateData/{userId}': UserPrivateDataSchema,\n 'userProfiles/{userId}/privateData/hallLibraryPreferences': HallLibraryPreferencesSchema,\n 'userProfiles/{userId}/profileCraftSkills/{craftSkillId}': CraftSkillSchema,\n 'userProfiles/{userId}/auditionVotes/{auditionId}': UserAuditionVoteSchema,\n 'userProfiles/{userId}/mentionHistory/{docId}': MentionHistoryDocumentSchema,\n 'userProfiles/{userId}/notificationHistory/{notificationId}': NotificationHistoryDocSchema,\n 'userProfiles/{userId}/userLikes/likeHistory/squareStreetzLikes/{postId}': SquareStreetzLikeSchema,\n 'publicUsers/{uid}': PublicUserSchema,\n\n // ===== Work / Realm / Guild =====\n 'allWorkProjects/{workProjectId}': FullWorkProjectSchema,\n 'allWorkProjects/{workProjectId}/guildmateUsers/{uid}': GuildmateUserSchema,\n 'allWorkProjects/{workProjectId}/publicGuildmateUsers/{uid}': PublicGuildmateUserSchema,\n 'allWorkProjects/{workProjectId}/workFileFolders/{workFileFolderId}': WorkFileFolderSchema,\n 'allWorkProjects/{workProjectId}/workFileFolders/{workFileFolderId}/workFiles/{workFileId}': WorkFileSchema,\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}': FullTaleSchema,\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}/taleChapters/{chapterId}': FullChapterSchema,\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}': FullTuneSchema,\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}/tuneTracks/{trackId}': FullTuneTrackSchema,\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}': FullTelevisionSchema,\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}/televisionEpisodes/{episodeId}': FullTelevisionEpisodeSchema,\n 'allWorkProjects/{workProjectId}/guildChatChannels/{guildChatChannelId}': GuildChatChannelSchema,\n // Guild channel + invite messages are REALTIME-ONLY (chat Worker DO) — no Firestore schema.\n 'publicWorkProjects/{workProjectId}': PublicWorkProjectSchema,\n 'workRealms/{workRealmId}': WorkRealmSchema,\n 'guildInviteConversations/{guildInviteId}': GuildInviteConversationSchema,\n\n // ===== Square / Social =====\n 'squareStreetzFeed/activePosts/socialPosts/{postId}': SquareStreetzPostSchema,\n 'squareStreetzFeed/trendingPosts': TrendingPostsSchema,\n 'followEdges/{followEdgeId}': FollowEdgeSchema,\n 'followCounters/{followCounterId}': FollowCounterSchema,\n // Durable Square announcement outbox (Admin-SDK-only; deterministic job ids).\n 'squareAnnouncementJobs/{jobId}': SquareAnnouncementJobSchema,\n\n // ===== Payments / pledge ledger =====\n 'pledgePayments/{pledgePaymentId}': PledgePaymentSchema,\n 'pledgePaymentProviderRefs/{pledgePaymentId}': PledgePaymentProviderRefSchema,\n 'processedStripeEvents/{stripeEventId}': ProcessedStripeEventSchema,\n 'pledgePaymentLedgerEvents/{ledgerId}': PledgePaymentLedgerEventSchema,\n 'paymentWebhookQuarantine/{stripeEventId}': PaymentWebhookQuarantineSchema,\n 'pledgePaymentTotals/summary': PledgePaymentTotalsDocSchema,\n 'pledgeRefundRequests/{requestId}': PledgeRefundRequestSchema,\n\n // ===== Threshold / Hall =====\n 'thresholdItems/{thresholdItemId}': ThresholdItemSchema,\n 'hallItems/{hallItemId}': PublishedHallItemSchema,\n // Published hall sub-item projections — the chapter/track/episode docs copied out of\n // the Work at publish time (runPublishApprovedHallLibraryItem). Segment names are the\n // HALL_ITEM_SUBCOLLECTIONS constants (the lowercased WorkProjectType).\n 'hallItems/{hallItemId}/tales/{itemId}': PublishedChapterSchema,\n 'hallItems/{hallItemId}/tunes/{itemId}': PublishedTuneTrackSchema,\n 'hallItems/{hallItemId}/television/{itemId}': PublishedTelevisionEpisodeSchema,\n 'hallContentChangeRequests/{changeRequestId}': HallContentChangeRequestSchema,\n\n // ===== Commission / Audition =====\n 'commissionListings/{commissionListingId}': FullCommissionListingSchema,\n 'commissionListings/{commissionListingId}/commissionProposals/{commissionProposalId}': CommissionProposalSchema,\n 'auditionBoard/{auditionId}': AuditionSchema,\n 'auditionBoard/{auditionId}/auditionEntries/{auditionEntryId}': AuditionEntrySchema,\n\n // ===== Moderation / Reports / Admin =====\n // The report spine (§A1): the restricted root, its public projection subdoc, and the\n // dedup/count group. The root + projection are written by the app's submitReport\n // callable; the group is maintained by an app-side trigger.\n 'contentReports/{reportId}': ProtectedReportRootV1Schema,\n 'contentReports/{reportId}/publicProjection/{reportId}': ReportPublicProjectionV1Schema,\n 'contentReports/{reportId}/private/snapshot': ReportTargetSnapshotV1Schema,\n 'contentReports/{reportId}/private/narrative': NarrativeRecordV1Schema,\n 'activeReportGroups/{groupKey}': ReportGroupV1Schema,\n 'adminTasks/{taskId}': AdminTaskDocSchema,\n 'contentViolations/{violationId}': ContentViolationSchema,\n 'moderationCascadeManifests/{cascadeId}': ModerationCascadeManifestSchema,\n 'moderationCascadeManifests/{cascadeId}/changedDocs/{changedDocId}': ModerationCascadeChangedDocSchema,\n 'auditEvents/{eventId}': TTTAuditEventSchema,\n 'stakeShareAuditEvents/{eventId}': StakeShareAuditEventSchema,\n 'pendingAdminDispatches/{adminDispatchId}': AdminDispatchSchema,\n 'pendingAdminDispatches/{adminDispatchId}/conversationMessages/{adminDispatchMessageId}': ChatMessageV1Schema,\n\n // ===== Media pipeline =====\n 'pendingMedia/{pendingMediaId}': PendingMediaSchema,\n 'pendingMediaArchive/{pendingMediaId}': ArchivedPendingMediaSchema,\n 'mediaAssets/{mediaAssetId}': MediaAssetSchema,\n 'mediaActivationJobs/{jobId}': MediaActivationJobSchema,\n\n // ===== Notifications =====\n 'activeUserNotifications/{notificationId}': NotificationDocSchema,\n 'activeAdminNotifications/{notificationId}': NotificationDocSchema,\n 'adminNotificationHistory/{notificationId}': NotificationHistoryDocSchema,\n 'pendingNotifications/{notificationId}': PendingNotificationSchema,\n\n // ===== Notification redesign — delivery ledger + fanout engine =====\n 'notificationDeliveries/{deliveryId}': NotificationDeliverySchema,\n 'notificationFanoutJobs/{jobId}': NotificationFanoutJobSchema,\n\n // ===== Chat realtime sync / projection / commands =====\n 'chatChannelAuthProjections/{authPairKey}': ChatChannelAuthProjectionSchema,\n 'chatScopeDegraded/{scopeKey}': ChatScopeDegradedSchema,\n 'chatScopeDegraded/{scopeKey}/causes/{causeId}': ChatScopeDegradedCauseSchema,\n 'chatSyncEvents/{eventId}': ChatSyncEventSchema,\n 'chatSyncFanoutJobs/{jobId}': ChatSyncFanoutJobSchema,\n 'chatMessageOutbox/{commandId}': ChatMessageOutboxSchema,\n 'chatAdminActionCommands/{requestId}': ChatAdminActionCommandSchema,\n 'chatHistoryAnonymizationJobs/{jobId}': ChatHistoryAnonymizationJobSchema,\n 'chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal}': ChatHistoryAnonymizationAffectedChunkSchema,\n\n // ===== Craft skills index =====\n 'craftSkillsByTag/{tag}/taggedCraftSkills/{compositeId}': CraftSkillReferenceSchema,\n\n // ===== Operational / utility =====\n 'reservedDisplayNames/{displayNameUppercase}': ReservedDisplayNameSchema,\n 'reservedRealmNames/{workingTitleUppercase}': ReservedRealmNameSchema,\n 'accountDeletionRequests/{uid}': AccountDeletionRequestV1Schema,\n 'shortLinks/{shortId}': ShortLinkSchema,\n 'feedbackAliases/{aliasId}': FeedbackAliasSchema,\n 'feedbackSubmissions/{feedbackType}/userSuggestions/{suggestionId}': UserSuggestionSchema,\n 'statusReconcileQueue/{uid}': StatusReconcileQueueEntrySchema,\n\n // ===== Trust & Safety — child-safety case spine (§A1b, §A2) =====\n 'childSafetyCaseList/{caseId}': ChildSafetyCaseListV1Schema,\n 'activeSafetyCaseAlerts/{caseId}': SafetyCaseAlertV1Schema,\n 'childSafetyCases/{caseId}': ChildSafetyCaseV1Schema,\n 'childSafetyCases/{caseId}/sourceSignals/{signalId}': ChildSafetySourceSignalV1Schema,\n 'childSafetyCases/{caseId}/decisions/{decisionId}': ChildSafetyDecisionV1Schema,\n 'childSafetyCases/{caseId}/decisions/{decisionId}/views/{viewId}': ChildSafetyDecisionViewV1Schema,\n 'childSafetyCases/{caseId}/accounts/{uid}': ChildSafetyCaseAccountV1Schema,\n 'childSafetyCases/{caseId}/accounts/{uid}/history/{historyId}': ChildSafetyCaseAccountHistoryV1Schema,\n 'childSafetyCases/{caseId}/ncmecSubmissions/{submissionId}': ChildSafetyNcmecSubmissionV1Schema,\n 'childSafetyCases/{caseId}/ncmecSubmissions/{submissionId}/files/{fileId}': ChildSafetyNcmecSubmissionFileV1Schema,\n 'childSafetyCases/{caseId}/legalProcess/{eventId}': ChildSafetyLegalProcessEventV1Schema,\n 'childSafetyOwningAliases/{aliasId}': ChildSafetyOwningAliasV1Schema,\n\n // ===== Trust & Safety — holds + resource commands (§A3) =====\n 'safetyHoldRefs/{holdRefId}': SafetyHoldRefV1Schema,\n 'safetyHoldResources/{resourceKeyHash}': SafetyHoldResourceV1Schema,\n 'safetyResourceCommands/{commandDocId}': SafetyResourceCommandV1Schema,\n 'safetyResourceCommands/{commandDocId}/authorizedRequests/{requestId}': SafetyResourceCommandAuthorizedRequestV1Schema,\n 'safetyResourceCommands/{commandDocId}/bypassRefs/{refId}': SafetyResourceCommandBypassRefV1Schema,\n\n // ===== Trust & Safety — evidence + provenance (§A4, §A6) =====\n // SafetyEvidenceManifestV1Schema is a refined ZodObject (superRefine for the H5\n // sourceKind invariant); the schema-doc generator unwraps the effect to introspect\n // its shape, so binding the refined schema here is correct.\n 'safetyEvidenceManifests/{manifestId}': SafetyEvidenceManifestV1Schema,\n 'safetyEvidenceJobs/{jobId}': SafetyEvidenceJobV1Schema,\n 'safetyEvidenceJobs/{jobId}/items/{itemId}': SafetyEvidenceJobItemV1Schema,\n 'safetyEvidenceJobs/{jobId}/disposition/{locationId}': SafetyEvidenceDispositionV1Schema,\n 'eventProvenance/{eventId}': EventProvenanceV1Schema,\n\n // ===== Trust & Safety — sagas + closure (§A5) =====\n 'quarantineSagaJobs/{caseId}': QuarantineSagaJobV1Schema,\n 'quarantineSagaJobs/{caseId}/relatedAssets/{assetId}': QuarantineSagaRelatedAssetV1Schema,\n 'ncmecSubmissionJobs/{ncmecJobId}': NcmecSubmissionJobV1Schema,\n 'accountActionCommands/{accountActionCommandId}': AccountActionCommandV1Schema,\n\n // ===== Trust & Safety — SLA monitors + heartbeat (§A8) =====\n 'safetySlaMonitors/{monitorId}': SafetySlaMonitorV1Schema,\n 'safetyMonitorHeartbeat/global': SafetyMonitorHeartbeatV1Schema,\n\n // ===== Trust & Safety — age attestation nonces (§A7) =====\n 'ageAttestationNonces/{nonceHash}': AgeAttestationNonceV1Schema,\n\n // ===== Trust & Safety — per-operator privileged-reviewer security (§A11 [M-6] / [H-17]) =====\n // Backend-only (Cloud-Functions-only readers/writers; client access denied in firestore.rules).\n 'privilegedReviewerPasskeyProfiles/{uid}': PrivilegedReviewerPasskeyProfileV1Schema,\n 'privilegedReviewerCapabilityGrants/{uid}': PrivilegedReviewerCapabilityGrantV1Schema,\n\n // ===== Trust & Safety — NCII / TAKE IT DOWN (§A11) =====\n 'nciiAllegations/{allegationId}': NciiAllegationV1Schema,\n 'takeItDownRequests/{requestId}': TakeItDownRequestRootV1Schema,\n 'takeItDownRequests/{requestId}/private/requester': TakeItDownRequesterPrivateV1Schema,\n 'takeItDownRequests/{requestId}/submissions/{submissionId}': TakeItDownSubmissionV1Schema,\n 'takeItDownRequests/{requestId}/validityDecisions/{decisionId}': TakeItDownValidityDecisionV1Schema,\n 'takeItDownRequests/{requestId}/actions/{actionId}': TakeItDownRequestActionV1Schema,\n 'takeItDownRequests/{requestId}/evidence/{evidenceId}': TakeItDownEvidenceV1Schema,\n 'nciiCases/{caseId}': NciiCaseV1Schema,\n 'nciiCases/{caseId}/allegationLinks/{allegationId}': NciiCaseAllegationLinkV1Schema,\n 'nciiCases/{caseId}/requestLinks/{requestId}': NciiCaseRequestLinkV1Schema,\n 'nciiCases/{caseId}/removalActions/{actionId}': NciiCaseRemovalActionV1Schema,\n 'nciiCases/{caseId}/blockedHashes/{hashId}': NciiBlockedHashV1Schema,\n 'nciiRetainedEvidenceInventory/{inventoryId}': NciiRetainedEvidenceInventoryV1Schema,\n // [H-01] dead-letter sink for inventory rows that could not be written to the primary\n // nciiRetainedEvidenceInventory collection. Stores the same document shape.\n 'nciiInventoryDeadLetter/{inventoryId}': NciiRetainedEvidenceInventoryV1Schema,\n 'nciiTemporaryHolds/{holdId}': NciiTemporaryHoldV1Schema,\n 'nciiRemovalJobs/{jobId}': NciiRemovalJobV1Schema,\n 'nciiRemovalJobs/{jobId}/targets/{targetKeyHash}': NciiRemovalTargetV1Schema,\n\n // ===== _config singletons (public) =====\n '_config/app': AppConfigSchema,\n '_config/futurePlans': FuturePlansDocumentSchema,\n '_config/rulesAndAgreements': RulesAndAgreementsSchema,\n // Content-pages migration (DJ ruling 2026-07-06): /terms, /privacy, and the\n // /take-it-down page copy render exclusively from these (all public pages —\n // take-it-down is a NO-LOGIN page, so its copy doc must be publicly readable).\n '_config/termsOfService': LegalPageDocumentSchema,\n '_config/privacyPolicy': LegalPageDocumentSchema,\n '_config/takeItDownPageCopy': TakeItDownPageCopySchema,\n\n // ===== _serverData singletons (server-only — Cloud-Functions-only readers, BACKEND-108) =====\n '_serverData/agePolicy': AgePolicyConfigV1Schema,\n '_serverData/nciiPolicy': NciiPolicyConfigV1Schema,\n '_serverData/privilegedReviewerSecurity': PrivilegedReviewerSecurityProfileV1Schema,\n\n // ===== _systemData singletons =====\n '_systemData/adminList': AdminListSchema,\n '_systemData/profanityList': ProfanityListSchema,\n '_systemData/reservedUsernames': ReservedUsernamesSchema,\n '_systemData/blockedFranchiseNames': BlockedFranchiseNamesSchema,\n '_systemData/appMode': AppModeMarkerSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\nexport type RegisteredCollectionPath = keyof typeof COLLECTION_SCHEMAS;\n\n/**\n * Doc-id field annotation: for the listed bindings, the named body field equals the\n * Firestore document id and is injected at READ time (`{ ...doc.data(), <field>: doc.id }`),\n * never persisted — the write callables store the body via `Omit<…, '<field>'>`. The bound\n * schema models the (correct) consumer/read shape, where the field is required, so a raw\n * stored doc is \"missing\" it. The drift-check injects `{ [field]: doc.id, ...data }` before\n * validating, generalizing the one-off `AdminTaskDocSchema` stored-shape workaround into a\n * single mechanism so real-callable drift-checks don't false-flag every doc-id collection.\n * The schema-doc generator ignores this map. Keys are compiler-checked against the registry.\n */\nexport const COLLECTION_DOC_ID_FIELDS = {\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}/taleChapters/{chapterId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}/tuneTracks/{trackId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}/televisionEpisodes/{episodeId}': 'uid',\n 'allWorkProjects/{workProjectId}/guildChatChannels/{guildChatChannelId}': 'guildChatChannelId',\n // Published hall sub-items: the doc id IS the live sub-item's id; `uid` is injected at\n // read (the publish writer spreads the live doc's stored body, which has no `uid`).\n 'hallItems/{hallItemId}/tales/{itemId}': 'uid',\n 'hallItems/{hallItemId}/tunes/{itemId}': 'uid',\n 'hallItems/{hallItemId}/television/{itemId}': 'uid',\n 'activeUserNotifications/{notificationId}': 'id',\n 'activeAdminNotifications/{notificationId}': 'id',\n 'adminNotificationHistory/{notificationId}': 'archiveOccurrenceId',\n 'userProfiles/{userId}/notificationHistory/{notificationId}': 'archiveOccurrenceId',\n 'pendingNotifications/{notificationId}': 'id',\n 'statusReconcileQueue/{uid}': 'uid',\n} as const satisfies Partial<Record<RegisteredCollectionPath, string>>;\n\n/**\n * Collections that exist (in COLLECTIONS / *_SUBCOLLECTIONS or firestore.rules) but are\n * intentionally NOT bound to a schema, each with a reason. Listed EXPLICITLY so completeness is\n * enforced and nothing is silently uncovered; the registry test fails if a NEW unlisted collection\n * appears. These three are the only remaining gaps after the schema-registry binding pass:\n *\n * - userMetadata: `userProfiles/{uid}/userMetadata/notificationSettings` — a firestore.rules\n * match and `PATH_BUILDERS.userMetadata` exist, but there is no live reader/writer and no\n * notification-settings type anywhere yet. Bind once that shape is implemented.\n * - checkedOutItems: a `userProfiles/{uid}/checkedOutItems` subcollection constant with no writer,\n * reader, rule, or path-builder (the admin \"checked out items\" UI reads adminTasks by\n * `checkoutDetails.userId`, not this subcollection). Vestigial — remove once confirmed safe.\n * - feedbackDenylist: `feedbackDenylist/{deniedWord}` — Console-managed (firestore.rules §3F: no\n * callable writes it) and submitFeedback reads it via `.exists` only, so there is no field\n * contract to author a schema from. The doc id is the denied word; the body is unused.\n */\nexport const PENDING_COLLECTIONS: readonly string[] = [\n 'userMetadata',\n 'checkedOutItems',\n 'feedbackDenylist',\n // Append-only NCII case closure/reopen event rows — the doc shape is owned app-side\n // (NciiCaseV1 closure events), not modeled in ttt-core doc-schemas.\n 'closureEvents',\n] as const;\n"]}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,0FAA0F;AAC1F,oFAAoF;AACpF,yFAAyF;AACzF,mFAAmF;AACnF,EAAE;AACF,0FAA0F;AAC1F,4EAA4E;AAG5E,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM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E;IAC5E,4EAA4E;IAC5E,+EAA+E;IAC/E,wBAAwB,EAAE,uBAAuB;IACjD,uBAAuB,EAAE,uBAAuB;IAChD,4BAA4B,EAAE,wBAAwB;IAEtD,+FAA+F;IAC/F,uBAAuB,EAAE,uBAAuB;IAChD,wBAAwB,EAAE,wBAAwB;IAClD,wCAAwC,EAAE,yCAAyC;IAEnF,qCAAqC;IACrC,uBAAuB,EAAE,eAAe;IACxC,2BAA2B,EAAE,mBAAmB;IAChD,+BAA+B,EAAE,uBAAuB;IACxD,mCAAmC,EAAE,2BAA2B;IAChE,qBAAqB,EAAE,mBAAmB;CACK,CAAC;AAIlD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,2DAA2D,EAAE,KAAK;IAClE,oFAAoF,EAAE,KAAK;IAC3F,2DAA2D,EAAE,KAAK;IAClE,gFAAgF,EAAE,KAAK;IACvF,sEAAsE,EAAE,KAAK;IAC7E,qGAAqG,EAAE,KAAK;IAC5G,wEAAwE,EAAE,oBAAoB;IAC9F,uFAAuF;IACvF,oFAAoF;IACpF,uCAAuC,EAAE,KAAK;IAC9C,uCAAuC,EAAE,KAAK;IAC9C,4CAA4C,EAAE,KAAK;IACnD,0CAA0C,EAAE,IAAI;IAChD,2CAA2C,EAAE,IAAI;IACjD,2CAA2C,EAAE,qBAAqB;IAClE,4DAA4D,EAAE,qBAAqB;IACnF,uCAAuC,EAAE,IAAI;IAC7C,4BAA4B,EAAE,KAAK;CACiC,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,oFAAoF;IACpF,oEAAoE;IACpE,eAAe;CACP,CAAC","sourcesContent":["// Firestore collection registry — the single, authoritative binding from each Firestore\n// collection/subcollection path template to its document Zod schema. This is the input to\n// the schema-doc generator and the drift-check, and its completeness is CI-enforced\n// (registry.test.ts) against the COLLECTIONS / *_SUBCOLLECTIONS name constants, so a new\n// collection cannot be added without either a schema or an explicit PENDING entry.\n//\n// Path templates reuse the segment names from ../paths/collections.ts (and the shapes the\n// path-builders produce). `{placeholder}` segments are document/parent IDs.\n\nimport type { z } from 'zod';\nimport {\n FullUserSchema,\n UserPrivateDataSchema,\n CraftSkillSchema,\n CraftSkillReferenceSchema,\n} from './user.js';\nimport { PublicUserSchema } from './publicUser.js';\nimport { AccountDeletionRequestV1Schema } from './account-deletion.js';\nimport {\n FullWorkProjectSchema,\n PublicWorkProjectSchema,\n WorkFileFolderSchema,\n WorkFileSchema,\n WorkRealmSchema,\n GuildmateUserSchema,\n PublicGuildmateUserSchema,\n} from './work-project.js';\nimport {\n FullTaleSchema,\n FullChapterSchema,\n FullTuneSchema,\n FullTuneTrackSchema,\n FullTelevisionSchema,\n FullTelevisionEpisodeSchema,\n ThresholdItemSchema,\n PublishedHallItemSchema,\n PublishedChapterSchema,\n PublishedTuneTrackSchema,\n PublishedTelevisionEpisodeSchema,\n HallContentChangeRequestSchema,\n FuturePlansDocumentSchema,\n RulesAndAgreementsSchema,\n LegalPageDocumentSchema,\n TakeItDownPageCopySchema,\n HallLibraryPreferencesSchema,\n} from './content.js';\nimport {\n SquareStreetzPostSchema,\n MentionHistoryDocumentSchema,\n FollowEdgeSchema,\n FollowCounterSchema,\n SquareStreetzLikeSchema,\n TrendingPostsSchema,\n} from './social.js';\nimport {\n PledgePaymentSchema,\n PledgePaymentProviderRefSchema,\n ProcessedStripeEventSchema,\n PledgePaymentLedgerEventSchema,\n PaymentWebhookQuarantineSchema,\n PledgePaymentTotalsDocSchema,\n PledgeRefundRequestSchema,\n} from './payments.js';\nimport {\n FullCommissionListingSchema,\n CommissionProposalSchema,\n AuditionSchema,\n AuditionEntrySchema,\n UserAuditionVoteSchema,\n} from './commissions.js';\nimport {\n GuildChatChannelSchema,\n GuildInviteConversationSchema,\n AdminDispatchSchema,\n ChatMessageV1Schema,\n} from './messaging.js';\nimport { AppConfigSchema, AdminListSchema, ProfanityListSchema, ReservedUsernamesSchema, BlockedFranchiseNamesSchema, AppModeMarkerSchema } from './system.js';\nimport {\n ContentViolationSchema,\n ModerationCascadeManifestSchema,\n ModerationCascadeChangedDocSchema,\n} from './moderation.js';\nimport {\n AdminTaskDocSchema,\n} from './report-docs.js';\nimport { TTTAuditEventSchema } from './audit.js';\nimport {\n NotificationDocSchema,\n NotificationHistoryDocSchema,\n PendingNotificationSchema,\n} from './notifications.js';\nimport {\n NotificationDeliverySchema,\n NotificationFanoutJobSchema,\n} from './notification-ledger.js';\nimport {\n ChatChannelAuthProjectionSchema,\n ChatScopeDegradedSchema,\n ChatScopeDegradedCauseSchema,\n ChatSyncEventSchema,\n ChatSyncFanoutJobSchema,\n ChatMessageOutboxSchema,\n ChatAdminActionCommandSchema,\n ChatHistoryAnonymizationJobSchema,\n ChatHistoryAnonymizationAffectedChunkSchema,\n} from './chat-sync.js';\nimport { SquareAnnouncementJobSchema } from './square-announcement-jobs.js';\nimport { PendingMediaSchema, ArchivedPendingMediaSchema } from '../media/pending-media.js';\nimport { MediaAssetSchema } from './media-assets.js';\nimport { MediaActivationJobSchema } from './media-activation-jobs.js';\nimport {\n ReservedDisplayNameSchema,\n ReservedRealmNameSchema,\n StakeShareAuditEventSchema,\n ShortLinkSchema,\n FeedbackAliasSchema,\n UserSuggestionSchema,\n StatusReconcileQueueEntrySchema,\n} from './operational.js';\n// ===== Trust & Safety — report spine (§A1) =====\nimport {\n ProtectedReportRootV1Schema,\n ReportPublicProjectionV1Schema,\n ReportGroupV1Schema,\n ReportTargetSnapshotV1Schema,\n NarrativeRecordV1Schema,\n} from './safety/report.js';\nimport { SafetyCaseAlertV1Schema } from './safety/case-alert.js';\n// ===== Trust & Safety — child-safety case spine (§A1b, §A2) =====\nimport {\n ChildSafetyCaseListV1Schema,\n ChildSafetyCaseV1Schema,\n ChildSafetySourceSignalV1Schema,\n ChildSafetyDecisionV1Schema,\n ChildSafetyDecisionViewV1Schema,\n ChildSafetyCaseAccountV1Schema,\n ChildSafetyCaseAccountHistoryV1Schema,\n ChildSafetyNcmecSubmissionV1Schema,\n ChildSafetyNcmecSubmissionFileV1Schema,\n ChildSafetyLegalProcessEventV1Schema,\n} from './safety/case.js';\nimport {\n ChildSafetyOwningAliasV1Schema,\n} from './safety/case-aliases.js';\nimport {\n SafetyHoldRefV1Schema,\n SafetyHoldResourceV1Schema,\n SafetyResourceCommandV1Schema,\n SafetyResourceCommandAuthorizedRequestV1Schema,\n SafetyResourceCommandBypassRefV1Schema,\n} from './safety/holds.js';\nimport {\n SafetyEvidenceManifestV1Schema,\n SafetyEvidenceJobV1Schema,\n SafetyEvidenceJobItemV1Schema,\n SafetyEvidenceDispositionV1Schema,\n} from './safety/evidence.js';\nimport { EventProvenanceV1Schema } from './safety/provenance.js';\nimport {\n QuarantineSagaJobV1Schema,\n QuarantineSagaRelatedAssetV1Schema,\n NcmecSubmissionJobV1Schema,\n AccountActionCommandV1Schema,\n} from './safety/sagas.js';\nimport {\n SafetySlaMonitorV1Schema,\n SafetyMonitorHeartbeatV1Schema,\n} from './safety/monitors.js';\nimport { AgeAttestationNonceV1Schema, AgePolicyConfigV1Schema } from './safety/age.js';\nimport {\n PrivilegedReviewerPasskeyProfileV1Schema,\n PrivilegedReviewerCapabilityGrantV1Schema,\n} from './safety/reviewer-security.js';\n// ===== Trust & Safety — NCII / TAKE IT DOWN (§A11) =====\nimport { NciiAllegationV1Schema } from './ncii/allegations.js';\nimport {\n TakeItDownRequestRootV1Schema,\n TakeItDownRequesterPrivateV1Schema,\n TakeItDownSubmissionV1Schema,\n TakeItDownValidityDecisionV1Schema,\n TakeItDownRequestActionV1Schema,\n TakeItDownEvidenceV1Schema,\n NciiRetainedEvidenceInventoryV1Schema,\n} from './ncii/requests.js';\nimport {\n NciiCaseV1Schema,\n NciiCaseAllegationLinkV1Schema,\n NciiCaseRequestLinkV1Schema,\n NciiCaseRemovalActionV1Schema,\n NciiBlockedHashV1Schema,\n} from './ncii/cases.js';\nimport { NciiTemporaryHoldV1Schema } from './ncii/holds.js';\nimport {\n NciiRemovalJobV1Schema,\n NciiRemovalTargetV1Schema,\n} from './ncii/removal.js';\nimport {\n NciiPolicyConfigV1Schema,\n PrivilegedReviewerSecurityProfileV1Schema,\n} from './ncii/config.js';\n\nexport const COLLECTION_SCHEMAS = {\n // ===== Users =====\n 'userProfiles/{userId}': FullUserSchema,\n 'userProfiles/{userId}/privateData/{userId}': UserPrivateDataSchema,\n 'userProfiles/{userId}/privateData/hallLibraryPreferences': HallLibraryPreferencesSchema,\n 'userProfiles/{userId}/profileCraftSkills/{craftSkillId}': CraftSkillSchema,\n 'userProfiles/{userId}/auditionVotes/{auditionId}': UserAuditionVoteSchema,\n 'userProfiles/{userId}/mentionHistory/{docId}': MentionHistoryDocumentSchema,\n 'userProfiles/{userId}/notificationHistory/{notificationId}': NotificationHistoryDocSchema,\n 'userProfiles/{userId}/userLikes/likeHistory/squareStreetzLikes/{postId}': SquareStreetzLikeSchema,\n 'publicUsers/{uid}': PublicUserSchema,\n\n // ===== Work / Realm / Guild =====\n 'allWorkProjects/{workProjectId}': FullWorkProjectSchema,\n 'allWorkProjects/{workProjectId}/guildmateUsers/{uid}': GuildmateUserSchema,\n 'allWorkProjects/{workProjectId}/publicGuildmateUsers/{uid}': PublicGuildmateUserSchema,\n 'allWorkProjects/{workProjectId}/workFileFolders/{workFileFolderId}': WorkFileFolderSchema,\n 'allWorkProjects/{workProjectId}/workFileFolders/{workFileFolderId}/workFiles/{workFileId}': WorkFileSchema,\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}': FullTaleSchema,\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}/taleChapters/{chapterId}': FullChapterSchema,\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}': FullTuneSchema,\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}/tuneTracks/{trackId}': FullTuneTrackSchema,\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}': FullTelevisionSchema,\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}/televisionEpisodes/{episodeId}': FullTelevisionEpisodeSchema,\n 'allWorkProjects/{workProjectId}/guildChatChannels/{guildChatChannelId}': GuildChatChannelSchema,\n // Guild channel + invite messages are REALTIME-ONLY (chat Worker DO) — no Firestore schema.\n 'publicWorkProjects/{workProjectId}': PublicWorkProjectSchema,\n 'workRealms/{workRealmId}': WorkRealmSchema,\n 'guildInviteConversations/{guildInviteId}': GuildInviteConversationSchema,\n\n // ===== Square / Social =====\n // SquareStreetzPostSchema is a refined ZodObject (superRefine for the MEDIA-101\n // mediaAssetId↔mediaType pair invariant); the schema-doc generator and the\n // drift-check both unwrap the effect to introspect its shape, so binding the\n // refined schema here is correct.\n 'squareStreetzFeed/activePosts/socialPosts/{postId}': SquareStreetzPostSchema,\n 'squareStreetzFeed/trendingPosts': TrendingPostsSchema,\n 'followEdges/{followEdgeId}': FollowEdgeSchema,\n 'followCounters/{followCounterId}': FollowCounterSchema,\n // Durable Square announcement outbox (Admin-SDK-only; deterministic job ids).\n 'squareAnnouncementJobs/{jobId}': SquareAnnouncementJobSchema,\n\n // ===== Payments / pledge ledger =====\n 'pledgePayments/{pledgePaymentId}': PledgePaymentSchema,\n 'pledgePaymentProviderRefs/{pledgePaymentId}': PledgePaymentProviderRefSchema,\n 'processedStripeEvents/{stripeEventId}': ProcessedStripeEventSchema,\n 'pledgePaymentLedgerEvents/{ledgerId}': PledgePaymentLedgerEventSchema,\n 'paymentWebhookQuarantine/{stripeEventId}': PaymentWebhookQuarantineSchema,\n 'pledgePaymentTotals/summary': PledgePaymentTotalsDocSchema,\n 'pledgeRefundRequests/{requestId}': PledgeRefundRequestSchema,\n\n // ===== Threshold / Hall =====\n 'thresholdItems/{thresholdItemId}': ThresholdItemSchema,\n 'hallItems/{hallItemId}': PublishedHallItemSchema,\n // Published hall sub-item projections — the chapter/track/episode docs copied out of\n // the Work at publish time (runPublishApprovedHallLibraryItem). Segment names are the\n // HALL_ITEM_SUBCOLLECTIONS constants (the lowercased WorkProjectType).\n 'hallItems/{hallItemId}/tales/{itemId}': PublishedChapterSchema,\n 'hallItems/{hallItemId}/tunes/{itemId}': PublishedTuneTrackSchema,\n 'hallItems/{hallItemId}/television/{itemId}': PublishedTelevisionEpisodeSchema,\n 'hallContentChangeRequests/{changeRequestId}': HallContentChangeRequestSchema,\n\n // ===== Commission / Audition =====\n 'commissionListings/{commissionListingId}': FullCommissionListingSchema,\n 'commissionListings/{commissionListingId}/commissionProposals/{commissionProposalId}': CommissionProposalSchema,\n 'auditionBoard/{auditionId}': AuditionSchema,\n 'auditionBoard/{auditionId}/auditionEntries/{auditionEntryId}': AuditionEntrySchema,\n\n // ===== Moderation / Reports / Admin =====\n // The report spine (§A1): the restricted root, its public projection subdoc, and the\n // dedup/count group. The root + projection are written by the app's submitReport\n // callable; the group is maintained by an app-side trigger.\n 'contentReports/{reportId}': ProtectedReportRootV1Schema,\n 'contentReports/{reportId}/publicProjection/{reportId}': ReportPublicProjectionV1Schema,\n 'contentReports/{reportId}/private/snapshot': ReportTargetSnapshotV1Schema,\n 'contentReports/{reportId}/private/narrative': NarrativeRecordV1Schema,\n 'activeReportGroups/{groupKey}': ReportGroupV1Schema,\n 'adminTasks/{taskId}': AdminTaskDocSchema,\n 'contentViolations/{violationId}': ContentViolationSchema,\n 'moderationCascadeManifests/{cascadeId}': ModerationCascadeManifestSchema,\n 'moderationCascadeManifests/{cascadeId}/changedDocs/{changedDocId}': ModerationCascadeChangedDocSchema,\n 'auditEvents/{eventId}': TTTAuditEventSchema,\n 'stakeShareAuditEvents/{eventId}': StakeShareAuditEventSchema,\n 'pendingAdminDispatches/{adminDispatchId}': AdminDispatchSchema,\n 'pendingAdminDispatches/{adminDispatchId}/conversationMessages/{adminDispatchMessageId}': ChatMessageV1Schema,\n\n // ===== Media pipeline =====\n 'pendingMedia/{pendingMediaId}': PendingMediaSchema,\n 'pendingMediaArchive/{pendingMediaId}': ArchivedPendingMediaSchema,\n 'mediaAssets/{mediaAssetId}': MediaAssetSchema,\n 'mediaActivationJobs/{jobId}': MediaActivationJobSchema,\n\n // ===== Notifications =====\n 'activeUserNotifications/{notificationId}': NotificationDocSchema,\n 'activeAdminNotifications/{notificationId}': NotificationDocSchema,\n 'adminNotificationHistory/{notificationId}': NotificationHistoryDocSchema,\n 'pendingNotifications/{notificationId}': PendingNotificationSchema,\n\n // ===== Notification redesign — delivery ledger + fanout engine =====\n 'notificationDeliveries/{deliveryId}': NotificationDeliverySchema,\n 'notificationFanoutJobs/{jobId}': NotificationFanoutJobSchema,\n\n // ===== Chat realtime sync / projection / commands =====\n 'chatChannelAuthProjections/{authPairKey}': ChatChannelAuthProjectionSchema,\n 'chatScopeDegraded/{scopeKey}': ChatScopeDegradedSchema,\n 'chatScopeDegraded/{scopeKey}/causes/{causeId}': ChatScopeDegradedCauseSchema,\n 'chatSyncEvents/{eventId}': ChatSyncEventSchema,\n 'chatSyncFanoutJobs/{jobId}': ChatSyncFanoutJobSchema,\n 'chatMessageOutbox/{commandId}': ChatMessageOutboxSchema,\n 'chatAdminActionCommands/{requestId}': ChatAdminActionCommandSchema,\n 'chatHistoryAnonymizationJobs/{jobId}': ChatHistoryAnonymizationJobSchema,\n 'chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal}': ChatHistoryAnonymizationAffectedChunkSchema,\n\n // ===== Craft skills index =====\n 'craftSkillsByTag/{tag}/taggedCraftSkills/{compositeId}': CraftSkillReferenceSchema,\n\n // ===== Operational / utility =====\n 'reservedDisplayNames/{displayNameUppercase}': ReservedDisplayNameSchema,\n 'reservedRealmNames/{workingTitleUppercase}': ReservedRealmNameSchema,\n 'accountDeletionRequests/{uid}': AccountDeletionRequestV1Schema,\n 'shortLinks/{shortId}': ShortLinkSchema,\n 'feedbackAliases/{aliasId}': FeedbackAliasSchema,\n 'feedbackSubmissions/{feedbackType}/userSuggestions/{suggestionId}': UserSuggestionSchema,\n 'statusReconcileQueue/{uid}': StatusReconcileQueueEntrySchema,\n\n // ===== Trust & Safety — child-safety case spine (§A1b, §A2) =====\n 'childSafetyCaseList/{caseId}': ChildSafetyCaseListV1Schema,\n 'activeSafetyCaseAlerts/{caseId}': SafetyCaseAlertV1Schema,\n 'childSafetyCases/{caseId}': ChildSafetyCaseV1Schema,\n 'childSafetyCases/{caseId}/sourceSignals/{signalId}': ChildSafetySourceSignalV1Schema,\n 'childSafetyCases/{caseId}/decisions/{decisionId}': ChildSafetyDecisionV1Schema,\n 'childSafetyCases/{caseId}/decisions/{decisionId}/views/{viewId}': ChildSafetyDecisionViewV1Schema,\n 'childSafetyCases/{caseId}/accounts/{uid}': ChildSafetyCaseAccountV1Schema,\n 'childSafetyCases/{caseId}/accounts/{uid}/history/{historyId}': ChildSafetyCaseAccountHistoryV1Schema,\n 'childSafetyCases/{caseId}/ncmecSubmissions/{submissionId}': ChildSafetyNcmecSubmissionV1Schema,\n 'childSafetyCases/{caseId}/ncmecSubmissions/{submissionId}/files/{fileId}': ChildSafetyNcmecSubmissionFileV1Schema,\n 'childSafetyCases/{caseId}/legalProcess/{eventId}': ChildSafetyLegalProcessEventV1Schema,\n 'childSafetyOwningAliases/{aliasId}': ChildSafetyOwningAliasV1Schema,\n\n // ===== Trust & Safety — holds + resource commands (§A3) =====\n 'safetyHoldRefs/{holdRefId}': SafetyHoldRefV1Schema,\n 'safetyHoldResources/{resourceKeyHash}': SafetyHoldResourceV1Schema,\n 'safetyResourceCommands/{commandDocId}': SafetyResourceCommandV1Schema,\n 'safetyResourceCommands/{commandDocId}/authorizedRequests/{requestId}': SafetyResourceCommandAuthorizedRequestV1Schema,\n 'safetyResourceCommands/{commandDocId}/bypassRefs/{refId}': SafetyResourceCommandBypassRefV1Schema,\n\n // ===== Trust & Safety — evidence + provenance (§A4, §A6) =====\n // SafetyEvidenceManifestV1Schema is a refined ZodObject (superRefine for the H5\n // sourceKind invariant); the schema-doc generator unwraps the effect to introspect\n // its shape, so binding the refined schema here is correct.\n 'safetyEvidenceManifests/{manifestId}': SafetyEvidenceManifestV1Schema,\n 'safetyEvidenceJobs/{jobId}': SafetyEvidenceJobV1Schema,\n 'safetyEvidenceJobs/{jobId}/items/{itemId}': SafetyEvidenceJobItemV1Schema,\n 'safetyEvidenceJobs/{jobId}/disposition/{locationId}': SafetyEvidenceDispositionV1Schema,\n 'eventProvenance/{eventId}': EventProvenanceV1Schema,\n\n // ===== Trust & Safety — sagas + closure (§A5) =====\n 'quarantineSagaJobs/{caseId}': QuarantineSagaJobV1Schema,\n 'quarantineSagaJobs/{caseId}/relatedAssets/{assetId}': QuarantineSagaRelatedAssetV1Schema,\n 'ncmecSubmissionJobs/{ncmecJobId}': NcmecSubmissionJobV1Schema,\n 'accountActionCommands/{accountActionCommandId}': AccountActionCommandV1Schema,\n\n // ===== Trust & Safety — SLA monitors + heartbeat (§A8) =====\n 'safetySlaMonitors/{monitorId}': SafetySlaMonitorV1Schema,\n 'safetyMonitorHeartbeat/global': SafetyMonitorHeartbeatV1Schema,\n\n // ===== Trust & Safety — age attestation nonces (§A7) =====\n 'ageAttestationNonces/{nonceHash}': AgeAttestationNonceV1Schema,\n\n // ===== Trust & Safety — per-operator privileged-reviewer security (§A11 [M-6] / [H-17]) =====\n // Backend-only (Cloud-Functions-only readers/writers; client access denied in firestore.rules).\n 'privilegedReviewerPasskeyProfiles/{uid}': PrivilegedReviewerPasskeyProfileV1Schema,\n 'privilegedReviewerCapabilityGrants/{uid}': PrivilegedReviewerCapabilityGrantV1Schema,\n\n // ===== Trust & Safety — NCII / TAKE IT DOWN (§A11) =====\n 'nciiAllegations/{allegationId}': NciiAllegationV1Schema,\n 'takeItDownRequests/{requestId}': TakeItDownRequestRootV1Schema,\n 'takeItDownRequests/{requestId}/private/requester': TakeItDownRequesterPrivateV1Schema,\n 'takeItDownRequests/{requestId}/submissions/{submissionId}': TakeItDownSubmissionV1Schema,\n 'takeItDownRequests/{requestId}/validityDecisions/{decisionId}': TakeItDownValidityDecisionV1Schema,\n 'takeItDownRequests/{requestId}/actions/{actionId}': TakeItDownRequestActionV1Schema,\n 'takeItDownRequests/{requestId}/evidence/{evidenceId}': TakeItDownEvidenceV1Schema,\n 'nciiCases/{caseId}': NciiCaseV1Schema,\n 'nciiCases/{caseId}/allegationLinks/{allegationId}': NciiCaseAllegationLinkV1Schema,\n 'nciiCases/{caseId}/requestLinks/{requestId}': NciiCaseRequestLinkV1Schema,\n 'nciiCases/{caseId}/removalActions/{actionId}': NciiCaseRemovalActionV1Schema,\n 'nciiCases/{caseId}/blockedHashes/{hashId}': NciiBlockedHashV1Schema,\n 'nciiRetainedEvidenceInventory/{inventoryId}': NciiRetainedEvidenceInventoryV1Schema,\n // [H-01] dead-letter sink for inventory rows that could not be written to the primary\n // nciiRetainedEvidenceInventory collection. Stores the same document shape.\n 'nciiInventoryDeadLetter/{inventoryId}': NciiRetainedEvidenceInventoryV1Schema,\n 'nciiTemporaryHolds/{holdId}': NciiTemporaryHoldV1Schema,\n 'nciiRemovalJobs/{jobId}': NciiRemovalJobV1Schema,\n 'nciiRemovalJobs/{jobId}/targets/{targetKeyHash}': NciiRemovalTargetV1Schema,\n\n // ===== _config singletons (public) =====\n '_config/app': AppConfigSchema,\n '_config/futurePlans': FuturePlansDocumentSchema,\n '_config/rulesAndAgreements': RulesAndAgreementsSchema,\n // Content-pages migration (DJ ruling 2026-07-06): /terms, /privacy, and the\n // /take-it-down page copy render exclusively from these (all public pages —\n // take-it-down is a NO-LOGIN page, so its copy doc must be publicly readable).\n '_config/termsOfService': LegalPageDocumentSchema,\n '_config/privacyPolicy': LegalPageDocumentSchema,\n '_config/takeItDownPageCopy': TakeItDownPageCopySchema,\n\n // ===== _serverData singletons (server-only — Cloud-Functions-only readers, BACKEND-108) =====\n '_serverData/agePolicy': AgePolicyConfigV1Schema,\n '_serverData/nciiPolicy': NciiPolicyConfigV1Schema,\n '_serverData/privilegedReviewerSecurity': PrivilegedReviewerSecurityProfileV1Schema,\n\n // ===== _systemData singletons =====\n '_systemData/adminList': AdminListSchema,\n '_systemData/profanityList': ProfanityListSchema,\n '_systemData/reservedUsernames': ReservedUsernamesSchema,\n '_systemData/blockedFranchiseNames': BlockedFranchiseNamesSchema,\n '_systemData/appMode': AppModeMarkerSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\nexport type RegisteredCollectionPath = keyof typeof COLLECTION_SCHEMAS;\n\n/**\n * Doc-id field annotation: for the listed bindings, the named body field equals the\n * Firestore document id and is injected at READ time (`{ ...doc.data(), <field>: doc.id }`),\n * never persisted — the write callables store the body via `Omit<…, '<field>'>`. The bound\n * schema models the (correct) consumer/read shape, where the field is required, so a raw\n * stored doc is \"missing\" it. The drift-check injects `{ [field]: doc.id, ...data }` before\n * validating, generalizing the one-off `AdminTaskDocSchema` stored-shape workaround into a\n * single mechanism so real-callable drift-checks don't false-flag every doc-id collection.\n * The schema-doc generator ignores this map. Keys are compiler-checked against the registry.\n */\nexport const COLLECTION_DOC_ID_FIELDS = {\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTales/{taleId}/taleChapters/{chapterId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTunes/{tuneId}/tuneTracks/{trackId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}': 'uid',\n 'allWorkProjects/{workProjectId}/workProjectTelevision/{televisionId}/televisionEpisodes/{episodeId}': 'uid',\n 'allWorkProjects/{workProjectId}/guildChatChannels/{guildChatChannelId}': 'guildChatChannelId',\n // Published hall sub-items: the doc id IS the live sub-item's id; `uid` is injected at\n // read (the publish writer spreads the live doc's stored body, which has no `uid`).\n 'hallItems/{hallItemId}/tales/{itemId}': 'uid',\n 'hallItems/{hallItemId}/tunes/{itemId}': 'uid',\n 'hallItems/{hallItemId}/television/{itemId}': 'uid',\n 'activeUserNotifications/{notificationId}': 'id',\n 'activeAdminNotifications/{notificationId}': 'id',\n 'adminNotificationHistory/{notificationId}': 'archiveOccurrenceId',\n 'userProfiles/{userId}/notificationHistory/{notificationId}': 'archiveOccurrenceId',\n 'pendingNotifications/{notificationId}': 'id',\n 'statusReconcileQueue/{uid}': 'uid',\n} as const satisfies Partial<Record<RegisteredCollectionPath, string>>;\n\n/**\n * Collections that exist (in COLLECTIONS / *_SUBCOLLECTIONS or firestore.rules) but are\n * intentionally NOT bound to a schema, each with a reason. Listed EXPLICITLY so completeness is\n * enforced and nothing is silently uncovered; the registry test fails if a NEW unlisted collection\n * appears. These three are the only remaining gaps after the schema-registry binding pass:\n *\n * - userMetadata: `userProfiles/{uid}/userMetadata/notificationSettings` — a firestore.rules\n * match and `PATH_BUILDERS.userMetadata` exist, but there is no live reader/writer and no\n * notification-settings type anywhere yet. Bind once that shape is implemented.\n * - checkedOutItems: a `userProfiles/{uid}/checkedOutItems` subcollection constant with no writer,\n * reader, rule, or path-builder (the admin \"checked out items\" UI reads adminTasks by\n * `checkoutDetails.userId`, not this subcollection). Vestigial — remove once confirmed safe.\n * - feedbackDenylist: `feedbackDenylist/{deniedWord}` — Console-managed (firestore.rules §3F: no\n * callable writes it) and submitFeedback reads it via `.exists` only, so there is no field\n * contract to author a schema from. The doc id is the denied word; the body is unused.\n */\nexport const PENDING_COLLECTIONS: readonly string[] = [\n 'userMetadata',\n 'checkedOutItems',\n 'feedbackDenylist',\n // Append-only NCII case closure/reopen event rows — the doc shape is owned app-side\n // (NciiCaseV1 closure events), not modeled in ttt-core doc-schemas.\n 'closureEvents',\n] as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"age.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/age.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB;;;EAA4B,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAA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AExE;0EAC0E;AAC1E,eAAO,MAAM,4BAA4B,EAAE,iBAsB1C,CAAC;AAaF,eAAO,MAAM,6BAA6B;;;;;;;kBAO/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAUpF;6EAC6E;AAC7E,eAAO,MAAM,wCAAwC;;;;kBAI1C,CAAC;AACZ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G;;kFAEkF;AAClF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;kBAoBhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;mDACmD;AACnD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;CAWhC,CAAC;AAUX,OAAO,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AACtE,YAAY,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAErE;;sBAEsB;AACtB,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;kBAGtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
@@ -17,9 +17,10 @@
17
17
  // orchestrator merges into `UserPrivateDataSchema` (privateData/{uid}). This file
18
18
  // does NOT edit user.ts.
19
19
  //
20
- // Every field/enum/optionality/bound is transcribed verbatim from the frozen spec
21
- // (docs/code_changes_needed/trust-and-safety/IMPLEMENTATION_PLAN.md, Appendix A) — no
22
- // invented values, no placeholders.
20
+ // Every field/enum/optionality/bound is transcribed verbatim from the frozen Trust &
21
+ // Safety spec (Appendix A); the durable design owners are ttt-prod
22
+ // docs/design/age-gating-and-account-types.md and
23
+ // docs/design/age-data-handling-profile.md — no invented values, no placeholders.
23
24
  //
24
25
  // `RegistrationCompletionOutcome` is the DOMAIN outcome that feeds the orphan-Auth
25
26
  // deletion policy; it is the SINGLE SOURCE in ./foundation.js and is IMPORTED here
@@ -1 +1 @@
1
- {"version":3,"file":"age.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/age.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,qFAAqF;AACrF,kBAAkB;AAClB,EAAE;AACF,qBAAqB;AACrB,iFAAiF;AACjF,oFAAoF;AACpF,sEAAsE;AACtE,uFAAuF;AACvF,qFAAqF;AACrF,8CAA8C;AAC9C,uFAAuF;AACvF,mFAAmF;AACnF,iCAAiC;AACjC,0DAA0D;AAC1D,kFAAkF;AAClF,sFAAsF;AACtF,6BAA6B;AAC7B,EAAE;AACF,kFAAkF;AAClF,sFAAsF;AACtF,oCAAoC;AACpC,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,qBAAqB;AACrB,EAAE;AACF,iFAAiF;AACjF,sFAAsF;AACtF,gBAAgB;AAEhB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAEtE,8EAA8E;AAC9E,gEAAgE;AAChE,oFAAoF;AACpF,oFAAoF;AACpF,iFAAiF;AACjF,yFAAyF;AACzF,oFAAoF;AACpF,8EAA8E;AAE9E,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAG1D,uFAAuF;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAGzF;;gEAEgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,OAAO,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,sEAAsE;AACtE,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,gCAAgC;AAChC,8EAA8E;AAE9E,OAAO,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAGtE;;sBAEsB;AACtB,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,OAAO,EAAE,mCAAmC;IAC5C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,qDAAqD;CACzF,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — age attestation, registration nonce, and account age-fields\n// (Appendix A §A7 — \"Age (full contract)\" + the §A11 [H6] concrete AgePolicyConfigV1\n// default block).\n//\n// This cluster owns:\n// - `ageAttestationNonces/{nonceHash}` (AgeAttestationNonceV1) — the one-time,\n// 256-bit server-generated registration nonce. Only the SHA-256 of the nonce is\n// the doc id; the raw nonce appears only inside the signed token.\n// - The pinned `ageBracketAttestation` JWS payload-claims shape [M-09] — the DECODED\n// claims of the compact JWS (JWT, RFC 7519, alg=HS256) issued at /api/age/attest\n// and verified at /api/register/complete.\n// - The `__Secure-ttt_age_session` cookie spec [F13] (an exported const, NOT a doc).\n// - `AgePolicyConfigV1` (the `_config/agePolicy` singleton) + its pinned literal\n// default const (§A11 [H6]).\n// - The teen→adult `ageUpgradeAttestation` token shape.\n// - `UserPrivateDataAgeFieldsSchema` — the STANDALONE age-fields shape that the\n// orchestrator merges into `UserPrivateDataSchema` (privateData/{uid}). This file\n// does NOT edit user.ts.\n//\n// Every field/enum/optionality/bound is transcribed verbatim from the frozen spec\n// (docs/code_changes_needed/trust-and-safety/IMPLEMENTATION_PLAN.md, Appendix A) — no\n// invented values, no placeholders.\n//\n// `RegistrationCompletionOutcome` is the DOMAIN outcome that feeds the orphan-Auth\n// deletion policy; it is the SINGLE SOURCE in ./foundation.js and is IMPORTED here\n// (never redefined).\n//\n// Timestamp convention: epoch-MILLISECONDS via z.number() — EXCEPT the JWS token\n// claims `iat`/`exp`, which are epoch-SECONDS per JWT (RFC 7519); those are commented\n// at the claim.\n\nimport { z } from 'zod';\nimport { RegistrationCompletionOutcomeSchema } from './foundation.js';\n\n// ===========================================================================\n// A7 — ageAttestationNonces/{nonceHash} (AgeAttestationNonceV1)\n// One-time, 256-bit server-generated nonce. Only the nonce's SHA-256 is the doc id;\n// the raw nonce appears only inside the signed token. 10-minute TTL; one successful\n// consume, transactionally bound to the new Auth uid AND the requestSessionHash;\n// expired/used/unknown fails closed. Spent records auto-delete ~24h after consume/expiry\n// via a Firestore native-TTL policy on `ttlExpireAt` (F-018) — no scheduled reaper.\n// ===========================================================================\n\n/** Server-derived audience bracket — NEVER client-derived. */\nexport const AgeBracketSchema = z.enum(['teen', 'adult']);\nexport type AgeBracket = z.infer<typeof AgeBracketSchema>;\n\n/** Nonce lifecycle status. `expired`/`consumed`/unknown all fail closed at consume. */\nexport const AgeAttestationNonceStatusSchema = z.enum(['issued', 'consumed', 'expired']);\nexport type AgeAttestationNonceStatus = z.infer<typeof AgeAttestationNonceStatusSchema>;\n\n/** `ageAttestationNonces/{nonceHash}` — the registration attestation nonce record.\n * Doc id is the SHA-256 hex of the 256-bit server nonce (deterministic; the raw\n * nonce lives only in the signed token, never in Firestore). */\nexport const AgeAttestationNonceV1Schema = z.object({\n schemaVersion: z.literal(1),\n bracket: AgeBracketSchema, // SERVER-derived audience bracket\n policyVersion: z.string().min(1), // the agePolicyVersion in force when issued\n signingKeyVersion: z.string().min(1), // the versioned KMS/Secret-Manager key that signs the token (= JWS `kid`)\n requestSessionHash: z.string().min(1), // SHA-256 of the registering session/request marker — the binding (High-6 §D)\n issuedAt: z.number(), // epoch ms\n expiresAt: z.number(), // epoch ms; issuedAt + 10-min TTL\n consumedAt: z.number().optional(), // epoch ms; set on the one successful consume\n consumedByUid: z.string().min(1).optional(), // the new Auth uid this nonce was transactionally bound to\n status: AgeAttestationNonceStatusSchema,\n // [Q21.5 REVISED — DJ 2026-07-06] The nonce carries NO date of birth for ANY bracket.\n // Registration never persists a DOB (adult or teen — only the derived bracket survives);\n // the previous adult-bracket `dateOfBirth` carry field was removed. The ONLY place a DOB\n // is ever persisted is becomeArtisanCreator ('artisanOnboarding') — see\n // UserPrivateDataAgeFieldsSchema below. Raw DOBs remain no-log everywhere.\n // [F-018] Firestore NATIVE-TTL field. Set to a real Firestore `Timestamp` of (consume/expire time +\n // ~24h) at the moment the nonce becomes spent; a TTL policy on `ageAttestationNonces.ttlExpireAt`\n // then auto-deletes the spent single-use record (no scheduled reaper). DOCUMENTED EXCEPTION to this\n // file's epoch-ms-number convention: native TTL requires a real Timestamp, and this field is\n // WRITE-ONLY (never read by app code), so it is typed opaquely here (`z.unknown`) to avoid pulling a\n // firebase `Timestamp` type into the environment-agnostic ttt-core schema layer (the app writes it via\n // `admin.firestore.Timestamp.fromMillis`, mirroring notification-core's `expireAt`). Absent until spent.\n ttlExpireAt: z.unknown().optional(),\n}).strict();\nexport type AgeAttestationNonceV1 = z.infer<typeof AgeAttestationNonceV1Schema>;\n\n// ===========================================================================\n// A7 [M-09] — ageBracketAttestation JWS payload claims (the ONE pinned wire format)\n//\n// The token is a COMPACT JWS (JWT, RFC 7519) with alg=HS256, signed by the versioned\n// KMS/Secret-Manager key. The schema below validates the DECODED PAYLOAD CLAIMS only.\n//\n// JOSE header (NOT part of this schema — documented for the verifier):\n// { \"alg\": \"HS256\", \"typ\": \"JWT\", \"kid\": <signingKeyVersion> } // kid = the exact signingKeyVersion\n//\n// Serialization: standard JWS compact form\n// base64url(header) '.' base64url(payload) '.' base64url(sig)\n// the signature is base64url (no padding); claim names + types are EXACTLY as below\n// (no extra claims).\n//\n// Verification REQUIRES (fail-closed on any miss): valid HS256 signature under the key\n// named by `kid`; aud == \"ttt-register-complete\"; iss == \"ttt-age-attest\"; exp not\n// passed; sub matches the ageAttestationNonces doc being consumed; rsh matches the\n// request's requestSessionHash.\n//\n// `iat`/`exp` are epoch-SECONDS (per JWT), NOT epoch-millis like the rest of this file.\n// ===========================================================================\n\nexport const AgeBracketAttestationClaimsV1Schema = z.object({\n iss: z.literal('ttt-age-attest'), // issuer\n aud: z.literal('ttt-register-complete'), // AUDIENCE/purpose binding — /api/register/complete MUST verify aud\n sub: z.string().min(1), // the SHA-256 nonce hash (also the ageAttestationNonces doc id)\n iat: z.number().int(), // epoch SECONDS (per JWT)\n exp: z.number().int(), // epoch SECONDS (per JWT); exp = iat + 600 (10-min TTL)\n bkt: AgeBracketSchema, // the SERVER-derived bracket (never client-derived)\n pv: z.string().min(1), // agePolicyVersion string\n rsh: z.string().min(1), // sha256(cookieValue) — the session binding\n}).strict();\nexport type AgeBracketAttestationClaimsV1 = z.infer<typeof AgeBracketAttestationClaimsV1Schema>;\n\n// ===========================================================================\n// A7 [F13] — Age-session cookie spec (`__Secure-ttt_age_session`)\n//\n// Pinned cookie attributes. The cookie VALUE is a cryptographically-random value\n// generated per registration attempt; only requestSessionHash = sha256(cookieValue)\n// is stored (with the nonce) — the raw cookie value is NEVER persisted. A separate\n// non-unique UX marker may exist for display, but is NEVER the security binding.\n//\n// `Domain` is omitted (host-only) — represented here by `hostOnly: true`.\n// ===========================================================================\n\nexport const AGE_SESSION_COOKIE_SPEC = {\n name: '__Secure-ttt_age_session',\n hostOnly: true, // Domain attribute omitted → host-only cookie\n path: '/api',\n secure: true,\n httpOnly: true,\n sameSite: 'Strict',\n maxAgeSeconds: 600, // 10 min\n} as const;\n\n// ===========================================================================\n// A7 / A11 [H6] — AgePolicyConfigV1 (the `_config/agePolicy` singleton)\n//\n// The generic gRPC retryable/terminal code lists are REMOVED — deletion is driven\n// ONLY by the RegistrationCompletionOutcome domain enum (§A7). No raw gRPC code ever\n// deletes an account. noDeleteOutcomes / terminalDeletableOutcomes are typed against\n// the imported RegistrationCompletionOutcome enum so the two arrays can never drift\n// from the domain outcome set.\n// ===========================================================================\n\nexport const AgePolicyConfigV1Schema = z.object({\n agePolicyVersion: z.string().min(1),\n registrationGracePeriodMinutes: z.number().int(),\n cleanupSchedule: z.string().min(1), // cron expression for the orphan-Auth cleanup worker\n ageTokenTtlSeconds: z.number().int(), // [M-09] token TTL\n keyRetirementVerificationMinutes: z.number().int(), // [M-09] retired-signingKeyVersion verification window (> TTL so no live token is orphaned by a rotation)\n noDeleteOutcomes: z.array(RegistrationCompletionOutcomeSchema),\n terminalDeletableOutcomes: z.array(RegistrationCompletionOutcomeSchema),\n}).strict();\nexport type AgePolicyConfigV1 = z.infer<typeof AgePolicyConfigV1Schema>;\n\n/** The pinned literal default for `_config/agePolicy` (§A11 [H6] concrete config\n * values). Build defaults — transcribed verbatim from the frozen spec. */\nexport const DEFAULT_AGE_POLICY_CONFIG_V1: AgePolicyConfigV1 = {\n agePolicyVersion: '2026-06-19.general-audience.v1',\n registrationGracePeriodMinutes: 30,\n cleanupSchedule: '*/15 * * * *',\n ageTokenTtlSeconds: 600,\n keyRetirementVerificationMinutes: 15,\n noDeleteOutcomes: [\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'privateDataConflict',\n ],\n terminalDeletableOutcomes: [\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'policyVersionRejected',\n ],\n};\n\n// ===========================================================================\n// A7 — teen→adult ageUpgradeAttestation token\n//\n// A SEPARATE token (not the registration nonce) issued to an authenticated,\n// recently-reauthenticated session. Binds uid + accountCapabilityVersion +\n// policyVersion + issued/expiry + nonce; consumed ONLY for that uid+version; never\n// the registration nonce, never cross-account.\n//\n// This is a token claims shape (decoded payload), NOT a stored Firestore doc.\n// ===========================================================================\n\nexport const AgeUpgradeAttestationV1Schema = z.object({\n uid: z.string().min(1), // the authenticated, recently-reauthenticated account\n accountCapabilityVersion: z.number().int(), // the capability version this upgrade is bound to\n policyVersion: z.string().min(1), // agePolicyVersion in force\n issuedAt: z.number(), // epoch ms\n expiresAt: z.number(), // epoch ms\n nonce: z.string().min(1), // single-use upgrade nonce (never the registration nonce; never cross-account)\n}).strict();\nexport type AgeUpgradeAttestationV1 = z.infer<typeof AgeUpgradeAttestationV1Schema>;\n\n// ===========================================================================\n// A7 — UserPrivateData age fields (STANDALONE shape for the orchestrator)\n//\n// These fields live on `privateData/{uid}` (server-write-only). They are exported as\n// a STANDALONE object shape so the orchestrator can merge them into\n// `UserPrivateDataSchema` in user.ts WITHOUT this file editing user.ts.\n// ===========================================================================\n\n/** Manual age-correction audit stub (who corrected, when, why) — embedded on the\n * private user data when a reviewer hand-corrects the recorded age state. */\nexport const UserPrivateDataAgeManualCorrectionSchema = z.object({\n at: z.number(), // epoch ms\n actorId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type UserPrivateDataAgeManualCorrection = z.infer<typeof UserPrivateDataAgeManualCorrectionSchema>;\n\n/** STANDALONE age-fields shape — the orchestrator merges these into\n * `UserPrivateDataSchema` (privateData/{uid}, server-write-only). Exported as a raw\n * object shape (NOT a z.object) so it can be spread into the canonical schema. */\nexport const UserPrivateDataAgeFieldsSchema = z.object({\n accountType: AgeBracketSchema, // 'teen' | 'adult'\n is18Plus: z.boolean(),\n agePolicyVersion: z.string().min(1),\n accountCapabilityVersion: z.number().int(),\n ageAttestedAt: z.number(), // epoch ms\n adultUpgradedAt: z.number().optional(), // epoch ms; set on a successful teen→adult upgrade\n ageManualCorrection: UserPrivateDataAgeManualCorrectionSchema.optional(),\n // [Q21.5 REVISED — DJ 2026-07-06, counsel review pending in the lawyer packet] The DOB is\n // persisted at EXACTLY ONE point: becomeArtisanCreator ('artisanOnboarding'). Registration\n // and the teen→adult upgrade derive the bracket server-side and persist NO DOB for anyone\n // (the register screen's \"It is not stored\" notice is literally true). Rationale: the\n // payout-KYC cross-check (compare to Stripe KYC DOB before paying out) only ever applies to\n // artisans — the money boundary — so collection happens there, with UI copy warning the\n // DOB must match the user's future payout identity. Server re-derives 18+ from the entered\n // DOB; an under-18 derivation rejects with a failure audit and stores nothing. PII —\n // privateData only (BACKEND-105); same no-log posture as the raw DOB (scrubber + canary).\n attestedDateOfBirth: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/).optional(), // 'YYYY-MM-DD'\n attestedDobRecordedAt: z.number().optional(), // epoch ms\n attestedDobSource: z.enum(['artisanOnboarding']).optional(),\n}).strict();\nexport type UserPrivateDataAgeFields = z.infer<typeof UserPrivateDataAgeFieldsSchema>;\n\n/** The raw shape (for the orchestrator to `.extend(...)` / spread into\n * `UserPrivateDataSchema` without re-wrapping). */\nexport const userPrivateDataAgeFieldsShape = {\n accountType: AgeBracketSchema,\n is18Plus: z.boolean(),\n agePolicyVersion: z.string().min(1),\n accountCapabilityVersion: z.number().int(),\n ageAttestedAt: z.number(),\n adultUpgradedAt: z.number().optional(),\n ageManualCorrection: UserPrivateDataAgeManualCorrectionSchema.optional(),\n attestedDateOfBirth: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/).optional(),\n attestedDobRecordedAt: z.number().optional(),\n attestedDobSource: z.enum(['artisanOnboarding']).optional(),\n} as const;\n\n// ===========================================================================\n// A7 — Registration-completion RESULT (uses the IMPORTED domain enum)\n//\n// `completeRegistration.ts` returns exactly one RegistrationCompletionOutcome. The\n// enum itself is the SINGLE SOURCE in ./foundation.js — re-exported here for cluster\n// convenience, NEVER redefined.\n// ===========================================================================\n\nexport { RegistrationCompletionOutcomeSchema } from './foundation.js';\nexport type { RegistrationCompletionOutcome } from './foundation.js';\n\n/** The result envelope `completeRegistration.ts` returns. `outcome` is the imported\n * domain enum (never a raw gRPC code); only this domain outcome feeds the orphan-Auth\n * deletion policy. */\nexport const RegistrationCompletionResultV1Schema = z.object({\n outcome: RegistrationCompletionOutcomeSchema,\n uid: z.string().min(1).optional(), // present on 'completed' / 'alreadyCompletedSameUid'\n}).strict();\nexport type RegistrationCompletionResultV1 = z.infer<typeof RegistrationCompletionResultV1Schema>;\n"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AAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAGtE;;sBAEsB;AACtB,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,OAAO,EAAE,mCAAmC;IAC5C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,qDAAqD;CACzF,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — age attestation, registration nonce, and account age-fields\n// (Appendix A §A7 — \"Age (full contract)\" + the §A11 [H6] concrete AgePolicyConfigV1\n// default block).\n//\n// This cluster owns:\n// - `ageAttestationNonces/{nonceHash}` (AgeAttestationNonceV1) — the one-time,\n// 256-bit server-generated registration nonce. Only the SHA-256 of the nonce is\n// the doc id; the raw nonce appears only inside the signed token.\n// - The pinned `ageBracketAttestation` JWS payload-claims shape [M-09] — the DECODED\n// claims of the compact JWS (JWT, RFC 7519, alg=HS256) issued at /api/age/attest\n// and verified at /api/register/complete.\n// - The `__Secure-ttt_age_session` cookie spec [F13] (an exported const, NOT a doc).\n// - `AgePolicyConfigV1` (the `_config/agePolicy` singleton) + its pinned literal\n// default const (§A11 [H6]).\n// - The teen→adult `ageUpgradeAttestation` token shape.\n// - `UserPrivateDataAgeFieldsSchema` — the STANDALONE age-fields shape that the\n// orchestrator merges into `UserPrivateDataSchema` (privateData/{uid}). This file\n// does NOT edit user.ts.\n//\n// Every field/enum/optionality/bound is transcribed verbatim from the frozen Trust &\n// Safety spec (Appendix A); the durable design owners are ttt-prod\n// docs/design/age-gating-and-account-types.md and\n// docs/design/age-data-handling-profile.md — no invented values, no placeholders.\n//\n// `RegistrationCompletionOutcome` is the DOMAIN outcome that feeds the orphan-Auth\n// deletion policy; it is the SINGLE SOURCE in ./foundation.js and is IMPORTED here\n// (never redefined).\n//\n// Timestamp convention: epoch-MILLISECONDS via z.number() — EXCEPT the JWS token\n// claims `iat`/`exp`, which are epoch-SECONDS per JWT (RFC 7519); those are commented\n// at the claim.\n\nimport { z } from 'zod';\nimport { RegistrationCompletionOutcomeSchema } from './foundation.js';\n\n// ===========================================================================\n// A7 — ageAttestationNonces/{nonceHash} (AgeAttestationNonceV1)\n// One-time, 256-bit server-generated nonce. Only the nonce's SHA-256 is the doc id;\n// the raw nonce appears only inside the signed token. 10-minute TTL; one successful\n// consume, transactionally bound to the new Auth uid AND the requestSessionHash;\n// expired/used/unknown fails closed. Spent records auto-delete ~24h after consume/expiry\n// via a Firestore native-TTL policy on `ttlExpireAt` (F-018) — no scheduled reaper.\n// ===========================================================================\n\n/** Server-derived audience bracket — NEVER client-derived. */\nexport const AgeBracketSchema = z.enum(['teen', 'adult']);\nexport type AgeBracket = z.infer<typeof AgeBracketSchema>;\n\n/** Nonce lifecycle status. `expired`/`consumed`/unknown all fail closed at consume. */\nexport const AgeAttestationNonceStatusSchema = z.enum(['issued', 'consumed', 'expired']);\nexport type AgeAttestationNonceStatus = z.infer<typeof AgeAttestationNonceStatusSchema>;\n\n/** `ageAttestationNonces/{nonceHash}` — the registration attestation nonce record.\n * Doc id is the SHA-256 hex of the 256-bit server nonce (deterministic; the raw\n * nonce lives only in the signed token, never in Firestore). */\nexport const AgeAttestationNonceV1Schema = z.object({\n schemaVersion: z.literal(1),\n bracket: AgeBracketSchema, // SERVER-derived audience bracket\n policyVersion: z.string().min(1), // the agePolicyVersion in force when issued\n signingKeyVersion: z.string().min(1), // the versioned KMS/Secret-Manager key that signs the token (= JWS `kid`)\n requestSessionHash: z.string().min(1), // SHA-256 of the registering session/request marker — the binding (High-6 §D)\n issuedAt: z.number(), // epoch ms\n expiresAt: z.number(), // epoch ms; issuedAt + 10-min TTL\n consumedAt: z.number().optional(), // epoch ms; set on the one successful consume\n consumedByUid: z.string().min(1).optional(), // the new Auth uid this nonce was transactionally bound to\n status: AgeAttestationNonceStatusSchema,\n // [Q21.5 REVISED — DJ 2026-07-06] The nonce carries NO date of birth for ANY bracket.\n // Registration never persists a DOB (adult or teen — only the derived bracket survives);\n // the previous adult-bracket `dateOfBirth` carry field was removed. The ONLY place a DOB\n // is ever persisted is becomeArtisanCreator ('artisanOnboarding') — see\n // UserPrivateDataAgeFieldsSchema below. Raw DOBs remain no-log everywhere.\n // [F-018] Firestore NATIVE-TTL field. Set to a real Firestore `Timestamp` of (consume/expire time +\n // ~24h) at the moment the nonce becomes spent; a TTL policy on `ageAttestationNonces.ttlExpireAt`\n // then auto-deletes the spent single-use record (no scheduled reaper). DOCUMENTED EXCEPTION to this\n // file's epoch-ms-number convention: native TTL requires a real Timestamp, and this field is\n // WRITE-ONLY (never read by app code), so it is typed opaquely here (`z.unknown`) to avoid pulling a\n // firebase `Timestamp` type into the environment-agnostic ttt-core schema layer (the app writes it via\n // `admin.firestore.Timestamp.fromMillis`, mirroring notification-core's `expireAt`). Absent until spent.\n ttlExpireAt: z.unknown().optional(),\n}).strict();\nexport type AgeAttestationNonceV1 = z.infer<typeof AgeAttestationNonceV1Schema>;\n\n// ===========================================================================\n// A7 [M-09] — ageBracketAttestation JWS payload claims (the ONE pinned wire format)\n//\n// The token is a COMPACT JWS (JWT, RFC 7519) with alg=HS256, signed by the versioned\n// KMS/Secret-Manager key. The schema below validates the DECODED PAYLOAD CLAIMS only.\n//\n// JOSE header (NOT part of this schema — documented for the verifier):\n// { \"alg\": \"HS256\", \"typ\": \"JWT\", \"kid\": <signingKeyVersion> } // kid = the exact signingKeyVersion\n//\n// Serialization: standard JWS compact form\n// base64url(header) '.' base64url(payload) '.' base64url(sig)\n// the signature is base64url (no padding); claim names + types are EXACTLY as below\n// (no extra claims).\n//\n// Verification REQUIRES (fail-closed on any miss): valid HS256 signature under the key\n// named by `kid`; aud == \"ttt-register-complete\"; iss == \"ttt-age-attest\"; exp not\n// passed; sub matches the ageAttestationNonces doc being consumed; rsh matches the\n// request's requestSessionHash.\n//\n// `iat`/`exp` are epoch-SECONDS (per JWT), NOT epoch-millis like the rest of this file.\n// ===========================================================================\n\nexport const AgeBracketAttestationClaimsV1Schema = z.object({\n iss: z.literal('ttt-age-attest'), // issuer\n aud: z.literal('ttt-register-complete'), // AUDIENCE/purpose binding — /api/register/complete MUST verify aud\n sub: z.string().min(1), // the SHA-256 nonce hash (also the ageAttestationNonces doc id)\n iat: z.number().int(), // epoch SECONDS (per JWT)\n exp: z.number().int(), // epoch SECONDS (per JWT); exp = iat + 600 (10-min TTL)\n bkt: AgeBracketSchema, // the SERVER-derived bracket (never client-derived)\n pv: z.string().min(1), // agePolicyVersion string\n rsh: z.string().min(1), // sha256(cookieValue) — the session binding\n}).strict();\nexport type AgeBracketAttestationClaimsV1 = z.infer<typeof AgeBracketAttestationClaimsV1Schema>;\n\n// ===========================================================================\n// A7 [F13] — Age-session cookie spec (`__Secure-ttt_age_session`)\n//\n// Pinned cookie attributes. The cookie VALUE is a cryptographically-random value\n// generated per registration attempt; only requestSessionHash = sha256(cookieValue)\n// is stored (with the nonce) — the raw cookie value is NEVER persisted. A separate\n// non-unique UX marker may exist for display, but is NEVER the security binding.\n//\n// `Domain` is omitted (host-only) — represented here by `hostOnly: true`.\n// ===========================================================================\n\nexport const AGE_SESSION_COOKIE_SPEC = {\n name: '__Secure-ttt_age_session',\n hostOnly: true, // Domain attribute omitted → host-only cookie\n path: '/api',\n secure: true,\n httpOnly: true,\n sameSite: 'Strict',\n maxAgeSeconds: 600, // 10 min\n} as const;\n\n// ===========================================================================\n// A7 / A11 [H6] — AgePolicyConfigV1 (the `_config/agePolicy` singleton)\n//\n// The generic gRPC retryable/terminal code lists are REMOVED — deletion is driven\n// ONLY by the RegistrationCompletionOutcome domain enum (§A7). No raw gRPC code ever\n// deletes an account. noDeleteOutcomes / terminalDeletableOutcomes are typed against\n// the imported RegistrationCompletionOutcome enum so the two arrays can never drift\n// from the domain outcome set.\n// ===========================================================================\n\nexport const AgePolicyConfigV1Schema = z.object({\n agePolicyVersion: z.string().min(1),\n registrationGracePeriodMinutes: z.number().int(),\n cleanupSchedule: z.string().min(1), // cron expression for the orphan-Auth cleanup worker\n ageTokenTtlSeconds: z.number().int(), // [M-09] token TTL\n keyRetirementVerificationMinutes: z.number().int(), // [M-09] retired-signingKeyVersion verification window (> TTL so no live token is orphaned by a rotation)\n noDeleteOutcomes: z.array(RegistrationCompletionOutcomeSchema),\n terminalDeletableOutcomes: z.array(RegistrationCompletionOutcomeSchema),\n}).strict();\nexport type AgePolicyConfigV1 = z.infer<typeof AgePolicyConfigV1Schema>;\n\n/** The pinned literal default for `_config/agePolicy` (§A11 [H6] concrete config\n * values). Build defaults — transcribed verbatim from the frozen spec. */\nexport const DEFAULT_AGE_POLICY_CONFIG_V1: AgePolicyConfigV1 = {\n agePolicyVersion: '2026-06-19.general-audience.v1',\n registrationGracePeriodMinutes: 30,\n cleanupSchedule: '*/15 * * * *',\n ageTokenTtlSeconds: 600,\n keyRetirementVerificationMinutes: 15,\n noDeleteOutcomes: [\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'privateDataConflict',\n ],\n terminalDeletableOutcomes: [\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'policyVersionRejected',\n ],\n};\n\n// ===========================================================================\n// A7 — teen→adult ageUpgradeAttestation token\n//\n// A SEPARATE token (not the registration nonce) issued to an authenticated,\n// recently-reauthenticated session. Binds uid + accountCapabilityVersion +\n// policyVersion + issued/expiry + nonce; consumed ONLY for that uid+version; never\n// the registration nonce, never cross-account.\n//\n// This is a token claims shape (decoded payload), NOT a stored Firestore doc.\n// ===========================================================================\n\nexport const AgeUpgradeAttestationV1Schema = z.object({\n uid: z.string().min(1), // the authenticated, recently-reauthenticated account\n accountCapabilityVersion: z.number().int(), // the capability version this upgrade is bound to\n policyVersion: z.string().min(1), // agePolicyVersion in force\n issuedAt: z.number(), // epoch ms\n expiresAt: z.number(), // epoch ms\n nonce: z.string().min(1), // single-use upgrade nonce (never the registration nonce; never cross-account)\n}).strict();\nexport type AgeUpgradeAttestationV1 = z.infer<typeof AgeUpgradeAttestationV1Schema>;\n\n// ===========================================================================\n// A7 — UserPrivateData age fields (STANDALONE shape for the orchestrator)\n//\n// These fields live on `privateData/{uid}` (server-write-only). They are exported as\n// a STANDALONE object shape so the orchestrator can merge them into\n// `UserPrivateDataSchema` in user.ts WITHOUT this file editing user.ts.\n// ===========================================================================\n\n/** Manual age-correction audit stub (who corrected, when, why) — embedded on the\n * private user data when a reviewer hand-corrects the recorded age state. */\nexport const UserPrivateDataAgeManualCorrectionSchema = z.object({\n at: z.number(), // epoch ms\n actorId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type UserPrivateDataAgeManualCorrection = z.infer<typeof UserPrivateDataAgeManualCorrectionSchema>;\n\n/** STANDALONE age-fields shape — the orchestrator merges these into\n * `UserPrivateDataSchema` (privateData/{uid}, server-write-only). Exported as a raw\n * object shape (NOT a z.object) so it can be spread into the canonical schema. */\nexport const UserPrivateDataAgeFieldsSchema = z.object({\n accountType: AgeBracketSchema, // 'teen' | 'adult'\n is18Plus: z.boolean(),\n agePolicyVersion: z.string().min(1),\n accountCapabilityVersion: z.number().int(),\n ageAttestedAt: z.number(), // epoch ms\n adultUpgradedAt: z.number().optional(), // epoch ms; set on a successful teen→adult upgrade\n ageManualCorrection: UserPrivateDataAgeManualCorrectionSchema.optional(),\n // [Q21.5 REVISED — DJ 2026-07-06, counsel review pending in the lawyer packet] The DOB is\n // persisted at EXACTLY ONE point: becomeArtisanCreator ('artisanOnboarding'). Registration\n // and the teen→adult upgrade derive the bracket server-side and persist NO DOB for anyone\n // (the register screen's \"It is not stored\" notice is literally true). Rationale: the\n // payout-KYC cross-check (compare to Stripe KYC DOB before paying out) only ever applies to\n // artisans — the money boundary — so collection happens there, with UI copy warning the\n // DOB must match the user's future payout identity. Server re-derives 18+ from the entered\n // DOB; an under-18 derivation rejects with a failure audit and stores nothing. PII —\n // privateData only (BACKEND-105); same no-log posture as the raw DOB (scrubber + canary).\n attestedDateOfBirth: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/).optional(), // 'YYYY-MM-DD'\n attestedDobRecordedAt: z.number().optional(), // epoch ms\n attestedDobSource: z.enum(['artisanOnboarding']).optional(),\n}).strict();\nexport type UserPrivateDataAgeFields = z.infer<typeof UserPrivateDataAgeFieldsSchema>;\n\n/** The raw shape (for the orchestrator to `.extend(...)` / spread into\n * `UserPrivateDataSchema` without re-wrapping). */\nexport const userPrivateDataAgeFieldsShape = {\n accountType: AgeBracketSchema,\n is18Plus: z.boolean(),\n agePolicyVersion: z.string().min(1),\n accountCapabilityVersion: z.number().int(),\n ageAttestedAt: z.number(),\n adultUpgradedAt: z.number().optional(),\n ageManualCorrection: UserPrivateDataAgeManualCorrectionSchema.optional(),\n attestedDateOfBirth: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/).optional(),\n attestedDobRecordedAt: z.number().optional(),\n attestedDobSource: z.enum(['artisanOnboarding']).optional(),\n} as const;\n\n// ===========================================================================\n// A7 — Registration-completion RESULT (uses the IMPORTED domain enum)\n//\n// `completeRegistration.ts` returns exactly one RegistrationCompletionOutcome. The\n// enum itself is the SINGLE SOURCE in ./foundation.js — re-exported here for cluster\n// convenience, NEVER redefined.\n// ===========================================================================\n\nexport { RegistrationCompletionOutcomeSchema } from './foundation.js';\nexport type { RegistrationCompletionOutcome } from './foundation.js';\n\n/** The result envelope `completeRegistration.ts` returns. `outcome` is the imported\n * domain enum (never a raw gRPC code); only this domain outcome feeds the orphan-Auth\n * deletion policy. */\nexport const RegistrationCompletionResultV1Schema = z.object({\n outcome: RegistrationCompletionOutcomeSchema,\n uid: z.string().min(1).optional(), // present on 'completed' / 'alreadyCompletedSameUid'\n}).strict();\nexport type RegistrationCompletionResultV1 = z.infer<typeof RegistrationCompletionResultV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"case-aliases.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAMzC,4CAA4C;AAC5C,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAS1F,eAAO,MAAM,8BAA8B;;;;;;;;;;;kBAMhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
1
+ {"version":3,"file":"case-aliases.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAMzC,4CAA4C;AAC5C,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAS1F,eAAO,MAAM,8BAA8B;;;;;;;;;;;kBAMhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -13,10 +13,11 @@
13
13
  // rows for one rare incident is acceptable, and cross-linking covers the operator's
14
14
  // need to see related cases.
15
15
  //
16
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
17
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A2 — no invented values,
18
- // no placeholders. Deterministic IDs are documented as comments; the server
19
- // computes them (never this schema layer).
16
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
17
+ // (Appendix A §A2) — no invented values, no placeholders; the durable design
18
+ // owner is ttt-prod docs/design/csam-detection-and-response.md. Deterministic
19
+ // IDs are documented as comments; the server computes them (never this schema
20
+ // layer).
20
21
  import { z } from 'zod';
21
22
  // ===========================================================================
22
23
  // Canonical-key version token (folded into the deterministic id formula below).
@@ -1 +1 @@
1
- {"version":3,"file":"case-aliases.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,6EAA6E;AAC7E,kFAAkF;AAClF,kEAAkE;AAClE,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,oFAAoF;AACpF,kFAAkF;AAClF,oFAAoF;AACpF,6BAA6B;AAC7B,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,2CAA2C;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,gFAAgF;AAChF,2DAA2D;AAC3D,8EAA8E;AAE9E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,8EAA8E;AAC9E,4BAA4B;AAC5B,8EAA8E;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC;IACrD,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,cAAc;CACf,CAAC,CAAC;AAGH,8EAA8E;AAC9E,2DAA2D;AAC3D,wFAAwF;AACxF,yEAAyE;AACzE,mFAAmF;AACnF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,gCAAgC;IAC3C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — child-safety case OWNING ALIASES (§A2, Finding-H2/H3).\n//\n// The owning-alias registry is a 1:1 claim map: `childSafetyOwningAliases/{aliasId}`.\n// Intake READS this registry inside the case-open transaction; an alias already\n// claimed by a DIFFERENT case is NOT a `tx.create` throw — the two cases are\n// cross-linked instead (a `relatedCaseIds` reference stamped on both cases so the\n// operator sees they're related), and the ORIGINAL owner is kept.\n//\n// The \"one case per incident\" MERGE protocol (merge jobs, correlations, mergeState)\n// was ripped out (DJ 2026-07-02): it existed only as schema, nothing ever created a\n// merge job or wrote a correlation. PhotoDNA is pre-publication, so the report+hash\n// collision only arises via the rare operator NCII-crossover re-scan; two console\n// rows for one rare incident is acceptable, and cross-linking covers the operator's\n// need to see related cases.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A2 — no invented values,\n// no placeholders. Deterministic IDs are documented as comments; the server\n// computes them (never this schema layer).\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// Canonical-key version token (folded into the deterministic id formula below).\n// Bump if its formula input set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into `aliasId` and `incidentKey`. */\nexport const SAFETY_ALIAS_VERSION = 'v1';\n\n// ===========================================================================\n// Cluster-local enum (§A2).\n// ===========================================================================\n\n/** OWNING alias types — ONLY these four. */\nexport const ChildSafetyOwningAliasTypeSchema = z.enum([\n 'incidentKey',\n 'rootIngest',\n 'canonicalTarget',\n 'messageRange',\n]);\nexport type ChildSafetyOwningAliasType = z.infer<typeof ChildSafetyOwningAliasTypeSchema>;\n\n// ===========================================================================\n// §A2 — OWNING aliases: childSafetyOwningAliases/{aliasId}\n// aliasId = sha256(SAFETY_ALIAS_VERSION + ':' + aliasType + ':' + canonicalValueHash)\n// incidentKey = sha256('incident-v1:' + normalizedRootIngestId + ':' +\n// normalizedOriginatingUploaderUid) (Finding-H3 hard key)\n// ===========================================================================\n\nexport const ChildSafetyOwningAliasV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n aliasType: ChildSafetyOwningAliasTypeSchema,\n canonicalValueHash: z.string(),\n createdAt: z.number(),\n}).strict();\nexport type ChildSafetyOwningAliasV1 = z.infer<typeof ChildSafetyOwningAliasV1Schema>;\n"]}
1
+ {"version":3,"file":"case-aliases.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,6EAA6E;AAC7E,kFAAkF;AAClF,kEAAkE;AAClE,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,oFAAoF;AACpF,kFAAkF;AAClF,oFAAoF;AACpF,6BAA6B;AAC7B,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,UAAU;AAEV,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,gFAAgF;AAChF,2DAA2D;AAC3D,8EAA8E;AAE9E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,8EAA8E;AAC9E,4BAA4B;AAC5B,8EAA8E;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC;IACrD,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,cAAc;CACf,CAAC,CAAC;AAGH,8EAA8E;AAC9E,2DAA2D;AAC3D,wFAAwF;AACxF,yEAAyE;AACzE,mFAAmF;AACnF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,gCAAgC;IAC3C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — child-safety case OWNING ALIASES (§A2, Finding-H2/H3).\n//\n// The owning-alias registry is a 1:1 claim map: `childSafetyOwningAliases/{aliasId}`.\n// Intake READS this registry inside the case-open transaction; an alias already\n// claimed by a DIFFERENT case is NOT a `tx.create` throw — the two cases are\n// cross-linked instead (a `relatedCaseIds` reference stamped on both cases so the\n// operator sees they're related), and the ORIGINAL owner is kept.\n//\n// The \"one case per incident\" MERGE protocol (merge jobs, correlations, mergeState)\n// was ripped out (DJ 2026-07-02): it existed only as schema, nothing ever created a\n// merge job or wrote a correlation. PhotoDNA is pre-publication, so the report+hash\n// collision only arises via the rare operator NCII-crossover re-scan; two console\n// rows for one rare incident is acceptable, and cross-linking covers the operator's\n// need to see related cases.\n//\n// Every shape here is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A §A2) — no invented values, no placeholders; the durable design\n// owner is ttt-prod docs/design/csam-detection-and-response.md. Deterministic\n// IDs are documented as comments; the server computes them (never this schema\n// layer).\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// Canonical-key version token (folded into the deterministic id formula below).\n// Bump if its formula input set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into `aliasId` and `incidentKey`. */\nexport const SAFETY_ALIAS_VERSION = 'v1';\n\n// ===========================================================================\n// Cluster-local enum (§A2).\n// ===========================================================================\n\n/** OWNING alias types — ONLY these four. */\nexport const ChildSafetyOwningAliasTypeSchema = z.enum([\n 'incidentKey',\n 'rootIngest',\n 'canonicalTarget',\n 'messageRange',\n]);\nexport type ChildSafetyOwningAliasType = z.infer<typeof ChildSafetyOwningAliasTypeSchema>;\n\n// ===========================================================================\n// §A2 — OWNING aliases: childSafetyOwningAliases/{aliasId}\n// aliasId = sha256(SAFETY_ALIAS_VERSION + ':' + aliasType + ':' + canonicalValueHash)\n// incidentKey = sha256('incident-v1:' + normalizedRootIngestId + ':' +\n// normalizedOriginatingUploaderUid) (Finding-H3 hard key)\n// ===========================================================================\n\nexport const ChildSafetyOwningAliasV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n aliasType: ChildSafetyOwningAliasTypeSchema,\n canonicalValueHash: z.string(),\n createdAt: z.number(),\n}).strict();\nexport type ChildSafetyOwningAliasV1 = z.infer<typeof ChildSafetyOwningAliasV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,kDAAkD;AAClD,eAAO,MAAM,8BAA8B;;;;;;;;EAQzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;yDACyD;AACzD,eAAO,MAAM,2BAA2B;;;;;;EAMtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;;;6BAU6B;AAC7B,eAAO,MAAM,2BAA2B;;;;;;;;EAQtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;yEAGyE;AACzE,eAAO,MAAM,mCAAmC;;;;;;EAM9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;0CAE0C;AAC1C,eAAO,MAAM,oCAAoC;;;;;EAK/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,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AAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,sCAAsC;;;;;;;;;kBAKxC,CAAC;AACZ,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,oCAAoC;;;;;;;;;;;;kBAMtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAwBF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;kBAEK,CAAC;AACpD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAM5F,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;kBAID,CAAC;AACpD,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC"}
@@ -7,9 +7,10 @@
7
7
  // in subcollections (NEVER arrays), each enforced by writing to the
8
8
  // subcollection so there is no parent array to overflow.
9
9
  //
10
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
11
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A1b + the §A9
12
- // state-transition rules — no invented values, no placeholders.
10
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
11
+ // (Appendix A §A1b + the §A9 state-transition rules) — no invented values, no
12
+ // placeholders; the durable design owner is ttt-prod
13
+ // docs/design/csam-detection-and-response.md.
13
14
  //
14
15
  // SHARED enums come from ./foundation.js (the single source for every
15
16
  // cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS
@@ -1 +1 @@
1
- {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,4EAA4E;AAC5E,6EAA6E;AA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AwD;IACxD,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,2BAA2B,CAAC;CAC1E,CAAC,CAAC,MAAM,EAAE,CAAC;AACZ,MAAM,CAAC,MAAM,iCAAiC,GAAG,uCAAuC;KACrF,WAAW,CAAC,iCAAiC,CAAC;KAC9C,WAAW,CAAC,mCAAmC,CAAC,CAAC;AAGpD,+FAA+F;AAC/F,sGAAsG;AACtG,iGAAiG;AACjG,sGAAsG;AACtG,MAAM,CAAC,MAAM,uCAAuC,GAAG,uCAAuC,CAAC,MAAM,CAAC;IACpG,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,wCAAwC,CAAC;CAClE,CAAC;KACC,WAAW,CAAC,iCAAiC,CAAC;KAC9C,WAAW,CAAC,mCAAmC,CAAC,CAAC","sourcesContent":["// Trust & Safety — the child-safety CASE spine (Appendix A §A1b, §A9).\n//\n// The split-projection case model: a reviewer list/metadata doc\n// (`childSafetyCaseList/{caseId}` — NO content, NO reporter identity) and a\n// restricted root (`childSafetyCases/{caseId}` — adds the evidence manifest,\n// the internal reason, and the lease/fencing fields). Append-only detail lives\n// in subcollections (NEVER arrays), each enforced by writing to the\n// subcollection so there is no parent array to overflow.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A1b + the §A9\n// state-transition rules — no invented values, no placeholders.\n//\n// SHARED enums come from ./foundation.js (the single source for every\n// cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS\n// ReportDispositionSchema, ReportDispositionReasonCodeSchema, and\n// NcmecSubmissionStateSchema from foundation.\n//\n// Collection note: this cluster introduces NEW Firestore collections; the app\n// leg (orchestrator) wires collections.ts / path-builders.ts / registry.ts.\n// The merge/alias/correlation cluster (§A2) lives in ./case-aliases.js.\n\nimport { z } from 'zod';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n NcmecSubmissionStateSchema,\n SafetyCaseClosureV1Schema,\n TargetLocatorV1Schema,\n SafetyCrossoverLegStatusSchema,\n} from './foundation.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from './evidence.js';\nimport { LEGAL_REPORTING_DISPOSITION_CONFIRMATION } from '../../constants/safety-confirmation-phrases.js';\n\n// ===========================================================================\n// Cluster-local enums (§A1b + §A9). These are case-spine-specific value sets,\n// NOT cross-cluster; they live here, not in foundation.\n// ===========================================================================\n\n/** Incident classification on the case (§A1b). */\nexport const ChildSafetyIncidentClassSchema = z.enum([\n 'apparentCsam',\n 'enticement',\n 'minorSexTrafficking',\n 'sextortion',\n 'csamSolicitation',\n 'imminentCsea',\n 'nonReportableSafety',\n]);\nexport type ChildSafetyIncidentClass = z.infer<typeof ChildSafetyIncidentClassSchema>;\n\n/** Source-signal kind (shared by the case `sourceSignalSummary` projection and\n * the `…/sourceSignals/{signalId}` append-only rows). */\nexport const ChildSafetySignalKindSchema = z.enum([\n 'hashMatch',\n 'report',\n 'aiFlag',\n 'manual',\n 'copyMatch',\n]);\nexport type ChildSafetySignalKind = z.infer<typeof ChildSafetySignalKindSchema>;\n\n/** §A9 workStatus FSM: new → triaged → reporting → actioning → operationallyResolved.\n * `operationallyResolved` NEVER deletes the case (preservation continues).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * it is NEVER cleared on the click. The WORKER (quarantine saga / NCII removal / edge\n * serving-deny) flips the case to the terminal `operationallyResolved` ONLY on VERIFIED\n * completion (which clears the time-sensitive pin via onSafetyCaseClosed). If the saga\n * exhausts its retries (dead-letter), the case moves to `failed` — kept pinned, surfaced in\n * the Safety Console failed-jobs view, with a Restart that re-arms the job. Both are explicit\n * values (never derived). */\nexport const ChildSafetyWorkStatusSchema = z.enum([\n 'new',\n 'triaged',\n 'reporting',\n 'actioning',\n 'processing',\n 'failed',\n 'operationallyResolved',\n]);\nexport type ChildSafetyWorkStatus = z.infer<typeof ChildSafetyWorkStatusSchema>;\n\n/** §A9 preservationStatus FSM: preReportHold → statutoryHold → extendedHold? →\n * dispositionPending → destroyed. `statutoryHold` is set only at verified\n * completion; deletion is eligible only when every hold ref is released AND a\n * reviewed disposition job runs (no auto-delete at exactly one year). */\nexport const ChildSafetyPreservationStatusSchema = z.enum([\n 'preReportHold',\n 'statutoryHold',\n 'extendedHold',\n 'dispositionPending',\n 'destroyed',\n]);\nexport type ChildSafetyPreservationStatus = z.infer<typeof ChildSafetyPreservationStatusSchema>;\n\n/** §A9 accountActionStatus — the closure projection over `accountActionCommands`\n * (Finding-H5). A report-required case may not operationally close while\n * `pending`/`operatorDecisionPending`. */\nexport const ChildSafetyAccountActionStatusSchema = z.enum([\n 'noAccountActionRequired',\n 'operatorDecisionPending',\n 'pending',\n 'resolved',\n]);\nexport type ChildSafetyAccountActionStatus = z.infer<typeof ChildSafetyAccountActionStatusSchema>;\n\n/** §A1b reportState — derived list-projection of (reportDisposition + latest\n * submission.state) for admin-list rendering ONLY; NOT the source of truth for\n * whether a report is required (that is reportDisposition, §A9). */\nexport const ChildSafetyReportStateSchema = z.enum([\n 'reportAsSoonAsReasonablyPossible',\n 'submissionInProgress',\n 'completed',\n]);\nexport type ChildSafetyReportState = z.infer<typeof ChildSafetyReportStateSchema>;\n\n/** §A1b decisions[].kind — the append-only decision-log kind. `caseClosed` [EUAS-008]\n * is the terminal close decision carrying the structured closure record. */\nexport const ChildSafetyDecisionKindSchema = z.enum([\n 'workStatus',\n 'accountAction',\n 'reportDisposition',\n 'reasonUpdate',\n 'caseClosed',\n]);\nexport type ChildSafetyDecisionKind = z.infer<typeof ChildSafetyDecisionKindSchema>;\n\n/** §A1b accounts[].role on a case. */\nexport const ChildSafetyAccountRoleSchema = z.enum([\n 'uploader',\n 'requester',\n 'distributor',\n 'questionable',\n]);\nexport type ChildSafetyAccountRole = z.infer<typeof ChildSafetyAccountRoleSchema>;\n\n/** §A1b accounts[].subjectDisposition (per-account; distinct from the case-level\n * `reportDisposition`/ReportDisposition). */\nexport const ChildSafetyAccountSubjectDispositionSchema = z.enum([\n 'subject',\n 'questionable',\n 'excluded',\n]);\nexport type ChildSafetyAccountSubjectDisposition = z.infer<\n typeof ChildSafetyAccountSubjectDispositionSchema\n>;\n\n/** §A1b accounts[].platformAction. */\nexport const ChildSafetyAccountPlatformActionSchema = z.enum([\n 'none',\n 'watch',\n 'suspend',\n 'safetyLocked',\n 'ban',\n]);\nexport type ChildSafetyAccountPlatformAction = z.infer<\n typeof ChildSafetyAccountPlatformActionSchema\n>;\n\n/** §A1b ncmecSubmissions[].kind. */\nexport const ChildSafetyNcmecSubmissionKindSchema = z.enum([\n 'initial',\n 'supplemental',\n 'correction',\n]);\nexport type ChildSafetyNcmecSubmissionKind = z.infer<\n typeof ChildSafetyNcmecSubmissionKindSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionChannel — launch = MANUAL portal only (the automated ispws API\n * is a post-launch feature, not built; the speculative live-API client was removed). */\nexport const ChildSafetyNcmecCompletionChannelSchema = z.enum(['manualPortal']);\nexport type ChildSafetyNcmecCompletionChannel = z.infer<\n typeof ChildSafetyNcmecCompletionChannelSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionProofType — manual portal only at launch (no API /finish\n * reportDoneResponse; the proof is the operator-recorded portal confirmation). */\nexport const ChildSafetyNcmecCompletionProofTypeSchema = z.enum([\n 'portalConfirmation',\n]);\nexport type ChildSafetyNcmecCompletionProofType = z.infer<\n typeof ChildSafetyNcmecCompletionProofTypeSchema\n>;\n\n/** §A1b ncmecSubmissions/{id}/files[].fileInfoState. */\nexport const ChildSafetyNcmecFileInfoStateSchema = z.enum(['pending', 'sent', 'ack']);\nexport type ChildSafetyNcmecFileInfoState = z.infer<\n typeof ChildSafetyNcmecFileInfoStateSchema\n>;\n\n/** §A1b legalProcess[].kind. */\nexport const ChildSafetyLegalProcessKindSchema = z.enum([\n 'leWatch',\n 'leDataRequest',\n 'leShutdown',\n 'leDestruction',\n 'disclosure',\n]);\nexport type ChildSafetyLegalProcessKind = z.infer<typeof ChildSafetyLegalProcessKindSchema>;\n\n// ===========================================================================\n// §A1b — sourceSignalSummary (embedded privacy-safe projection on the list doc)\n// ===========================================================================\n\n/** Embedded latest-signal summary on `childSafetyCaseList` — NO content. */\nexport const ChildSafetySourceSignalSummarySchema = z.object({\n count: z.number(),\n latestKind: ChildSafetySignalKindSchema,\n latestAt: z.number(),\n}).strict();\nexport type ChildSafetySourceSignalSummary = z.infer<\n typeof ChildSafetySourceSignalSummarySchema\n>;\n\n// ===========================================================================\n// §A1b — childSafetyCaseList/{caseId} (reviewer list/metadata; NO content, NO\n// reporter identity)\n// ===========================================================================\n\nexport const ChildSafetyCaseListV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n revision: z.number(),\n canonicalIncidentKey: z.string(),\n incidentClass: ChildSafetyIncidentClassSchema,\n sourceSignalSummary: ChildSafetySourceSignalSummarySchema,\n workStatus: ChildSafetyWorkStatusSchema,\n preservationStatus: ChildSafetyPreservationStatusSchema,\n ncmecStatus: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState (no `notRequired`)\n accountActionStatus: ChildSafetyAccountActionStatusSchema,\n reportDisposition: ReportDispositionSchema, // §A9 case-level reporting determination\n reviewDueAt: z.number(),\n actualKnowledgeAt: z.number().optional(),\n reportState: ChildSafetyReportStateSchema.optional(), // derived list-projection only\n submissionCompletedAt: z.number().optional(),\n preserveUntil: z.number().optional(),\n openHoldCount: z.number(),\n // Cross-links to other cases that claimed the same owning alias (a rare operator NCII-crossover\n // re-scan collision). arrayUnion'd on both cases in the intake transaction that detected the claim;\n // the console renders these as plain links on the case view. The original alias owner is kept — the\n // colliding case never `tx.create`-throws (see childSafetyOwningAliases intake). Additive/optional.\n relatedCaseIds: z.array(z.string().min(1)).optional(),\n // [H-04 V1] Set to true when a protected-reason chat report's Worker context could not be\n // resolved at intake (text-only / Worker-down / attachment-not-ready). The case is still a\n // fully-valid protected case; context resolution is retried async. Absent = false (no pending\n // context). Cleared once context is attached. Surfaced in the safety console so the reviewer\n // knows to trigger a manual re-fetch if the async retry hasn't landed yet.\n contextResolutionPending: z.boolean().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseListV1 = z.infer<typeof ChildSafetyCaseListV1Schema>;\n\n// ===========================================================================\n// §A1b — childSafetyCases/{caseId} (restricted root; childSafetyReviewer only;\n// adds the evidence manifest, the internal reason, and the lease/fencing fields)\n// ===========================================================================\n\nexport const ChildSafetyCaseV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n evidenceManifestId: z.string().min(1),\n currentReasonInternal: z.string(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n fencingOwnerToken: z.string().min(1).optional(),\n fencingGeneration: z.number().optional(),\n // [H-04 V1] Immutable channel/message locator stored at case open when the Worker context\n // could not be resolved at intake. This is the AUTHORITATIVE source-of-truth locator that\n // the best-effort async re-fetch (and the operator's manual re-fetch) use to retrieve the\n // message text/sender. NEVER updated after creation — if context resolves, the resolved\n // context is ATTACHED to the case; this field stays unchanged as the permanent intake record.\n // Uses TargetLocatorV1 (a `guildChatMessage` or `chatAttachment` kind); absent on media-resolved\n // cases that went through the normal protected path with a ready attachment.\n chatMessageLocator: TargetLocatorV1Schema.optional(),\n // [H-04 V1] Mirror of the list-doc field — kept in sync so the restricted root can be\n // independently queried/checked without a join against childSafetyCaseList.\n contextResolutionPending: z.boolean().optional(),\n // [H-2] Per-leg persisted state for the two POST-COMMIT possible-minor crossover side-effects\n // (serving-deny + PhotoDNA) that `setNciiMinorAssessment` fans out when it opens/links this\n // parallel crossover case. Written via dotted-path update() (`crossoverLegs.servingDeny` etc.)\n // AFTER the case root is created in-tx, so an operator/reconciler can see which leg is\n // pending/done/failed and drive a replay — a leg failure never rolls back the committed\n // assessment, and the NCII removal clock is never touched. ABSENT on non-crossover cases (this\n // object exists only on a crossover child-safety case), and each leg field is absent when that\n // leg never applied (external / no-media target). The app also writes an in-transaction initial\n // `pending` marker, so the status enum includes `pending`.\n crossoverLegs: z.object({\n // Serving-deny leg: `pending` (in-tx marker) → `done` | `failed`.\n servingDeny: SafetyCrossoverLegStatusSchema.optional(),\n servingDeniedAt: z.number().optional(), // epoch ms; set when servingDeny → done\n servingDenyFailedAt: z.number().optional(), // epoch ms; set when servingDeny → failed\n servingDenyLastError: z.string().optional(), // error name captured on failure (never raw bytes/PII)\n // PhotoDNA leg: `pending` (in-tx marker) → `done` | `failed`.\n photoDna: SafetyCrossoverLegStatusSchema.optional(),\n photoDnaScannedAt: z.number().optional(), // epoch ms; set when photoDna → done\n photoDnaFailedAt: z.number().optional(), // epoch ms; set when photoDna → failed\n photoDnaLastError: z.string().optional(), // error name captured on failure\n }).strict().optional(),\n}).strict();\nexport type ChildSafetyCaseV1 = z.infer<typeof ChildSafetyCaseV1Schema>;\n\n// ===========================================================================\n// §A1b subcollections (append-only, NEVER arrays)\n// ===========================================================================\n\n/** …/sourceSignals/{signalId} — append-only source-signal row. */\nexport const ChildSafetySourceSignalV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetySignalKindSchema,\n detector: z.string().min(1).optional(),\n sourceRef: z.string(),\n actorId: z.string().min(1).optional(),\n}).strict();\nexport type ChildSafetySourceSignalV1 = z.infer<typeof ChildSafetySourceSignalV1Schema>;\n\n/** …/decisions/{decisionId} — append-only decision-log row. The actual\n * viewed-evidence ids live in …/decisions/{decisionId}/views/{viewId}. */\nexport const ChildSafetyDecisionV1Schema = z.object({\n at: z.number(),\n actorId: z.string().min(1),\n kind: ChildSafetyDecisionKindSchema,\n from: z.string(),\n to: z.string(),\n reasonInternal: z.string(),\n reasonUserFacing: z.string().optional(),\n evidenceItemsViewedCount: z.number(),\n // [EUAS-008] present only on a `caseClosed` row — the structured operator closure record\n // (outcome / summary / note + actor / timestamp) persisted when the case is closed.\n closure: SafetyCaseClosureV1Schema.optional(),\n}).strict();\nexport type ChildSafetyDecisionV1 = z.infer<typeof ChildSafetyDecisionV1Schema>;\n\n/** …/decisions/{decisionId}/views/{viewId} — the actual viewed-evidence ids\n * (kept off the decision row itself). */\nexport const ChildSafetyDecisionViewV1Schema = z.object({\n evidenceItemId: z.string().min(1),\n at: z.number(),\n}).strict();\nexport type ChildSafetyDecisionViewV1 = z.infer<typeof ChildSafetyDecisionViewV1Schema>;\n\n/** …/accounts/{uid} — per-account case record. The per-account\n * `subjectDisposition` is distinct from the case-level `reportDisposition`. */\nexport const ChildSafetyCaseAccountV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountV1 = z.infer<typeof ChildSafetyCaseAccountV1Schema>;\n\n/** …/accounts/{uid}/history/{historyId} — append-only per-account history. */\nexport const ChildSafetyCaseAccountHistoryV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n at: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountHistoryV1 = z.infer<\n typeof ChildSafetyCaseAccountHistoryV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId} — one NCMEC submission record. */\nexport const ChildSafetyNcmecSubmissionV1Schema = z.object({\n kind: ChildSafetyNcmecSubmissionKindSchema,\n state: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState\n completionChannel: ChildSafetyNcmecCompletionChannelSchema.optional(),\n submissionCompletedAt: z.number().optional(),\n completionProofType: ChildSafetyNcmecCompletionProofTypeSchema.optional(),\n completionProofRef: z.string().min(1).optional(),\n reportId: z.string().min(1).optional(),\n responseCode: z.number().optional(),\n}).strict();\nexport type ChildSafetyNcmecSubmissionV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId}/files/{fileId} — per-evidence-item file row. */\nexport const ChildSafetyNcmecSubmissionFileV1Schema = z.object({\n localEvidenceItemId: z.string().min(1),\n ncmecFileId: z.string().min(1).optional(),\n md5: z.string().min(1).optional(),\n fileInfoState: ChildSafetyNcmecFileInfoStateSchema,\n}).strict();\nexport type ChildSafetyNcmecSubmissionFileV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionFileV1Schema\n>;\n\n/** …/legalProcess/{eventId} — append-only legal-process event. */\nexport const ChildSafetyLegalProcessEventV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetyLegalProcessKindSchema,\n verifiedBy: z.string().min(1),\n instruction: z.string(),\n handedOver: z.boolean().optional(),\n}).strict();\nexport type ChildSafetyLegalProcessEventV1 = z.infer<\n typeof ChildSafetyLegalProcessEventV1Schema\n>;\n\n// ===========================================================================\n// §A9 — setReportDisposition privileged-command input (NON-DOC embedded shape).\n// Authority = `legalDispositionAuthority` (§A11 matrix); requires fresh two-step\n// reauth. Appends to …/decisions/{decisionId} with kind:'reportDisposition'.\n// `evidenceRefs` is an array capped at MAX; it MAY be empty EXCEPT for disposition\n// 'reportRequired', which requires ≥1 (enforced by the shared\n// refineReportDispositionEvidenceRefs cross-field rule, not a field-level min).\n// ===========================================================================\n\n// The base object shape (kept as a ZodObject so the callable input can `.extend` it); the exported\n// schema below adds the TWO canonical cross-field refinements (disposition↔reason pairing +\n// reportRequired⇒evidence-present).\nconst SetReportDispositionInputV1ObjectSchema = z.object({\n caseId: z.string().min(1),\n expectedRevision: z.number(),\n disposition: ReportDispositionSchema,\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // MAX derives from the ONE receipts cap (evidence.ts) — the callable + admin.ts use the same. No\n // field-level min: the reportRequired⇒non-empty rule lives in the shared cross-field refinement so\n // every other disposition may legally leave this empty.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n}).strict();\nexport const SetReportDispositionInputV1Schema = SetReportDispositionInputV1ObjectSchema\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionInputV1 = z.infer<typeof SetReportDispositionInputV1Schema>;\n\n// The PRIVILEGED CALLABLE input (`setReportDisposition`) — extends the embedded shape with the\n// interim explicit typed confirmation (stands in for the passkey two-step until [H-17]), then applies\n// the SAME shared cross-field refinements. evidenceRefs is inherited from the base (MAX-bounded,\n// empty allowed except when disposition is 'reportRequired'). Lives beside the base shape it extends.\nexport const SetReportDispositionCallableInputSchema = SetReportDispositionInputV1ObjectSchema.extend({\n confirmation: z.literal(LEGAL_REPORTING_DISPOSITION_CONFIRMATION),\n})\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionCallableInput = z.infer<typeof SetReportDispositionCallableInputSchema>;\n"]}
1
+ {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,oEAAoE;AACpE,yDAAyD;AACzD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,qDAAqD;AACrD,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,kEAAkE;AAClE,8CAA8C;AAC9C,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,E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GAAG,uCAAuC,CAAC,MAAM,CAAC;IACpG,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,wCAAwC,CAAC;CAClE,CAAC;KACC,WAAW,CAAC,iCAAiC,CAAC;KAC9C,WAAW,CAAC,mCAAmC,CAAC,CAAC","sourcesContent":["// Trust & Safety — the child-safety CASE spine (Appendix A §A1b, §A9).\n//\n// The split-projection case model: a reviewer list/metadata doc\n// (`childSafetyCaseList/{caseId}` — NO content, NO reporter identity) and a\n// restricted root (`childSafetyCases/{caseId}` — adds the evidence manifest,\n// the internal reason, and the lease/fencing fields). Append-only detail lives\n// in subcollections (NEVER arrays), each enforced by writing to the\n// subcollection so there is no parent array to overflow.\n//\n// Every shape here is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A §A1b + the §A9 state-transition rules) — no invented values, no\n// placeholders; the durable design owner is ttt-prod\n// docs/design/csam-detection-and-response.md.\n//\n// SHARED enums come from ./foundation.js (the single source for every\n// cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS\n// ReportDispositionSchema, ReportDispositionReasonCodeSchema, and\n// NcmecSubmissionStateSchema from foundation.\n//\n// Collection note: this cluster introduces NEW Firestore collections; the app\n// leg (orchestrator) wires collections.ts / path-builders.ts / registry.ts.\n// The merge/alias/correlation cluster (§A2) lives in ./case-aliases.js.\n\nimport { z } from 'zod';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n NcmecSubmissionStateSchema,\n SafetyCaseClosureV1Schema,\n TargetLocatorV1Schema,\n SafetyCrossoverLegStatusSchema,\n} from './foundation.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from './evidence.js';\nimport { LEGAL_REPORTING_DISPOSITION_CONFIRMATION } from '../../constants/safety-confirmation-phrases.js';\n\n// ===========================================================================\n// Cluster-local enums (§A1b + §A9). These are case-spine-specific value sets,\n// NOT cross-cluster; they live here, not in foundation.\n// ===========================================================================\n\n/** Incident classification on the case (§A1b). */\nexport const ChildSafetyIncidentClassSchema = z.enum([\n 'apparentCsam',\n 'enticement',\n 'minorSexTrafficking',\n 'sextortion',\n 'csamSolicitation',\n 'imminentCsea',\n 'nonReportableSafety',\n]);\nexport type ChildSafetyIncidentClass = z.infer<typeof ChildSafetyIncidentClassSchema>;\n\n/** Source-signal kind (shared by the case `sourceSignalSummary` projection and\n * the `…/sourceSignals/{signalId}` append-only rows). */\nexport const ChildSafetySignalKindSchema = z.enum([\n 'hashMatch',\n 'report',\n 'aiFlag',\n 'manual',\n 'copyMatch',\n]);\nexport type ChildSafetySignalKind = z.infer<typeof ChildSafetySignalKindSchema>;\n\n/** §A9 workStatus FSM: new → triaged → reporting → actioning → operationallyResolved.\n * `operationallyResolved` NEVER deletes the case (preservation continues).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * it is NEVER cleared on the click. The WORKER (quarantine saga / NCII removal / edge\n * serving-deny) flips the case to the terminal `operationallyResolved` ONLY on VERIFIED\n * completion (which clears the time-sensitive pin via onSafetyCaseClosed). If the saga\n * exhausts its retries (dead-letter), the case moves to `failed` — kept pinned, surfaced in\n * the Safety Console failed-jobs view, with a Restart that re-arms the job. Both are explicit\n * values (never derived). */\nexport const ChildSafetyWorkStatusSchema = z.enum([\n 'new',\n 'triaged',\n 'reporting',\n 'actioning',\n 'processing',\n 'failed',\n 'operationallyResolved',\n]);\nexport type ChildSafetyWorkStatus = z.infer<typeof ChildSafetyWorkStatusSchema>;\n\n/** §A9 preservationStatus FSM: preReportHold → statutoryHold → extendedHold? →\n * dispositionPending → destroyed. `statutoryHold` is set only at verified\n * completion; deletion is eligible only when every hold ref is released AND a\n * reviewed disposition job runs (no auto-delete at exactly one year). */\nexport const ChildSafetyPreservationStatusSchema = z.enum([\n 'preReportHold',\n 'statutoryHold',\n 'extendedHold',\n 'dispositionPending',\n 'destroyed',\n]);\nexport type ChildSafetyPreservationStatus = z.infer<typeof ChildSafetyPreservationStatusSchema>;\n\n/** §A9 accountActionStatus — the closure projection over `accountActionCommands`\n * (Finding-H5). A report-required case may not operationally close while\n * `pending`/`operatorDecisionPending`. */\nexport const ChildSafetyAccountActionStatusSchema = z.enum([\n 'noAccountActionRequired',\n 'operatorDecisionPending',\n 'pending',\n 'resolved',\n]);\nexport type ChildSafetyAccountActionStatus = z.infer<typeof ChildSafetyAccountActionStatusSchema>;\n\n/** §A1b reportState — derived list-projection of (reportDisposition + latest\n * submission.state) for admin-list rendering ONLY; NOT the source of truth for\n * whether a report is required (that is reportDisposition, §A9). */\nexport const ChildSafetyReportStateSchema = z.enum([\n 'reportAsSoonAsReasonablyPossible',\n 'submissionInProgress',\n 'completed',\n]);\nexport type ChildSafetyReportState = z.infer<typeof ChildSafetyReportStateSchema>;\n\n/** §A1b decisions[].kind — the append-only decision-log kind. `caseClosed` [EUAS-008]\n * is the terminal close decision carrying the structured closure record. */\nexport const ChildSafetyDecisionKindSchema = z.enum([\n 'workStatus',\n 'accountAction',\n 'reportDisposition',\n 'reasonUpdate',\n 'caseClosed',\n]);\nexport type ChildSafetyDecisionKind = z.infer<typeof ChildSafetyDecisionKindSchema>;\n\n/** §A1b accounts[].role on a case. */\nexport const ChildSafetyAccountRoleSchema = z.enum([\n 'uploader',\n 'requester',\n 'distributor',\n 'questionable',\n]);\nexport type ChildSafetyAccountRole = z.infer<typeof ChildSafetyAccountRoleSchema>;\n\n/** §A1b accounts[].subjectDisposition (per-account; distinct from the case-level\n * `reportDisposition`/ReportDisposition). */\nexport const ChildSafetyAccountSubjectDispositionSchema = z.enum([\n 'subject',\n 'questionable',\n 'excluded',\n]);\nexport type ChildSafetyAccountSubjectDisposition = z.infer<\n typeof ChildSafetyAccountSubjectDispositionSchema\n>;\n\n/** §A1b accounts[].platformAction. */\nexport const ChildSafetyAccountPlatformActionSchema = z.enum([\n 'none',\n 'watch',\n 'suspend',\n 'safetyLocked',\n 'ban',\n]);\nexport type ChildSafetyAccountPlatformAction = z.infer<\n typeof ChildSafetyAccountPlatformActionSchema\n>;\n\n/** §A1b ncmecSubmissions[].kind. */\nexport const ChildSafetyNcmecSubmissionKindSchema = z.enum([\n 'initial',\n 'supplemental',\n 'correction',\n]);\nexport type ChildSafetyNcmecSubmissionKind = z.infer<\n typeof ChildSafetyNcmecSubmissionKindSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionChannel — launch = MANUAL portal only (the automated ispws API\n * is a post-launch feature, not built; the speculative live-API client was removed). */\nexport const ChildSafetyNcmecCompletionChannelSchema = z.enum(['manualPortal']);\nexport type ChildSafetyNcmecCompletionChannel = z.infer<\n typeof ChildSafetyNcmecCompletionChannelSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionProofType — manual portal only at launch (no API /finish\n * reportDoneResponse; the proof is the operator-recorded portal confirmation). */\nexport const ChildSafetyNcmecCompletionProofTypeSchema = z.enum([\n 'portalConfirmation',\n]);\nexport type ChildSafetyNcmecCompletionProofType = z.infer<\n typeof ChildSafetyNcmecCompletionProofTypeSchema\n>;\n\n/** §A1b ncmecSubmissions/{id}/files[].fileInfoState. */\nexport const ChildSafetyNcmecFileInfoStateSchema = z.enum(['pending', 'sent', 'ack']);\nexport type ChildSafetyNcmecFileInfoState = z.infer<\n typeof ChildSafetyNcmecFileInfoStateSchema\n>;\n\n/** §A1b legalProcess[].kind. */\nexport const ChildSafetyLegalProcessKindSchema = z.enum([\n 'leWatch',\n 'leDataRequest',\n 'leShutdown',\n 'leDestruction',\n 'disclosure',\n]);\nexport type ChildSafetyLegalProcessKind = z.infer<typeof ChildSafetyLegalProcessKindSchema>;\n\n// ===========================================================================\n// §A1b — sourceSignalSummary (embedded privacy-safe projection on the list doc)\n// ===========================================================================\n\n/** Embedded latest-signal summary on `childSafetyCaseList` — NO content. */\nexport const ChildSafetySourceSignalSummarySchema = z.object({\n count: z.number(),\n latestKind: ChildSafetySignalKindSchema,\n latestAt: z.number(),\n}).strict();\nexport type ChildSafetySourceSignalSummary = z.infer<\n typeof ChildSafetySourceSignalSummarySchema\n>;\n\n// ===========================================================================\n// §A1b — childSafetyCaseList/{caseId} (reviewer list/metadata; NO content, NO\n// reporter identity)\n// ===========================================================================\n\nexport const ChildSafetyCaseListV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n revision: z.number(),\n canonicalIncidentKey: z.string(),\n incidentClass: ChildSafetyIncidentClassSchema,\n sourceSignalSummary: ChildSafetySourceSignalSummarySchema,\n workStatus: ChildSafetyWorkStatusSchema,\n preservationStatus: ChildSafetyPreservationStatusSchema,\n ncmecStatus: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState (no `notRequired`)\n accountActionStatus: ChildSafetyAccountActionStatusSchema,\n reportDisposition: ReportDispositionSchema, // §A9 case-level reporting determination\n reviewDueAt: z.number(),\n actualKnowledgeAt: z.number().optional(),\n reportState: ChildSafetyReportStateSchema.optional(), // derived list-projection only\n submissionCompletedAt: z.number().optional(),\n preserveUntil: z.number().optional(),\n openHoldCount: z.number(),\n // Cross-links to other cases that claimed the same owning alias (a rare operator NCII-crossover\n // re-scan collision). arrayUnion'd on both cases in the intake transaction that detected the claim;\n // the console renders these as plain links on the case view. The original alias owner is kept — the\n // colliding case never `tx.create`-throws (see childSafetyOwningAliases intake). Additive/optional.\n relatedCaseIds: z.array(z.string().min(1)).optional(),\n // [H-04 V1] Set to true when a protected-reason chat report's Worker context could not be\n // resolved at intake (text-only / Worker-down / attachment-not-ready). The case is still a\n // fully-valid protected case; context resolution is retried async. Absent = false (no pending\n // context). Cleared once context is attached. Surfaced in the safety console so the reviewer\n // knows to trigger a manual re-fetch if the async retry hasn't landed yet.\n contextResolutionPending: z.boolean().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseListV1 = z.infer<typeof ChildSafetyCaseListV1Schema>;\n\n// ===========================================================================\n// §A1b — childSafetyCases/{caseId} (restricted root; childSafetyReviewer only;\n// adds the evidence manifest, the internal reason, and the lease/fencing fields)\n// ===========================================================================\n\nexport const ChildSafetyCaseV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n evidenceManifestId: z.string().min(1),\n currentReasonInternal: z.string(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n fencingOwnerToken: z.string().min(1).optional(),\n fencingGeneration: z.number().optional(),\n // [H-04 V1] Immutable channel/message locator stored at case open when the Worker context\n // could not be resolved at intake. This is the AUTHORITATIVE source-of-truth locator that\n // the best-effort async re-fetch (and the operator's manual re-fetch) use to retrieve the\n // message text/sender. NEVER updated after creation — if context resolves, the resolved\n // context is ATTACHED to the case; this field stays unchanged as the permanent intake record.\n // Uses TargetLocatorV1 (a `guildChatMessage` or `chatAttachment` kind); absent on media-resolved\n // cases that went through the normal protected path with a ready attachment.\n chatMessageLocator: TargetLocatorV1Schema.optional(),\n // [H-04 V1] Mirror of the list-doc field — kept in sync so the restricted root can be\n // independently queried/checked without a join against childSafetyCaseList.\n contextResolutionPending: z.boolean().optional(),\n // [H-2] Per-leg persisted state for the two POST-COMMIT possible-minor crossover side-effects\n // (serving-deny + PhotoDNA) that `setNciiMinorAssessment` fans out when it opens/links this\n // parallel crossover case. Written via dotted-path update() (`crossoverLegs.servingDeny` etc.)\n // AFTER the case root is created in-tx, so an operator/reconciler can see which leg is\n // pending/done/failed and drive a replay — a leg failure never rolls back the committed\n // assessment, and the NCII removal clock is never touched. ABSENT on non-crossover cases (this\n // object exists only on a crossover child-safety case), and each leg field is absent when that\n // leg never applied (external / no-media target). The app also writes an in-transaction initial\n // `pending` marker, so the status enum includes `pending`.\n crossoverLegs: z.object({\n // Serving-deny leg: `pending` (in-tx marker) → `done` | `failed`.\n servingDeny: SafetyCrossoverLegStatusSchema.optional(),\n servingDeniedAt: z.number().optional(), // epoch ms; set when servingDeny → done\n servingDenyFailedAt: z.number().optional(), // epoch ms; set when servingDeny → failed\n servingDenyLastError: z.string().optional(), // error name captured on failure (never raw bytes/PII)\n // PhotoDNA leg: `pending` (in-tx marker) → `done` | `failed`.\n photoDna: SafetyCrossoverLegStatusSchema.optional(),\n photoDnaScannedAt: z.number().optional(), // epoch ms; set when photoDna → done\n photoDnaFailedAt: z.number().optional(), // epoch ms; set when photoDna → failed\n photoDnaLastError: z.string().optional(), // error name captured on failure\n }).strict().optional(),\n}).strict();\nexport type ChildSafetyCaseV1 = z.infer<typeof ChildSafetyCaseV1Schema>;\n\n// ===========================================================================\n// §A1b subcollections (append-only, NEVER arrays)\n// ===========================================================================\n\n/** …/sourceSignals/{signalId} — append-only source-signal row. */\nexport const ChildSafetySourceSignalV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetySignalKindSchema,\n detector: z.string().min(1).optional(),\n sourceRef: z.string(),\n actorId: z.string().min(1).optional(),\n}).strict();\nexport type ChildSafetySourceSignalV1 = z.infer<typeof ChildSafetySourceSignalV1Schema>;\n\n/** …/decisions/{decisionId} — append-only decision-log row. The actual\n * viewed-evidence ids live in …/decisions/{decisionId}/views/{viewId}. */\nexport const ChildSafetyDecisionV1Schema = z.object({\n at: z.number(),\n actorId: z.string().min(1),\n kind: ChildSafetyDecisionKindSchema,\n from: z.string(),\n to: z.string(),\n reasonInternal: z.string(),\n reasonUserFacing: z.string().optional(),\n evidenceItemsViewedCount: z.number(),\n // [EUAS-008] present only on a `caseClosed` row — the structured operator closure record\n // (outcome / summary / note + actor / timestamp) persisted when the case is closed.\n closure: SafetyCaseClosureV1Schema.optional(),\n}).strict();\nexport type ChildSafetyDecisionV1 = z.infer<typeof ChildSafetyDecisionV1Schema>;\n\n/** …/decisions/{decisionId}/views/{viewId} — the actual viewed-evidence ids\n * (kept off the decision row itself). */\nexport const ChildSafetyDecisionViewV1Schema = z.object({\n evidenceItemId: z.string().min(1),\n at: z.number(),\n}).strict();\nexport type ChildSafetyDecisionViewV1 = z.infer<typeof ChildSafetyDecisionViewV1Schema>;\n\n/** …/accounts/{uid} — per-account case record. The per-account\n * `subjectDisposition` is distinct from the case-level `reportDisposition`. */\nexport const ChildSafetyCaseAccountV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountV1 = z.infer<typeof ChildSafetyCaseAccountV1Schema>;\n\n/** …/accounts/{uid}/history/{historyId} — append-only per-account history. */\nexport const ChildSafetyCaseAccountHistoryV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n at: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountHistoryV1 = z.infer<\n typeof ChildSafetyCaseAccountHistoryV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId} — one NCMEC submission record. */\nexport const ChildSafetyNcmecSubmissionV1Schema = z.object({\n kind: ChildSafetyNcmecSubmissionKindSchema,\n state: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState\n completionChannel: ChildSafetyNcmecCompletionChannelSchema.optional(),\n submissionCompletedAt: z.number().optional(),\n completionProofType: ChildSafetyNcmecCompletionProofTypeSchema.optional(),\n completionProofRef: z.string().min(1).optional(),\n reportId: z.string().min(1).optional(),\n responseCode: z.number().optional(),\n}).strict();\nexport type ChildSafetyNcmecSubmissionV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId}/files/{fileId} — per-evidence-item file row. */\nexport const ChildSafetyNcmecSubmissionFileV1Schema = z.object({\n localEvidenceItemId: z.string().min(1),\n ncmecFileId: z.string().min(1).optional(),\n md5: z.string().min(1).optional(),\n fileInfoState: ChildSafetyNcmecFileInfoStateSchema,\n}).strict();\nexport type ChildSafetyNcmecSubmissionFileV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionFileV1Schema\n>;\n\n/** …/legalProcess/{eventId} — append-only legal-process event. */\nexport const ChildSafetyLegalProcessEventV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetyLegalProcessKindSchema,\n verifiedBy: z.string().min(1),\n instruction: z.string(),\n handedOver: z.boolean().optional(),\n}).strict();\nexport type ChildSafetyLegalProcessEventV1 = z.infer<\n typeof ChildSafetyLegalProcessEventV1Schema\n>;\n\n// ===========================================================================\n// §A9 — setReportDisposition privileged-command input (NON-DOC embedded shape).\n// Authority = `legalDispositionAuthority` (§A11 matrix); requires fresh two-step\n// reauth. Appends to …/decisions/{decisionId} with kind:'reportDisposition'.\n// `evidenceRefs` is an array capped at MAX; it MAY be empty EXCEPT for disposition\n// 'reportRequired', which requires ≥1 (enforced by the shared\n// refineReportDispositionEvidenceRefs cross-field rule, not a field-level min).\n// ===========================================================================\n\n// The base object shape (kept as a ZodObject so the callable input can `.extend` it); the exported\n// schema below adds the TWO canonical cross-field refinements (disposition↔reason pairing +\n// reportRequired⇒evidence-present).\nconst SetReportDispositionInputV1ObjectSchema = z.object({\n caseId: z.string().min(1),\n expectedRevision: z.number(),\n disposition: ReportDispositionSchema,\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // MAX derives from the ONE receipts cap (evidence.ts) — the callable + admin.ts use the same. No\n // field-level min: the reportRequired⇒non-empty rule lives in the shared cross-field refinement so\n // every other disposition may legally leave this empty.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n}).strict();\nexport const SetReportDispositionInputV1Schema = SetReportDispositionInputV1ObjectSchema\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionInputV1 = z.infer<typeof SetReportDispositionInputV1Schema>;\n\n// The PRIVILEGED CALLABLE input (`setReportDisposition`) — extends the embedded shape with the\n// interim explicit typed confirmation (stands in for the passkey two-step until [H-17]), then applies\n// the SAME shared cross-field refinements. evidenceRefs is inherited from the base (MAX-bounded,\n// empty allowed except when disposition is 'reportRequired'). Lives beside the base shape it extends.\nexport const SetReportDispositionCallableInputSchema = SetReportDispositionInputV1ObjectSchema.extend({\n confirmation: z.literal(LEGAL_REPORTING_DISPOSITION_CONFIRMATION),\n})\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionCallableInput = z.infer<typeof SetReportDispositionCallableInputSchema>;\n"]}
@@ -12,9 +12,9 @@
12
12
  // status) with two subcollections: …/items/{itemId} and
13
13
  // …/disposition/{locationId}.
14
14
  //
15
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
16
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A4 — no invented values, no
17
- // placeholders.
15
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
16
+ // (Appendix A §A4) — no invented values, no placeholders; the durable design owner
17
+ // is ttt-prod docs/design/safety-evidence-control-profile.md.
18
18
  //
19
19
  // SHARED media lineage comes from ../media-assets.js (the single canonical lineage
20
20
  // used by media, CSAM, and safety); it is NEVER redefined here.